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
usernamemust 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41631573b9154c397e919dc350d7bfe05b55b6959121947e6e073b331e19cedd
|
|
| MD5 |
56d797c2848eed1a1ebfdf11059d8f47
|
|
| BLAKE2b-256 |
5f7bdb53c1aecdeaefd01581da981967a8d27fb2a8f5dae8da8fa56afb2ef391
|
Provenance
The following attestation bundles were made for face_grouper-0.1.1.tar.gz:
Publisher:
publish.yml on dinhanhthi/face-organizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
face_grouper-0.1.1.tar.gz -
Subject digest:
41631573b9154c397e919dc350d7bfe05b55b6959121947e6e073b331e19cedd - Sigstore transparency entry: 1418892448
- Sigstore integration time:
-
Permalink:
dinhanhthi/face-organizer@af0d7732b9b6a62b0431feae83eda7af85fe4b20 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dinhanhthi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@af0d7732b9b6a62b0431feae83eda7af85fe4b20 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6b6db5359c785c7e4cfc6897815ed3962491513178af1bd30c10e2f25a2ba20
|
|
| MD5 |
d1953e8b427dc370db49cbd483d0e5df
|
|
| BLAKE2b-256 |
c47e85c4ef933b4901fba93438c7d892ff32f7b3bf3a65832d3cc6c94dbedec1
|
Provenance
The following attestation bundles were made for face_grouper-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on dinhanhthi/face-organizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
face_grouper-0.1.1-py3-none-any.whl -
Subject digest:
e6b6db5359c785c7e4cfc6897815ed3962491513178af1bd30c10e2f25a2ba20 - Sigstore transparency entry: 1418892546
- Sigstore integration time:
-
Permalink:
dinhanhthi/face-organizer@af0d7732b9b6a62b0431feae83eda7af85fe4b20 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dinhanhthi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@af0d7732b9b6a62b0431feae83eda7af85fe4b20 -
Trigger Event:
push
-
Statement type: