Skip to content

Standalone Scripts

MrBeanDev edited this page Aug 23, 2026 · 1 revision

Standalone Scripts

part1.py and part2.py at the repository root are the original command-line tools the web app grew out of. They are useful for batch work with no UI, and have no database, no API, and no progress reporting.

Script What it does
part1.py Scans input/ and writes one cropped image per distinct person into UNIQUE/
part2.py Copies each photo from input/ into sorted_by_face/{person}/ for everyone in it

Running them

pip install -r requirements.txt

# put your photos in input/
python part1.py
python part2.py

part2.py needs part1.py to have run first, since it matches against the faces in UNIQUE/.

Differences from the web app

These scripts predate the pipeline improvements in the web backend, and do not share code with it.

  • They encode every photo twice, once per script, where the web pipeline reuses the first pass.
  • They do not downscale before detection, so large photos take several times longer.
  • They accept the first face within tolerance rather than the closest, so a photo containing lookalikes can be filed under the wrong person.
  • sorted_by_face/ physically copies each photo once per person in it, so a group shot of five people is stored six times.

For anything beyond a quick batch, the web app produces better results.

Clone this wiki locally