Closed
Description
🐛 Bug
Trying to save detection crops from youtube URL results in error.
To Reproduce (REQUIRED)
Input:
!python yolov5/detect.py --source https://www.youtube.com/watch?v=hZulqoCj6wM --save-crop --nosave
Output:
Traceback (most recent call last):
File "yolov5/detect.py", line 181, in <module>
detect(opt=opt)
File "yolov5/detect.py", line 112, in detect
save_one_box(xyxy, im0s, file=save_dir / 'crops' / names[c] / f'{p.stem}.jpg', BGR=True)
File "E:\YOLOV5_Tests\yolov5\utils\general.py", line 669, in save_one_box
clip_coords(xyxy, im.shape)
AttributeError: 'list' object has no attribute 'shape'
Expected behavior
Detection should crop from youtube.
Additional context
im0s is a list, im0s does not get processed in #Process Detections section in dectect.py. Using im0 instead, which is the ith element in im0s, crops the frame with b-box included. Passing im0s[i] instead of im0s in save_one_box seems to select the original image instance and avoids the error.