Spaces:
Running
Running
--DELETE--
#5
by
atalaydenknalbant
- opened
- app.py +2 -1
- requirements.txt +1 -1
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from ultralytics import YOLO
|
3 |
import supervision as sv
|
|
|
4 |
|
5 |
|
6 |
box_annotator = sv.BoxAnnotator()
|
@@ -24,7 +25,7 @@ category_dict = {
|
|
24 |
}
|
25 |
|
26 |
|
27 |
-
|
28 |
def yolov10_inference(image, model_id, image_size, conf_threshold, iou_threshold):
|
29 |
model = YOLO(f"{model_id}.pt")
|
30 |
results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
|
|
|
1 |
import gradio as gr
|
2 |
from ultralytics import YOLO
|
3 |
import supervision as sv
|
4 |
+
import spaces
|
5 |
|
6 |
|
7 |
box_annotator = sv.BoxAnnotator()
|
|
|
25 |
}
|
26 |
|
27 |
|
28 |
+
@spaces.GPU(duration=200)
|
29 |
def yolov10_inference(image, model_id, image_size, conf_threshold, iou_threshold):
|
30 |
model = YOLO(f"{model_id}.pt")
|
31 |
results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
supervision
|
2 |
ultralytics
|
3 |
spaces
|
4 |
gradio
|
|
|
1 |
+
supervision
|
2 |
ultralytics
|
3 |
spaces
|
4 |
gradio
|