LBLong commited on
Commit
e5af115
1 Parent(s): 83af7df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
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) <= len(faces2):
35
- if len(faces2) < len(faces3):
36
- faces = faces3
37
- else:
38
- faces = faces2
39
- else:
40
  faces = faces1
41
- print(len(faces1),len(faces2),len(faces3))
 
 
 
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))