Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,9 @@
|
|
4 |
# # Import YOLOv9
|
5 |
# import yolov9
|
6 |
|
7 |
-
#
|
8 |
-
#
|
9 |
-
#
|
10 |
|
11 |
# def download_models(model_id):
|
12 |
# hf_hub_download("merve/yolov9", filename=f"{model_id}", local_dir=f"./")
|
@@ -157,9 +157,9 @@ import spaces
|
|
157 |
from huggingface_hub import hf_hub_download
|
158 |
|
159 |
|
160 |
-
def download_models(model_id):
|
161 |
-
|
162 |
-
|
163 |
|
164 |
|
165 |
def yolov9_inference(img_path, model_id, image_size, conf_threshold, iou_threshold):
|
@@ -178,8 +178,8 @@ def yolov9_inference(img_path, model_id, image_size, conf_threshold, iou_thresho
|
|
178 |
import yolov9
|
179 |
|
180 |
# Load the model
|
181 |
-
model_path = download_models(model_id)
|
182 |
-
model = yolov9.load(
|
183 |
|
184 |
# Set model parameters
|
185 |
model.conf = conf_threshold
|
@@ -204,7 +204,7 @@ def app():
|
|
204 |
choices=[
|
205 |
"best.pt",
|
206 |
],
|
207 |
-
value="best.pt",
|
208 |
)
|
209 |
image_size = gr.Slider(
|
210 |
label="Image Size",
|
|
|
4 |
# # Import YOLOv9
|
5 |
# import yolov9
|
6 |
|
7 |
+
# def download_models(model_id):
|
8 |
+
# hf_hub_download("SakshiRathi77/void-space-detection/weights", filename=f"{model_id}", local_dir=f"./")
|
9 |
+
# return f"./{model_id}"
|
10 |
|
11 |
# def download_models(model_id):
|
12 |
# hf_hub_download("merve/yolov9", filename=f"{model_id}", local_dir=f"./")
|
|
|
157 |
from huggingface_hub import hf_hub_download
|
158 |
|
159 |
|
160 |
+
# def download_models(model_id):
|
161 |
+
# hf_hub_download("SakshiRathi77/void-space-detection/weights", filename=f"{model_id}", local_dir=f"./")
|
162 |
+
# return f"./{model_id}"
|
163 |
|
164 |
|
165 |
def yolov9_inference(img_path, model_id, image_size, conf_threshold, iou_threshold):
|
|
|
178 |
import yolov9
|
179 |
|
180 |
# Load the model
|
181 |
+
# model_path = download_models(model_id)
|
182 |
+
model = yolov9.load(model_id)
|
183 |
|
184 |
# Set model parameters
|
185 |
model.conf = conf_threshold
|
|
|
204 |
choices=[
|
205 |
"best.pt",
|
206 |
],
|
207 |
+
value="./best.pt",
|
208 |
)
|
209 |
image_size = gr.Slider(
|
210 |
label="Image Size",
|