vgg16 в наборе данных lfw Dont get RGB - PullRequest
0 голосов
/ 18 июня 2020

Я хочу использовать VGGNET-16 из библиотеки Keras в наборе данных LFW для распознавания лиц. Однако вместо RGB создается оттенок серого, и я не могу его изменить:

загрузить данные

разделить это

1 Ответ

0 голосов
/ 25 июня 2020
      #load dataset
 lfw_people = fetch_lfw_people(min_faces_per_person=53, resize=0.4)


 

# introspect the images arrays to find the shapes (for plotting)
n_samples, h, w = lfw_people.images.shape

# for machine learning we use the 2 data directly (as relative pixel
# positions info is ignored by this model)
# access the images

X = lfw_people.data
n_features = X.shape[1]


# the label to predict is the id of the person
# access the class labels
y = lfw_people.target
target_names = lfw_people.target_names
n_classes = target_names.shape[0]



print("Total dataset size:")
print("number of samples: " , n_samples)
print("number of classes: " , n_classes)
print("image dimensions: ", h, w)
print("number of features per image: ", h*w)


lfw_people.target_names

** array (['Ariel Sharon', 'Colin Powell', 'Donald Rumsfeld', 'George W. Bu sh', 'Gerhard Schroeder', 'Hu go Chavez', 'Jean Chretien ',' John Ashcroft ',' Junichiro Koizumi ',' Tony Blair '], dtype ='

...