Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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[
|
| 17 |
cls = arr[int(cls)]
|
| 18 |
-
lbl = result.boxes.conf[
|
| 19 |
-
boxes = result.boxes.xyxy[
|
| 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
|