0
我想從cifar10-數據集中獲取圖像。當我從數組重建圖像, 我在一張圖片中看到9個相同的圖像,我不知道是什麼問題。要從cifat10-數據集中獲取圖像
當我從數據加載圖像,single_img
shape(3072,)。之後,我重塑 我的single_img
變量(32,32,3)。我不知道問題在哪裏。 這裏我的代碼;
import cPickle
from PIL import Image
import numpy as np
f = open("/home/leo/Downloads/cifar-10-batches-py/data_batch_1", "rb")
tupled_data= cPickle.load(f)
f.close()
img = tupled_data['data']
single_img = np.array(img[0])
single_img_reshaped = single_img.reshape(32, 32 ,3)
j = Image.fromarray(single_img_reshaped)
j.save("/home/leo/Desktop/blabla.bmp")