fastmtcnn sometimes fails

This commit is contained in:
Sefik Ilkin Serengil 2024-03-02 12:26:02 +00:00
parent db0db06f59
commit 50dd5d7aa2

View File

@ -27,8 +27,11 @@ class FastMtCnnClient(Detector):
detections = self.model.detect(
img_rgb, landmarks=True
) # returns boundingbox, prob, landmark
if detections is not None and len(detections) > 0:
if (
detections is not None
and len(detections) > 0
and not any(detection is None for detection in detections) # issue 1043
):
for current_detection in zip(*detections):
x, y, w, h = xyxy_to_xywh(current_detection[0])
confidence = current_detection[1]