Commit a5c47c6 1 parent 80f5a93 commit a5c47c6 Copy full SHA for a5c47c6
File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -281,10 +281,12 @@ def extract_faces(
281
281
# Expand the facial area to be extracted and stay within img.shape limits
282
282
x1 = max (0 , facial_area [0 ] - int ((facial_area [2 ] * expand_face_area ) / 100 ))
283
283
y1 = max (0 , facial_area [1 ] - int ((facial_area [3 ] * expand_face_area ) / 100 ))
284
- x2 = min (img .shape [1 ], facial_area [2 ] +
285
- int ((facial_area [2 ] * expand_face_area ) / 100 ))
286
- y2 = min (img .shape [0 ], facial_area [3 ] +
287
- int ((facial_area [3 ] * expand_face_area ) / 100 ))
284
+ x2 = min (
285
+ img .shape [1 ], facial_area [2 ] + int ((facial_area [2 ] * expand_face_area ) / 100 )
286
+ )
287
+ y2 = min (
288
+ img .shape [0 ], facial_area [3 ] + int ((facial_area [3 ] * expand_face_area ) / 100 )
289
+ )
288
290
facial_img = facial_img [y1 :y2 , x1 :x2 ]
289
291
290
292
resp .append (facial_img [:, :, ::- 1 ])
You can’t perform that action at this time.
0 commit comments