olive100 commited on
Commit
8f18873
·
1 Parent(s): 9421f35

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -16,11 +16,9 @@ def detect(img):
16
  if isinstance(img,str):
17
  img = get_url_img(img) if img.startswith('http') else Image.open(img).convert('RGB')
18
  result = model.predict(source=img)
19
- if len(result[0].boxes.data)>0:
20
- print(result)
21
- vis = img
22
- # vis = plots.plot_detection(img,boxes=result[0].boxes.data,
23
- # class_names=class_names, min_score=0.2)
24
  else:
25
  vis = img
26
  return vis
 
16
  if isinstance(img,str):
17
  img = get_url_img(img) if img.startswith('http') else Image.open(img).convert('RGB')
18
  result = model.predict(source=img)
19
+ if len(result[0].boxes)>0:
20
+ vis = plots.plot_detection(img,boxes=result[0].boxes,
21
+ class_names=class_names, min_score=0.2)
 
 
22
  else:
23
  vis = img
24
  return vis