Posts

Showing posts with the label numpy-ndarray

How to deal with this when I use numpy.array() to deal with 'list'?

Image
Clash Royale CLAN TAG #URR8PPP How to deal with this when I use numpy.array() to deal with 'list'? import cv2 import numpy list_pixel= list_label= for i in range(0,10): for j in range(0,10): list_pixel.append(cv2.imread("C:\Users\kimcho\Desktop\testdata\testdata_"+str(i)+"_0"+str(j)+".png",0)) list_label.append(i) j=0 list_pixel.pop(0) list_label.pop(0) list_pixel=numpy.array(list_pixel) print(list_pixel) print(list_pixel.shape) print(list_pixel[0].shape) How to deal with this when I use numpy.array() to deal with 'list'?I wanna make datasets by imitating keras.But,the datasets I made didn't satisfy me.I want it to act like keras,to return a value like this: It can return a value of(60000,28,28) But as for my datasets,it can only return like this: Only return a value of(99,)—— I got 99 pictures and I want to load their pixel into list_pixel Here is my code: Hoping anyone can help me solve this problem.Deeply tha...