代码拉取完成,页面将自动刷新
# vim: expandtab:ts=4:sw=4
import argparse
import os
import deep_sort_app
def parse_args():
""" Parse command line arguments.
"""
parser = argparse.ArgumentParser(description="MOTChallenge evaluation")
parser.add_argument(
"--mot_dir", help="Path to MOTChallenge directory (train or test)",
required=True)
parser.add_argument(
"--detection_dir", help="Path to detections.", default="detections",
required=True)
parser.add_argument(
"--output_dir", help="Folder in which the results will be stored. Will "
"be created if it does not exist.", default="results")
parser.add_argument(
"--min_confidence", help="Detection confidence threshold. Disregard "
"all detections that have a confidence lower than this value.",
default=0.0, type=float)
parser.add_argument(
"--min_detection_height", help="Threshold on the detection bounding "
"box height. Detections with height smaller than this value are "
"disregarded", default=0, type=int)
parser.add_argument(
"--nms_max_overlap", help="Non-maxima suppression threshold: Maximum "
"detection overlap.", default=1.0, type=float)
parser.add_argument(
"--max_cosine_distance", help="Gating threshold for cosine distance "
"metric (object appearance).", type=float, default=0.2)
parser.add_argument(
"--nn_budget", help="Maximum size of the appearance descriptors "
"gallery. If None, no budget is enforced.", type=int, default=100)
return parser.parse_args()
if __name__ == "__main__":
args = parse_args()
os.makedirs(args.output_dir, exist_ok=True)
sequences = os.listdir(args.mot_dir)
for sequence in sequences:
print("Running sequence %s" % sequence)
sequence_dir = os.path.join(args.mot_dir, sequence)
detection_file = os.path.join(args.detection_dir, "%s.npy" % sequence)
output_file = os.path.join(args.output_dir, "%s.txt" % sequence)
deep_sort_app.run(
sequence_dir, detection_file, output_file, args.min_confidence,
args.nms_max_overlap, args.min_detection_height,
args.max_cosine_distance, args.nn_budget, display=False)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。