Skip to content

Datasets full and downsampled

Latest
Compare
Choose a tag to compare
@attaullah attaullah released this 06 Sep 22:54
· 4 commits to main since this release

Attached files are PlantVillage disease datasets with original image resolution (256x256) and downsampled variants with a resolution of (96x96), (64x64), and (32x32) with train and test splits.

After downloading and extracting the full version of data can be loaded using tensorflow.keras as:

import tensorflow as tf

data_dir = "plant-ful/"
image_size = (256,256)
batch_size = 100

aug = tf.keras.preprocessing.image.ImageDataGenerator()
test_generator = aug.flow_from_directory(data_dir + 'test', color_mode="rgb", class_mode='sparse',
                                          target_size=image_size, batch_size=batch_size)
train_generator = aug.flow_from_directory(data_dir + 'train', color_mode="rgb", target_size=image_size,
                                          batch_size=batch_size, class_mode='sparse')

After downloading, downsampled variants can be loadded using numpy as:

import numpy as np
file_path = ''  # path to  plant32.npz or plant64.npz or plant96.npz 
npzfile = np.load(file_path)
train_images, train_labels, test_images, test_labels = npzfile['train_images'], npzfile['train_labels'], npzfile[
            'test_images'], npzfile['test_labels']