kedimestan
commited on
Commit
•
e472bb3
1
Parent(s):
3228b30
Update app.py
Browse files
app.py
CHANGED
@@ -43,13 +43,13 @@ def yolov8_inference(
|
|
43 |
model.overrides["conf"] = conf_threshold
|
44 |
model.overrides["iou"] = iou_threshold
|
45 |
results = model.predict(image, imgsz=image_size)
|
46 |
-
|
47 |
-
|
48 |
-
for
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
return
|
53 |
|
54 |
|
55 |
inputs = [
|
|
|
43 |
model.overrides["conf"] = conf_threshold
|
44 |
model.overrides["iou"] = iou_threshold
|
45 |
results = model.predict(image, imgsz=image_size)
|
46 |
+
|
47 |
+
outputs=[]
|
48 |
+
for i,box in enumerate(results[0].boxes):
|
49 |
+
label = results[0].names[box.cls[0].item()]
|
50 |
+
bbox = box.xyxy[0]
|
51 |
+
output.append({"label": label, "bbox_coords": bbox})
|
52 |
+
return output
|
53 |
|
54 |
|
55 |
inputs = [
|