Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -214,10 +214,10 @@ if picture:
|
|
| 214 |
expanded_h = min(expanded_h, frm.shape[0] - expanded_y)
|
| 215 |
|
| 216 |
# Extract the expanded face area
|
| 217 |
-
|
| 218 |
|
| 219 |
# Now, 'face_img' contains the largest face. You can process it further as needed.
|
| 220 |
-
if np.array(
|
| 221 |
target_size = (512, 512)
|
| 222 |
resized_face = cv2.resize(face_img, target_size)
|
| 223 |
# Perform spatial pyramid feature extraction
|
|
|
|
| 214 |
expanded_h = min(expanded_h, frm.shape[0] - expanded_y)
|
| 215 |
|
| 216 |
# Extract the expanded face area
|
| 217 |
+
face_img = frm[expanded_y:expanded_y + expanded_h, expanded_x:expanded_x + expanded_w]
|
| 218 |
|
| 219 |
# Now, 'face_img' contains the largest face. You can process it further as needed.
|
| 220 |
+
if np.array(face_img).size != 0 :
|
| 221 |
target_size = (512, 512)
|
| 222 |
resized_face = cv2.resize(face_img, target_size)
|
| 223 |
# Perform spatial pyramid feature extraction
|