trackers icon indicating copy to clipboard operation
trackers copied to clipboard

Dedup scale-aware noise machinery shared by BoTSORTTracklet/McByteTracklet

Open Borda opened this issue 2 months ago • 0 comments

BoTSORTTracklet and McByteTracklet already share ~250 near-identical lines (_configure_initial_noise, _build_process_noise, _build_measurement_noise, _set_scale_aware_noise, both _refresh_*_noise_from_state, all _clamp_* static methods, _SIGMA_P/_SIGMA_V/_SIGMA_M).

PR #578 added a 5-line _diagonal_matrix helper duplicated verbatim across both files, on top of the existing duplication.

Extract to a shared base class or mixin; fold _diagonal_matrix into that work.

Shared home options:

  • utils/matrix.py, module-internal privacy
  • utils/_matrix.py, exposing a public diagonal_matrix — a third consumer already exists at src/trackers/utils/motion_models.py:236

Constraint: do not add to src/trackers/__init__.py — that surface is the stable public API per repo convention.

Source: /oss:review PR #578 report, .reports/review/2026-09-10T11-04-46Z/review-report.md, finding A1.

Borda avatar Sep 10 '26 11:09 Borda