Skip to main content

A CLI tool that groups photos and videos by person using offline face recognition.

Project description

face-organizer Logo

face-organizer

A CLI tool that groups photos and videos by person using offline face recognition.

Installation

# Default (dlib backend, photos only)
pipx install face-grouper

# With video support
pipx install "face-grouper[video]"

# With ArcFace support (more accurate, recommended)
pipx install "face-grouper[arcface]"

# With both video + ArcFace
pipx install "face-grouper[video,arcface]"

# Upgrade (core only)
pipx upgrade face-grouper

Compile error? Install CMake first: brew install cmake (macOS), sudo apt install cmake build-essential (Linux), or Visual Studio Build Tools (Windows).

Don't have pipx? brew install pipx && pipx ensurepath (macOS) or pip install --user pipx && pipx ensurepath (Linux/Windows).

Usage

Photos (fgroup group)

# ⭐ Quick start — named clusters, flat output, include single-photo people
fgroup group ./photos --ref-dir ./refs --output ./sorted --backend arcface --mode rename --min-samples 1

# Basic grouping into person_1/, person_2/, ... subfolders
fgroup group ./photos --output ./sorted

# Pass individual files
fgroup group a.jpg b.jpg c.jpg --output ./sorted

# Disable multi-face export (legacy: one output per photo)
fgroup group ./photos --output ./sorted --no-multi-export

Originals are never modified. Supported formats: .jpg .jpeg .png .webp .bmp

Videos (fgroup video)

# Group short clips by person
fgroup video ./clips --output ./sorted

# Allow longer videos (default 15s, max 120s)
fgroup video ./clips --output ./sorted --max-duration 30

# Use ArcFace for better accuracy
fgroup video ./clips --output ./sorted --backend arcface

# Preview without copying
fgroup video ./clips --output ./sorted --dry-run

Supported formats: .mp4 .mov .avi .mkv. Requires pip install 'face-grouper[video]'.

Videos exceeding --max-duration are skipped and copied to output/skipped/. A video with multiple people is copied into each relevant person folder.

Parameters

fgroup group

Option Default Description
INPUTS... (required) Directories or image files to scan (recursive)
--output / -o (required) Output directory
--backend dlib Face recognition backend. dlib: fast, 128-D embeddings, works offline, good for frontal faces — pair with --model cnn for better accuracy. arcface: 512-D embeddings, more accurate across varied lighting/angles, but downloads around 300 MB (buffalo_l model) on first run to ~/.insightface/; --model and --upsample are ignored for this backend
--mode group groupperson_N/ subfolders; rename → flat person_N_img_M.ext files
--eps 0.5 DBSCAN max distance between embeddings for same person. Raise to merge split clusters, lower to split merged ones. Use --debug to calibrate
--min-samples 2 Min photos to form a cluster. People below threshold go to unknown/. Set to 1 to keep solo faces
--ref-dir none Folder of named reference images. john.jpg → cluster named john. Multiple photos per person supported: john_1.jpg, john_2.jpg, … all map to john
--no-multi-export false Only use the largest face per photo. By default every detected face is exported independently — a photo with two people lands in both person folders.
--model hog dlib only: hog (fast) or cnn (accurate, GPU recommended)
--upsample 1 dlib only: upsample N times before detection — finds smaller faces, ~4× cost per level
--dry-run false Preview planned operations without copying anything
--debug false Print pairwise distance stats to help choose --eps

fgroup video

Option Default Description
INPUTS... (required) Directories or video files to scan (recursive)
--output / -o (required) Output directory
--mode group groupperson_N/ subfolders; rename → flat person_N_vid_M.ext files
--backend dlib dlib or arcface — same as fgroup group
--model hog dlib only: hog or cnn
--upsample 1 dlib only: upsample N times before detection
--eps 0.5 DBSCAN epsilon — same as fgroup group
--min-samples 2 Min face detections to form a cluster
--ref-dir none Folder of named reference images — same behaviour as fgroup group
--max-duration 15.0 Max video length in seconds (1–120). Videos over this go to skipped/. Warns if > 30s
--dry-run false Preview planned operations without copying anything
--debug false Print pairwise distance stats to help choose --eps

Dev mode

git clone https://github.com/your-username/face-organizer.git
cd face-organizer

# Install with all optional extras for full local development
pip install -e ".[arcface,video]"

# Verify the CLI is wired up
fgroup --help

Changes to face_grouper/*.py take effect immediately — no reinstall needed. Only re-run pip install -e . if you change pyproject.toml (e.g. new dependency or entry point).

macOS compile error? Install CMake first: brew install cmake

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

face_grouper-0.3.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

face_grouper-0.3.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file face_grouper-0.3.0.tar.gz.

File metadata

  • Download URL: face_grouper-0.3.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for face_grouper-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7e8c3c675e30c69ba08bed597c2c8d134e46f5b9e10158c15e66b6311675b416
MD5 bda2dcf0ed261fb1ea24a125c44ee685
BLAKE2b-256 e64293f6c7d0815800b6314f480788d2d5e48ba3a78460a671a876b6ce6254fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for face_grouper-0.3.0.tar.gz:

Publisher: publish.yml on dinhanhthi/face-organizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file face_grouper-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: face_grouper-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for face_grouper-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3324fc25477d77285b595537283982a2a122985c527d43b9ad055e64751a15ff
MD5 3fa627112cd2bc99567482fa3a16246e
BLAKE2b-256 b9cdb581f3c38205341f69c3a44aff3e486e666fbd8c097db7032b8f69488e97

See more details on using hashes here.

Provenance

The following attestation bundles were made for face_grouper-0.3.0-py3-none-any.whl:

Publisher: publish.yml on dinhanhthi/face-organizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page