Skip to content

feat(multicamera): add world-plane HOTA - #556

Draft
AlexBodner wants to merge 10 commits into
developfrom
feat/multicamera-evaluation
Draft

AlexBodner wants to merge 10 commits into
developfrom
feat/multicamera-evaluation

Conversation

@AlexBodner

@AlexBodner AlexBodner commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds AI City Challenge 2024 Track 1 evaluation: world-plane HOTA per scene and the protocol's unweighted scene mean. Every number is checked directly against NVIDIA's pinned evaluator (nvidia/PhysicalAI-SmartSpaces @ 1eebcf0f).

Multicamera evaluation differs from MOT in three ways, and the code follows NVIDIA on each:

  • Similarity is max(0, 1 - euclidean / 2 m) on world coordinates rounded to three decimals, computed with scipy.spatial.distance.cdist. A Gram-matrix form was measured to flip alpha-threshold ties at world-plane magnitudes and was replaced.
  • Cameras are filtered first, then duplicate (frame_id, obj_id) rows keep the first occurrence, then frame ids shift by +1.
  • The headline is the unweighted mean of per-scene HOTA, DetA, AssA and LocA, not the TP-weighted MOT aggregate, so SceneMeanHOTA carries exactly those four fields.

A missing prediction file raises so a scene cannot be skipped silently; an empty one scores HOTA/DetA/AssA as zero with LocA 1.0 per TrackEval. HOTAMetrics, BenchmarkResult and eval/evaluate.py are untouched; the only change to results.py is sharing the table renderer, with MOT output byte-identical to develop and now pinned by a test.

Public API

from trackers.eval import evaluate_multicamera_scene, evaluate_multicamera_scenes
from trackers.io import load_multicamera_file, load_scene_camera_map

evaluate_multicamera_scene returns a SequenceResult with full HOTA metrics. evaluate_multicamera_scenes returns a MulticameraBenchmarkResult whose scenes hold per-scene results and whose aggregate is the SceneMeanHOTA. Inputs are per-scene files:

gt/<scene>/ground_truth.txt
pred/<scene>.txt

How to try it

from trackers.eval import evaluate_multicamera_scenes

result = evaluate_multicamera_scenes(
    gt_dir="tests/data/multicamera/gt",
    tracker_dir="tests/data/multicamera/pred",
    scene_camera_map="tests/data/multicamera/scene_camera_map.json",
)
print(result.table())
Scene                            HOTA     DetA     AssA     LocA
----------------------------------------------------------------
scene_a                        57.735   42.857   77.778  100.000
scene_b                       100.000  100.000  100.000  100.000
----------------------------------------------------------------
SCENE_MEAN                     78.868   71.429   88.889  100.000

Parity against NVIDIA's evaluator, on the committed fixture and optionally the full 30-scene sample:

uv run --with pandas python scripts/verify_multicamera_eval.py \
    --nvidia-eval-dir /path/to/MTMC_Tracking_2024/eval [--sample-dir /path/to/sample]

Full-benchmark headline: HOTA 49.2825, DetA 49.1998, AssA 49.3655, LocA 77.0547, all 30 scenes within 1e-4 (tests/data/multicamera/nvidia_scene_comparison.jsonl).

Dataset download, the eval CLI and the user-facing protocol page are follow-up PRs.

🤖 Generated with Claude Code

AlexBodner and others added 4 commits August 12, 2026 11:39
- Add streaming AI City 2024 multicamera loaders and single-/multi-scene world-plane HOTA evaluation APIs with explicit scene-mean coverage semantics.
- Verify hermetic, truncated real-scene, and full 30-scene parity against the pinned official NVIDIA evaluator, with authenticated fixtures and provenance.
- Extend benchmark results with aggregation modes, strict JSON serialization, coverage round-tripping, table labels, and typed incompatibility errors.
- Wire focused unit/integration coverage, required external test-data handling, API docs, CI paths, and the Hugging Face development dependency.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
- Keep API docs and exports focused on supported entry points while making allocation guards private.
- Persist compact per-scene NVIDIA parity evidence with portable, hash-authenticated provenance.
- Update tests to enforce the narrowed surface and auditable full-benchmark receipt.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Integrate the pre-commit autofix commit while preserving compact Tier 3 provenance.
- Measure evaluator memory above package-import overhead so the integration guard is portable across CI environments.
- Avoid the Python 3.10 docformatter tokenizer conflict in the subprocess test harness.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Borda
Borda requested a balanced review from Copilot August 12, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds AI City 2024 multicamera world-plane HOTA evaluation, including streaming input preparation, scene-mean aggregation, and NVIDIA parity validation.

Changes:

  • Adds multicamera parsing and Euclidean HOTA evaluation APIs.
  • Adds aggregation and benchmark-coverage metadata.
  • Adds fixtures, parity tooling, tests, documentation, and CI integration.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/trackers/io/multicamera.py Implements multicamera parsing and preparation.
