From 9f593318542e9fc38de6b30b070673104a3c6f28 Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:29:40 +0800 Subject: [PATCH] `ultralytics 8.2.74` add `fuse_score=True` BoT-SORT and ByteTrack arg (#14965) Co-authored-by: UltralyticsAssistant Co-authored-by: Glenn Jocher --- docs/mkdocs_github_authors.yaml | 1 + ultralytics/__init__.py | 2 +- ultralytics/cfg/trackers/botsort.yaml | 2 +- ultralytics/cfg/trackers/bytetrack.yaml | 2 +- ultralytics/trackers/bot_sort.py | 5 ++--- ultralytics/trackers/byte_tracker.py | 5 ++--- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/mkdocs_github_authors.yaml b/docs/mkdocs_github_authors.yaml index 210c3595..2ea9b856 100644 --- a/docs/mkdocs_github_authors.yaml +++ b/docs/mkdocs_github_authors.yaml @@ -14,6 +14,7 @@ 49699333+dependabot[bot]@users.noreply.github.com: dependabot 52826299+Chayanonjackal@users.noreply.github.com: Chayanonjackal 53246858+hasanghaffari93@users.noreply.github.com: hasanghaffari93 +60036186+mfloto@users.noreply.github.com: mfloto 61612323+Laughing-q@users.noreply.github.com: Laughing-q 62214284+Burhan-Q@users.noreply.github.com: Burhan-Q 68285002+Kayzwer@users.noreply.github.com: Kayzwer diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 313c06fd..4b6386f0 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.2.73" +__version__ = "8.2.74" import os diff --git a/ultralytics/cfg/trackers/botsort.yaml b/ultralytics/cfg/trackers/botsort.yaml index 0c66dc6c..01cebb64 100644 --- a/ultralytics/cfg/trackers/botsort.yaml +++ b/ultralytics/cfg/trackers/botsort.yaml @@ -7,8 +7,8 @@ track_low_thresh: 0.1 # threshold for the second association new_track_thresh: 0.6 # threshold for init new track if the detection does not match any tracks track_buffer: 30 # buffer to calculate the time when to remove tracks match_thresh: 0.8 # threshold for matching tracks +fuse_score: True # Whether to fuse confidence scores with the iou distances before matching # min_box_area: 10 # threshold for min box areas(for tracker evaluation, not used for now) -# mot20: False # for tracker evaluation(not used for now) # BoT-SORT settings gmc_method: sparseOptFlow # method of global motion compensation diff --git a/ultralytics/cfg/trackers/bytetrack.yaml b/ultralytics/cfg/trackers/bytetrack.yaml index 29d352c6..49ab3f69 100644 --- a/ultralytics/cfg/trackers/bytetrack.yaml +++ b/ultralytics/cfg/trackers/bytetrack.yaml @@ -7,5 +7,5 @@ track_low_thresh: 0.1 # threshold for the second association new_track_thresh: 0.6 # threshold for init new track if the detection does not match any tracks track_buffer: 30 # buffer to calculate the time when to remove tracks match_thresh: 0.8 # threshold for matching tracks +fuse_score: True # Whether to fuse confidence scores with the iou distances before matching # min_box_area: 10 # threshold for min box areas(for tracker evaluation, not used for now) -# mot20: False # for tracker evaluation(not used for now) diff --git a/ultralytics/trackers/bot_sort.py b/ultralytics/trackers/bot_sort.py index 31d5e1be..862e217d 100644 --- a/ultralytics/trackers/bot_sort.py +++ b/ultralytics/trackers/bot_sort.py @@ -179,9 +179,8 @@ class BOTSORT(BYTETracker): dists = matching.iou_distance(tracks, detections) dists_mask = dists > self.proximity_thresh - # TODO: mot20 - # if not self.args.mot20: - dists = matching.fuse_score(dists, detections) + if self.args.fuse_score: + dists = matching.fuse_score(dists, detections) if self.args.with_reid and self.encoder is not None: emb_dists = matching.embedding_distance(tracks, detections) / 2.0 diff --git a/ultralytics/trackers/byte_tracker.py b/ultralytics/trackers/byte_tracker.py index e0e5bd61..7b4dc00f 100644 --- a/ultralytics/trackers/byte_tracker.py +++ b/ultralytics/trackers/byte_tracker.py @@ -375,9 +375,8 @@ class BYTETracker: def get_dists(self, tracks, detections): """Calculates the distance between tracks and detections using IoU and fuses scores.""" dists = matching.iou_distance(tracks, detections) - # TODO: mot20 - # if not self.args.mot20: - dists = matching.fuse_score(dists, detections) + if self.args.fuse_score: + dists = matching.fuse_score(dists, detections) return dists def multi_predict(self, tracks):