Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import gradio as gr
|
2 |
-
import spaces
|
3 |
import os
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
|
@@ -9,7 +8,6 @@ def download_models(model_id):
|
|
9 |
return f"./{model_id}"
|
10 |
|
11 |
|
12 |
-
@spaces.GPU
|
13 |
def yolov9_inference(img_path, model_id, image_size, conf_threshold, iou_threshold):
|
14 |
"""
|
15 |
Load a YOLOv9 model, configure it, perform inference on an image, and optionally adjust
|
@@ -27,7 +25,7 @@ def yolov9_inference(img_path, model_id, image_size, conf_threshold, iou_thresho
|
|
27 |
|
28 |
# Load the model
|
29 |
model_path = download_models(model_id)
|
30 |
-
model = yolov9.load(model_path, device="
|
31 |
|
32 |
# Set model parameters
|
33 |
model.conf = conf_threshold
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import os
|
3 |
from huggingface_hub import hf_hub_download
|
4 |
|
|
|
8 |
return f"./{model_id}"
|
9 |
|
10 |
|
|
|
11 |
def yolov9_inference(img_path, model_id, image_size, conf_threshold, iou_threshold):
|
12 |
"""
|
13 |
Load a YOLOv9 model, configure it, perform inference on an image, and optionally adjust
|
|
|
25 |
|
26 |
# Load the model
|
27 |
model_path = download_models(model_id)
|
28 |
+
model = yolov9.load(model_path, device="cpu")
|
29 |
|
30 |
# Set model parameters
|
31 |
model.conf = conf_threshold
|