text_html_output_1.png
import cv2

import matplotlib.pyplot as plt

import os

import pandas as pd

import seaborn as sns

train = '/kaggle/input/rice-image-dataset/Rice_Image_Dataset'
file_names = os.listdir(train)
pd.DataFrame(file_names, columns=['Names'])

files = []
for file in file_names:
    if file == 'Rice_Citation_Request.txt':
        continue
    files.append(file)
files

size_number = []
size = []
for file in files:
    path = os.path.join(train, file)
    size_number.append(len(os.listdir(path)))
    for img in os.listdir(path):
        image = cv2.imread(os.path.join(path, img))
        size.append(image.shape)
pd.DataFrame(size_number, columns=['size'], index=files)

plt.figure(figsize=(5, 5))
sns.countplot(x=size_number, hue=files)