text_plain_output_1.png
import glob as gb

import matplotlib.pyplot as plt

import os

import os

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import tensorflow as tf

import numpy as np
import pandas as pd
import os

IMAGE_SIZE = (256, 256)
BATCH_SIZE = 32
CHANNELS = 3
EPOCHES = 100

dataset = tf.keras.preprocessing.image_dataset_from_directory('/kaggle/input/corn-or-maize-leaf-disease-dataset/data', shuffle=True, image_size=IMAGE_SIZE, batch_size=BATCH_SIZE)

import os
import glob as gb
path = '//kaggle//input//corn-or-maize-leaf-disease-dataset//data'
size = []
for folder in os.listdir(path):
    files = gb.glob(pathname=str(path + '//' + folder + '/*.jpg'))
    for file in files:
        image = plt.imread(file)
        size.append(image.shape)
pd.Series(size).value_counts()

class_names = dataset.class_names
class_names

plt.figure(figsize=(10, 10))
for image_batch, label_batch in dataset.take(1):
    for i in range(12):
        ax = plt.subplot(3, 4, i + 1)
        plt.imshow(image_batch[i].numpy().astype('uint8'))
        plt.title(class_names[label_batch[i]])
        plt.axis('off')