Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,9 +9,9 @@ import shutil
|
|
| 9 |
# Clear the torch hub cache to prevent any previous corrupted downloads
|
| 10 |
shutil.rmtree(torch.hub._get_torch_home(), ignore_errors=True)
|
| 11 |
|
| 12 |
-
# Load the YOLOv5 model
|
| 13 |
model = torch.hub.load(
|
| 14 |
-
'ultralytics/yolov5', 'custom', path='
|
| 15 |
)
|
| 16 |
|
| 17 |
# Global variables to store images and labels for carousel functionality
|
|
|
|
| 9 |
# Clear the torch hub cache to prevent any previous corrupted downloads
|
| 10 |
shutil.rmtree(torch.hub._get_torch_home(), ignore_errors=True)
|
| 11 |
|
| 12 |
+
# Load the YOLOv5 model from the uploaded best.pt file
|
| 13 |
model = torch.hub.load(
|
| 14 |
+
'ultralytics/yolov5', 'custom', path='best.pt', trust_repo=True
|
| 15 |
)
|
| 16 |
|
| 17 |
# Global variables to store images and labels for carousel functionality
|