text_html_output_1.png
import numpy as np

import os

import pandas as pd

data_dir = '/kaggle/input/lego-vs-unknown-cropped/VIA_dataset_cropped/train/'
data_dir_train_lego = '/kaggle/input//lego-vs-unknown-cropped/VIA_dataset_cropped/train/LEGO'
test_lego = ['LEGO/' + f for f in os.listdir(data_dir_train_lego)]
data_dir_test_Unknown = '/kaggle/input//lego-vs-unknown-cropped/VIA_dataset_cropped/train/Unknown'
test_Unknown = ['Unknown/' + f for f in os.listdir(data_dir_test_Unknown)]
lists = test_lego + test_Unknown
df = pd.DataFrame(lists, columns=['image'])
df['label'] = np.where(df['image'].str.contains('LEGO'), 'LEGO', 'Unknown')

df['label'].value_counts().plot.bar()