/DNFAD

Dual-branch Normalizing Flow for Anomaly Detection and Localization from Images

Primary LanguagePython

DNFAD

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.

Setup

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

Data Download and Preprocess

Dataset

After download, put the dataset in dataset folder.

Train

python main.py

Test

python eval.py