How do I output confidence level in Resnet 50 classification?
问题 I trained Resnet-50 classification network to classify my objects and I use the following code to evaluate the network. from tensorflow.keras.models import load_model import cv2 import numpy as np import os class_names = ["x", "y", "b","g", "xx", "yy", "bb","gg", "xyz","xzy","yy"] model = load_model('transfer_resnet.h5') model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy']) imgg = cv2.imread('/path to image/a1.jpg') img = cv2.resize(imgg,(224,224)) img = np