From e6ad10e5cf86676c898fe27af19dc991fc4d98f4 Mon Sep 17 00:00:00 2001 From: Feng Ni Date: Mon, 18 Jul 2022 17:08:08 +0800 Subject: [PATCH] fix ids2names in plot_tracking_dict (#6466) --- deploy/pipeline/pipeline.py | 1 + deploy/pptracking/python/mot/visualize.py | 2 +- deploy/pptracking/python/mot_sde_infer.py | 6 ++++-- deploy/python/mot_sde_infer.py | 8 +++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/deploy/pipeline/pipeline.py b/deploy/pipeline/pipeline.py index 0f675ef14..fe3654dae 100644 --- a/deploy/pipeline/pipeline.py +++ b/deploy/pipeline/pipeline.py @@ -966,6 +966,7 @@ class PipePredictor(object): online_scores, frame_id=frame_id, fps=fps, + ids2names=self.mot_predictor.pred_config.labels, do_entrance_counting=self.do_entrance_counting, do_break_in_counting=self.do_break_in_counting, entrance=entrance, diff --git a/deploy/pptracking/python/mot/visualize.py b/deploy/pptracking/python/mot/visualize.py index 141140f8e..9a4cb5806 100644 --- a/deploy/pptracking/python/mot/visualize.py +++ b/deploy/pptracking/python/mot/visualize.py @@ -191,7 +191,7 @@ def plot_tracking_dict(image, scores_dict, frame_id=0, fps=0., - ids2names=['pedestrian'], + ids2names=[], do_entrance_counting=False, do_break_in_counting=False, entrance=None, diff --git a/deploy/pptracking/python/mot_sde_infer.py b/deploy/pptracking/python/mot_sde_infer.py index 1e92652fd..b62905e2a 100644 --- a/deploy/pptracking/python/mot_sde_infer.py +++ b/deploy/pptracking/python/mot_sde_infer.py @@ -512,14 +512,15 @@ class SDE_Detector(Detector): online_ids, online_scores, frame_id=frame_id, - ids2names=[]) + ids2names=ids2names) else: im = plot_tracking( frame, online_tlwhs, online_ids, online_scores, - frame_id=frame_id) + frame_id=frame_id, + ids2names=ids2names) save_dir = os.path.join(self.output_dir, seq_name) if not os.path.exists(save_dir): os.makedirs(save_dir) @@ -632,6 +633,7 @@ class SDE_Detector(Detector): online_scores, frame_id=frame_id, fps=fps, + ids2names=ids2names, do_entrance_counting=self.do_entrance_counting, entrance=entrance) else: diff --git a/deploy/python/mot_sde_infer.py b/deploy/python/mot_sde_infer.py index 29b80751f..b4a487fac 100644 --- a/deploy/python/mot_sde_infer.py +++ b/deploy/python/mot_sde_infer.py @@ -359,14 +359,15 @@ class SDE_Detector(Detector): online_ids, online_scores, frame_id=frame_id, - ids2names=[]) + ids2names=ids2names) else: im = plot_tracking( frame, online_tlwhs, online_ids, online_scores, - frame_id=frame_id) + frame_id=frame_id, + ids2names=ids2names) save_dir = os.path.join(self.output_dir, seq_name) if not os.path.exists(save_dir): os.makedirs(save_dir) @@ -431,7 +432,8 @@ class SDE_Detector(Detector): online_ids, online_scores, frame_id=frame_id, - fps=fps) + fps=fps, + ids2names=ids2names) else: # use ByteTracker, support multiple class for cls_id in range(num_classes): -- GitLab