8 """ Parse command line arguments. 10 parser = argparse.ArgumentParser(description=
"MOTChallenge evaluation")
12 "--mot_dir", help=
"Path to MOTChallenge directory (train or test)",
15 "--detection_dir", help=
"Path to detections.", default=
"detections",
18 "--output_dir", help=
"Folder in which the results will be stored. Will " 19 "be created if it does not exist.", default=
"results")
21 "--min_confidence", help=
"Detection confidence threshold. Disregard " 22 "all detections that have a confidence lower than this value.",
23 default=0.0, type=float)
25 "--min_detection_height", help=
"Threshold on the detection bounding " 26 "box height. Detections with height smaller than this value are " 27 "disregarded", default=0, type=int)
29 "--nms_max_overlap", help=
"Non-maxima suppression threshold: Maximum " 30 "detection overlap.", default=1.0, type=float)
32 "--max_cosine_distance", help=
"Gating threshold for cosine distance " 33 "metric (object appearance).", type=float, default=0.2)
35 "--nn_budget", help=
"Maximum size of the appearance descriptors " 36 "gallery. If None, no budget is enforced.", type=int, default=100)
37 return parser.parse_args()
40 if __name__ ==
"__main__":
43 os.makedirs(args.output_dir, exist_ok=
True)
44 sequences = os.listdir(args.mot_dir)
45 for sequence
in sequences:
46 print(
"Running sequence %s" % sequence)
47 sequence_dir = os.path.join(args.mot_dir, sequence)
48 detection_file = os.path.join(args.detection_dir,
"%s.npy" % sequence)
49 output_file = os.path.join(args.output_dir,
"%s.txt" % sequence)
51 sequence_dir, detection_file, output_file, args.min_confidence,
52 args.nms_max_overlap, args.min_detection_height,
53 args.max_cosine_distance, args.nn_budget, display=
False)
def run(sequence_dir, detection_file, output_file, min_confidence, nms_max_overlap, min_detection_height, max_cosine_distance, nn_budget, display)