Beasto commited on
Commit
5c6b2cf
·
verified ·
1 Parent(s): e4cadaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,10 +13,10 @@ if img is not None:
13
  img = Image.open(img).resize((416,416)).convert('RGB')
14
  results = model(img)
15
  for result in results:
16
- cls = result.boxes.cls[i]
17
  cls = arr[int(cls)]
18
- lbl = result.boxes.conf[i]
19
- boxes = result.boxes.xyxy[i]
20
  draw = ImageDraw.Draw(img)
21
  draw.rectangle([boxes[0], boxes[1], boxes[2], boxes[3]], outline="black", width=5)
22
  text_position = (boxes[0]+boxes[2])/2, boxes[1]-10
 
13
  img = Image.open(img).resize((416,416)).convert('RGB')
14
  results = model(img)
15
  for result in results:
16
+ cls = result.boxes.cls[0]
17
  cls = arr[int(cls)]
18
+ lbl = result.boxes.conf[0]
19
+ boxes = result.boxes.xyxy[0]
20
  draw = ImageDraw.Draw(img)
21
  draw.rectangle([boxes[0], boxes[1], boxes[2], boxes[3]], outline="black", width=5)
22
  text_position = (boxes[0]+boxes[2])/2, boxes[1]-10