结合上文,flow的ImageDataGenerator的分析,该部分伪代码如下:
xm,y=getDataIndex()
while(
True):
if shuffle==
True:
shuffle(xm,y)
for i
in range(
0,len(x),batch_size):
xm_batch=xm[i:i+batch_size]
y_batch=y[i:i+batch_size]
x_batch=getImg(xm_batch)
ImagePro(x_batch)
yield (x_batch,y_batch)
源码参考:/Lib/site-packages/keras/preprocessing/image.py