From 7d596463859720d7bb07bb38792a78c7da022d03 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Wed, 14 Sep 2022 20:05:06 +0800 Subject: [PATCH] fix deploy when bs=2 (#6914) --- deploy/python/infer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/deploy/python/infer.py b/deploy/python/infer.py index c27617589..bc503941c 100644 --- a/deploy/python/infer.py +++ b/deploy/python/infer.py @@ -154,7 +154,7 @@ class Detector(object): np_boxes_num = result['boxes_num'] if sum(np_boxes_num) <= 0: 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} return result @@ -402,10 +402,8 @@ class Detector(object): self.pred_config.labels, output_dir=self.output_dir, threshold=self.threshold) - results.append(result) print('Test iter {}'.format(i)) - results = self.merge_batch_result(results) if save_results: Path(self.output_dir).mkdir(exist_ok=True) -- GitLab