Update app.py
Browse files
app.py
CHANGED
@@ -157,7 +157,7 @@ def image_inference(image):
|
|
157 |
# Draw rectangle around the faces
|
158 |
# rawfaces = postProcessed( rawfaces, image.shape[:2] )
|
159 |
|
160 |
-
rawfaces = face_recognition.face_locations( image , model="hog")
|
161 |
faces = [ image[top:bottom, left:right].copy() for (top, left, bottom, right) in rawfaces ]
|
162 |
# faces = [ image[x:w+x, y:h+y].copy() for (x, y, w, h) in rawfaces ]
|
163 |
faces = [ Image.fromarray(x, mode = 'RGB') for x in faces ]
|
@@ -191,7 +191,7 @@ def video_inference(video_path):
|
|
191 |
except:
|
192 |
break
|
193 |
# rawfaces = postProcessed( rawfaces, image.shape[:2] )
|
194 |
-
rawfaces = face_recognition.face_locations( image , model="hog")
|
195 |
# Draw rectangle around the faces
|
196 |
# https://stackoverflow.com/questions/15589517/how-to-crop-an-image-in-opencv-using-python for fliping axis
|
197 |
global_facesCo.append( rawfaces )
|
|
|
157 |
# Draw rectangle around the faces
|
158 |
# rawfaces = postProcessed( rawfaces, image.shape[:2] )
|
159 |
|
160 |
+
rawfaces = face_recognition.face_locations( image, number_of_times_to_upsample = 5 , model="hog")
|
161 |
faces = [ image[top:bottom, left:right].copy() for (top, left, bottom, right) in rawfaces ]
|
162 |
# faces = [ image[x:w+x, y:h+y].copy() for (x, y, w, h) in rawfaces ]
|
163 |
faces = [ Image.fromarray(x, mode = 'RGB') for x in faces ]
|
|
|
191 |
except:
|
192 |
break
|
193 |
# rawfaces = postProcessed( rawfaces, image.shape[:2] )
|
194 |
+
rawfaces = face_recognition.face_locations( image, number_of_times_to_upsample = 5 , model="hog")
|
195 |
# Draw rectangle around the faces
|
196 |
# https://stackoverflow.com/questions/15589517/how-to-crop-an-image-in-opencv-using-python for fliping axis
|
197 |
global_facesCo.append( rawfaces )
|