Skip to content

Commit

Permalink
fix nontype error (opencv#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuentau authored Nov 9, 2023
1 parent c4684d1 commit b6e370b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/face_detection_yunet/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def visualize(image, results, box_color=(0, 255, 0), text_color=(0, 0, 255), fps
if fps is not None:
cv.putText(output, 'FPS: {:.2f}'.format(fps), (0, 15), cv.FONT_HERSHEY_SIMPLEX, 0.5, text_color)

for det in (results if results is not None else []):
for det in results:
bbox = det[0:4].astype(np.int32)
cv.rectangle(output, (bbox[0], bbox[1]), (bbox[0]+bbox[2], bbox[1]+bbox[3]), box_color, 2)

Expand Down
2 changes: 1 addition & 1 deletion models/face_detection_yunet/yunet.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ def setInputSize(self, input_size):
def infer(self, image):
# Forward
faces = self._model.detect(image)
return faces[1]
return np.array([]) if faces[1] is None else faces[1]

0 comments on commit b6e370b

Please sign in to comment.