From 219c5f84185de8ef2b99f40b95c18b39e70bed97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:06:30 +0200 Subject: [PATCH 01/14] follow tracker name convention --- boxmot/__init__.py | 14 +++++++------- boxmot/tracker_zoo.py | 12 ++++++------ boxmot/trackers/botsort/botsort.py | 2 +- boxmot/trackers/bytetrack/byte_tracker.py | 2 +- boxmot/trackers/deepocsort/deep_ocsort.py | 2 +- boxmot/trackers/hybridsort/hybridsort.py | 2 +- boxmot/trackers/ocsort/ocsort.py | 2 +- boxmot/trackers/strongsort/strong_sort.py | 2 +- tests/unit/test_trackers.py | 6 +++--- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/boxmot/__init__.py b/boxmot/__init__.py index f716c0d1af..83c7b9107d 100644 --- a/boxmot/__init__.py +++ b/boxmot/__init__.py @@ -4,17 +4,17 @@ from boxmot.postprocessing.gsi import gsi from boxmot.tracker_zoo import create_tracker, get_tracker_config -from boxmot.trackers.botsort.botsort import BoTSORT -from boxmot.trackers.bytetrack.byte_tracker import BYTETracker -from boxmot.trackers.deepocsort.deep_ocsort import DeepOCSort as DeepOCSORT -from boxmot.trackers.hybridsort.hybridsort import HybridSORT -from boxmot.trackers.ocsort.ocsort import OCSort as OCSORT -from boxmot.trackers.strongsort.strong_sort import StrongSORT +from boxmot.trackers.botsort.botsort import BotSort +from boxmot.trackers.bytetrack.byte_tracker import ByteTrack +from boxmot.trackers.deepocsort.deep_ocsort import DeepOcSort +from boxmot.trackers.hybridsort.hybridsort import HybridSort +from boxmot.trackers.ocsort.ocsort import OcSort as OcSort +from boxmot.trackers.strongsort.strong_sort import StrongSort from boxmot.trackers.imprassoc.impr_assoc_tracker import ImprAssocTrack TRACKERS = ['bytetrack', 'botsort', 'strongsort', 'ocsort', 'deepocsort', 'hybridsort', 'imprassoc'] __all__ = ("__version__", - "StrongSORT", "OCSORT", "BYTETracker", "BoTSORT", "DeepOCSORT", "HybridSORT", "ImprAssocTrack" + "StrongSort", "OcSort", "ByteTrack", "BotSort", "DeepOcSort", "HybridSort", "ImprAssocTrack" "create_tracker", "get_tracker_config", "gsi") diff --git a/boxmot/tracker_zoo.py b/boxmot/tracker_zoo.py index 3ecd32886b..50b9b26c21 100644 --- a/boxmot/tracker_zoo.py +++ b/boxmot/tracker_zoo.py @@ -41,12 +41,12 @@ def create_tracker(tracker_type, tracker_config=None, reid_weights=None, device= # Map tracker types to their corresponding classes tracker_mapping = { - 'strongsort': 'boxmot.trackers.strongsort.strong_sort.StrongSORT', - 'ocsort': 'boxmot.trackers.ocsort.ocsort.OCSort', - 'bytetrack': 'boxmot.trackers.bytetrack.byte_tracker.BYTETracker', - 'botsort': 'boxmot.trackers.botsort.botsort.BoTSORT', - 'deepocsort': 'boxmot.trackers.deepocsort.deep_ocsort.DeepOCSort', - 'hybridsort': 'boxmot.trackers.hybridsort.hybridsort.HybridSORT', + 'strongsort': 'boxmot.trackers.strongsort.strong_sort.StrongSort', + 'ocsort': 'boxmot.trackers.ocsort.ocsort.OcSort', + 'bytetrack': 'boxmot.trackers.bytetrack.byte_tracker.ByteTrack', + 'botsort': 'boxmot.trackers.botsort.botsort.BotSort', + 'deepocsort': 'boxmot.trackers.deepocsort.deep_ocsort.DeepOcSort', + 'hybridsort': 'boxmot.trackers.hybridsort.hybridsort.HybridSort', 'imprassoc': 'boxmot.trackers.imprassoc.impr_assoc_tracker.ImprAssocTrack' } diff --git a/boxmot/trackers/botsort/botsort.py b/boxmot/trackers/botsort/botsort.py index 40d878189a..3601d47a09 100644 --- a/boxmot/trackers/botsort/botsort.py +++ b/boxmot/trackers/botsort/botsort.py @@ -17,7 +17,7 @@ -class BoTSORT(BaseTracker): +class BotSort(BaseTracker): """ BoTSORT Tracker: A tracking algorithm that combines appearance and motion-based tracking. diff --git a/boxmot/trackers/bytetrack/byte_tracker.py b/boxmot/trackers/bytetrack/byte_tracker.py index 32f2af99b3..a3357327ce 100644 --- a/boxmot/trackers/bytetrack/byte_tracker.py +++ b/boxmot/trackers/bytetrack/byte_tracker.py @@ -115,7 +115,7 @@ def xyxy(self): return ret -class BYTETracker(BaseTracker): +class ByteTrack(BaseTracker): """ BYTETracker: A tracking algorithm based on ByteTrack, which utilizes motion-based tracking. diff --git a/boxmot/trackers/deepocsort/deep_ocsort.py b/boxmot/trackers/deepocsort/deep_ocsort.py index aa8237f68e..158a233582 100644 --- a/boxmot/trackers/deepocsort/deep_ocsort.py +++ b/boxmot/trackers/deepocsort/deep_ocsort.py @@ -222,7 +222,7 @@ def mahalanobis(self, bbox): return self.kf.md_for_measurement(self.bbox_to_z_func(bbox)) -class DeepOCSort(BaseTracker): +class DeepOcSort(BaseTracker): """ DeepOCSort Tracker: A tracking algorithm that utilizes a combination of appearance and motion-based tracking. diff --git a/boxmot/trackers/hybridsort/hybridsort.py b/boxmot/trackers/hybridsort/hybridsort.py index 257fadf54c..ed52af1217 100644 --- a/boxmot/trackers/hybridsort/hybridsort.py +++ b/boxmot/trackers/hybridsort/hybridsort.py @@ -329,7 +329,7 @@ def get_state(self): return convert_x_to_bbox(self.kf.x) -class HybridSORT(BaseTracker): +class HybridSort(BaseTracker): """ HybridSORT Tracker: A tracking algorithm that utilizes a combination of appearance and motion-based tracking and temporal consistency models (TCM) for improved tracking accuracy and robustness. diff --git a/boxmot/trackers/ocsort/ocsort.py b/boxmot/trackers/ocsort/ocsort.py index f2151a5442..0131463a32 100644 --- a/boxmot/trackers/ocsort/ocsort.py +++ b/boxmot/trackers/ocsort/ocsort.py @@ -179,7 +179,7 @@ def get_state(self): return convert_x_to_bbox(self.kf.x) -class OCSort(BaseTracker): +class OcSort(BaseTracker): """ OCSort Tracker: A tracking algorithm that utilizes motion-based tracking. diff --git a/boxmot/trackers/strongsort/strong_sort.py b/boxmot/trackers/strongsort/strong_sort.py index 86a41374a0..0e180ff43a 100644 --- a/boxmot/trackers/strongsort/strong_sort.py +++ b/boxmot/trackers/strongsort/strong_sort.py @@ -13,7 +13,7 @@ from boxmot.trackers.basetracker import BaseTracker -class StrongSORT(object): +class StrongSort(object): """ StrongSORT Tracker: A tracking algorithm that utilizes a combination of appearance and motion-based tracking. diff --git a/tests/unit/test_trackers.py b/tests/unit/test_trackers.py index 763ed23bcb..7ad4e09333 100644 --- a/tests/unit/test_trackers.py +++ b/tests/unit/test_trackers.py @@ -6,7 +6,7 @@ from numpy.testing import assert_allclose from boxmot import ( - StrongSORT, BoTSORT, DeepOCSORT, OCSORT, BYTETracker, ImprAssocTrack, get_tracker_config, create_tracker, + StrongSort, BotSort, DeepOcSort, OcSort, ByteTrack, ImprAssocTrack, get_tracker_config, create_tracker, ) from boxmot.trackers.ocsort.ocsort import KalmanBoxTracker as OCSortKalmanBoxTracker @@ -14,8 +14,8 @@ -MOTION_ONLY_TRACKING_METHODS=[OCSORT, BYTETracker] -MOTION_N_APPEARANCE_TRACKING_METHODS=[StrongSORT, BoTSORT, DeepOCSORT, ImprAssocTrack] +MOTION_ONLY_TRACKING_METHODS=[OcSort, ByteTrac] +MOTION_N_APPEARANCE_TRACKING_METHODS=[StrongSort, BotSort, DeepOcSort, ImprAssocTrack] ALL_TRACKERS=['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'strongsort', 'imprassoc'] PER_CLASS_TRACKERS=['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'imprassoc'] From 3a245a4fd32918d31e11c22bf7b9412e579c1c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:12:03 +0200 Subject: [PATCH 02/14] follow tracker name convention --- tests/performance/test_tracking_p.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/performance/test_tracking_p.py b/tests/performance/test_tracking_p.py index cf3fdda424..b68546b894 100644 --- a/tests/performance/test_tracking_p.py +++ b/tests/performance/test_tracking_p.py @@ -7,11 +7,11 @@ from numpy.testing import assert_allclose from boxmot import ( - StrongSORT, BoTSORT, DeepOCSORT, OCSORT, BYTETracker, ImprAssocTrack, get_tracker_config, create_tracker, + StrongSort, BotSort, DeepOcSort, OcSort, ByteTrack, ImprAssocTrack, get_tracker_config, create_tracker, ) -MOTION_N_APPEARANCE_TRACKING_METHODS=['botsort', 'deepocsort', 'strongsort', 'imprassoc'] -MOTION_ONLY_TRACKING_METHODS=['ocsort', 'bytetrack'] +MOTION_ONLY_TRACKING_METHODS=[OcSort, ByteTrack] +MOTION_N_APPEARANCE_TRACKING_METHODS=[StrongSort, BotSort, DeepOcSort, ImprAssocTrack] @pytest.mark.parametrize("tracker_type", MOTION_ONLY_TRACKING_METHODS) def test_motion_tracker_update_time(tracker_type): From 872da5d0da972a6acd543d02d499b56a1860f98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:14:23 +0200 Subject: [PATCH 03/14] follow tracker name convention --- tests/unit/test_trackers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_trackers.py b/tests/unit/test_trackers.py index 7ad4e09333..11504caf1e 100644 --- a/tests/unit/test_trackers.py +++ b/tests/unit/test_trackers.py @@ -14,7 +14,7 @@ -MOTION_ONLY_TRACKING_METHODS=[OcSort, ByteTrac] +MOTION_ONLY_TRACKING_METHODS=[OcSort, ByteTrack] MOTION_N_APPEARANCE_TRACKING_METHODS=[StrongSort, BotSort, DeepOcSort, ImprAssocTrack] ALL_TRACKERS=['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'strongsort', 'imprassoc'] PER_CLASS_TRACKERS=['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'imprassoc'] From d5cb2b999f0164e10090984ddf5c147ace11cb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:19:45 +0200 Subject: [PATCH 04/14] follow tracker name convention --- tests/unit/test_trackers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_trackers.py b/tests/unit/test_trackers.py index 11504caf1e..1d31fa1062 100644 --- a/tests/unit/test_trackers.py +++ b/tests/unit/test_trackers.py @@ -56,7 +56,7 @@ def test_tracker_output_size(tracker_type): def test_dynamic_max_obs_based_on_max_age(): max_age = 400 - ocsort = OCSORT( + ocsort = OcSort( max_age=max_age ) @@ -90,8 +90,8 @@ def create_kalman_box_tracker_deepocsort(bbox, cls, det_ind, tracker): @pytest.mark.parametrize("Tracker, init_args", [ - (OCSORT, {}), - (DeepOCSORT, { + (OcSort, {}), + (DeepOcSort, { 'reid_weights': Path(WEIGHTS / 'osnet_x0_25_msmt17.pt'), 'device': 'cpu', 'half': True From 84d4a0ac4c89a337cbc540ebdf3f7c15d488bdf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:24:45 +0200 Subject: [PATCH 05/14] follow tracker name convention --- tests/unit/test_trackers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_trackers.py b/tests/unit/test_trackers.py index 1d31fa1062..953365a568 100644 --- a/tests/unit/test_trackers.py +++ b/tests/unit/test_trackers.py @@ -84,8 +84,8 @@ def create_kalman_box_tracker_deepocsort(bbox, cls, det_ind, tracker): TRACKER_CREATORS = { - OCSORT: create_kalman_box_tracker_ocsort, - DeepOCSORT: create_kalman_box_tracker_deepocsort, + OcSort: create_kalman_box_tracker_ocsort, + DeepOcSort: create_kalman_box_tracker_deepocsort, } From 2e1fb04bf2e63477a740a321be6e05714ae09b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:34:29 +0200 Subject: [PATCH 06/14] follow tracker name convention --- boxmot/tracker_zoo.py | 8 ++++---- .../trackers/bytetrack/{byte_tracker.py => bytetrack.py} | 0 .../trackers/deepocsort/{deep_ocsort.py => deepocsort.py} | 0 .../{impr_assoc_tracker.py => imprassoctrack.py} | 0 .../trackers/strongsort/{strong_sort.py => strongsort.py} | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename boxmot/trackers/bytetrack/{byte_tracker.py => bytetrack.py} (100%) rename boxmot/trackers/deepocsort/{deep_ocsort.py => deepocsort.py} (100%) rename boxmot/trackers/imprassoc/{impr_assoc_tracker.py => imprassoctrack.py} (100%) rename boxmot/trackers/strongsort/{strong_sort.py => strongsort.py} (100%) diff --git a/boxmot/tracker_zoo.py b/boxmot/tracker_zoo.py index 50b9b26c21..be05e13c95 100644 --- a/boxmot/tracker_zoo.py +++ b/boxmot/tracker_zoo.py @@ -41,13 +41,13 @@ def create_tracker(tracker_type, tracker_config=None, reid_weights=None, device= # Map tracker types to their corresponding classes tracker_mapping = { - 'strongsort': 'boxmot.trackers.strongsort.strong_sort.StrongSort', + 'strongsort': 'boxmot.trackers.strongsort.strongsort.StrongSort', 'ocsort': 'boxmot.trackers.ocsort.ocsort.OcSort', - 'bytetrack': 'boxmot.trackers.bytetrack.byte_tracker.ByteTrack', + 'bytetrack': 'boxmot.trackers.bytetrack.bytetrack.ByteTrack', 'botsort': 'boxmot.trackers.botsort.botsort.BotSort', - 'deepocsort': 'boxmot.trackers.deepocsort.deep_ocsort.DeepOcSort', + 'deepocsort': 'boxmot.trackers.deepocsort.deepocsort.DeepOcSort', 'hybridsort': 'boxmot.trackers.hybridsort.hybridsort.HybridSort', - 'imprassoc': 'boxmot.trackers.imprassoc.impr_assoc_tracker.ImprAssocTrack' + 'imprassoc': 'boxmot.trackers.imprassoc.imprassoctrack.ImprAssocTrack' } # Check if the tracker type exists in the mapping diff --git a/boxmot/trackers/bytetrack/byte_tracker.py b/boxmot/trackers/bytetrack/bytetrack.py similarity index 100% rename from boxmot/trackers/bytetrack/byte_tracker.py rename to boxmot/trackers/bytetrack/bytetrack.py diff --git a/boxmot/trackers/deepocsort/deep_ocsort.py b/boxmot/trackers/deepocsort/deepocsort.py similarity index 100% rename from boxmot/trackers/deepocsort/deep_ocsort.py rename to boxmot/trackers/deepocsort/deepocsort.py diff --git a/boxmot/trackers/imprassoc/impr_assoc_tracker.py b/boxmot/trackers/imprassoc/imprassoctrack.py similarity index 100% rename from boxmot/trackers/imprassoc/impr_assoc_tracker.py rename to boxmot/trackers/imprassoc/imprassoctrack.py diff --git a/boxmot/trackers/strongsort/strong_sort.py b/boxmot/trackers/strongsort/strongsort.py similarity index 100% rename from boxmot/trackers/strongsort/strong_sort.py rename to boxmot/trackers/strongsort/strongsort.py From 6d3e73da1c0ee3844cd664614ecaa15d63c014e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:35:26 +0200 Subject: [PATCH 07/14] follow tracker name convention --- boxmot/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/boxmot/__init__.py b/boxmot/__init__.py index 83c7b9107d..4251df7537 100644 --- a/boxmot/__init__.py +++ b/boxmot/__init__.py @@ -5,12 +5,12 @@ from boxmot.postprocessing.gsi import gsi from boxmot.tracker_zoo import create_tracker, get_tracker_config from boxmot.trackers.botsort.botsort import BotSort -from boxmot.trackers.bytetrack.byte_tracker import ByteTrack -from boxmot.trackers.deepocsort.deep_ocsort import DeepOcSort +from boxmot.trackers.bytetrack.bytetrack import ByteTrack +from boxmot.trackers.deepocsort.deepocsort import DeepOcSort from boxmot.trackers.hybridsort.hybridsort import HybridSort -from boxmot.trackers.ocsort.ocsort import OcSort as OcSort -from boxmot.trackers.strongsort.strong_sort import StrongSort -from boxmot.trackers.imprassoc.impr_assoc_tracker import ImprAssocTrack +from boxmot.trackers.ocsort.ocsort import OcSort +from boxmot.trackers.strongsort.strongsort import StrongSort +from boxmot.trackers.imprassoc.imprassoctrack import ImprAssocTrack TRACKERS = ['bytetrack', 'botsort', 'strongsort', 'ocsort', 'deepocsort', 'hybridsort', 'imprassoc'] From 57c6f885598d0df4e5639273140dd2d30668dcc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:38:26 +0200 Subject: [PATCH 08/14] follow tracker name convention --- tests/unit/test_trackers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_trackers.py b/tests/unit/test_trackers.py index 953365a568..e53c0668c2 100644 --- a/tests/unit/test_trackers.py +++ b/tests/unit/test_trackers.py @@ -10,7 +10,7 @@ ) from boxmot.trackers.ocsort.ocsort import KalmanBoxTracker as OCSortKalmanBoxTracker -from boxmot.trackers.deepocsort.deep_ocsort import KalmanBoxTracker as DeepOCSortKalmanBoxTracker +from boxmot.trackers.deepocsort.deepocsort import KalmanBoxTracker as DeepOCSortKalmanBoxTracker From 663c920fcac0f2592f14badc4e2bb7782c959784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 09:56:05 +0200 Subject: [PATCH 09/14] follow tracker name convention --- tests/performance/test_tracking_p.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/performance/test_tracking_p.py b/tests/performance/test_tracking_p.py index b68546b894..a075fc55fd 100644 --- a/tests/performance/test_tracking_p.py +++ b/tests/performance/test_tracking_p.py @@ -10,8 +10,8 @@ StrongSort, BotSort, DeepOcSort, OcSort, ByteTrack, ImprAssocTrack, get_tracker_config, create_tracker, ) -MOTION_ONLY_TRACKING_METHODS=[OcSort, ByteTrack] -MOTION_N_APPEARANCE_TRACKING_METHODS=[StrongSort, BotSort, DeepOcSort, ImprAssocTrack] +MOTION_N_APPEARANCE_TRACKING_METHODS=['botsort', 'deepocsort', 'strongsort', 'imprassoc'] +MOTION_ONLY_TRACKING_METHODS=['ocsort', 'bytetrack'] @pytest.mark.parametrize("tracker_type", MOTION_ONLY_TRACKING_METHODS) def test_motion_tracker_update_time(tracker_type): From 8c195c8e7260b214bb50ffee5b264dfe1dca49b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 10:01:20 +0200 Subject: [PATCH 10/14] update imported tracker name --- examples/torchvision_det_boxmot.ipynb | 4 ++-- examples/torchvision_pose_boxmot.ipynb | 4 ++-- examples/torchvision_seg_boxmot.ipynb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/torchvision_det_boxmot.ipynb b/examples/torchvision_det_boxmot.ipynb index 2ffdcfc8dd..72fbf821b5 100644 --- a/examples/torchvision_det_boxmot.ipynb +++ b/examples/torchvision_det_boxmot.ipynb @@ -12,7 +12,7 @@ "import numpy as np\n", "from pathlib import Path\n", "\n", - "from boxmot import BoTSORT\n", + "from boxmot import BotSort\n", "\n", "# Load a pre-trained Faster R-CNN model\n", "device = torch.device('cpu') # Use 'cuda' if you have a GPU\n", @@ -20,7 +20,7 @@ "detector.eval().to(device)\n", "\n", "# Initialize the tracker\n", - "tracker = BoTSORT(\n", + "tracker = BotSort(\n", " reid_weights=Path('osnet_x0_25_msmt17.pt'), # Path to ReID model\n", " device=device, # Use CPU for inference\n", " half=False\n", diff --git a/examples/torchvision_pose_boxmot.ipynb b/examples/torchvision_pose_boxmot.ipynb index a25175e960..548d8f00ab 100644 --- a/examples/torchvision_pose_boxmot.ipynb +++ b/examples/torchvision_pose_boxmot.ipynb @@ -11,14 +11,14 @@ "import cv2\n", "import numpy as np\n", "from pathlib import Path\n", - "from boxmot import BoTSORT\n", + "from boxmot import BotSort\n", "\n", "# Load a pre-trained Keypoint R-CNN model from torchvision\n", "device = torch.device('cpu') # Change to 'cuda' if you have a GPU available\n", "pose_model = torchvision.models.detection.keypointrcnn_resnet50_fpn(pretrained=True)\n", "pose_model.eval().to(device)\n", "\n", - "tracker = BoTSORT(\n", + "tracker = BotSort(\n", " reid_weights=Path('osnet_x0_25_msmt17.pt'), # ReID model to use\n", " device=device,\n", " half=False,\n", diff --git a/examples/torchvision_seg_boxmot.ipynb b/examples/torchvision_seg_boxmot.ipynb index 3a21b67945..c5276274ad 100644 --- a/examples/torchvision_seg_boxmot.ipynb +++ b/examples/torchvision_seg_boxmot.ipynb @@ -11,14 +11,14 @@ "import cv2\n", "import numpy as np\n", "from pathlib import Path\n", - "from boxmot import BoTSORT\n", + "from boxmot import BotSort\n", "\n", "# Load a pre-trained Mask R-CNN model from torchvision\n", "device = torch.device('cpu') # Change to 'cuda' if you have a GPU available\n", "segmentation_model = torchvision.models.detection.maskrcnn_resnet50_fpn(pretrained=True)\n", "segmentation_model.eval().to(device)\n", "\n", - "tracker = BoTSORT(\n", + "tracker = BotSort(\n", " reid_weights=Path('osnet_x0_25_msmt17.pt'), # ReID model to use\n", " device=device,\n", " half=False,\n", From 54d451b0bad359308be38839ea40ad43b2e3d5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 10:07:26 +0200 Subject: [PATCH 11/14] update imported tracker name --- tests/__init__.py | 0 tests/performance/__init__.py | 0 tests/performance/test_tracking_p.py | 3 +-- tests/test_config.py | 12 ++++++++++++ tests/unit/__init__.py | 0 5 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 tests/__init__.py create mode 100644 tests/performance/__init__.py create mode 100644 tests/test_config.py create mode 100644 tests/unit/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/performance/__init__.py b/tests/performance/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/performance/test_tracking_p.py b/tests/performance/test_tracking_p.py index a075fc55fd..501b46e273 100644 --- a/tests/performance/test_tracking_p.py +++ b/tests/performance/test_tracking_p.py @@ -9,9 +9,8 @@ from boxmot import ( StrongSort, BotSort, DeepOcSort, OcSort, ByteTrack, ImprAssocTrack, get_tracker_config, create_tracker, ) +from tests.test_config import MOTION_ONLY_TRACKING_METHODS, MOTION_N_APPEARANCE_TRACKING_METHODS -MOTION_N_APPEARANCE_TRACKING_METHODS=['botsort', 'deepocsort', 'strongsort', 'imprassoc'] -MOTION_ONLY_TRACKING_METHODS=['ocsort', 'bytetrack'] @pytest.mark.parametrize("tracker_type", MOTION_ONLY_TRACKING_METHODS) def test_motion_tracker_update_time(tracker_type): diff --git a/tests/test_config.py b/tests/test_config.py new file mode 100644 index 0000000000..08e18a3480 --- /dev/null +++ b/tests/test_config.py @@ -0,0 +1,12 @@ +from boxmot import ( + StrongSort, BotSort, DeepOcSort, OcSort, ByteTrack, ImprAssocTrack, get_tracker_config, create_tracker, +) + +MOTION_N_APPEARANCE_TRACKING_METHODS = ['botsort', 'deepocsort', 'strongsort', 'imprassoc'] +MOTION_ONLY_TRACKING_METHODS = ['ocsort', 'bytetrack'] + +MOTION_N_APPEARANCE_TRACKER_CLASSES = [StrongSort, BotSort, DeepOcSort, ImprAssocTrack] +MOTION_ONLY_TRACKER_CLASSES = [OCSORT, BYTETracker] + +ALL_TRACKERS = ['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'strongsort', 'imprassoc'] +PER_CLASS_TRACKERS = ['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'imprassoc'] \ No newline at end of file diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000000..e69de29bb2 From 6c1bc9ba0eea4bf2635a037e7229ab6d13e5dd72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 10:09:55 +0200 Subject: [PATCH 12/14] update imported tracker name --- tests/unit/test_trackers.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/unit/test_trackers.py b/tests/unit/test_trackers.py index e53c0668c2..e3e2b68ba2 100644 --- a/tests/unit/test_trackers.py +++ b/tests/unit/test_trackers.py @@ -11,13 +11,7 @@ from boxmot.trackers.ocsort.ocsort import KalmanBoxTracker as OCSortKalmanBoxTracker from boxmot.trackers.deepocsort.deepocsort import KalmanBoxTracker as DeepOCSortKalmanBoxTracker - - - -MOTION_ONLY_TRACKING_METHODS=[OcSort, ByteTrack] -MOTION_N_APPEARANCE_TRACKING_METHODS=[StrongSort, BotSort, DeepOcSort, ImprAssocTrack] -ALL_TRACKERS=['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'strongsort', 'imprassoc'] -PER_CLASS_TRACKERS=['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'imprassoc'] +from tests.test_config import MOTION_ONLY_TRACKING_METHODS, MOTION_N_APPEARANCE_TRACKING_METHODS, ALL_TRACKERS, PER_CLASS_TRACKERS @pytest.mark.parametrize("Tracker", MOTION_N_APPEARANCE_TRACKING_METHODS) From f112f711bc4fd90e144fdb43901a2afbd000ed8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 10:11:20 +0200 Subject: [PATCH 13/14] update imported tracker name --- tests/test_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 08e18a3480..46eb10c592 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -5,8 +5,8 @@ MOTION_N_APPEARANCE_TRACKING_METHODS = ['botsort', 'deepocsort', 'strongsort', 'imprassoc'] MOTION_ONLY_TRACKING_METHODS = ['ocsort', 'bytetrack'] -MOTION_N_APPEARANCE_TRACKER_CLASSES = [StrongSort, BotSort, DeepOcSort, ImprAssocTrack] -MOTION_ONLY_TRACKER_CLASSES = [OCSORT, BYTETracker] +MOTION_N_APPEARANCE_TRACKING_METHODS=[StrongSort, BotSort, DeepOcSort, ImprAssocTrack] +MOTION_ONLY_TRACKING_METHODS=[OcSort, ByteTrack] ALL_TRACKERS = ['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'strongsort', 'imprassoc'] PER_CLASS_TRACKERS = ['botsort', 'deepocsort', 'ocsort', 'bytetrack', 'imprassoc'] \ No newline at end of file From e10513807bd9a995f9633ae70a06e314e90a87f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Brostr=C3=B6m?= Date: Tue, 1 Oct 2024 10:19:46 +0200 Subject: [PATCH 14/14] update imported tracker name --- tests/performance/test_tracking_p.py | 6 +++--- tests/test_config.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/performance/test_tracking_p.py b/tests/performance/test_tracking_p.py index 501b46e273..06c9d97e55 100644 --- a/tests/performance/test_tracking_p.py +++ b/tests/performance/test_tracking_p.py @@ -9,10 +9,10 @@ from boxmot import ( StrongSort, BotSort, DeepOcSort, OcSort, ByteTrack, ImprAssocTrack, get_tracker_config, create_tracker, ) -from tests.test_config import MOTION_ONLY_TRACKING_METHODS, MOTION_N_APPEARANCE_TRACKING_METHODS +from tests.test_config import MOTION_ONLY_TRACKING_NAMES, MOTION_N_APPEARANCE_TRACKING_NAMES -@pytest.mark.parametrize("tracker_type", MOTION_ONLY_TRACKING_METHODS) +@pytest.mark.parametrize("tracker_type", MOTION_ONLY_TRACKING_NAMES) def test_motion_tracker_update_time(tracker_type): tracker_conf = get_tracker_config(tracker_type) tracker = create_tracker( @@ -40,7 +40,7 @@ def test_motion_tracker_update_time(tracker_type): assert elapsed_time_per_iteration < max_allowed_time, f"Tracking algorithms processing time exceeds the allowed limit: {elapsed_time_per_iteration} > {max_allowed_time}" -@pytest.mark.parametrize("tracker_type", MOTION_N_APPEARANCE_TRACKING_METHODS) +@pytest.mark.parametrize("tracker_type", MOTION_N_APPEARANCE_TRACKING_NAMES) def test_motion_n_appearance_tracker_update_time(tracker_type): tracker_conf = get_tracker_config(tracker_type) tracker = create_tracker( diff --git a/tests/test_config.py b/tests/test_config.py index 46eb10c592..7880055c8d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -2,8 +2,8 @@ StrongSort, BotSort, DeepOcSort, OcSort, ByteTrack, ImprAssocTrack, get_tracker_config, create_tracker, ) -MOTION_N_APPEARANCE_TRACKING_METHODS = ['botsort', 'deepocsort', 'strongsort', 'imprassoc'] -MOTION_ONLY_TRACKING_METHODS = ['ocsort', 'bytetrack'] +MOTION_N_APPEARANCE_TRACKING_NAMES = ['botsort', 'deepocsort', 'strongsort', 'imprassoc'] +MOTION_ONLY_TRACKING_NAMES = ['ocsort', 'bytetrack'] MOTION_N_APPEARANCE_TRACKING_METHODS=[StrongSort, BotSort, DeepOcSort, ImprAssocTrack] MOTION_ONLY_TRACKING_METHODS=[OcSort, ByteTrack]