Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -5,19 +5,19 @@ import PIL.Image as Image
|
|
5 |
from ultralytics import YOLO, YOLOv10
|
6 |
from huggingface_hub import hf_hub_download, HfApi
|
7 |
|
8 |
-
global repo_id
|
9 |
|
10 |
def download_models(model_id):
|
11 |
-
hf_hub_download(repo_id, filename=f"{model_id}", local_dir=f"./")
|
12 |
return f"./{model_id}"
|
13 |
|
14 |
-
def get_model_filenames(repo_id, file_extension=".pt"):
|
15 |
api = HfApi()
|
16 |
files = api.list_repo_files(repo_id)
|
17 |
model_filenames = [file for file in files if file.endswith(file_extension)]
|
18 |
return model_filenames
|
19 |
|
20 |
-
|
21 |
model_filenames = get_model_filenames(repo_id)
|
22 |
print("Model filenames:", model_filenames)
|
23 |
|
|
|
5 |
from ultralytics import YOLO, YOLOv10
|
6 |
from huggingface_hub import hf_hub_download, HfApi
|
7 |
|
8 |
+
global repo_id
|
9 |
|
10 |
def download_models(model_id):
|
11 |
+
hf_hub_download(repo_id, filename = f"{model_id}", local_dir = f"./")
|
12 |
return f"./{model_id}"
|
13 |
|
14 |
+
def get_model_filenames(repo_id, file_extension = ".pt"):
|
15 |
api = HfApi()
|
16 |
files = api.list_repo_files(repo_id)
|
17 |
model_filenames = [file for file in files if file.endswith(file_extension)]
|
18 |
return model_filenames
|
19 |
|
20 |
+
repo_id = "atalaydenknalbant/asl-models"
|
21 |
model_filenames = get_model_filenames(repo_id)
|
22 |
print("Model filenames:", model_filenames)
|
23 |
|