Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
import os
|
3 |
-
from huggingface_hub import hf_hub_download
|
4 |
import spaces
|
|
|
|
|
5 |
|
6 |
def download_models(model_id):
|
7 |
hf_hub_download("merve/yolov9", filename=f"{model_id}", local_dir=f"./")
|
@@ -25,7 +25,7 @@ def yolov9_inference(img_path, model_id, image_size, conf_threshold, iou_thresho
|
|
25 |
|
26 |
# Load the model
|
27 |
model_path = download_models(model_id)
|
28 |
-
model = yolov9.load(model_path, device="
|
29 |
|
30 |
# Set model parameters
|
31 |
model.conf = conf_threshold
|
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
import spaces
|
3 |
+
from huggingface_hub import hf_hub_download
|
4 |
+
|
5 |
|
6 |
def download_models(model_id):
|
7 |
hf_hub_download("merve/yolov9", filename=f"{model_id}", local_dir=f"./")
|
|
|
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
|