LBLong commited on
Commit
9bf7951
·
verified ·
1 Parent(s): ca8f959

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,7 +13,7 @@ def detect_faces(image):
13
  output = model(image)
14
  results = Detections.from_ultralytics(output[0])
15
 
16
- im = image
17
  for i in results:
18
  im = cv2.rectangle(im, (int(i[0][0]),int(i[0][1])), (int(i[0][2]),int(i[0][3])), (0,0,255), 2)
19
 
@@ -24,7 +24,7 @@ def detect_faces(image):
24
  for (x, y, w, h) in faces:
25
  cv2.rectangle(image_np, (x, y), (x+w, y+h), (0, 255, 0), 2)
26
 
27
- return (im,image_np)
28
 
29
  interface = gr.Interface(
30
  fn=detect_faces,
 
13
  output = model(image)
14
  results = Detections.from_ultralytics(output[0])
15
 
16
+ im = np.array(image)
17
  for i in results:
18
  im = cv2.rectangle(im, (int(i[0][0]),int(i[0][1])), (int(i[0][2]),int(i[0][3])), (0,0,255), 2)
19
 
 
24
  for (x, y, w, h) in faces:
25
  cv2.rectangle(image_np, (x, y), (x+w, y+h), (0, 255, 0), 2)
26
 
27
+ return (image_np,im)
28
 
29
  interface = gr.Interface(
30
  fn=detect_faces,