Repository navigation
Cleanup on other machines: one at a time over SSH, or from a queue several machines work from. Stopped work picks up where it left off, with the same result.
Stopping and resuming
clean now saves each slow stage as it finishes: the faces, crop and date stamp; the dust mask; the scratch model's results; the scratch mask; and every window MI-GAN fills. If a run is stopped (Ctrl-C, a machine that sleeps, a power cut), running the same command again picks up from there. The result is the same as an uninterrupted run, byte for byte. On a 1.3 MP portrait stopped after 2 of 12 windows, the rest took 5 s instead of 48. Saved stages live in ~/.cache/openfilmkit/checkpoints and are cleared once the photo is done.
clean --on HOST
Cleans on another machine over SSH and brings the results back beside the originals. The host needs the same OpenFilmKit, rsync and an SSH key. Run the same command again after a dropped connection: finished photos are only copied back, and one under way resumes on the host. ~/.config/openfilmkit/hosts.toml can say where openfilmkit lives on a host. Cleaned on a Raspberry Pi 5, a portrait came back identical to the same clean on a Mac.
A queue and workers
clean --queue NAME puts photos into a queue: a folder on any machine reachable over SSH. Nothing runs there. openfilmkit worker (a systemd service is in packaging/) takes jobs one at a time:
- Choosing: the oldest job it can do. That means the same OpenFilmKit code, a memory need it can meet, inside its working hours, and never while a service named in
yield_tois busy (another program sharing the machine). - Claims: a worker renews its claim every 2 minutes. A claim not renewed for 10 minutes lapses, and the next worker continues from the slow stages the last one pushed.
- Access: workers only use
rsync, read the queue and write their own folder, so each can have an SSH key restricted withrrsync.
queue status shows jobs and workers. queue collect checks every result against its recipe before putting it beside the original, and runs a job again if its result doesn't check out.
Claims keep workers out of each other's way but can't rule out two doing the same job. That's harmless: a job gives the same file wherever it runs, and collecting keeps the first good one.
Job packages
All of this is built on job packages: clean --pack DIR, then openfilmkit job run, job show, job collect and job remove. A package holds one photo and its options. It's named by a checksum of everything that decides the result, including a fingerprint of the OpenFilmKit code (openfilmkit job build). So the same work packs to the same package, and runs only where the code is the same. The same photo in two folders is one job, and both folders get the result.
Install or upgrade
brew upgrade aidansiegel/openfilmkit/openfilmkit