Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 24, 2020 15:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save amankharwal/67bedb13bcbabcf7ebb5a93835d36626 to your computer and use it in GitHub Desktop.
datagen = ImageDataGenerator(rescale=1./255, validation_split=0.1)
train_generator = datagen.flow_from_dataframe(
reduced_df,
directory="Indian Number Plates/",
x_col="image_name",
y_col=["top_x", "top_y", "bottom_x", "bottom_y"],
target_size=(WIDTH, HEIGHT),
batch_size=32,
class_mode="other",
subset="training")
validation_generator = datagen.flow_from_dataframe(
reduced_df,
directory="Indian Number Plates/",
x_col="image_name",
y_col=["top_x", "top_y", "bottom_x", "bottom_y"],
target_size=(WIDTH, HEIGHT),
batch_size=32,
class_mode="other",
subset="validation")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment