Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vgg16_hybrid_places_1365a.py predicts only ImageNet classes #9

Closed
atunick opened this issue Jun 1, 2018 · 1 comment
Closed

vgg16_hybrid_places_1365a.py predicts only ImageNet classes #9

atunick opened this issue Jun 1, 2018 · 1 comment

Comments

@atunick
Copy link

atunick commented Jun 1, 2018

 The hybrid CNN vgg16_hybrid_places_1365.py appears to predict only ImageNet classes rather than including neural net predictions for the 365 Places categories.
 As an example, with the newly converted training weights provided by Pavel Gonchar, analysis of the image http://places2.csail.mit.edu/imgs/demo/6.jpg results in the following:
top-5 probabilities [ 0.17788495  0.1438169   0.09974416  0.03602608  0.02783776]
top_5 predictions [865 917 611 819 509]
--SCENE CATEGORIES:
 toyshop
 comic book
 jigsaw puzzle
 stage
 confectionery, confectionary, candy store.

Clearly these are not the Places classes suggested by G Kalliatakis in his code vgg16_hybrid_places_1365.py, i.e,,

 --PREDICTED SCENE CATEGORIES:
    # restaurant, eating
    # house, eating
    # place, eatery
    # folding
    # chair
    # patio, terrace
    # food_court
    # cafeteria

As another example, the vgg16_hybrid_places_1365 CNN results for the attached "beach" image are:

top_5 probabilities [ 0.28962466  0.14460842  0.10124382  0.08060224  0.0580104 ]
top_5 predictions 1 (5L,) [842 445 978 977 638]
--SCENE CATEGORIES:
 swimming trunks, bathing trunks
 bikini, two-piece
 seashore, coast, seacoast, sea-coast
 sandbar, sand bar
 maillot

beach-1
Again, where are the Places class label predictions?

PLEASE ADVISE.
THANK YOU.

@GKalliatakis
Copy link
Owner

@atunick I have rerun the example with the image http://places2.csail.mit.edu/imgs/demo/6.jpg and the results are the following for the (hybrid model):

--PREDICTED SCENE CATEGORIES:
restaurant, eating house, eating place, eatery
folding chair
patio, terrace
food_court
cafeteria

Regarding the other image https://user-images.githubusercontent.com/17481462/40858563-adb86a74-65ac-11e8-91ae-2363f9687c3f.jpg using the hybrid model I get the following predictions:

--PREDICTED SCENE CATEGORIES:
 seashore, coast, seacoast, sea-coast 
 sandbar, sand bar 
 swimming trunks, bathing trunks 
 maillot, tank suit 
 bikini, two-piece 

while using the plain VGG16-places365 model results in the following predictions:

--PREDICTED SCENE CATEGORIES:
desert/sand
desert_road
beach
coast
desert/vegetation

So, clearly both models are working fine. As expected for the same image the hybrid version and the original version will come up with different predictions and clearly the provided image contains not only the beach as a place but a person wearing a swimming trunk etc.

Your problem for getting different results might lie in the fact that your

cache_subdir = 'models' 

might contain the weights from the previous version. So try deleting all previous weight files and running the scripts again before reporting your new results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants