Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/supervision/tracker/byte_tracker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class ByteTrack:
minimum_matching_threshold: Threshold for matching tracks with detections.
Decreasing minimum_matching_threshold improves accuracy but risks fragmentation.
Increasing it improves completeness but risks false positives and drift.
frame_rate: The frame rate of the video.
minimum_consecutive_frames: Number of consecutive frames that an object must
be tracked before it is considered a 'valid' track.
Increasing minimum_consecutive_frames prevents the creation of accidental tracks from
Expand All @@ -45,15 +44,14 @@ def __init__(
track_activation_threshold: float = 0.25,
lost_track_buffer: int = 30,
minimum_matching_threshold: float = 0.8,
frame_rate: int = 30,
minimum_consecutive_frames: int = 1,
):
self.track_activation_threshold = track_activation_threshold
self.minimum_matching_threshold = minimum_matching_threshold

self.frame_id = 0
self.det_thresh = self.track_activation_threshold + 0.1
self.max_time_lost = int(frame_rate / 30.0 * lost_track_buffer)
self.max_time_lost = lost_track_buffer
self.minimum_consecutive_frames = minimum_consecutive_frames
Comment on lines 52 to 55
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

self.max_time_lost used to be explicitly converted to int(...). With self.max_time_lost = lost_track_buffer, callers who pass a non-int (e.g. track_seconds * fps where track_seconds is a float) will now silently change the type/rounding behavior. Consider normalizing/validating lost_track_buffer (e.g. cast to int and/or reject negative values) so max_time_lost remains an integer frame count as documented.

Copilot uses AI. Check for mistakes.
self.kalman_filter = KalmanFilter()
self.shared_kalman = KalmanFilter()
Expand Down
Loading