sehaj13 commited on
Commit
6e0c810
·
verified ·
1 Parent(s): fda1bc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,7 +11,7 @@ def detect_faces(image_np):
11
  gray_image = cv2.cvtColor(image_np, cv2.COLOR_RGB2GRAY)
12
 
13
  # Detect faces
14
- faces = face_cascade.detectMultiScale(gray_image, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))
15
 
16
  # Draw rectangles around faces
17
  for (x, y, w, h) in faces:
@@ -22,7 +22,7 @@ def detect_faces(image_np):
22
  # Create Gradio Interface
23
  iface = gr.Interface(
24
  fn=detect_faces,
25
- inputs="image",
26
  outputs="image",
27
  title="Face Detection",
28
  description="Upload an image, and the model will detect faces and draw bounding boxes around them."
 
11
  gray_image = cv2.cvtColor(image_np, cv2.COLOR_RGB2GRAY)
12
 
13
  # Detect faces
14
+ faces = face_cascade.detectMultiScale(gray_image, scaleFactor=slider, minNeighbors=5, minSize=(30, 30))
15
 
16
  # Draw rectangles around faces
17
  for (x, y, w, h) in faces:
 
22
  # Create Gradio Interface
23
  iface = gr.Interface(
24
  fn=detect_faces,
25
+ inputs=["image",gr.Slider(minimum=1,maximum=2,step=.1,label= "adjust the scaleFactor")],
26
  outputs="image",
27
  title="Face Detection",
28
  description="Upload an image, and the model will detect faces and draw bounding boxes around them."