Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import cv2, matplotlib.pyplot as plt
  2. img = cv2.imread('imgs_soccer/soccer_10.jpg',cv2.IMREAD_COLOR)
  3. img = cv2.resize(img, (128, 128))
  4. plt.imshow(img)
  5. plt.show()
  6.  
  7. image_gen = ImageDataGenerator(rotation_range=15,
  8. width_shift_range=0.1,
  9. height_shift_range=0.1,
  10. shear_range=0.01,
  11. zoom_range=[0.9, 1.25],
  12. horizontal_flip=True,
  13. vertical_flip=False,
  14. fill_mode='reflect',
  15. data_format='channels_last',
  16. brightness_range=[0.5, 1.5])
  17.  
  18. image_gen.flow(img)
  19.  
  20. '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