Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from ultralytics import YOLO
|
3 |
import spaces
|
4 |
-
import supervision as sv
|
5 |
-
|
6 |
-
box_annotator = sv.BoxAnnotator()
|
7 |
|
8 |
category_dict = {
|
9 |
0: 'person', 1: 'bicycle', 2: 'car', 3: 'motorcycle', 4: 'airplane', 5: 'bus',
|
@@ -50,6 +47,7 @@ def LeYOLO_inference(image, model_id, image_size, conf_threshold, iou_threshold)
|
|
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 |
|
|
|
1 |
import gradio as gr
|
2 |
from ultralytics import YOLO
|
3 |
import spaces
|
|
|
|
|
|
|
4 |
|
5 |
category_dict = {
|
6 |
0: 'person', 1: 'bicycle', 2: 'car', 3: 'motorcycle', 4: 'airplane', 5: 'bus',
|
|
|
47 |
model = model = YOLO(MODEL_PATH)
|
48 |
results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
|
49 |
annotated_image = results[0].plot()
|
50 |
+
annotated_image = cv2.cvtColor(annotated_image, cv2.COLOR_RGB2BGR)
|
51 |
return annotated_image
|
52 |
|
53 |
|