oskarastrom commited on
Commit
1b23d7b
·
1 Parent(s): 5ede26e

tracking types 2

Browse files
Files changed (2) hide show
  1. scripts/track_detection.py +2 -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 False:
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['use_associative']:
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 (args.associativity.startswith("boost")):
33
- config['associativity'] = "boost"
34
- conf = args.associativity.split(":")
35
- if len(conf) > 1: config['boost_power'] = float(conf[1])
36
- if len(conf) > 2: config['boost_decay'] = float(conf[2])
37
- if (args.associativity.startswith("bytetrack")):
38
- config['associativity'] = "bytetrack"
39
- conf = args.associativity.split(":")
40
- if len(conf) > 1: config['low_conf_threshold'] = float(conf[1])
41
- if len(conf) > 2: config['high_conf_threshold'] = float(conf[2])
 
 
 
 
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