OP#9534: Add ultralytics BoT-SORT tracker integration#520
Open
Sebastian-Gerken wants to merge 9 commits intomainfrom
Open
OP#9534: Add ultralytics BoT-SORT tracker integration#520Sebastian-Gerken wants to merge 9 commits intomainfrom
Sebastian-Gerken wants to merge 9 commits intomainfrom
Conversation
Made-with: Cursor
- Add TRACK.BOT_SORT + TRACKER_TYPE parsing and TrackConfig.to_dict() parity - Sync OTVision/config.py CONFIG defaults (TRACK, DETECT video fields, GUI icon) - Fix BotsortTracker: BYTETracker.update(results, img) for ultralytics 8.3+ - UltralyticsResultsLite: len/getitem/xyxy for tracker internals - Tests: botsort results lite, CLI expectations use user_config base config - user_config: TRACKER_TYPE + BOT_SORT defaults Made-with: Cursor
Allow uppercase BOT_SORT YAML keys by normalizing to ultralytics-style lowercase in parser, and document BOT_SORT defaults with inline descriptions in user config. Made-with: Cursor
Read frame rate from .otdet VIDEO metadata (actual_fps then recorded_fps) and hard-fail when metadata is missing or unreadable, instead of silently defaulting to 30 FPS. Made-with: Cursor
Explain that T_MISS_MAX is applied by OTVision post-processing while TRACK_BUFFER is used inside Ultralytics BoT-SORT. Made-with: Cursor
The --tracker CLI default was "iou", unconditionally overwriting any TRACKER_TYPE set in the YAML config. Changed to default=None and use value_or_default so the YAML setting is honored when the flag is omitted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…T integration tests The FPS extraction for BoT-SORT now handles string-encoded values (e.g. "20.0") found in real .otdet files via a new _try_positive_float helper. Added integration tests covering E2E tracking, multi-video group reset, and FPS error paths. Improved inline documentation for the sigma_h omission, frame.no==0 reset convention, and image dtype contract. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cker_type TrackCliArgs.tracker_type is now `str | None = None` to match the actual argparse output (None when --tracker is omitted). Added validate_tracker_type() in ConfigParser to reject unknown tracker types from YAML with a clear error message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Adds BoT-SORT as an alternative tracker to the existing IOU tracker, wrapping ultralytics'
BOTSORTimplementation (v8.3.159). BoT-SORT offers more robust tracking through Kalman-filter motion models, appearance matching, and Global Motion Compensation (GMC).What changed
OTVision/track/tracker/tracker_plugin_botsort.py— New file (400 lines):BotsortTrackerimplementing theTrackerABC with ultralytics adapter patternBoTSORTTrackerLike,UltralyticsResultsLite) for lazy import isolationt_min/t_miss_max) with parity to IOU tracker.otdetmetadata (supports numeric and string-encoded values)OTVision/application/config.py— Config model:_TrackBotSortConfigfrozen dataclass witht_min,t_miss_max, andtracker_paramsdictTrackConfig.tracker_typefield with polymorphict_min/t_miss_maxpropertiesOTVision/application/config_parser.py— YAML parsing:parse_track_botsort_config()with UPPERCASE → lowercase key normalization for ultralyticsvalidate_tracker_type()rejects unknown tracker types with clear error messageOTVision/track/builder.py— Factory:BotsortTracker/IouTrackerinstantiation based ontracker_typeOTVision/track/cli.py+OTVision/domain/cli.py— CLI:--tracker {iou,botsort}option;TrackCliArgs.tracker_typetyped asstr | NoneOTVision/application/track/update_track_config_with_cli_args.py— CLI override logic:OTVision/application/track/ottrk.py+OTVision/track/parser/frame_group_parser_plugins.py:.ottrkmetadata for reproducibilityTests:
tests/track/test_botsort_tracker.py— E2E tracking, multi-video reset, FPS error pathstests/track/test_botsort_results_lite.py— Adapter stub unit tests, string-encoded FPStests/cli/test_track_cli.py— BoT-SORT CLI mode selection testOP#9534