Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -49,14 +49,7 @@ def LeYOLO_inference(image, model_id, image_size, conf_threshold, iou_threshold)
|
|
49 |
MODEL_PATH = attempt_download_from_hub(model_id)
|
50 |
model = model = YOLO(MODEL_PATH)
|
51 |
results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
|
52 |
-
|
53 |
-
|
54 |
-
labels = [
|
55 |
-
f"{category_dict[class_id]} {confidence:.2f}"
|
56 |
-
for class_id, confidence in zip(detections.class_id, detections.confidence)
|
57 |
-
]
|
58 |
-
annotated_image = box_annotator.annotate(image, detections=detections, labels=labels)
|
59 |
-
|
60 |
return annotated_image
|
61 |
|
62 |
|
|
|
49 |
MODEL_PATH = attempt_download_from_hub(model_id)
|
50 |
model = model = YOLO(MODEL_PATH)
|
51 |
results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
|
52 |
+
annotated_image = results[0].plot()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
return annotated_image
|
54 |
|
55 |
|