text_plain_output_1.png
import cv2

import numpy as np

import os

subdir = ['angry', 'notAngry']
target = {'angry': 0, 'notAngry': 1}
dataset = '../input/fer2013new2class/FER2013NEW2CLASS/train/'
X = []
y = []
for emotions in subdir:
    for img_names in os.listdir(dataset + '/' + emotions):
        load_images = cv2.imread(dataset + '/' + emotions + '/' + img_names)
        X.append(load_images)
        y.append(target[emotions])

X, y = (np.array(X), np.array(y))
(X.shape, y.shape)