diff --git a/boxmot/configs/search/botsort.yaml b/boxmot/configs/botsort.yaml similarity index 51% rename from boxmot/configs/search/botsort.yaml rename to boxmot/configs/botsort.yaml index 71ea1c7763..d148c90401 100644 --- a/boxmot/configs/search/botsort.yaml +++ b/boxmot/configs/botsort.yaml @@ -1,37 +1,34 @@ -# botsort_search_space.yaml - track_high_thresh: type: uniform + default: 0.6 # from the default parameters range: [0.3, 0.7] track_low_thresh: type: uniform + default: 0.1 # from the default parameters range: [0.1, 0.3] new_track_thresh: type: uniform + default: 0.7 # from the default parameters range: [0.1, 0.8] track_buffer: type: randint + default: 30 # from the default parameters range: [20, 81] match_thresh: type: uniform + default: 0.8 # from the default parameters range: [0.1, 0.9] proximity_thresh: type: uniform + default: 0.5 # from the default parameters range: [0.25, 0.75] appearance_thresh: type: uniform - range: [0.1, 0.8] - -cmc_method: - type: choice - options: ['sparseOptFlow'] - -frame_rate: - type: choice - options: [30] + default: 0.25 # from the default parameters + range: [0.1, 0.8] \ No newline at end of file diff --git a/boxmot/configs/bytetrack.yaml b/boxmot/configs/bytetrack.yaml new file mode 100644 index 0000000000..5f33000e1a --- /dev/null +++ b/boxmot/configs/bytetrack.yaml @@ -0,0 +1,19 @@ +track_thresh: + type: uniform + default: 0.5 # from the default parameters + range: [0.4, 0.6] + +track_buffer: + type: randint + default: 30 # from the default parameters + range: [10, 61, 10] # step size of 10, upper bound exclusive + +match_thresh: + type: uniform + default: 0.8 # from the default parameters + range: [0.7, 0.9] + +frame_rate: + type: choice + default: 30 # from the default parameters + choices: [30] # static choice for Ray Search \ No newline at end of file diff --git a/boxmot/configs/deepocsort.yaml b/boxmot/configs/deepocsort.yaml new file mode 100644 index 0000000000..22b30b8bdf --- /dev/null +++ b/boxmot/configs/deepocsort.yaml @@ -0,0 +1,74 @@ +det_thresh: + type: uniform + default: 0.5 # from the default parameters + range: [0.3, 0.6] + +max_age: + type: randint + default: 30 # from the default parameters + range: [10, 61, 10] # step size of 10, upper bound exclusive + +min_hits: + type: randint + default: 3 # from the default parameters + range: [1, 6] # upper bound exclusive + +iou_thresh: + type: uniform + default: 0.3 # from the default parameters + range: [0.1, 0.4] + +delta_t: + type: randint + default: 3 # from the default parameters + range: [1, 6] # upper bound exclusive + +asso_func: + type: choice + default: iou # from the default parameters + options: ['iou', 'giou'] + +inertia: + type: uniform + default: 0.2 # from the default parameters + range: [0.1, 0.4] + +w_association_emb: + type: uniform + default: 0.75 # from the default parameters + range: [0.5, 0.9] + +alpha_fixed_emb: + type: uniform + default: 0.95 # from the default parameters + range: [0.9, 0.999] + +aw_param: + type: uniform + default: 0.5 # from the default parameters + range: [0.3, 0.7] + +embedding_off: + type: choice + default: false # from the default parameters + options: [True, False] + +cmc_off: + type: choice + default: false # from the default parameters + options: [True, False] + +aw_off: + type: choice + default: false # from the default parameters + options: [True, False] + +Q_xy_scaling: + type: uniform + default: 0.01 # from the default parameters + range: [0.01, 1] + +Q_s_scaling: + type: uniform + default: 0.0001 # from the default parameters + range: [0.0001, 1] diff --git a/boxmot/configs/defaults/__init__.py b/boxmot/configs/defaults/__init__.py deleted file mode 100644 index 4f7a4d0f1f..0000000000 --- a/boxmot/configs/defaults/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Mikel Broström 🔥 Yolo Tracking 🧾 AGPL-3.0 license diff --git a/boxmot/configs/defaults/botsort.yaml b/boxmot/configs/defaults/botsort.yaml deleted file mode 100644 index 75028a2279..0000000000 --- a/boxmot/configs/defaults/botsort.yaml +++ /dev/null @@ -1,9 +0,0 @@ -appearance_thresh: 0.25 -cmc_method: ecc -frame_rate: 30 -match_thresh: 0.8 -new_track_thresh: 0.7 -proximity_thresh: 0.5 -track_buffer: 30 -track_high_thresh: 0.6 -track_low_thresh: 0.1 diff --git a/boxmot/configs/defaults/bytetrack.yaml b/boxmot/configs/defaults/bytetrack.yaml deleted file mode 100644 index db49d46a46..0000000000 --- a/boxmot/configs/defaults/bytetrack.yaml +++ /dev/null @@ -1,4 +0,0 @@ -track_thresh: 0.5 # tracking confidence threshold, should be the same as model conf -track_buffer: 30 # the frames for keep lost tracks -match_thresh: 0.8 # matching threshold for tracking -frame_rate: 30 # FPS diff --git a/boxmot/configs/defaults/deepocsort.yaml b/boxmot/configs/defaults/deepocsort.yaml deleted file mode 100644 index cad97ed40b..0000000000 --- a/boxmot/configs/defaults/deepocsort.yaml +++ /dev/null @@ -1,15 +0,0 @@ -alpha_fixed_emb: 0.95 -asso_func: iou -aw_off: false -aw_param: 0.5 -cmc_off: false -delta_t: 3 -det_thresh: 0.5 -embedding_off: false -inertia: 0.2 -iou_thresh: 0.3 -max_age: 30 -min_hits: 3 -w_association_emb: 0.75 -Q_xy_scaling: 0.01 -Q_s_scaling: 0.0001 diff --git a/boxmot/configs/defaults/hybridsort.yaml b/boxmot/configs/defaults/hybridsort.yaml deleted file mode 100644 index c29e68266f..0000000000 --- a/boxmot/configs/defaults/hybridsort.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# Trial number: 7 -# HOTA, MOTA, IDF1: [40.35] -TCM_first_step_weight: 0.2866529225304586 -asso_func: hmiou -delta_t: 5 -det_thresh: 0.12442660055370669 -inertia: 0.369525477649008 -longterm_reid_weight: 0.0509704360503877 -max_age: 30 -min_hits: 1 -use_byte: False diff --git a/boxmot/configs/defaults/imprassoc.yaml b/boxmot/configs/defaults/imprassoc.yaml deleted file mode 100644 index 0588c8572a..0000000000 --- a/boxmot/configs/defaults/imprassoc.yaml +++ /dev/null @@ -1,12 +0,0 @@ -appearance_thresh: 0.25 -cmc_method: sparseOptFlow -frame_rate: 30 -lambda_: 0.2 -match_thresh: 0.65 -new_track_thresh: 0.5 -overlap_thresh: 0.55 -proximity_thresh: 0.1 -second_match_thresh: 0.19 -track_buffer: 35 -track_high_thresh: 0.5 -track_low_thresh: 0.1 \ No newline at end of file diff --git a/boxmot/configs/defaults/ocsort.yaml b/boxmot/configs/defaults/ocsort.yaml deleted file mode 100644 index b38ab30fff..0000000000 --- a/boxmot/configs/defaults/ocsort.yaml +++ /dev/null @@ -1,9 +0,0 @@ -asso_func: iou -delta_t: 3 -det_thresh: 0.6 -inertia: 0.2 -max_age: 30 -min_hits: 3 -use_byte: false -Q_xy_scaling: 0.01 -Q_s_scaling: 0.0001 diff --git a/boxmot/configs/defaults/strongsort.yaml b/boxmot/configs/defaults/strongsort.yaml deleted file mode 100644 index bb8c7c62e8..0000000000 --- a/boxmot/configs/defaults/strongsort.yaml +++ /dev/null @@ -1,7 +0,0 @@ -ema_alpha: 0.9 -max_age: 30 -max_cos_dist: 0.4 -max_iou_dist: 0.7 -mc_lambda: 0.98 -n_init: 3 -nn_budget: 100 diff --git a/boxmot/configs/hybridsort.yaml b/boxmot/configs/hybridsort.yaml new file mode 100644 index 0000000000..db72d502c5 --- /dev/null +++ b/boxmot/configs/hybridsort.yaml @@ -0,0 +1,49 @@ +det_thresh: + type: uniform + default: 0.12442660055370669 # from the default parameters + range: [0, 0.6] + +max_age: + type: randint + default: 30 # from the default parameters + range: [10, 151, 10] # step size of 10, upper bound exclusive + +min_hits: + type: randint + default: 1 # from the default parameters + range: [1, 6] # upper bound exclusive + +delta_t: + type: randint + default: 5 # from the default parameters + range: [1, 6] # upper bound exclusive + +asso_func: + type: choice + default: hmiou # from the default parameters + options: ['iou', 'giou', 'diou'] + +iou_threshold: + type: uniform + default: 0.3 # from the default parameters + range: [0.1, 0.4] + +inertia: + type: uniform + default: 0.369525477649008 # from the default parameters + range: [0.1, 0.4] + +TCM_first_step_weight: + type: uniform + default: 0.2866529225304586 # from the default parameters + range: [0, 0.5] + +longterm_reid_weight: + type: uniform + default: 0.0509704360503877 # from the default parameters + range: [0, 0.5] + +use_byte: + type: choice + default: False # from the default parameters + options: [True, False] \ No newline at end of file diff --git a/boxmot/configs/imprassoc.yaml b/boxmot/configs/imprassoc.yaml new file mode 100644 index 0000000000..5bc3f2f813 --- /dev/null +++ b/boxmot/configs/imprassoc.yaml @@ -0,0 +1,59 @@ +track_high_thresh: + type: uniform + default: 0.5 # from the default parameters + range: [0.3, 0.7] + +track_low_thresh: + type: uniform + default: 0.1 # from the default parameters + range: [0.05, 0.3] + +new_track_thresh: + type: uniform + default: 0.5 # from the default parameters + range: [0.5, 0.9] + +track_buffer: + type: qrandint + default: 35 # from the default parameters + range: [20, 80, 10] # step size of 10, upper bound exclusive + +match_thresh: + type: uniform + default: 0.65 # from the default parameters + range: [0.1, 0.9] + +second_match_thresh: + type: uniform + default: 0.19 # from the default parameters + range: [0.1, 0.4] + +overlap_thresh: + type: uniform + default: 0.55 # from the default parameters + range: [0.3, 0.6] + +proximity_thresh: + type: uniform + default: 0.1 # from the default parameters + range: [0.1, 0.8] + +appearance_thresh: + type: uniform + default: 0.25 # from the default parameters + range: [0.1, 0.8] + +cmc_method: + type: choice + default: sparseOptFlow # from the default parameters + options: ['sparseOptFlow'] + +frame_rate: + type: choice + default: 30 # from the default parameters + options: [30] + +lambda_: + type: uniform + default: 0.05 # from the default parameters + range: [0.05, 0.3] \ No newline at end of file diff --git a/boxmot/configs/ocsort.yaml b/boxmot/configs/ocsort.yaml new file mode 100644 index 0000000000..93e79e989b --- /dev/null +++ b/boxmot/configs/ocsort.yaml @@ -0,0 +1,44 @@ +det_thresh: + type: uniform + default: 0.6 # from the default parameters + range: [0, 0.6] + +max_age: + type: grid_search + default: 30 # from the default parameters + values: [10, 20, 30, 40, 50, 60] + +min_hits: + type: grid_search + default: 3 # from the default parameters + values: [1, 2, 3, 4, 5] + +delta_t: + type: grid_search + default: 3 # from the default parameters + values: [1, 2, 3, 4, 5] + +asso_func: + type: choice + default: iou # from the default parameters + options: ['iou', 'giou', 'centroid'] + +use_byte: + type: choice + default: false # from the default parameters + options: [True, False] + +inertia: + type: uniform + default: 0.2 # from the default parameters + range: [0.1, 0.4] + +Q_xy_scaling: + type: loguniform + default: 0.01 # from the default parameters + range: [0.01, 1] + +Q_s_scaling: + type: loguniform + default: 0.0001 # from the default parameters + range: [0.0001, 1] diff --git a/boxmot/configs/search/__init__.py b/boxmot/configs/search/__init__.py deleted file mode 100644 index 4f7a4d0f1f..0000000000 --- a/boxmot/configs/search/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Mikel Broström 🔥 Yolo Tracking 🧾 AGPL-3.0 license diff --git a/boxmot/configs/search/bytetrack.yaml b/boxmot/configs/search/bytetrack.yaml deleted file mode 100644 index c1249cc468..0000000000 --- a/boxmot/configs/search/bytetrack.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# bytetrack_search_space.yaml - -track_thresh: - type: uniform - range: [0.4, 0.6] - -track_buffer: - type: randint - range: [10, 61, 10] # The upper bound is exclusive, step size of 10 - -match_thresh: - type: uniform - range: [0.7, 0.9] \ No newline at end of file diff --git a/boxmot/configs/search/deepocsort.yaml b/boxmot/configs/search/deepocsort.yaml deleted file mode 100644 index 1badbe2573..0000000000 --- a/boxmot/configs/search/deepocsort.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# deepocsort_search_space.yaml - -det_thresh: - type: uniform - range: [0.3, 0.6] - -max_age: - type: randint - range: [10, 61, 10] # The upper bound is exclusive, step size of 10 - -min_hits: - type: randint - range: [1, 6] # The upper bound is exclusive - -iou_thresh: - type: uniform - range: [0.1, 0.4] - -delta_t: - type: randint - range: [1, 6] # The upper bound is exclusive - -asso_func: - type: choice - options: ['iou', 'giou'] - -inertia: - type: uniform - range: [0.1, 0.4] - -w_association_emb: - type: uniform - range: [0.5, 0.9] - -alpha_fixed_emb: - type: uniform - range: [0.9, 0.999] - -aw_param: - type: uniform - range: [0.3, 0.7] - -embedding_off: - type: choice - options: [True, False] - -cmc_off: - type: choice - options: [True, False] - -aw_off: - type: choice - options: [True, False] - -Q_xy_scaling: - type: uniform - range: [0.01, 1] - -Q_s_scaling: - type: uniform - range: [0.0001, 1] diff --git a/boxmot/configs/search/hybridsort.yaml b/boxmot/configs/search/hybridsort.yaml deleted file mode 100644 index 677968e5bb..0000000000 --- a/boxmot/configs/search/hybridsort.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# hybridsort_search_space.yaml - -det_thresh: - type: uniform - range: [0, 0.6] - -max_age: - type: randint - range: [10, 151, 10] # The upper bound is exclusive, step size of 10 - -min_hits: - type: randint - range: [1, 6] # The upper bound is exclusive - -delta_t: - type: randint - range: [1, 6] # The upper bound is exclusive - -asso_func: - type: choice - options: ['iou', 'giou', 'diou'] - -iou_thresh: - type: uniform - range: [0.1, 0.4] - -inertia: - type: uniform - range: [0.1, 0.4] - -TCM_first_step_weight: - type: uniform - range: [0, 0.5] - -longterm_reid_weight: - type: uniform - range: [0, 0.5] - -use_byte: - type: choice - options: [True, False] \ No newline at end of file diff --git a/boxmot/configs/search/imprassoc.yaml b/boxmot/configs/search/imprassoc.yaml deleted file mode 100644 index 9fb5e7c175..0000000000 --- a/boxmot/configs/search/imprassoc.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# imprassoc_search_space.yaml - -track_high_thresh: - type: uniform - range: [0.3, 0.7] - -track_low_thresh: - type: uniform - range: [0.1, 0.3] - -new_track_thresh: - type: uniform - range: [0.1, 0.8] - -track_buffer: - type: qrandint - range: [20, 80, 10] # The upper bound is exclusive, step size of 10 - -match_thresh: - type: uniform - range: [0.1, 0.9] - -second_match_thresh: - type: uniform - range: [0.1, 0.4] - -overlap_thresh: - type: uniform - range: [0.3, 0.6] - -proximity_thresh: - type: uniform - range: [0.1, 0.8] - -appearance_thresh: - type: uniform - range: [0.1, 0.8] - -cmc_method: - type: choice - options: ['sparseOptFlow'] - -frame_rate: - type: choice - options: [30] - -lambda_: - type: uniform - range: [0.97, 0.995] diff --git a/boxmot/configs/search/ocsort.yaml b/boxmot/configs/search/ocsort.yaml deleted file mode 100644 index 70f2437651..0000000000 --- a/boxmot/configs/search/ocsort.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# ocsort_search_space.yaml - -det_thresh: - type: uniform - range: [0, 0.6] - -max_age: - type: grid_search - values: [10, 20, 30, 40, 50, 60] # Discrete values using grid search - -min_hits: - type: grid_search - values: [1, 2, 3, 4, 5] # Discrete values using grid search - -delta_t: - type: grid_search - values: [1, 2, 3, 4, 5] # Discrete values using grid search - -asso_func: - type: choice - options: ['iou', 'giou', 'centroid'] - -use_byte: - type: choice - options: [True, False] - -inertia: - type: uniform - range: [0.1, 0.4] - -Q_xy_scaling: - type: loguniform - range: [0.01, 1] - -Q_s_scaling: - type: loguniform - range: [0.0001, 1] \ No newline at end of file diff --git a/boxmot/configs/search/strongsort.yaml b/boxmot/configs/search/strongsort.yaml deleted file mode 100644 index 357fcb4456..0000000000 --- a/boxmot/configs/search/strongsort.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# strongsort_search_space.yaml - -ema_alpha: - type: uniform - range: [0.7, 0.95] - -max_cos_dist: - type: uniform - range: [0.1, 0.4] - -max_iou_dist: - type: uniform - range: [0.5, 0.95] - -max_age: - type: randint - range: [10, 151] # The upper bound is exclusive - -n_init: - type: randint - range: [1, 4] # The upper bound is exclusive - -mc_lambda: - type: uniform - range: [0.90, 0.999] - -nn_budget: - type: choice - options: [100] \ No newline at end of file diff --git a/boxmot/configs/strongsort.yaml b/boxmot/configs/strongsort.yaml new file mode 100644 index 0000000000..09d4b687b7 --- /dev/null +++ b/boxmot/configs/strongsort.yaml @@ -0,0 +1,34 @@ +ema_alpha: + type: uniform + default: 0.9 # from the default parameters + range: [0.7, 0.95] + +max_cos_dist: + type: uniform + default: 0.4 # from the default parameters + range: [0.1, 0.4] + +max_iou_dist: + type: uniform + default: 0.7 # from the default parameters + range: [0.5, 0.95] + +max_age: + type: randint + default: 30 # from the default parameters + range: [10, 151] # upper bound exclusive + +n_init: + type: randint + default: 3 # from the default parameters + range: [1, 4] # upper bound exclusive + +mc_lambda: + type: uniform + default: 0.98 # from the default parameters + range: [0.90, 0.999] + +nn_budget: + type: choice + default: 100 # from the default parameters + options: [100] diff --git a/boxmot/tracker_zoo.py b/boxmot/tracker_zoo.py index 72285c79e0..034cee5a66 100644 --- a/boxmot/tracker_zoo.py +++ b/boxmot/tracker_zoo.py @@ -27,7 +27,8 @@ def create_tracker(tracker_type, tracker_config=None, reid_weights=None, device= # Load configuration from file or use provided dictionary if evolve_param_dict is None: with open(tracker_config, "r") as f: - tracker_args = yaml.load(f, Loader=yaml.FullLoader) + yaml_config = yaml.load(f, Loader=yaml.FullLoader) + tracker_args = {param: details['default'] for param, details in yaml_config.items()} else: tracker_args = evolve_param_dict diff --git a/boxmot/utils/__init__.py b/boxmot/utils/__init__.py index 004f91476b..c3a15a2649 100644 --- a/boxmot/utils/__init__.py +++ b/boxmot/utils/__init__.py @@ -11,8 +11,7 @@ DATA = ROOT / 'data' BOXMOT = ROOT / "boxmot" EXAMPLES = ROOT / "tracking" -TRACKER_CONFIGS = ROOT / "boxmot" / "configs" / "defaults" -TRACKER_SEARCH_SPACES = ROOT / "boxmot" / "configs" / "search" +TRACKER_CONFIGS = ROOT / "boxmot" / "configs" WEIGHTS = ROOT / "tracking" / "weights" REQUIREMENTS = ROOT / "requirements.txt" diff --git a/tracking/evolve.py b/tracking/evolve.py index 3661889062..11c6dba5d7 100644 --- a/tracking/evolve.py +++ b/tracking/evolve.py @@ -4,7 +4,7 @@ from pathlib import Path from boxmot.utils.checks import RequirementsChecker -from boxmot.utils import EXAMPLES, TRACKER_SEARCH_SPACES +from boxmot.utils import EXAMPLES, TRACKER_CONFIGS from tracking.val import ( run_generate_dets_embs, run_generate_mot_results, @@ -40,7 +40,7 @@ def objective_function(self, config): def load_yaml_config(tracking_method): - config_path = TRACKER_SEARCH_SPACES / f"{tracking_method}.yaml" # Example: 'botsort_search_space.yaml' + config_path = TRACKER_CONFIGS / f"{tracking_method}.yaml" # Example: 'botsort_search_space.yaml' with open(config_path, 'r') as file: config = yaml.safe_load(file) return config