Learn practical skills, build real-world projects, and advance your career
Updated 4 years ago
!pip install jovian --upgrade --quiet
import os
import numpy as np
import tensorflow as tf
from PIL import Image
from matplotlib import pyplot as plt
generator = tf.keras.preprocessing.image.ImageDataGenerator(
rotation_range=10,
width_shift_range=0.1,
height_shift_range=0.1,
shear_range=0.15,
zoom_range=0.1,
channel_shift_range = 10,
horizontal_flip=True
)
image_path = '../input/cricket/cut/cut/00000000.jpg'
plt.imshow(plt.imread(image_path));
x, y = next(generator.flow_from_directory('../input/cricket/cut', batch_size=118))
plt.imshow(x[10].astype('uint8'));
print(len(x), len(y))
Found 118 images belonging to 1 classes.
118 118