Created
December 5, 2020 20:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pick random test data sample from one batch | |
x = random.randint(0, len(Xtest) - 1) | |
# getting output; input shape (256, 256, 3) --> (1, 256, 256, 3) | |
output = model.predict(Xtest[x].reshape(1, -1)) | |
pred = np.argmax(output[0]) # finding max | |
# Picking the label from class_names based on the model output | |
print("Prdicted: ", class_names[pred]) | |
output_true = np.array(ytest)[x] | |
print("True: ", class_names[np.argmax(output_true)]) | |
print("Probability: ", output[0][pred]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment