I have a cnn model for image classification which uses a sigmoid activation function as its last layer
from keras import layers
from keras import models
model = models.Sequential()
model.add(layers.Conv2D(32, (3, 3), activation='relu',
input_shape=(1500, 1500, 3)))
..........
model.add(layers.Dense(1, activation='sigmoid'))
The images belong to two classes. When I use the model.predict()
on an image I get a 0 or a 1. However I want to get a probability score like 0.656 for example when I use model.predict_generator()
, it outputs these scores. However, predict_generator
requires that the images are placed in folders that identify their classes, therefore, it is only relevant for validation and testing. I want to output this score for a new unknown image or images. How can I do this?