Home

Awesome

Real-IAD Dataset

Official experiment example of Real-IAD Dataset using UniAD

1. Preparation

1.1. Download the decompress the dataset

The Real-IAD dataset directory should be as follow: (audiojack is one of the 30 objects in Real-IAD)

data
└── Real-IAD
        ├── realiad_1024
        │   ├── audiojack
        │   │   │── *.jpg
        │   │   │── *.png
        │   │   ...
        │   ...
        ├── realiad_jsons
        │   ├── audiojack.json
        │   ...
        ├── realiad_jsons_sv
        │   ├── audiojack.json
        │   ...
        ├── realiad_jsons_fuiad_0.0
        │   ├── audiojack.json
        │   ...
        ├── realiad_jsons_fuiad_0.1
        │   ├── audiojack.json
        │   ...
        ├── realiad_jsons_fuiad_0.2
        │   ├── audiojack.json
        │   ...
        ├── realiad_jsons_fuiad_0.4
        │   ├── audiojack.json
        │   ...
        └── realiad_raw
            ├── audiojack
            │   │── *.jpg
            │   │── *.png
            │   ...
            ...

1.2. Setup environment

Setup python environments following requirements.txt. We have tested the code under the environment with packages of versions listed below:

einops==0.4.1
scikit-learn==0.24.2
scipy==1.9.1
tabulate==0.8.10
timm==0.6.12
torch==1.13.1+cu117
torchvision==0.14.1+cu117

You may change them if you have to and should adjust the code accordingly.

2. Training

We provide config for Single-View/Multi-View UIAD and FUIAD, they are located under experiments directory as follow:

experiments
├── RealIAD-C1       # Single-View UIAD
├── RealIAD-fuad-n0  # FUIAD (NR=0.0)
├── RealIAD-fuad-n1  # FUIAD (NR=0.1)
├── RealIAD-fuad-n2  # FUIAD (NR=0.2)
├── RealIAD-fuad-n4  # FUIAD (NR=0.4)
├── RealIAD-full     # Multi-View UIAD
...

3. Evaluating

After training finished, ano-map of evaluation set is generated under experiments/{your_setting}/checkpoints/ and store in *.pkl files, one file per object. Then use ADEval to evaluate the result.

Acknowledgement

This repo is built on the top of Offical Implementation of UniAD, which use some codes from repositories including detr and efficientnet.