We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 253f930 commit ac54a8fCopy full SHA for ac54a8f
DeepFried2/datasets/images.py
@@ -8,6 +8,9 @@ def imread(fname, dtype=_np.float32):
8
im = _cv2.imread(fname, flags=_cv2.IMREAD_UNCHANGED)
9
if im is None:
10
raise IOError("Couldn't open image file {}".format(fname))
11
+ # Convert BGR to RGB. OpenCV is weird like that.
12
+ if im.ndim == 3 and im.shape[-1] == 3:
13
+ im = im[:,:,::-1]
14
return im.astype(dtype)
15
16
def imresize(im, h, w):
0 commit comments