Phase B1: appearance re-ID (wire HSV descriptors into detection + cross-camera matching) - #9
Closed
mandarwagh9 wants to merge 1 commit into
Closed
mandarwagh9 wants to merge 1 commit into
mandarwagh9 wants to merge 1 commit into
Conversation
… matching Phase B1 — the first feature build. Activates appearance re-ID, which was scaffolded but dormant (compute_appearance was never called; Detection.appearance was always None, so tracking was pure-IoU and cross-camera matching distance-only). - detection: extract module-level compute_hsv_appearance() and populate Detection.appearance per detection (64-dim L2-normalized HSV histogram; toggle via APPEARANCE_REID_ENABLED). This also activates the appearance term already present in the tracking cost matrix. - world model: gate cross-camera association on appearance cosine similarity (CROSS_CAMERA_APPEARANCE_THRESHOLD, default 0.5) so differently-dressed people at the same ground position stay separate; EMA-smooth (alpha=0.3) the fused descriptor. - config: add appearance_reid_enabled + cross_camera_appearance_threshold as real Settings fields (env-wired) + .env.example docs. - README: flip "Appearance re-ID" from planned to implemented. - Tests: 7 new (descriptor shape/similarity/degenerate; appearance-gated matching; distance fallback; config wiring). Coverage 52%->55%. ruff/mypy clean, 81 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
Superseded — all commits from this phase landed on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Phase B1 — the first feature build of the 10× roadmap. Activates appearance re-ID, which was scaffolded but completely dormant:
compute_appearance()was never called, soDetection.appearancewas alwaysNone— tracking ran pure-IoU and cross-camera matching was distance-only.Changes
compute_hsv_appearance()(64-dim L2-normalized HSV histogram) and populateDetection.appearanceper detection (toggle viaAPPEARANCE_REID_ENABLED). This also activates the appearance term already in the tracking cost matrix.CROSS_CAMERA_APPEARANCE_THRESHOLD, default 0.5): two differently-dressed people at the same ground position stay separate world objects. The fused descriptor is EMA-smoothed (α = 0.3).appearance_reid_enabled+cross_camera_appearance_thresholdas realSettingsfields (genuinely env-wired) +.env.exampledocs.Tests (TDD)
7 new in
test_appearance_reid.py: descriptor shape/normalization, same-vs-different-color similarity, degenerate bbox → None, appearance-gated matching (similar merges, dissimilar stays separate), distance fallback when no appearance, and a config-wiring guard (so the new keys can't silently become no-ops).Verification
ruffclean ·mypyclean · 81 tests pass (was 74).🤖 Generated with Claude Code