Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2, matplotlib.pyplot as plt
- img = cv2.imread('imgs_soccer/soccer_10.jpg',cv2.IMREAD_COLOR)
- img = cv2.resize(img, (128, 128))
- plt.imshow(img)
- plt.show()
- image_gen = ImageDataGenerator(rotation_range=15,
- width_shift_range=0.1,
- height_shift_range=0.1,
- shear_range=0.01,
- zoom_range=[0.9, 1.25],
- horizontal_flip=True,
- vertical_flip=False,
- fill_mode='reflect',
- data_format='channels_last',
- brightness_range=[0.5, 1.5])
- image_gen.flow(img)
- 'Input data in `NumpyArrayIterator` should have rank 4. You passed an array with shape', (128, 128, 3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement