From 26a5d2674f6c84fc95174e384d449f38bf1cefe3 Mon Sep 17 00:00:00 2001 From: wangxinxin08 <69842442+wangxinxin08@users.noreply.github.com> Date: Sat, 19 Nov 2022 13:56:08 +0800 Subject: [PATCH] fix deploy infer when rotate detection is empty (#7367) --- deploy/python/infer.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/deploy/python/infer.py b/deploy/python/infer.py index ba143e62d..344eca59f 100644 --- a/deploy/python/infer.py +++ b/deploy/python/infer.py @@ -158,9 +158,6 @@ class Detector(object): assert isinstance(np_boxes_num, np.ndarray), \ '`np_boxes_num` should be a `numpy.ndarray`' - if np_boxes_num.sum() <= 0: - print('[WARNNING] No object detected.') - result = {'boxes': np.zeros([0, 6]), 'boxes_num': np_boxes_num} result = {k: v for k, v in result.items() if v is not None} return result @@ -434,7 +431,7 @@ class Detector(object): if not os.path.exists(self.output_dir): os.makedirs(self.output_dir) out_path = os.path.join(self.output_dir, video_out_name) - fourcc = cv2.VideoWriter_fourcc(*'mp4v') + fourcc = cv2.VideoWriter_fourcc(* 'mp4v') writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height)) index = 1 while (1): -- GitLab