lopesdri commited on
Commit
b314b38
·
1 Parent(s): f312c0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -26,13 +26,9 @@ def detect(img):
26
  boxes = predictions[:, :4] # x1, y1, x2, y2
27
  scores = predictions[:, 4]
28
  categories = predictions[:, 5]
29
- img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
30
- for i, box in enumerate(boxes):
31
- cv2.rectangle(img, tuple(box[:2]), tuple(box[2:]), (0, 255, 0), 2)
32
 
33
  # save image as numpy array
34
- img_array = np.array(img)
35
- return image_array
36
  # show detection bounding boxes on image
37
 
38
  img = gr.inputs.Image(shape=(192, 192))
 
26
  boxes = predictions[:, :4] # x1, y1, x2, y2
27
  scores = predictions[:, 4]
28
  categories = predictions[:, 5]
 
 
 
29
 
30
  # save image as numpy array
31
+ return results.numpy()
 
32
  # show detection bounding boxes on image
33
 
34
  img = gr.inputs.Image(shape=(192, 192))