Let the user choose which SCRFD finds their faces

faces.md §12.3 measured what the cheapest detector costs: the small
faces in every group shot, and a dog embedded a dozen times. Which
trade is right depends on the machine doing the sweep — a desktop left
overnight and a tablet on a battery want different answers — so the
detector is now a per-device setting, Fast / Balanced / Thorough on
the settings page beside the indexing button, persisted with the rest
of the settings file.

A detector is half of a model id. Every face, marker, shard and
calibration is keyed on faces.model_id precisely so that a model change
is a new id and a re-index rather than a silent change under existing
data, and a detector change is a model change: it decides which faces
exist and where the landmarks that align them land. So each choice
names its own pipeline. 500M keeps the bare "w600k_mbf" every existing
library was written under, so an upgrade disturbs nothing; the others
are qualified. Choosing one restarts coverage from zero under the new
id, the sweep re-detects, confirmed names carry across by box overlap,
and the sync shards are keyed by the same id so a peer on another
setting neither adopts nor pollutes them. The library controller
carries the id into the sync the same way it carries the cache budget,
because the sync starts from places that have no settings in reach.

All three shape-fixed exports ship — APK, Arch, Flatpak — since a
tablet has no other way to obtain the one it was not installed with;
the APK grows by twenty megabytes for the choice.
This commit is contained in:
2026-09-11 22:12:53 +02:00
parent adf5d6cdd9
commit 4f31123b0c
20 changed files with 468 additions and 122 deletions
+9 -3
View File
@@ -1099,9 +1099,15 @@ is not a desktop-only feature (NFR-RES-2). It loads in tract with the same fix a
(`--input input.1=1,3,640,640`; its outputs are declared dynamic and tract infers them) and
decodes through the same nine-output path unchanged. Same licence, same `buffalo_m` release page.
What a swap has to deal with: `face_index` is keyed on the *embedder's* `model_id`, so a new
detector re-queues nothing. The images already indexed under `500M` keep their faces and their
dogs until something re-detects them — that is a re-index policy question, not a detector one.
**Which detector runs is a setting** — `FaceSettings::detector`, per device, on the settings page
beside the indexing button as Fast / Balanced / Thorough. All three files ship. Each detector is
its own `faces.model_id` (`w600k_mbf` for `500M`, unchanged, so nothing already indexed is
disturbed; `scrfd_2.5g+w600k_mbf` and `scrfd_10g+w600k_mbf` for the others), which is the
mechanism §2.1 always intended for a model change: the coverage figure restarts at zero under the
new id, the sweep re-detects, `record_detections` carries confirmed names across by box overlap and
drops the previous pipeline's marker for each image it revisits, and the sync shards are keyed by
the same id so a peer on another setting neither adopts nor pollutes them. The default stays `500M`
so that an upgrade changes nothing until the user chooses; the recommendation is `2.5G`.
---