Spaces:
Runtime error
Runtime error
Commit
·
1b23d7b
1
Parent(s):
5ede26e
tracking types 2
Browse files- scripts/track_detection.py +2 -2
- scripts/track_eval.py +14 -10
scripts/track_detection.py
CHANGED
@@ -101,7 +101,7 @@ def track(in_loc_dir, out_loc_dir, metadata_path, seq, config, verbose):
|
|
101 |
image_meter_height = sequence['y_meter_start'] - sequence['y_meter_stop']
|
102 |
|
103 |
|
104 |
-
if
|
105 |
|
106 |
low_outputs = do_suppression(inference, conf_thres=config['low_conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
107 |
low_preds, real_width, real_height = format_predictions(image_shapes, low_outputs, width, height, verbose=verbose)
|
@@ -113,7 +113,7 @@ def track(in_loc_dir, out_loc_dir, metadata_path, seq, config, verbose):
|
|
113 |
else:
|
114 |
outputs = do_suppression(inference, conf_thres=config['conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
115 |
|
116 |
-
if config['
|
117 |
|
118 |
do_confidence_boost(inference, outputs, boost_power=config['boost_power'], boost_decay=config['boost_decay'], verbose=verbose)
|
119 |
|
|
|
101 |
image_meter_height = sequence['y_meter_start'] - sequence['y_meter_stop']
|
102 |
|
103 |
|
104 |
+
if config['associativity'] == "bytetrack":
|
105 |
|
106 |
low_outputs = do_suppression(inference, conf_thres=config['low_conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
107 |
low_preds, real_width, real_height = format_predictions(image_shapes, low_outputs, width, height, verbose=verbose)
|
|
|
113 |
else:
|
114 |
outputs = do_suppression(inference, conf_thres=config['conf_threshold'], iou_thres=config['nms_iou'], verbose=verbose)
|
115 |
|
116 |
+
if config['associativity'] == "boost":
|
117 |
|
118 |
do_confidence_boost(inference, outputs, boost_power=config['boost_power'], boost_decay=config['boost_decay'], verbose=verbose)
|
119 |
|
scripts/track_eval.py
CHANGED
@@ -29,16 +29,20 @@ def main(args):
|
|
29 |
'associativity': None
|
30 |
}
|
31 |
|
32 |
-
if
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
42 |
|
43 |
print("verbose", args.verbose)
|
44 |
|
|
|
29 |
'associativity': None
|
30 |
}
|
31 |
|
32 |
+
if args.associativity != "":
|
33 |
+
if (args.associativity.startswith("boost")):
|
34 |
+
config['associativity'] = "boost"
|
35 |
+
conf = args.associativity.split(":")
|
36 |
+
if len(conf) > 1: config['boost_power'] = float(conf[1])
|
37 |
+
if len(conf) > 2: config['boost_decay'] = float(conf[2])
|
38 |
+
elif (args.associativity.startswith("bytetrack")):
|
39 |
+
config['associativity'] = "bytetrack"
|
40 |
+
conf = args.associativity.split(":")
|
41 |
+
if len(conf) > 1: config['low_conf_threshold'] = float(conf[1])
|
42 |
+
if len(conf) > 2: config['high_conf_threshold'] = float(conf[2])
|
43 |
+
else:
|
44 |
+
print("INVALID ASSOCIATIVITY TYPE:", args.associativity)
|
45 |
+
return
|
46 |
|
47 |
print("verbose", args.verbose)
|
48 |
|