Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,14 +31,12 @@ def detect_faces(image):
|
|
31 |
faces2 = face_cascade_face_2.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(5, 5))
|
32 |
faces3 = face_cascade_face_3.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(5, 5))
|
33 |
|
34 |
-
if len(faces1)
|
35 |
-
if len(faces2) < len(faces3):
|
36 |
-
faces = faces3
|
37 |
-
else:
|
38 |
-
faces = faces2
|
39 |
-
else:
|
40 |
faces = faces1
|
41 |
-
|
|
|
|
|
|
|
42 |
|
43 |
face_cascade_eye = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_eye.xml")
|
44 |
eyes = face_cascade_eye.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(5, 5))
|
|
|
31 |
faces2 = face_cascade_face_2.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(5, 5))
|
32 |
faces3 = face_cascade_face_3.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(5, 5))
|
33 |
|
34 |
+
if (len(faces1) >= len(faces2)) and (len(faces1) >= len(faces3)):
|
|
|
|
|
|
|
|
|
|
|
35 |
faces = faces1
|
36 |
+
elif len(faces2) >= len(faces3):
|
37 |
+
faces = faces2
|
38 |
+
else:
|
39 |
+
faces = faces3
|
40 |
|
41 |
face_cascade_eye = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_eye.xml")
|
42 |
eyes = face_cascade_eye.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(5, 5))
|