Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,13 +17,13 @@ def detect_faces(image):
|
|
| 17 |
x, y, width, height = face['box']
|
| 18 |
cv2.rectangle(image, (x, y), (x + width, y + height), (255, 0, 0), 2)
|
| 19 |
|
| 20 |
-
return image
|
| 21 |
|
| 22 |
# Gradio Interface
|
| 23 |
iface = gr.Interface(
|
| 24 |
fn=detect_faces,
|
| 25 |
inputs=gr.Image(type="numpy", label="Input Image"),
|
| 26 |
-
outputs=gr.Image(type="numpy", label="Output Image"),
|
| 27 |
live=True,
|
| 28 |
title="MTCNN Face Detection",
|
| 29 |
description="Detect faces in an image using MTCNN.",
|
|
|
|
| 17 |
x, y, width, height = face['box']
|
| 18 |
cv2.rectangle(image, (x, y), (x + width, y + height), (255, 0, 0), 2)
|
| 19 |
|
| 20 |
+
return image, faces
|
| 21 |
|
| 22 |
# Gradio Interface
|
| 23 |
iface = gr.Interface(
|
| 24 |
fn=detect_faces,
|
| 25 |
inputs=gr.Image(type="numpy", label="Input Image"),
|
| 26 |
+
outputs=[gr.Image(type="numpy", label="Output Image"), gr.Textbox(label="Face Coordinates")],
|
| 27 |
live=True,
|
| 28 |
title="MTCNN Face Detection",
|
| 29 |
description="Detect faces in an image using MTCNN.",
|