Skip to content

Bot-SORT refactored + Original ByteTrack alignment#337

Draft
AlexBodner wants to merge 181 commits intobot-sort-devfrom
feat/core/botsort-refactored
Draft

Bot-SORT refactored + Original ByteTrack alignment#337
AlexBodner wants to merge 181 commits intobot-sort-devfrom
feat/core/botsort-refactored

Conversation

@AlexBodner
Copy link
Copy Markdown
Collaborator

@AlexBodner AlexBodner commented Mar 27, 2026

What does this PR do?

Refactor of Bot-SORT from Tomasz with kalman box tracker class to kalman filter separetely from tracklet. That doesnt change metrics.

Then aligned Bot-SORT thing inherited from "overpowered" ByteTrack to how it was done in the original one:

  • The original ByteTrack performs score fusing, based on the detection confidence. It happens during the first association stage and during the unconfirmed detections matching (towards initiating new tracklets)
  • Original ByteTrack stores lost_stracks. We had similar mechanisms in ByteTrack in Trackers with maximum_frames_without_update, but the original one also makes additional distinction. It only considers lost_stracks in the first association step and not in the second association step.
  • Now we give 1 frame to confirm unconfirmed tracks (in step 3)

closes #334

AlexBodner and others added 30 commits January 29, 2026 13:10
Borda and others added 13 commits April 21, 2026 19:27
- robots.txt: add Google-Extended, OAI-SearchBot, ChatGPT-User, Applebot-Extended; fix Sitemap URL → /latest/sitemap.xml
- mkdocs.yml: add iso_date type for git-revision-date plugin; add Privacy Policy + ToS to copyright
- schema_inject.py: add datePublished/dateModified, mainEntityOfPage, image to TechArticle; inject FAQPage (homepage) and BreadcrumbList schemas
- main.html: remove REPLACE_WITH_BING_VERIFICATION_KEY placeholder; enhance Organization (description, foundingDate, Wikidata, Crunchbase sameAs); add SoftwareApplication featureList; render FAQPage + BreadcrumbList blocks
- docs/llms.txt: new file — AI crawler content map with Documentation/API/Optional sections
- index.md: rewrite hero from marketing to stat-forward (HOTA scores, PyPI installs, license)
- comparison.md: add benchmark methodology disclosure (detector + parameter info)
- sort.md, bytetrack.md, ocsort.md: convert declarative H2s to question format for AIO extraction
- schema_inject.py: fix false dataset claims in FAQPage (MOT17+SportsMOT only); fix homepage breadcrumb duplication; add Dataset schema for comparison page (4 datasets with arXiv citations); add ScholarlyArticle citation to algorithm TechArticles; prefer raw ISO date keys from git plugin
- ocsort.md: sync benchmark values to comparison.md (authoritative source)
- main.html: og:type conditional (website/article); add WebSite+SearchAction schema on homepage; render Dataset schema blocks
- robots.txt: consolidate all AI crawlers under wildcard block (fix Disallow inheritance); convert wildcard patterns to portable prefix matches
- index.md, download.md: remove false MOT20/SoccerNet/DanceTrack dataset support claims
- 6 content pages: add expanded keyword-rich title frontmatter (50-60 chars)
- about.md: add package provenance table (PyPI, license, Python version)

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* add search spaces in trackers
* add validation
* add tests
* fix errors

* add `Tuner` class
* add tests for `Tuner`
* add `tune` dependancy
* add checks

* fix(tune): validate search_space value schema; raise for unknown type
* test(tune): add e2e tests for _run_tracker_on_detections
* docs(tune): clarify expected MOT 17 input format in Tuner docstring
* test(core): add OCSORTTracker to search_space key test; add value schema tests
* refactor(io): promote _load_mot_file to public API; export from trackers
* chore(deps): update `uv.lock` to include new dependencies

---------

Signed-off-by: Omkar Kabde <omkarkabde@gmail.com>
Co-authored-by: SkalskiP <piotr.skalski92@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* test: add determinism regression test for _get_associated_indices

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
* add missing and modern typehints
* Remove unused import from __init__.py
* add missing `: object` to __exit__ *_ params for consistency
* add TYPE_CHECKING and annotations to resolve potential circular imports

---------

Co-authored-by: Piotr Skalski <piotr.skalski92@gmail.com>
Co-authored-by: jirka <6035284+Borda@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Avoid input mutation in SortTracker.update
* Potential fix for pull request finding
* fix: revert empty-path to sv.Detections.empty() to prevent mutation
* test: add non-mutation regression tests for SORTTracker.update

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
* add cli parser
* register subparser in main
* fix: wrap output file write in try/except OSError
* docs: add Returns: section to tune() docstring
* refactor: move OBJECTIVE_TO_FAMILY auto-add into Tuner.__init__
* test: add CLI-level tests for tune subcommand

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
@Borda
Copy link
Copy Markdown
Member

Borda commented Apr 24, 2026

@AlexBodner, could you pls try to rebase or cherry-pick the commits? It seems that merging has cumulated too many unrelated commits 🦝

