evaluate_motchallenge.py
Go to the documentation of this file.
1 # vim: expandtab:ts=4:sw=4
2 import argparse
3 import os
4 import deep_sort_app
5 
6 
7 def parse_args():
8  """ Parse command line arguments.
9  """
10  parser = argparse.ArgumentParser(description="MOTChallenge evaluation")
11  parser.add_argument(
12  "--mot_dir", help="Path to MOTChallenge directory (train or test)",
13  required=True)
14  parser.add_argument(
15  "--detection_dir", help="Path to detections.", default="detections",
16  required=True)
17  parser.add_argument(
18  "--output_dir", help="Folder in which the results will be stored. Will "
19  "be created if it does not exist.", default="results")
20  parser.add_argument(
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)
24  parser.add_argument(
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)
28  parser.add_argument(
29  "--nms_max_overlap", help="Non-maxima suppression threshold: Maximum "
30  "detection overlap.", default=1.0, type=float)
31  parser.add_argument(
32  "--max_cosine_distance", help="Gating threshold for cosine distance "
33  "metric (object appearance).", type=float, default=0.2)
34  parser.add_argument(
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()
38 
39 
40 if __name__ == "__main__":
41  args = parse_args()
42 
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)


jsk_perception
Author(s): Manabu Saito, Ryohei Ueda
autogenerated on Mon May 3 2021 03:03:27