ultralytics 8.2.44 Increase Predict dataloader robustness (#14005)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
5332f52f1e
commit
8136f66bfc
4 changed files with 6 additions and 8 deletions
|
|
@ -362,10 +362,11 @@ class LoadImagesAndVideos:
|
|||
self.mode = "image"
|
||||
im0 = cv2.imread(path) # BGR
|
||||
if im0 is None:
|
||||
raise FileNotFoundError(f"Image Read Error {path}")
|
||||
paths.append(path)
|
||||
imgs.append(im0)
|
||||
info.append(f"image {self.count + 1}/{self.nf} {path}: ")
|
||||
LOGGER.warning(f"WARNING ⚠️ Image Read Error {path}")
|
||||
else:
|
||||
paths.append(path)
|
||||
imgs.append(im0)
|
||||
info.append(f"image {self.count + 1}/{self.nf} {path}: ")
|
||||
self.count += 1 # move to the next file
|
||||
if self.count >= self.ni: # end of image list
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue