Skip to content

Commit

Permalink
cv2.imread(img, -1) for IMREAD_UNCHANGED (#3379)
Browse files Browse the repository at this point in the history
* Update datasets.py

* comment

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
tudoulei and glenn-jocher authored May 29, 2021
1 parent 57f773b commit 21a9607
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def __next__(self):
else:
# Read image
self.count += 1
img0 = cv2.imread(path) # BGR
img0 = cv2.imread(path, -1) # BGR (-1 is IMREAD_UNCHANGED)
assert img0 is not None, 'Image Not Found ' + path
print(f'image {self.count}/{self.nf} {path}: ', end='')

Expand Down

2 comments on commit 21a9607

@cledi01
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gave me a bug, couldn't detect JPG files on a kaggle notebook. Had to checkout earlier commit to run detect.py properly on jpg images.

@glenn-jocher
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cledi01 thanks for letting us know, I'll revert.

Please sign in to comment.