pushpinder06 commited on
Commit
3c9afdd
·
verified ·
1 Parent(s): f521c10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -19,13 +19,13 @@ def detect_faces(image_np,slider):
19
  for (x, y, w, h) in faces:
20
  cv2.rectangle(image_np, (x, y), (x + w, y + h), (0, 255, 0), 2)
21
 
22
- return img
23
 
24
  # Create Gradio Interface
25
  iface = gr.Interface(
26
  fn=detect_faces,
27
  inputs=["image",gr.Slider(minimum=1,maximum=2,step=.1,label="Adjust the scale factor.")],
28
- outputs="image",
29
  title="Face Detection",
30
  description="Upload an image, and the model will detect faces and draw bounding boxes around them."
31
  )
 
19
  for (x, y, w, h) in faces:
20
  cv2.rectangle(image_np, (x, y), (x + w, y + h), (0, 255, 0), 2)
21
 
22
+ return img, len(faces)
23
 
24
  # Create Gradio Interface
25
  iface = gr.Interface(
26
  fn=detect_faces,
27
  inputs=["image",gr.Slider(minimum=1,maximum=2,step=.1,label="Adjust the scale factor.")],
28
+ outputs=["image",gr.label("Face counts:":len(detect_faces))],
29
  title="Face Detection",
30
  description="Upload an image, and the model will detect faces and draw bounding boxes around them."
31
  )