shkumar156 commited on
Commit
f43c9e5
·
verified ·
1 Parent(s): 0b2f757

Update yolo_detect.py

Browse files
Files changed (1) hide show
  1. 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
- results = model(image_path, save=True, project='runs/detect', exist_ok=True)
 
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: