Skip to content

Instantly share code, notes, and snippets.

@RITIK-12
Created September 20, 2020 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RITIK-12/61cce0c07e1fc638d1c792e1ab4ed1c3 to your computer and use it in GitHub Desktop.
Save RITIK-12/61cce0c07e1fc638d1c792e1ab4ed1c3 to your computer and use it in GitHub Desktop.
# partition the data into training and testing splits using 75% of
# the data for training and the remaining 25% for testing
(trainX, testX, trainY, testY) = train_test_split(data, labels,
test_size=0.20, stratify=labels, random_state=42)
# construct the training image generator for data augmentation
aug = ImageDataGenerator(
rotation_range=20,
zoom_range=0.15,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.15,
horizontal_flip=True,
fill_mode="nearest")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment