Dual-branch Normalizing Flow for Anomaly Detection and Localization from Images
Present a dual-branch architecture to model the density mapping of global and local features, respectively. Our model can achieve coarse-grained and fine-grained image anomaly detection and localization, via modeling both the global features and local texture attributes of the input images with a dual branch normalizing flow.
We implement this repo with the following environment:
- Ubuntu 22.04
- Python 3.8
- Pytorch 2.1.2
- CUDA 12.1
Install the other package via:
pip install -r requirement.txt
-
The
MVTec AD
dataset can be download from the Official Website of MVTec AD. -
The
BTAD
dataset can be download from the Official Website of BTAD.
After download, put the dataset in dataset
folder.
python main.py
python eval.py