hashb commited on
Commit
73d3615
·
1 Parent(s): 2f4756c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -11,8 +11,7 @@ model = cv2.dnn_DetectionModel(net)
11
  model.setInputParams(scale=1 / 255, size=(416, 416), swapRB=True)
12
 
13
  def detect(image):
14
- img1 = Image.fromarray(image)
15
- img = cv2.imread(img1)
16
  classIds, scores, boxes = model.detect(img, confThreshold=0.6, nmsThreshold=0.4)
17
 
18
  for (classId, score, box) in zip(classIds, scores, boxes):
@@ -24,7 +23,7 @@ def detect(image):
24
 
25
  return img
26
 
27
- image_in = gr.components.Image()
28
  image_out = gr.components.Image()
29
 
30
  Iface = gr.Interface(
 
11
  model.setInputParams(scale=1 / 255, size=(416, 416), swapRB=True)
12
 
13
  def detect(image):
14
+ img = cv2.imread(image)
 
15
  classIds, scores, boxes = model.detect(img, confThreshold=0.6, nmsThreshold=0.4)
16
 
17
  for (classId, score, box) in zip(classIds, scores, boxes):
 
23
 
24
  return img
25
 
26
+ image_in = gr.Image()
27
  image_out = gr.components.Image()
28
 
29
  Iface = gr.Interface(