Closed northtree closed 4 years ago
@GKalliatakis It seems that the official demo used ResNet instead of VGG16
Different network architecture and training will lead to different prediction score. But you can print the confidence with something like:
predictions_to_return = 5
preds = model.predict(image)[0]
top_preds = np.argsort(preds)[::-1][0:predictions_to_return]
top_preds_score = np.sort(preds)[::-1][0:predictions_to_return]
for i in range(0, 5):
print("{:.2f}".format(top_preds_score[i]*100)+'% ' +
classes[top_preds[i]])
Please make sure that the boxes below are checked before you submit your issue.
Thank you!
[x] Check that you are up-to-date with the master branch of Keras. You can update with:
[x] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
[x] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with:
[x] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
From the official demo website: http://places2.csail.mit.edu/demo.html It will return below results from test image: http://places2.csail.mit.edu/imgs/demo/6.jpg
How could we have the confidence from scene categories, such as
food_court (0.690)
The current
vgg16_places_365
just return categories without confidence (also return different ranking).