src/trackers/eval/evaluate.py Adds scene and benchmark evaluation.
src/trackers/eval/results.py Adds aggregation and coverage metadata.
src/trackers/eval/hota.py Validates aggregation arrays.
src/trackers/eval/errors.py Defines aggregation exception.
src/trackers/eval/__init__.py Exports new public APIs.
scripts/verify_multicamera_eval.py Adds NVIDIA parity harness.
tests/io/test_multicamera.py Tests parsing and preparation.
tests/eval/test_evaluate.py Tests multicamera evaluation.
tests/eval/test_results.py Tests result semantics and serialization.
tests/eval/test_integration.py Adds real-scene parity coverage.
tests/cli/test_verify_multicamera_eval.py Tests verification tooling.
tests/conftest.py Adds pinned fixture downloads.
tests/data/multicamera/tier3_validation.md Records Tier 3 validation summary.
tests/data/multicamera/tier2_expected.json Stores Tier 2 recipe and golden.
tests/data/multicamera/provenance.json Records validation provenance.
tests/data/multicamera/expected_results.json Stores Tier 1 goldens.
tests/data/multicamera/scene_camera_map.json Defines synthetic scene mapping.
tests/data/multicamera/scene_a_gt.txt Adds scene A ground truth.
tests/data/multicamera/scene_a_pred.txt Adds scene A predictions.
tests/data/multicamera/scene_b_gt.txt Adds scene B ground truth.
tests/data/multicamera/scene_b_pred.txt Adds scene B predictions.
tests/data/multicamera/combined_gt.txt Adds combined oracle ground truth.
tests/data/multicamera/combined_pred.txt Adds combined oracle predictions.
tests/data/multicamera/gt/scene_a/ground_truth.txt Adds benchmark-layout scene A GT.
tests/data/multicamera/gt/scene_b/ground_truth.txt Adds benchmark-layout scene B GT.
tests/data/multicamera/pred/scene_a.txt Adds benchmark-layout scene A predictions.
tests/data/multicamera/pred/scene_b.txt Adds benchmark-layout scene B predictions.
docs/api/io.md Documents multicamera loaders.
docs/api/evals.md Documents evaluation APIs and results.
.github/workflows/ci-integrations.yml Requires external integration fixtures.
pyproject.toml Adds Hugging Face development dependency.
uv.lock Locks the new dependency.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +608 to +612
pred_prepared = _load_prepared_multicamera_file(
pred_path,
file_format=file_format,
camera_ids=camera_ids,
)
- AssA: 49.3655
- LocA: 77.0546

Per-scene numeric values were not retained and are not reconstructed here. The source validator report was `.reports/review/2026-08-11T17-59-13Z/validate-qa-tier3.md`.
Comment thread src/trackers/eval/evaluate.py Outdated
Comment on lines +429 to +432
def _scene_camera_map_sha256(camera_map: dict[str, list[int]]) -> str:
"""Hash normalized map semantics independently of JSON formatting."""
encoded = json.dumps(camera_map, sort_keys=True, separators=(",", ":")).encode()
return hashlib.sha256(encoded).hexdigest()
AlexBodner and others added 5 commits August 12, 2026 17:11
Remove deferred acquisition, coverage, and re-aggregation machinery while preserving AI City world-plane HOTA and its minimal parity evidence.
Make the first ground-truth and prediction examples self-explanatory without changing their parsed values.
Name the metadata file after the NVIDIA verification evidence it records.
The AI City 2024 benchmark row defines only HOTA, DetA, AssA, and LocA, and
expressing that through the shared MOT types forced eight HOTAMetrics fields to
become optional plus an aggregation discriminator on BenchmarkResult. Every MOT
consumer paid for one four-number row.

Move the feature into eval/multicamera.py with SceneMeanHOTA for the aggregate
and MulticameraBenchmarkResult holding per-scene SequenceResult objects that
keep full, strict HOTA metrics. HOTAMetrics, BenchmarkResult, and evaluate.py
return to their develop state; results.py keeps only an extracted table
renderer shared by both benchmark tables, verified to render byte-identical
output.

Also drop the committed combined_*.txt fixtures: the parity script now builds
NVIDIA's monolithic layout from the per-scene files, so the rows no longer live
in the repo twice and cannot drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Borda Borda added the enhancement New feature or request label Aug 23, 2026
- compute world-plane similarity with scipy cdist; the Gram-matrix form flipped alpha-threshold ties at world-plane magnitudes (30/30 scenes drifted one-directionally vs NVIDIA)
- reuse io.mot._remap_ids; validate zero_distance once per public entry point before any I/O
- evaluate_multicamera_scene keeps MOT argument order with scene keyword-only; Literal file_format on all three signatures; Sequence/Mapping input types
- export loaders from trackers.io; add __dir__ for lazy eval names; drop two unreachable guards; from_dict rejects MOT payloads
- complete Raises/Examples docstrings, document NVIDIA divergences and the LocA=1.0 empty-prediction rule
- tests: prediction-side camera filter, alpha-boundary regression, half-to-even tie value, table golden; scripts/ added to mypy files
- rename tier3_comparison.jsonl to nvidia_scene_comparison.jsonl; script gains --comparison-out to regenerate it

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants