#StackBounty: #keras #tensorflow #numpy Load numpy data from directory to keras image generator

Bounty: 100

I have two folders of hyperspectral data with five channels which are converted to numpy array. Each folder depicts the respective label.

Example :

dataset  
----good_data  
      ----good_image_01.npy  
      ----good_image_02.npy  
----bad_data  
    ----bad_image_01.npy  
    ----bad_image_02.npy

I have used keras image generator to feed the data to input pipeline previously with png images.

train_ds = tf.keras.preprocessing.image_dataset_from_directory(
  data_dir,
  validation_split=0.2,
  subset="training",
  seed=123,
  image_size=(img_height, img_width),
  batch_size=batch_size)

But I am not sure how to achieve the same with numpy dataset. can anyone help?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.