Closed chenjunnn closed 2 years ago
When nothing detected,
cv2.dnn.NMSBoxes
would return an empty tuple which has no attribute 'flatten'. Thus it would cause an AttributeError.Traceback (most recent call last): File "main.py", line 158, in <module> srcimg = net.detect(srcimg) File "main.py", line 133, in detect det_bboxes, det_conf, det_classid = self.post_process(outs) File "main.py", line 69, in post_process det_bboxes, det_conf, det_classid = self.get_bboxes_single(cls_scores, bbox_preds, 1, rescale=False) File "main.py", line 107, in get_bboxes_single indices = cv2.dnn.NMSBoxes(bboxes_wh.tolist(), confidences.tolist(), self.prob_threshold, self.iou_threshold).flatten() AttributeError: 'tuple' object has no attribute 'flatten'
So
flatten()
should be called after the check of indices' emptiness.
yes, you are right
Would you consider to merge this PR?
yes
---Original--- From: @.> Date: Wed, Jan 5, 2022 18:41 PM To: @.>; Cc: @.**@.>; Subject: Re: [hpc203/picodet-onnxruntime] fix a bug when nothing detect (PR#1)
Would you consider to merge this PR?
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>
这个PR很久没有动静了,请问您可以考虑合并一下吗 @hpc203
When nothing detected,
cv2.dnn.NMSBoxes
would return an empty tuple which has no attribute 'flatten'. Thus it would cause an AttributeError.So
flatten()
should be called after the check of indices' emptiness.