Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ from PIL import Image
|
|
7 |
import numpy as np
|
8 |
from transformers import pipeline
|
9 |
|
10 |
-
|
11 |
pipe = pipeline("image-classification", model="NTQAI/pedestrian_gender_recognition")
|
12 |
model_path = hf_hub_download(repo_id="arnabdhar/YOLOv8-Face-Detection", filename="model.pt")
|
13 |
model = YOLO(model_path)
|
@@ -27,6 +26,7 @@ def detect_faces(image):
|
|
27 |
for (x, y, w, h) in faces:
|
28 |
cv2.rectangle(image_np, (x, y), (x+w, y+h), (0, 255, 0), 2)
|
29 |
|
|
|
30 |
label_out = pipe(image)
|
31 |
|
32 |
return (image_np,im,label_out[0]['label'])
|
|
|
7 |
import numpy as np
|
8 |
from transformers import pipeline
|
9 |
|
|
|
10 |
pipe = pipeline("image-classification", model="NTQAI/pedestrian_gender_recognition")
|
11 |
model_path = hf_hub_download(repo_id="arnabdhar/YOLOv8-Face-Detection", filename="model.pt")
|
12 |
model = YOLO(model_path)
|
|
|
26 |
for (x, y, w, h) in faces:
|
27 |
cv2.rectangle(image_np, (x, y), (x+w, y+h), (0, 255, 0), 2)
|
28 |
|
29 |
+
image = Image.open(image)
|
30 |
label_out = pipe(image)
|
31 |
|
32 |
return (image_np,im,label_out[0]['label'])
|