Spaces:
Sleeping
Sleeping
Commit ·
9c0d975
1
Parent(s): dedf935
fix: add .pt extension
Browse files
app.py
CHANGED
|
@@ -19,8 +19,12 @@ def load_model():
|
|
| 19 |
# Download the model file from the Hub and cache it locally
|
| 20 |
cached_model_path = cached_download(model_url)
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Load the model using YOLO from the cached model file
|
| 23 |
-
return YOLO(
|
| 24 |
|
| 25 |
|
| 26 |
def process_video(video_path):
|
|
|
|
| 19 |
# Download the model file from the Hub and cache it locally
|
| 20 |
cached_model_path = cached_download(model_url)
|
| 21 |
|
| 22 |
+
# Rename the file to have a .pt extension
|
| 23 |
+
new_cached_model_path = f"{cached_model_path}.pt"
|
| 24 |
+
os.rename(cached_model_path, new_cached_model_path)
|
| 25 |
+
|
| 26 |
# Load the model using YOLO from the cached model file
|
| 27 |
+
return YOLO(new_cached_model_path)
|
| 28 |
|
| 29 |
|
| 30 |
def process_video(video_path):
|