Reference for ultralytics/trackers/bot_sort.py
Note
Full source code for this file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/trackers/bot_sort.py. Help us fix any issues you see by submitting a Pull Request 🛠️. Thank you 🙏!
ultralytics.trackers.bot_sort.BOTrack
Bases: STrack
Source code in ultralytics/trackers/bot_sort.py
tlwh
property
Get current position in bounding box format (top left x, top left y,
width, height)
.
__init__(tlwh, score, cls, feat=None, feat_history=50)
Initialize YOLOv8 object with temporal parameters, such as feature history, alpha and current features.
Source code in ultralytics/trackers/bot_sort.py
convert_coords(tlwh)
multi_predict(stracks)
staticmethod
Predicts the mean and covariance of multiple object tracks using shared Kalman filter.
Source code in ultralytics/trackers/bot_sort.py
predict()
Predicts the mean and covariance using Kalman filter.
Source code in ultralytics/trackers/bot_sort.py
re_activate(new_track, frame_id, new_id=False)
Reactivates a track with updated features and optionally assigns a new ID.
Source code in ultralytics/trackers/bot_sort.py
tlwh_to_xywh(tlwh)
staticmethod
Convert bounding box to format (center x, center y, width,
height)
.
update(new_track, frame_id)
Update the YOLOv8 instance with new track and frame ID.
update_features(feat)
Update features vector and smooth it using exponential moving average.
Source code in ultralytics/trackers/bot_sort.py
ultralytics.trackers.bot_sort.BOTSORT
Bases: BYTETracker
Source code in ultralytics/trackers/bot_sort.py
__init__(args, frame_rate=30)
Initialize YOLOv8 object with ReID module and GMC algorithm.
Source code in ultralytics/trackers/bot_sort.py
get_dists(tracks, detections)
Get distances between tracks and detections using IoU and (optionally) ReID embeddings.
Source code in ultralytics/trackers/bot_sort.py
get_kalmanfilter()
init_track(dets, scores, cls, img=None)
Initialize track with detections, scores, and classes.