Skip to content

Feat/core/refactor tracklet kalman filter#310

Open
AlexBodner wants to merge 78 commits intodevelopfrom
feat/core/refactor-tracklet-kalman-filter
Open

Feat/core/refactor tracklet kalman filter#310
AlexBodner wants to merge 78 commits intodevelopfrom
feat/core/refactor-tracklet-kalman-filter

Conversation

@AlexBodner
Copy link
Collaborator

What does this PR do?

Refactors KalmanBoxTracker to Tracklet classes so decouples Kalman Filter logic from the tracklet, also creating a unique Kalman Filter that will be used by all the algorithms based on the OC-SORT paper implementation of the KF. This also supports swappable kalman filter state coordinates, using the abstraction StateEstimator.

Beware that:

  • OC-SORT and SORT metrics remain the same BUT ByteTrack ones has small changes (at least with default parameters) because it now uses the same kalman filter as OC-SORT (which has slight differences in implementation that make it better in OC-SORT) but here it drops 0.1%. Initialization for bytetrack remains the same as we now support custom initializations per tracker.

  • ByteTrack has a behaviour difference wrt other trackers, to match original it initializes tracklets number_of_successful_consecutive_updates to 1, while in the other ones it is initalized to 0. Changing this gives slighter worse performance (-2% HOTA). So we might have to consider changing something around this to have same behaviour out of same parameters around trackers.

Type of Change

  • New feature (non-breaking change that adds functionality)

AlexBodner and others added 30 commits January 29, 2026 13:10
AlexBodner and others added 29 commits February 23, 2026 11:11
- Add `tracker_id = "ocsort"` class variable to enable CLI auto-registration via BaseTracker's registry mechanism
- Export OCSORTTracker in `__all__` for public API discoverability
  - Remove module-level docstring from state_representations.py
  - Remove section divider comment from state_representations.py
  - Remove duplicate/truncated headers from converters.py and kalman_filter.py
  double backticks in state_representations.py.
  - Add backticks to variable references (`x1`, `y1`, `scale`, etc.)
  - Replace Sphinx-style :class:/:meth: with plain backticks
  - Remove bullet points (poor mkdocs rendering)
  - Expand StateRepresentation, XCYCSRKalmanFilter, XYXYKalmanFilter
    docstrings with variable explanations and behavioral implications
  - Add doctests with full input/output examples
  - Add unit tests covering conversions, edge cases, and round-trips
  - Add API documentation under Trackers > Utilities section
…eemed redundant because oc-sort activates them earlier
…er evaluating in sportsmot and getting same metrics
…ecause we changed kalman filter it uses and now the initialization is aligned to the original implementation
@AlexBodner AlexBodner requested a review from SkalskiP as a code owner March 5, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants