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

Common parameters (fgroup group and fgroup video)

Option Default Description
INPUTS... (required) Directories or 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 files with sequential index
--start-index 1 Starting index for file counters in rename mode (e.g. --start-index 10person_N_img_10.ext, person_N_img_11.ext, …). Ignored in group mode
--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 detections 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
--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 group specific

Option Default Description
--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

fgroup video specific

Option Default Description
--max-duration 15.0 Max video length in seconds (1–120). Videos over this go to skipped/. Warns if > 30s

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.4.0.tar.gz (19.2 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.4.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: face_grouper-0.4.0.tar.gz
  • Upload date:
  • Size: 19.2 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.4.0.tar.gz
Algorithm Hash digest
SHA256 35723418fae54022a4d8a1f2e05331f6adcc3cca15b990289747f7d6521e0391
MD5 13248c9c87eee9669fd9653ad4ad25c6
BLAKE2b-256 e860cc7a6586294607131e4393a455674986c5087d2ce8358202fa398fe41390

See more details on using hashes here.

Provenance

The following attestation bundles were made for face_grouper-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: face_grouper-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc9ec92a98a6beeb4e84b3dc8407da452397ae96821875319e113ac30bd763f3
MD5 d958903ba4858e3ac3b8d646e609be5a
BLAKE2b-256 1d69b0f1ecdb51302923626f3a9333623e0c1f091d32e81f8bc49ff467983700

See more details on using hashes here.

Provenance

The following attestation bundles were made for face_grouper-0.4.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