image_output_1.png
from tqdm import tqdm

import cv2

import numpy as np

import pandas as pd

test = pd.read_csv('/kaggle/input/lego-dataset/Test.csv')
train = pd.read_csv('/kaggle/input/lego-dataset/Train.csv')

train_img = []
for img_name in tqdm(train['name']):
    image_path = '/kaggle/input/lego-dataset/train/' + str(img_name)
    img = cv2.imread(image_path, 0)
    img = img / 255.0
    img = img.reshape(200, 200, 1)
    img = img.astype('float32')
    train_img.append(img)
train_x = np.array(train_img)
train_y = train['category'].values - 1
train_x.shape