text_plain_output_1.png
import numpy as np

images = np.load('../input/olivetti_faces.npy')
images.shape

targets = np.load('../input/olivetti_faces_target.npy')
targets.shape

data = images.reshape(images.shape[0], images.shape[1] * images.shape[2])
data.shape

test = data[targets >= 30]
test.shape

n_faces = test.shape[0] // 10
n_faces

face_ids = np.random.randint(0, 100, size=n_faces)
face_ids

test = test[face_ids, :]
test.shape