Record that face detection has run, not just what it found
An image with no faces in it was indistinguishable from one that had never been looked at, so every landscape, still life and document scan in the library was re-detected on every pass, for ever. In a real library that is most of it: on the 23,527-image test library, 64 of the first 110 images indexed contain no face at all. Schema v9 adds face_index, a run marker per (image, model) carrying the face count and the proxy edge it read. Keyed on the model, so a model change puts every image back in the queue by itself. That makes a coverage figure possible, which is the thing a user actually wants to see. The audit also splits the outstanding set by whether a proxy exists, because 23,417 awaiting a proxy and 110 ready to index are different problems, and telling the user to run indexing again would not fix the first. The Identity screen gains Index faces, Stop, and the coverage line. examples/face_index.rs is the same check and sweep without a window, which is the right shape for an overnight pass. Measured on the real library in release: 3.5 images/second, 110 images and 125 faces in 30 seconds, and a second run correctly finds nothing left to do. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -972,6 +972,28 @@ pub fn run(paths: Vec<PathBuf>) -> Result<()> {
|
||||
.ok()
|
||||
.map(std::rc::Rc::new)
|
||||
},
|
||||
// The weights are not shipped and are not a build input
|
||||
// (docs/faces.md §2): the user puts them beside the catalog,
|
||||
// and their absence is the ordinary state of a fresh install.
|
||||
{
|
||||
let lib = library.clone();
|
||||
move || {
|
||||
let (_, session) = lib.session()?;
|
||||
library::face_models(&session.server, &session.user_id)
|
||||
}
|
||||
},
|
||||
// The sweep opens its own connection on its own thread, so it
|
||||
// takes paths rather than the handles this screen holds.
|
||||
{
|
||||
let lib = library.clone();
|
||||
move || {
|
||||
let (_, session) = lib.session()?;
|
||||
Some((
|
||||
library::catalog_path(&session.server, &session.user_id),
|
||||
library::thumbs_dir(&session.server, &session.user_id),
|
||||
))
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user