I am reading the following code segment, this function was once invoked as generator = image_gen.get_image_gen_rgb(nx, ny, cnt=20)
. I am not very clear about the usage of **kwargs
in the function of get_image_gen_rgb
. Does cnt=20
was used to setup the parameter of n_image
in create_batch
def get_image_gen_rgb(nx, ny, **kwargs):
def create_batch(n_image):
print("n_image: ",n_image)
X = np.zeros((n_image, nx, ny, 3))
Y = np.zeros((n_image, nx, ny,2))
for i in range(n_image):
x, Y[i,:,:,1] = create_image_and_label(nx,ny, **kwargs)
X[i] = to_rgb(x)
Y[i,:,:,0] = 1-Y[i,:,:,1]
return X, Y
create_batch.channels = 3
create_batch.n_class = 2
return create_batch