byungjae89 / SPADE-pytorch

PyTorch implementation of "Sub-Image Anomaly Detection with Deep Pyramid Correspondences"
Apache License 2.0
235 stars 43 forks source link

Large diffrence in pixel rocauc #15

Closed momo1476422482 closed 2 years ago

momo1476422482 commented 2 years ago

Hello, I tried your code within the MVCTech dataset (bottle class) and I used all of the train data and a part of the test data. For the image leb=vel AUC ROC, there is no pb but for the pixel level one, I have only got 0.61... I would like to know that if I did sth wrong?

Thans a lot in advance

AndSonder commented 2 years ago

Me too! My bottle class result: image

hellojun12 commented 2 years ago

I'm also having the same problem here. I tried to find the solution for 2days but couldn't reach any close results.

mgpadalkar commented 2 years ago

I believe this is happening because of difference in PyTorch versions.

Earlier I tried using:

python 3.10.4
torch 1.12.1
torchvision 0.13.1

and got these results :disappointed: roc_curve

Then I used the environment suggested by @byungjae89 in the readme, viz.,

python 3.6.13
torch 1.5.0
torchvision 0.6.0

and now the results are as given below (same as expected)! :heart_eyes: :sweat_smile: roc_curve

Thanks to the following comments: https://github.com/byungjae89/SPADE-pytorch/issues/6#issue-871820112 https://github.com/byungjae89/MahalanobisAD-pytorch/issues/2#issuecomment-771366404

How I set my environment?

conda create -n spade python=3.6
conda activate spade
conda install pytorch==1.5.0 torchvision==0.6.0 cudatoolkit=10.2 -c pytorch
pip install sklearn matplotlib tqdm
momo1476422482 commented 2 years ago

Thanks a lot for your help @mgpadalkar!!!

detectivelinx commented 1 year ago

I'm confused, why versions results in difference? Could you help to explain it?

wu33learn commented 4 months ago

I'm confused, why versions results in difference? Could you help to explain it?

https://github.com/byungjae89/SPADE-pytorch/issues/13