EVAx10_Video_analitics/REID_EVALUATION.md

90 lines
6.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Visitor sessions and Re-ID evaluation
## Controlled PoC in 0.3.9
The separate, consent-gated APK uses the exact SFace INT8 artifact described
below. It enrolls one RAM-only template per session and runs inference when
a track needs an enrollment or comparison, rather than for every video frame.
The production build uses the disabled provider. See the current
[PoC behavior and acceptance test](README.md#controlled-face-re-id-poc) and
[license review](LICENSE_REPORT.md#controlled-poc-model-registry-entry).
## Session lifecycle in 0.3.3 (historical)
A geometric tracking ID is associated with a visitor-session ID after
confirmation. Closing a track releases its binding and preserves the
session until the configured timeout. Every observed frame from the bound
track refreshes the session's monotonic last-seen timestamp. The default
timeout is 30 minutes, configurable from 1 to 1440 minutes in **Tracking
settings → Visitor Session Timeout (minutes)**.
Before processing detections, the session manager expires sessions whose
last sighting meets the limit. While capture is idle, expiration is
evaluated when processing resumes. Stop/Start on the same screen releases
track bindings and retains open sessions. Reset Statistics or recreating
the activity clears these in-memory sessions. There is no persistent
visitor-session database or historical unique-person count.
A pluggable ReIdProvider may choose a confidently matched, open, unoccupied
session and attach the new track. The session manager verifies the match
against its own current state. Simultaneously visible tracks cannot claim
one session. A successful reconnect refreshes last seen and leaves the
created-session count unchanged. An unmatched track creates a new session.
The test provider operates on synthetic data. The application supplies only
the disabled provider, which neither receives nor stores observations.
There is no timer-based or one-candidate identity fallback.
**More** reports simulator-independent technical diagnostics: open and created
sessions, timeout, and Re-ID status. Those numbers do not represent unique
visitors. A 30-minute session window and a unique-person count over a day
are different requirements. Daily or custom-range deduplication requires
an approved stable identifier over that reporting horizon and a separate
retention decision.
## Candidate comparison
| | Person Re-ID | Face Re-ID |
| --- | --- | --- |
| Candidate | Intel Open Model Zoo person-reidentification-retail-0286, FP32 IR converted to ONNX for the lab | OpenCV Zoo SFace 2021dec INT8 ONNX |
| Input / output | Whole body, 256×128 → 256 floats | Aligned face, 112×112 → 128 floats |
| Published evidence | Intel reports Market-1501 rank-1 94.8%, mAP 83.7%. This is closed-set retrieval. [Model card](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/intel/person-reidentification-retail-0286/README.md) | OpenCV reports LFW 99.60% and CPLFW 91.05% for the full-size SFace reference model. These are pair-verification results. The INT8 candidate was not checked against those labels here. [OpenCV tutorial](https://docs.opencv.org/4.x/d0/dd4/tutorial_dnn_face.html) |
| Expected field limitations | Similar clothing or uniforms can cause false merges. Changing clothes, heavy occlusion, or a partial body crop can cause false splits. A visible face is unnecessary. | Requires a visible, adequately lit face at a suitable pose. A mask, head turn, or distance may leave no usable observation. |
| Licensing review | The named IR artifacts and their SHA-384 checksums appear in a [manifest](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/intel/person-reidentification-retail-0286/model.yml) that points to Apache-2.0. Review source checkpoint, training-data evidence, and conversion parity before admitting the derived weights in production. Torchreid OSNet checkpoints are a separate source. Their [maintainer limits pretrained weights to research](https://github.com/KaiyangZhou/deep-person-reid/issues/520). | The pinned model directory explicitly covers its files with [Apache-2.0](https://github.com/opencv/opencv_zoo/blob/eb9f4f2d4b79b58e5513b5d25d5f0243a8357bf4/models/face_recognition_sface/README.md#license). The question about provenance for the exact INT8 release remains [open](https://github.com/opencv/opencv_zoo/issues/318). No candidate approval or production packaging change in this release. |
| Privacy | An appearance descriptor that links a person's visits can be personal data. If the method identifies people using physical or behavioural characteristics, biometric rules can apply even when facial features are omitted. | Facial templates used to identify returning people require a biometric assessment. Local processing and a short TTL reduce exposure but do not remove that obligation. [EDPB video guidelines](https://www.edpb.europa.eu/system/files/documents/files/file1/edpb_guidelines_201903_video_devices_en_0.pdf) |
The published accuracy figures are on different data and protocols. They do
not establish which method is more accurate on this camera. Before approval,
use the same labelled returns and impostor arrivals in both arms. Report
false merges, false splits, no-match coverage, and errors by elapsed time,
lighting, pose, clothing similarity, and occlusion. Use only participants
who have agreed to the test. Evaluate retention, access, deletion, and legal
basis before any field deployment.
## RK3566 measurements
Separate temporary Android app, ONNX Runtime 1.32.0 ARM64, CPU, two intra-op
threads, 10 warm-up passes and 50 timed passes per run, two runs alternating
the candidates. Inputs were deterministic synthetic tensors. Timings cover
creating the input tensor, model execution and reading the output buffer.
They exclude camera, alignment, search and production contention. No
images, identities or templates from people were used. The bench APK was
removed from the tablet afterwards.
| Model | Run 1 p50 / p95 | Run 2 p50 / p95 |
| --- | ---: | ---: |
| Intel person-reidentification-retail-0286 FP32 | 204.2 / 213.9 ms | 203.6 / 267.0 ms |
| SFace INT8 | 101.3 / 108.2 ms | 100.9 / 102.4 ms |
The earlier body-tracking benchmark had median 118.5 ms for detector plus
tracker at a 5 FPS target. Adding either model synchronously to every frame
would exceed a 200 ms frame budget at those median latencies. Benchmark a
candidate at new-track/reattachment time with a bounded work queue before
committing to an architecture and runtime budget.
Lab ONNX SHA-256: person
`a4a96924dfd42b84d4e326a6b8d5ce87ce53acc508a52c73cb51584e56eb9853`,
SFace `2b0e941e6f16cc048c20aee0c8e31f569118f65d702914540f7bfdc14048d78a`.
The Intel FP32 IR SHA-384 values matched the upstream manifest. The converted
graph was validated by successful execution, not numerical IR parity.
No bench model weights or code are in the production APK.