Spaces:
Build error
Build error
Commit
·
7a92592
1
Parent(s):
ef164a1
Fix error for no objects by type checking
Browse files
inference/face_detector.py
CHANGED
|
@@ -96,7 +96,7 @@ class StatRetinaFaceDetector(FaceDetector):
|
|
| 96 |
def detect_crops(self, img, *args, **kwargs):
|
| 97 |
faces = RetinaFace.detect_faces(img, model=self.model)
|
| 98 |
crops = []
|
| 99 |
-
if
|
| 100 |
faces = {}
|
| 101 |
for name, face in faces.items():
|
| 102 |
x1, y1, x2, y2 = face['facial_area']
|
|
|
|
| 96 |
def detect_crops(self, img, *args, **kwargs):
|
| 97 |
faces = RetinaFace.detect_faces(img, model=self.model)
|
| 98 |
crops = []
|
| 99 |
+
if isinstance(faces, tuple):
|
| 100 |
faces = {}
|
| 101 |
for name, face in faces.items():
|
| 102 |
x1, y1, x2, y2 = face['facial_area']
|