bit-guber commited on
Commit
4125416
1 Parent(s): 28ecdc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -165,10 +165,11 @@ def image_inference(image):
165
  # rawfaces = postProcessed( rawfaces, image.shape[:2] )
166
 
167
  # rawfaces = face_recognition.face_locations( image, number_of_times_to_upsample = 1 , model="hog")
168
- rawfaces = []
169
- for name, keys in RetinaFace.detect_faces( image ).items():
170
- rawfaces.append( keys['facial_area'] )
171
- faces = [ image[top:bottom, left:right].copy() for (top, left, bottom, right) in rawfaces ]
 
172
  faces_mean = [ x.mean() for x in faces ]
173
  # faces = [ image[x:w+x, y:h+y].copy() for (x, y, w, h) in rawfaces ]
174
  faces = [ Image.fromarray(x, mode = 'RGB') for x in faces ]
 
165
  # rawfaces = postProcessed( rawfaces, image.shape[:2] )
166
 
167
  # rawfaces = face_recognition.face_locations( image, number_of_times_to_upsample = 1 , model="hog")
168
+ # rawfaces = []
169
+ # for name, keys in RetinaFace.detect_faces( image ).items():
170
+ # rawfaces.append( keys['facial_area'] )
171
+ # faces = [ image[top:bottom, left:right].copy() for (top, left, bottom, right) in rawfaces ]
172
+ faces = RetinaFace.extract_faces( image, align = True)
173
  faces_mean = [ x.mean() for x in faces ]
174
  # faces = [ image[x:w+x, y:h+y].copy() for (x, y, w, h) in rawfaces ]
175
  faces = [ Image.fromarray(x, mode = 'RGB') for x in faces ]