I had 37,000 photos in Nextcloud, full of screenshots, memes, forwarded WhatsApp copies and pocket shots. Duplicate finders that go by filename or file hash missed most of the copies, because a forward of a photo is a different file. My own dedup script hashes the whole file, so it only ever caught exact copies (the same photo uploaded twice, or synced from two devices). The forwards and reposts were most of the 12k I ended up cleaning out. So I built this.
What it does
• Sorts the library into screenshots, memes, documents, junk, blurry shots, clutter and real photos. A built-in image classifier (SigLIP) does this on the CPU, about a quarter of a second a picture on one core, so no GPU is needed. On my library it agreed with a vision model on 98% of labels. If you have a GPU, a local vision model through Ollama is optional and only gets the pictures the classifier is unsure about. • Learns from you. When it's idle, it retrains the classifier on your own answers, and keeps the new version only if it tests better. • Finds duplicates by what the picture shows, not the file. A WhatsApp forward, a HEIC next to its JPEG or a re-import all land in one group, with the best copy first. Two tiers: ◦ Same: true copies, which you can clear in one go. Each group always keeps its best version. ◦ Similar: bursts and look-alikes the fingerprint misses, like crops, filters and burst frames with movement. You pick these by hand; there's never a one-click option here. • Catches mirrored copies. Some apps flip a selfie when you forward it, so the copy no longer matches. These get a "mirrored" label and a filter of their own, and you can select them all at once. • Breaks a big library down. Every tab filters by year and by source (camera, messaging apps), and Blurry splits into dark, bright and normal shots. • Deletes are restorable. Deletes go through Nextcloud's own API into Deleted files, so everything is restorable for the retention period.
Nothing leaves your network. There's also an optional cloud API mode for people who don't mind their photos leaving the network and just want the sweep done. It stays off until you explicitly allow it.
Duplicates-only mode needs no model at all: set MODEL=none and CLASSIFIER=none.
Honest limits
• Docker needs file access to the photo folder: Nextcloud on the same box, a network mount of its data folder, or a desktop-client sync. The app password is only used for deleting, into Deleted files. • With the vision model on a GPU, mine ran about 3 seconds a picture. The classifier alone is far faster. • The labels are a model's opinion, so it's built around reviewing before deleting. • I measured whether picking the sharpest frame in a burst would help. It doesn't: the existing ranking already chose a frame I'd kept 97% of the time.
Docker compose, AGPL-3.0: https://github.com/ixiondt/photosweep
I built it with heavy help from an AI coding assistant, and I run it on my own library. Feedback welcome.
Edit: thanks for all the feedback. The no-GPU classifier, duplicates-only mode, look-alikes, mirrored copies and the cloud option all came from requests in this thread.