Johannes commited on
Commit
86cae26
1 Parent(s): b713355
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -12,18 +12,13 @@ import gradio as gr
12
  import face_detection
13
 
14
 
15
- def detect_faces(img: np.ndarray, method:str):
16
  frame = np.array(img)
17
 
18
  kornia_detections = kornia_detect(frame)
19
  retina_detections = retina_detect(frame)
20
  retina_mobile_detections = retina_mobilenet_detect(frame)
21
  dsfd_detections = dsfd_detect(frame)
22
-
23
- # if method == "Kornia YuNet":
24
- # re_im = kornia_detect(frame)
25
- # elif method == "RetinaFace":
26
- # re_im = retina_detect(frame)
27
 
28
  return kornia_detections, retina_detections, retina_mobile_detections, dsfd_detections
29
 
@@ -126,14 +121,14 @@ nms_slider = gr.components.Slider(minimum=0.1, maximum=0.9, value=0.5, label="Mi
126
  # scale_slider = gr.components.Slider(minimum=1.1, maximum=2.0, value=1.3, step=0.1, label="Scale Factor")
127
  # classifier_radio = gr.components.Radio(s)
128
 
129
- methods_dropdown = gr.components.Dropdown(["Kornia YuNet", "RetinaFace", "RetinaMobile", "DSFD"], value="Kornia YuNet", label="Choose a method")
130
 
131
  description = """Face Detection"""
132
 
133
 
134
  Iface = gr.Interface(
135
  fn=detect_faces,
136
- inputs=[input_image, methods_dropdown],#, size_slider, neighbour_slider, scale_slider],
137
  outputs=[image_kornia, image_retina, image_retina_mobile, image_dsfd],
138
  examples=[["data/9_Press_Conference_Press_Conference_9_86.jpg"], ["data/12_Group_Group_12_Group_Group_12_39.jpg"], ["data/31_Waiter_Waitress_Waiter_Waitress_31_55.jpg"]],
139
  title="Face Detection",
 
12
  import face_detection
13
 
14
 
15
+ def detect_faces(img: np.ndarray):
16
  frame = np.array(img)
17
 
18
  kornia_detections = kornia_detect(frame)
19
  retina_detections = retina_detect(frame)
20
  retina_mobile_detections = retina_mobilenet_detect(frame)
21
  dsfd_detections = dsfd_detect(frame)
 
 
 
 
 
22
 
23
  return kornia_detections, retina_detections, retina_mobile_detections, dsfd_detections
24
 
 
121
  # scale_slider = gr.components.Slider(minimum=1.1, maximum=2.0, value=1.3, step=0.1, label="Scale Factor")
122
  # classifier_radio = gr.components.Radio(s)
123
 
124
+ #methods_dropdown = gr.components.Dropdown(["Kornia YuNet", "RetinaFace", "RetinaMobile", "DSFD"], value="Kornia YuNet", label="Choose a method")
125
 
126
  description = """Face Detection"""
127
 
128
 
129
  Iface = gr.Interface(
130
  fn=detect_faces,
131
+ inputs=[input_image],#, size_slider, neighbour_slider, scale_slider],
132
  outputs=[image_kornia, image_retina, image_retina_mobile, image_dsfd],
133
  examples=[["data/9_Press_Conference_Press_Conference_9_86.jpg"], ["data/12_Group_Group_12_Group_Group_12_39.jpg"], ["data/31_Waiter_Waitress_Waiter_Waitress_31_55.jpg"]],
134
  title="Face Detection",