Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,13 +16,13 @@ def detect_faces(image , slider ) :
|
|
16 |
for (x, y, w, h) in faces:
|
17 |
cv2.rectangle(image_np, (x, y), (x+w, y+h), (255, 0, 0), 5)
|
18 |
|
19 |
-
return image_np
|
20 |
|
21 |
# slider = gr.Slider(minimum=1, maximum=2, step=.1, label="Adjust the ScaleFactor")
|
22 |
|
23 |
iface = gr.Interface( fn=detect_faces,
|
24 |
inputs=["image",gr.Slider(minimum=1, maximum=2, step=.1, label="Adjust the ScaleFactor")],
|
25 |
-
outputs="image",
|
26 |
title="Face Detection using Haar Cascade Classifier ",
|
27 |
description="Upload an image,and the model will detect faces and draw bounding boxes around them.",
|
28 |
)
|
|
|
16 |
for (x, y, w, h) in faces:
|
17 |
cv2.rectangle(image_np, (x, y), (x+w, y+h), (255, 0, 0), 5)
|
18 |
|
19 |
+
return image_np , len(faces)
|
20 |
|
21 |
# slider = gr.Slider(minimum=1, maximum=2, step=.1, label="Adjust the ScaleFactor")
|
22 |
|
23 |
iface = gr.Interface( fn=detect_faces,
|
24 |
inputs=["image",gr.Slider(minimum=1, maximum=2, step=.1, label="Adjust the ScaleFactor")],
|
25 |
+
outputs=["image", gr.Label("faces count ")] ,
|
26 |
title="Face Detection using Haar Cascade Classifier ",
|
27 |
description="Upload an image,and the model will detect faces and draw bounding boxes around them.",
|
28 |
)
|