Ai
1 Star 0 Fork 0

snowingbear/deep_sort

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
evaluate_motchallenge.py 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
Nicolai Wojke 提交于 2017-02-14 20:17 +08:00 . Initial commit
# 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)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/snowingbear/deep_sort.git
git@gitee.com:snowingbear/deep_sort.git
snowingbear
deep_sort
deep_sort
master

搜索帮助