# How to use Keras predict_generator() for segmentation output?

Below is the code I'm using for segmentation mask prediction after using fit_generator(...) on model named m :-

test_datagen = ImageDataGenerator(rescale=1./255)

test_generator.reset()

test_generator =test_datagen.flow_from_directory('result/test', class_mode=None,seed=1, color_mode="grayscale",target_size=(256,256),batch_size=1)

results = m.predict_generator(test_generator,steps=17, verbose=1)


It runs without any errors but how do I visualise the predicted segmentation masks from results?

Okay, I checked that m.predict_generator returns a numpy array so I just plotted it using plt.imshow(). Obviously I'd to do some slicing and squeeze on it.