Rasleen commited on
Commit
16c505d
·
verified ·
1 Parent(s): 2e4b973

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -16
app.py CHANGED
@@ -24,22 +24,10 @@ def detect_faces(img, size, neighbours, scale):
24
 
25
  midX = int(x+w/2)
26
  midY = int(y+h/2)
27
- box = {
28
- "position": {
29
- "middle": [midX, midY],
30
- "width": float(w),
31
- "height": float(h)
32
- },
33
- "domain" : "pixel",
34
- "class_id" : 0
35
- }
36
  box_data.append(box)
37
 
38
- predictions = {"predictions": {
39
- "box_data": box_data,
40
- "class_labels": class_labels
41
- }
42
- }
43
 
44
  re_im =cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
45
  return re_im
@@ -55,5 +43,4 @@ description = """Face Detection with Haar Cascades using OpenCV"""
55
 
56
 
57
  Iface = gr.Interface(fn=detect_faces,inputs=[image, size_slider, neighbour_slider, scale_slider],outputs=out_im,title="Haar Cascade Object Detection",).launch()
58
- #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"]],
59
-
 
24
 
25
  midX = int(x+w/2)
26
  midY = int(y+h/2)
27
+ box = {"position": {"middle": [midX, midY],"width": float(w),"height": float(h)},"domain" : "pixel","class_id" : 0}
 
 
 
 
 
 
 
 
28
  box_data.append(box)
29
 
30
+ predictions = {"predictions": {"box_data": box_data,"class_labels": class_labels } }
 
 
 
 
31
 
32
  re_im =cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
33
  return re_im
 
43
 
44
 
45
  Iface = gr.Interface(fn=detect_faces,inputs=[image, size_slider, neighbour_slider, scale_slider],outputs=out_im,title="Haar Cascade Object Detection",).launch()
46
+