Spaces:
Sleeping
Sleeping
Update yolo_detect.py
Browse files- yolo_detect.py +2 -1
yolo_detect.py
CHANGED
|
@@ -12,7 +12,8 @@ image_path = sys.argv[2]
|
|
| 12 |
print("Using weights file:", weights_path)
|
| 13 |
|
| 14 |
model = YOLO(weights_path)
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
# Print the path to the saved image
|
| 18 |
for r in results:
|
|
|
|
| 12 |
print("Using weights file:", weights_path)
|
| 13 |
|
| 14 |
model = YOLO(weights_path)
|
| 15 |
+
# Use /data/runs/detect as the project directory (writable in Hugging Face Spaces)
|
| 16 |
+
results = model(image_path, save=True, project='/data/runs/detect', exist_ok=True)
|
| 17 |
|
| 18 |
# Print the path to the saved image
|
| 19 |
for r in results:
|