Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
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"./")
|
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
|
|
|
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"./")
|
8 |
return f"./{model_id}"
|
9 |
|
10 |
+
@spaces.GPU
|
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
|