Home

Awesome

Reconstruction by Inpainting for visual Anomaly Detection (RIAD) in PyTorch

This is an unofficial implementation of Reconstruction by inpainting for visual anomaly detection (RIAD).

PipeLine

avatar

Prerequisites

Visualization demo of randomly generated mosaic masks

Please check this mosaic.ipynb file

Usage

To train RIAD on MVTec AD dataset:

python train.py --obj zipper --data_path [your-mvtec_ad-data-path]

Then to test:

python test.py --obj zipper --data_path [your-mvtec_ad-data-path] --checkpoint_dir [your-saved-weights-path]

Finally, you will get results like img_ROCAUC (anomaly detection) around 0.97 and pixel_ROCAUC (anomaly segmetation) around 0.98

Localization results

avatar

References

Vitjan Zavrtanik, Matej Kristan, Danijel Skčaj,<br> Reconstruction by inpainting for visual anomaly detection,<br> Pattern Recognition,<br> 2020,<br> 107706,<br> ISSN 0031-3203<br>

Acknowledgement

Thanks for the paper authors.
A big thanks to xiahaifeng1995 for contributing most of the codes.