Skip to main content

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

Project description

face-organizer

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

Installation

# Default (dlib backend)
pipx install face-grouper

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

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

# ⭐ QUICK START
fgroup group ./photos --reference-dir ./photo_names --output ./sorted --backend arcface --mode rename --min-samples 1

# Group into person_1/, person_2/, ... subfolders (default)
fgroup group ./photos --output ./sorted

# Flat output with renamed files: person_1_img_1.jpg, person_2_img_1.jpg, ...
fgroup group ./photos --output ./sorted --mode rename

# ArcFace backend — more accurate when dlib groups everyone into 1 person
# (~300 MB model downloaded to ~/.insightface/ on first run, then cached offline)
fgroup group ./photos --output ./sorted --backend arcface

# Include people who appear in only 1 photo (default min-samples=2 sends them to unknown/)
fgroup group ./photos --output ./sorted --backend arcface --min-samples 1

# Too many groups (same person split)? raise --eps. Too few? lower it.
fgroup group ./photos --output ./sorted --backend arcface --eps 0.6

# Not sure what --eps to use? --debug prints distance distribution to guide you
fgroup group ./photos --output ./sorted --backend arcface --debug

# Preview without copying anything
fgroup group ./photos --output ./sorted --dry-run

# Name clusters after known people — place one face photo per person in a reference folder
# (john.jpg → john/, jane.jpg → jane/; unrecognised people stay as person_N/)
fgroup group ./photos --output ./sorted --reference-dir ./refs

# Combine with rename mode for named flat files: john_img_1.jpg, jane_img_1.jpg, ...
fgroup group ./photos --output ./sorted --mode rename --reference-dir ./refs

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

# dlib only: better detection for small/angled faces (slower)
fgroup group ./photos --output ./sorted --model cnn --upsample 2

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

Full option reference: fgroup group --help

Dev mode

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

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).

Build & publish

# One time setup
# Create an account on https://pypi.org and generate a token, then
cp .pypirc.example ~/.pypirc
# then edit ~/.pypirc and replace pypi-xxx with your actual token

username must stay as __token__. Never commit ~/.pypirc.

Build and upload:

pip install build twine
rm -rf dist/ build/      # clean previous artifacts
python -m build          # creates dist/*.whl and dist/*.tar.gz
twine upload dist/*

Releasing an update — bump version in pyproject.toml first, then repeat the build and upload steps above. PyPI does not allow re-uploading the same version.

Users upgrading:

pipx upgrade face-grouper

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.1.1.tar.gz (14.0 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.1.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: face_grouper-0.1.1.tar.gz
  • Upload date:
  • Size: 14.0 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.1.1.tar.gz
Algorithm Hash digest
SHA256 41631573b9154c397e919dc350d7bfe05b55b6959121947e6e073b331e19cedd
MD5 56d797c2848eed1a1ebfdf11059d8f47
BLAKE2b-256 5f7bdb53c1aecdeaefd01581da981967a8d27fb2a8f5dae8da8fa56afb2ef391

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: face_grouper-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6b6db5359c785c7e4cfc6897815ed3962491513178af1bd30c10e2f25a2ba20
MD5 d1953e8b427dc370db49cbd483d0e5df
BLAKE2b-256 c47e85c4ef933b4901fba93438c7d892ff32f7b3bf3a65832d3cc6c94dbedec1

See more details on using hashes here.

Provenance

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