未验证 提交 26a5d267 编写于 作者: W wangxinxin08 提交者: GitHub

fix deploy infer when rotate detection is empty (#7367)

上级 697dd72e
......@@ -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):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册