it’s the library: from PIL import Image as img0,
thank you very much for your answer
now i am trying the following code:
class DataLoader:
def init(self,batchSize,inputShape,dataList,guaMaxValue):
self.inputShape=inputShape
self.batchSize=batchSize
self.dataList=dataList
self.guaMaxValue=guaMaxValue
def generator(self):
while(1):
batch=np.random.choice(self.dataList,size=self.batchSize,replace=False) #Génère un échantillon aléatoire à partir d’un tableau 1D donné
images=[]
labels=[]
for b in batch:
img=imread(b)
images.append(img)
temp=np.load(b.replace(".jpg",".npy")).astype(int)
np.place(temp,temp==255,self.guaMaxValue)
labels.append(temp)
images=np.array(images)
yield (np.array(images)/255.).astype(np.float32),np.array(labels)
but I have as an error:
batch=np.random.choice(self.dataList,size=self.batchSize,replace=True)
File “mtrand.pyx”, line 908, in numpy.random.mtrand.RandomState.choice
ValueError: ‘a’ cannot be empty unless no samples are taken
do you have a solution for me please?
thank you in advance