marco-rudolph / differnet

This is the official repository to the WACV 2021 paper "Same Same But DifferNet: Semi-Supervised Defect Detection with Normalizing Flows" by Marco Rudolph, Bastian Wandt and Bodo Rosenhahn.
215 stars 67 forks source link

Get a gradient map from scored image #24

Closed aditya-pratama96 closed 3 years ago

aditya-pratama96 commented 3 years ago

I use the evaluate.py script to scores some images. How can I get the gradient map from the scored images?

marco-rudolph commented 3 years ago

See here to see how to call the function to get gradient maps. See here to see how to get the test dataloader for that. Alternatively you could use and modify the code of this file directly. Watch out that gradient maps are only produced if the label is 1 (=anomaly).