Files
winf-photobooth-app/models

Palm detection model

palm_detection_mediapipe_2023feb.onnx is the floating-point MediaPipe palm detector distributed by OpenCV Zoo, under Apache 2.0 (see LICENSE).

Source: https://github.com/opencv/opencv_zoo/tree/main/models/palm_detection_mediapipe

Weights: https://media.githubusercontent.com/media/opencv/opencv_zoo/main/models/palm_detection_mediapipe/palm_detection_mediapipe_2023feb.onnx

SHA-256: 78ff51c38496b7fc8b8ebdb6cc8c1abb02fa6c38427c6848254cdaba57fcce7c

The weights are embedded in the executable. Inference and preprocessing are implemented in src/palm.rs, following OpenCV Zoo's mp_palmdet.py reference. No download is needed at runtime.

Open-hand verification

handpose_estimation_mediapipe_2023feb.onnx provides 21 hand landmarks for second-stage verification. Distributed under Apache 2.0 (see HANDPOSE_LICENSE).

Source and preprocessing reference: https://github.com/opencv/opencv_zoo/tree/main/models/handpose_estimation_mediapipe

Weights: https://media.githubusercontent.com/media/opencv/opencv_zoo/main/models/handpose_estimation_mediapipe/handpose_estimation_mediapipe_2023feb.onnx

SHA-256: db0898ae717b76b075d9bf563af315b29562e11f8df5027a1ef07b02bef6d81c

src/hand_pose.rs rotates and crops the detected hand, requires at least 0.65 hand confidence, and checks all five fingers for extension using 3D landmarks. Finger extension tolerates natural curvature and a relaxed thumb while rejecting curled fingers and fists. Rejected poses reset the dwell/progress timer; the outline persists for up to 750 ms after the last accepted sample to avoid flicker. This verifies an open hand, not whether the palm side rather than the back faces the camera. Thresholds may need tuning for the camera and viewing distance.

Capture face counting

Faces are detected with OpenCV YuNet (face_detection_yunet_2023mar.onnx), replacing the Haar face and eye cascades. The 228 KiB ONNX model is embedded in the executable, loaded once, and run with OpenCV DNN on CPU. OpenCV 4.8 or newer with DNN and FaceDetectorYN buffer loading is required (tested with 4.10).

Source: https://github.com/opencv/opencv_zoo/tree/main/models/face_detection_yunet

Weights: https://media.githubusercontent.com/media/opencv/opencv_zoo/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx

SHA-256: 8f2383e4dd3cfbb4553ea8718107fc0423210dc964f9f4280604804ed2552fa4

License: MIT, reproduced in YUNET_LICENSE.

Images retain their aspect ratio, with the longest edge resized to 320 px and black padding to 320×320. Confidence threshold is 0.8, NMS threshold 0.3 and top K 500. Predicted eye and nose landmarks filter strongly turned faces: the nose projection must fall within the central 70% of the eye line, with eye separation at least 23% of the face width. This tolerates roll and mirrored coordinates and does not depend on a separate eye detector. It estimates frontal head orientation, not eye gaze. Small, occluded or strongly tilted faces can still be missed; validate group-photo accuracy and timings on the target kiosk.

The clean mirrored camera frame is counted once after capture. Debug logs retain candidate boxes, confidence, accepted/rejected counts, intended copies and timing. The count is passed to an intentionally empty print_picture hook. There is no printer command, image encoding, file output or physical printing yet.

Face rectangles and live face inference are enabled only in debug builds (cargo run); release builds (cargo run --release) have neither. The debug worker samples at most twice per second, drops samples while busy, and expires results after 1.5 seconds. Green (#84bf65) means accepted; blue (#4caee3) means rejected for head orientation. Rectangles use mirrored camera coordinates and share the preview crop, but never enter capture or detector input. Counts are always recomputed on the captured frame and can differ from the last live sample. OpenCV remains limited to two threads; actual kiosk latency needs measurement.