Repository navigation
feat: Picasa-style People album for the gallery - #116
Merged
Merged
Conversation
Faces are detected as thumbnails index (UltraFace, the existing "face" model) and, with the new SFace recogniser (OpenCV Zoo, Apache-2.0), embedded so unnamed faces can be suggested as people already named. A viewer (Space, the tray's View button, or the photo menu) shows a photo big with its faces boxed; click one, type a name, Enter. Missed faces are drawn by hand, wrong detections dismissed. The sidebar lists people with avatars and an Unnamed album; a person's name in the search box pulls their photos in first. Names persist in library.json, detections in a .faces cache and a v2 index snapshot (v1 still reads). gallery_people is exposed on both MCP servers. Also fixes three clippy lints in the telemetry module inherited from main so the branch lints clean. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Naming a face now runs the recogniser over every unnamed face in the library: those above a 0.5 cosine of the person's mean vector are put with them as automatic tags (marked "auto", with a "Not them" button), and newly indexed faces get the same pass as they arrive. Between 0.45 and 0.5 a face is still only offered. Only hand-named faces feed the mean, so a wrong guess cannot steer the next; saying "not them" is remembered per name so the face is not put back. Co-Authored-By: Claude Fable 5.1 <[email protected]>
While the detector and recogniser download, the sidebar's PEOPLE section (and the viewer's people panel) show a progress bar in place of the "Find faces…" link — the photo-search bar's twin, both files counted as one so it runs once from nothing to done. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Clicking a person no longer drops the bucket: their photos are shown
within it, the sidebar counts (and the unnamed tally) are theirs in
that bucket, and the header says so ("People · Ann · in Trip"). The
same holds for a folder. Clicking the person again lifts the filter
and the bucket is back as it was.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Two costs that made a fresh library churn on load. Every photo with faces was decoded a second time at 1024 px for the recogniser's crops: now big faces crop from the thumbnail, and small ones use the larger decode kept from rendering the thumbnail (only a thumbnail cached before the models arrived earns one more decode). And a face whose embedding failed stayed "owed" and was re-queued on every idle pass forever: failures are recorded as tried, a recogniser that is installed but will not load switches recognition off for the session, and the readiness check no longer loads a model on the UI thread. Both face models are released when the loader goes idle, like the snapshot save; they reload in a third of a second when needed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The sidebar's counts were recomputed per frame: each tagged photo looked up by walking every scanned entry, and each detected face checked against every tag in the library — millions of comparisons a frame on a real library, which is what made the gallery lag behind main. Counts are now computed once per change (a cached summary keyed on the index generation, the people revision, and the bucket, folder and map filters), entries are indexed by path, the unnamed tally uses per-photo claim maps, the scope is resolved once per pass, a loader batch auto-tags only the photos it just found faces in, and the viewer's "n of m" is worked out once on opening. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The unnamed tally climbed batch by batch at launch: the idle indexer re-read per-photo face caches before the index snapshot had been read back, and a snapshot written before the last photos were indexed left it climbing after that too. Last launch's whole-library counts are now kept in the state directory (people.json, by name) and shown from the first frame until the indexer has caught up, and the indexer waits for the snapshot rather than re-deriving what it is about to be handed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A People album for the gallery, the way Picasa did it: faces are found as photos index, you name them in a viewer, and each person becomes a sidebar album you can browse and search.
facemodel (renamed "Faces (Detection)" in Manage Models). Detections are cached beside thumbnails (.faces) and carried in the index snapshot, nowSCHIDX2(v1 still reads).face-embed: SFace from the OpenCV Zoo (38.7 MB, Apache-2.0, commit-pinned, hash-checked). Big faces are cropped from the thumbnail; small ones from a 1024 px decode kept from rendering the thumbnail (a thumbnail cached before the models arrived earns one more decode of the original, once). Embedding failures are recorded as tried so no photo is re-queued forever, and both models are released when indexing goes idle. Naming a face teaches it: every unnamed face in the library above a 0.5 cosine of the person's mean vector is put with them at once as an automatic tag (marked "auto", one-click "Not them"), and faces indexed later get the same pass. Between 0.45 and 0.5 a face is only offered with an "Is this …?" prompt. Only hand-named faces feed the mean, and a "not them" is remembered per name so the face is never put back.gallery_peopleMCP tool on both the in-app and stdio servers; docs/gallery.md has a People section.maincurrently fails on.Verified
schist-gallery,schist-neuraland the app's library module; clippy-D warningsand rustfmt clean on the touched crates.Performance
The sidebar's People counts are a cached summary recomputed only when the index, the people, or the bucket/folder/map filter change; scanned entries are indexed by path; a loader batch auto-tags only its own photos. Nothing in the gallery's render path walks all photos or all tags per frame. Last launch's counts are persisted (
people.jsonin the state dir) and shown from the first frame until the indexer has caught up, so the unnamed tally does not creep up on load; the idle indexer waits for the snapshot restore instead of re-reading per-photo caches.Notes for review
Library::save()is a no-op undercfg!(test)so unit tests cannot write the developer'slibrary.json..absolute().size_full()canvas with no offsets lands at its static position; the viewer's bounds probe needed.top_0().left_0().🤖 Generated with Claude Code