CSAILVision / places365

The Places365-CNNs for Scene Classification
http://places2.csail.mit.edu/
MIT License
1.92k stars 536 forks source link

Different probability in demo website and run_placesCNN_unified.py for SCENE CATEGORIES #45

Closed rahulranjan07 closed 6 years ago

rahulranjan07 commented 6 years ago

Does anyone know why the demo here: http://places2.csail.mit.edu/demo.html and the run_placesCNN_unified.py . I tried testing with the same images mentiones in the README.md file, and the result differs a lot:

According to the README file and places demo website, the result is as follows:

RESULT ON http://places.csail.mit.edu/demo/6.jpg --TYPE: indoor --SCENE CATEGORIES: 0.690 -> food_court 0.163 -> cafeteria 0.033 -> dining_hall 0.022 -> fastfood_restaurant 0.016 -> restaurant --SCENE ATTRIBUTES: no horizon, enclosed area, man-made, socializing, indoor lighting, cloth, congregating, eating, working Class activation map is output as cam.jpg

But when I run run_placesCNN_unified.py on my server, I get the following result:

RESULT ON http://places.csail.mit.edu/demo/6.jpg --TYPE OF ENVIRONMENT: indoor --SCENE CATEGORIES: 0.511 -> food_court 0.085 -> fastfood_restaurant 0.083 -> cafeteria 0.040 -> dining_hall 0.021 -> flea_market/indoor --SCENE ATTRIBUTES: no horizon, enclosed area, man-made, socializing, indoor lighting, cloth, congregating, eating, working Class activation map is saved as cam.jpg

Does anyone knows which model the current demo website is using ?

nickspriet commented 6 years ago

I'm having the same issue!

Running the run_placesCNN_unified.py code gives me the following prediction: 0.232 -> beauty_salon 0.204 -> reception

while running the demo on the Places365 website gives the following: 0.613 -> reception

Why is this difference so big? I'm using the same wideresnet18_places365.pth.tar model as shown in the README file.

zhoubolei commented 6 years ago

The weight is converted once due to the upgrade of the pytorch0.4, so there might be some small numeric change in the weight value. I don't think it affects the overall performance of the model.

nickspriet commented 6 years ago

And which network architecture is used in the online demo model?

MasterYodah commented 6 years ago

Hi @metalbubble , I ran into same issue today. After a closer inspection I found the problem to be this line.

Could you explain why you enforce transition weights to be non-negative? Intuitively this prevents any pooled features from directly diminishing output probabilities (discounting softmax). but is there any specific reason behind this?