Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ from PIL import Image
|
|
| 5 |
|
| 6 |
# Load Haar Cascade classifier
|
| 7 |
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
|
| 8 |
-
|
| 9 |
# Face Detection Function
|
| 10 |
def detect_faces(image_np,slider):
|
| 11 |
img=np.array(gray_image)
|
|
@@ -20,7 +20,7 @@ def detect_faces(image_np,slider):
|
|
| 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,
|
|
|
|
| 5 |
|
| 6 |
# Load Haar Cascade classifier
|
| 7 |
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
|
| 8 |
+
slider=gr.Slider(minimum=1,maximum=2,step=.1,label="Adjust the scale factor.")
|
| 9 |
# Face Detection Function
|
| 10 |
def detect_faces(image_np,slider):
|
| 11 |
img=np.array(gray_image)
|
|
|
|
| 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,
|