Borda and others added 14 commits April 24, 2026 18:05
* ocsort with piotr's review changes
...
* try removing activate tracklets in activate_or_kill_tracklets as it seemed redundant because oc-sort activates them earlier
* completely corrected activate_or_kill_tracklets to kill_tracklets after evaluating in sportsmot and getting same metrics
* changed BaseKalmanFilter to BaseStateEstimator and same for other types of StateKalmanFilters
* tracker changed by tracklet in byte
* possible optimization by copying detections only once per update
* version with tracklets ready to test, bytetrack values might change because we changed kalman filter it uses and now the initialization is aligned to the original implementation
* small bug fix in sort, passed detections instead of confidence
* default in sort is XYXY now
* now sort tracklets initialize number_of_successful_consecutive_updates
* initializing parameters like old version
* Now SORT uses number_of_succesful_updates (not consecutive)
* Now SORT uses number_of_succesful_updates (not consecutive)
* fix bytetrack broken because of usage of sort utility
* changed kalman filter name in tracklet to state_estimator
* added first version of docs for custom kalmans
* removed copy from being passed to tracker
* added first numbers on state estimators and video
* finished putting the explained numbers for StateEstimators comparison
* aded new bytetrack results to tables (missing update on dancetrack in index.md
* changed bytetrack integration test HOTA
* fix: handle empty detections in SORT tracker correctly
* fix: guard detections.confidence=None in SORTTracker._spawn_new_tracklets
* refactor: simplify SORTTracker API — one canonical tracks attr + deprecated trackers alias
* perf: remove redundant deepcopy in OCSORTTracker (supervision slice creates independent copy)
* fix: use TypeVar on _get_alive_tracklets — remove type: ignore[assignment]
* docs+tests: shape validation, noise config note, maturity attr docs, new tracklet tests

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Piotr Skalski <piotr.skalski92@gmail.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Bumps [wheel](https://github.com/pypa/wheel) from 0.46.3 to 0.47.0.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](pypa/wheel@0.46.3...0.47.0)

---
updated-dependencies:
- dependency-name: wheel
  dependency-version: 0.47.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps inference-models from 0.24.4 to 0.27.2.

---
updated-dependencies:
- dependency-name: inference-models
  dependency-version: 0.27.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [build](https://github.com/pypa/build) from 1.4.3 to 1.4.4.
- [Release notes](https://github.com/pypa/build/releases)
- [Changelog](https://github.com/pypa/build/blob/main/CHANGELOG.rst)
- [Commits](pypa/build@1.4.3...1.4.4)

---
updated-dependencies:
- dependency-name: build
  dependency-version: 1.4.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 4.5.1 to 4.6.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](pre-commit/pre-commit@v4.5.1...v4.6.0)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-version: 4.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [supervision](https://github.com/roboflow/supervision) from 0.28.0rc1 to 0.28.0rc2.
- [Release notes](https://github.com/roboflow/supervision/releases)
- [Changelog](https://github.com/roboflow/supervision/blob/develop/docs/changelog.md)
- [Commits](roboflow/supervision@0.28.0rc1...0.28.0rc2)

---
updated-dependencies:
- dependency-name: supervision
  dependency-version: 0.28.0rc2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* add `tracks` attribute to `BaseTracker`
* add regression tests for tracker pruning
* update metrics
* update ByteTrack metrics in docs

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Alex Bodner <yodabodner@gmail.com>
* add base abstractmethod
* add core implementations
* docs: expand tracked_objects docstring
* test: add tracked_objects regression tests
* docs: note per-tracker alive semantics in tracked_objects docstring
* test: add empty-state test for tracked_objects before first update
* refactor: consolidate tracked_objects in BaseTracker via _alive_tracklets()
* docs: clarify confidence and class_id are None in tracked_objects docstring
* test: add multi-track test for tracked_objects with N>1 simultaneous tracks
* fix: annotate maximum_frames_without_update on BaseTracker, drop type: ignore
* lint: add type: ignore for scipy and cast in ocsort tracker
* fix(tracked_objects): uniform sv.Detections shape, TrackletProtocol, occlusion tests

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
…dling it in predict (#383)

* bytetrack metris adjusted in docs and no longer dependence on update(None) for ByteTrack
* removed dependence on update(None) for all the trackers
* missed to change sportsmot tuned number
* fix(bytetrack): reset consecutive counter on missed frame in predict()
* docs(bytetrack): fix stale miss() ref in utils docstring
* docs: document predict()/update() responsibility split in tracklets
* refactor: clarify type annotation and contract in base classes
* test(bytetrack): add regression test for consecutive counter reset on miss

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.11 → v0.15.12](astral-sh/ruff-pre-commit@v0.15.11...v0.15.12)
- [github.com/pre-commit/mirrors-mypy: v1.20.1 → v1.20.2](pre-commit/mirrors-mypy@v1.20.1...v1.20.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@Borda Borda marked this pull request as draft April 29, 2026 18:36
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.

6 participants