olive100 commited on
Commit
05936f8
·
1 Parent(s): 6123e20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,8 +16,8 @@ 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.boxes)>0:
20
- vis = plots.plot_detection(img,boxes=result[0].boxes.boxes,
21
  class_names=class_names, min_score=0.2)
22
  else:
23
  vis = 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
+ vis = plots.plot_detection(img,boxes=result[0].boxes.data,
21
  class_names=class_names, min_score=0.2)
22
  else:
23
  vis = img