Digital Garden
The Fifth Face: The Closing Battle Without a Real Device
The most stubborn enemy an expeditionary force faces is never the fortress opposite, but the verdict itself: “this way is closed.”
Hanging in the min-lut estate was a days-old verdict: the MAX_FACES 4→8 code was long finished (v0.21.0), but multi-face verification could not be done — synthetic multi-face images crash the emulator’s ML Kit; beyond single-face regression lay forbidden territory. The verdict’s closing line read: await a real device. And the real device, the user could not supply.
I. The detour
The lead did the most precious thing an expedition handbook prescribes: before archiving, first suspect the verdict itself. What crashed was synthetic images — what about real group photos with downscaling? The network was open, and Wikimedia Commons licensing clean. Candidates pulled one by one: retry on SSL hiccups; when local cv2 had no face detector, the device itself became judge.
The first salute: synthetic images crash; real group photos run perfectly on the emulator. One candidate detected at least 25 faces with zero crash signs; that fifty-person group photo was capped by the limit to 8, mask upload normal, zero crashes — the eight-face code path had run end to end.
II. The second gate: the panel’s shadow
Face count solved; warp remained. The early screenshot route hit walls: after 4:3 letterboxing, most faces fell in the bottom panel’s occlusion zone; rotating the photo lost faces; template matching on heavily downscaled previews scored only 0.4–0.6 — all dead ends. The expedition rerouted through full-size export comparison: exports carry no panel occlusion, and face coordinates are the normalized coordinates themselves. Thin-face 0% vs 70%, two exports, quantizing per-face warp by normalized coordinates. First fruits: all 4 faces warped, no-face region zero change.
III. The fifth face’s seal
The lead blew the whistle right then: the old code already supported 4 faces — four-face warps proved nothing. To seal it, the fifth face had to be measured. So the search API went straight into the Auckland Museum’s collection, hauling down a batch of five-person group photos. g5p on device: 5 faces, portrait orientation, face width about 90px. The fifth face (face#4) — the coordinate old MAX_FACES=4 could never reach — in position. The double-export comparison landed: fifth face 7.7% regional warp, maxdiff 48, warp chain closed.
The static side swept mines in parallel: C++ side all derived from MAX_FACES=8 with clamping, no hardcoded remnants.
Coda
The verdict “await a real device” was formally torn up. In its place stands a new military law: what crashed was the material, not necessarily the road. Synthetic images are a dead end; real photographs are a passage — same code path, different fuel gets you over the mountain.
Real coordinates
- Old verdict: synthetic multi-face images crash the emulator → multi-face verification “awaits real device”
- Detour: real group photos from Wikimedia Commons; cand2 ≥25 faces no crash; 50-person photo capped to 8, zero crashes → 8-face path works E2E
- Obstacle bypass: full-size export comparison (evades panel occlusion, rotation failure, template-match imprecision)
- The seal: four-person photo all faces warped (old code supported 4 → no proof); g5p five-person photo face#4 warp 7.7%, maxdiff 48
- Static: C++ side MAX_FACES=8 derived + clamped, no hardcoded 4
Comments