From 36cbb08f937a8496ba7d7ee4543a0ccacccc73d8 Mon Sep 17 00:00:00 2001 From: JYChen Date: Fri, 15 Apr 2022 10:29:48 +0800 Subject: [PATCH] Change saved result format (#5698) * change id to image path when save result of image directory prediction * fix error info --- deploy/python/det_keypoint_unite_infer.py | 3 ++- deploy/python/infer.py | 2 +- deploy/python/mot_keypoint_unite_infer.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/deploy/python/det_keypoint_unite_infer.py b/deploy/python/det_keypoint_unite_infer.py index 2b901dcaa..c32955597 100644 --- a/deploy/python/det_keypoint_unite_infer.py +++ b/deploy/python/det_keypoint_unite_infer.py @@ -85,8 +85,9 @@ def topdown_unite_predict(detector, FLAGS.run_benchmark) if save_res: + save_name = img_file if isinstance(img_file, str) else i store_res.append([ - i, keypoint_res['bbox'], + save_name, keypoint_res['bbox'], [keypoint_res['keypoint'][0], keypoint_res['keypoint'][1]] ]) else: diff --git a/deploy/python/infer.py b/deploy/python/infer.py index d712ed7e8..c8737ccfd 100644 --- a/deploy/python/infer.py +++ b/deploy/python/infer.py @@ -691,7 +691,7 @@ def get_test_images(infer_dir, infer_img): Get image path list in TEST mode """ assert infer_img is not None or infer_dir is not None, \ - "--infer_img or --infer_dir should be set" + "--image_file or --image_dir should be set" assert infer_img is None or os.path.isfile(infer_img), \ "{} is not a file".format(infer_img) assert infer_dir is None or os.path.isdir(infer_dir), \ diff --git a/deploy/python/mot_keypoint_unite_infer.py b/deploy/python/mot_keypoint_unite_infer.py index 96ed8e399..9f8413bb6 100644 --- a/deploy/python/mot_keypoint_unite_infer.py +++ b/deploy/python/mot_keypoint_unite_infer.py @@ -95,8 +95,9 @@ def mot_topdown_unite_predict(mot_detector, FLAGS.run_benchmark) if save_res: + save_name = img_file if isinstance(img_file, str) else i store_res.append([ - i, keypoint_res['bbox'], + save_name, keypoint_res['bbox'], [keypoint_res['keypoint'][0], keypoint_res['keypoint'][1]] ]) if FLAGS.run_benchmark: -- GitLab