未验证 提交 7d596463 编写于 作者: W wangguanzhong 提交者: GitHub

fix deploy when bs=2 (#6914)

上级 911e3517
...@@ -154,7 +154,7 @@ class Detector(object): ...@@ -154,7 +154,7 @@ class Detector(object):
np_boxes_num = result['boxes_num'] np_boxes_num = result['boxes_num']
if sum(np_boxes_num) <= 0: if sum(np_boxes_num) <= 0:
print('[WARNNING] No object detected.') print('[WARNNING] No object detected.')
result = {'boxes': np.zeros([0, 6]), 'boxes_num': [0]} 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} result = {k: v for k, v in result.items() if v is not None}
return result return result
...@@ -402,10 +402,8 @@ class Detector(object): ...@@ -402,10 +402,8 @@ class Detector(object):
self.pred_config.labels, self.pred_config.labels,
output_dir=self.output_dir, output_dir=self.output_dir,
threshold=self.threshold) threshold=self.threshold)
results.append(result) results.append(result)
print('Test iter {}'.format(i)) print('Test iter {}'.format(i))
results = self.merge_batch_result(results) results = self.merge_batch_result(results)
if save_results: if save_results:
Path(self.output_dir).mkdir(exist_ok=True) Path(self.output_dir).mkdir(exist_ok=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册