From 8474ac990c391d5c14b45ba7f38251b834d67915 Mon Sep 17 00:00:00 2001 From: shangliang Xu Date: Thu, 21 Oct 2021 10:32:58 +0800 Subject: [PATCH] [deploy] fix no object in Detector.predict (#4325) --- deploy/python/infer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/python/infer.py b/deploy/python/infer.py index 036423e33..ed7eb66f8 100644 --- a/deploy/python/infer.py +++ b/deploy/python/infer.py @@ -170,7 +170,7 @@ class Detector(object): results = [] if reduce(lambda x, y: x * y, np_boxes.shape) < 6: print('[WARNNING] No object detected.') - results = {'boxes': np.array([[]]), 'boxes_num': [0]} + results = {'boxes': np.zeros([0, 6]), 'boxes_num': [0]} else: results = self.postprocess( np_boxes, np_masks, inputs, np_boxes_num, threshold=threshold) -- GitLab