因为detect的时候,会有很多问题文件无法识别。
解决办法
找到yolo v5的dataloaders.py ,
找到
im0 = cv2.imread(path) # BGR
assert im0 is not None, f'Image Not Found {path}'
替换为
im0 = cv2.imread(path) # BGR
if im0 is None:
print(f'Warning: Could not read {path}. Skipping.')
self.count += 1 # move to the next file
return self.__next__() # recursively call the next item