This is my implementation of Inpainting Transformer for Anomaly Detection paper [https://arxiv.org/abs/2104.13897]
First, install dependencies
# tested on Pytorch 1.9
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c
conda install pytorch-lightning -c conda-forge
conda install piq -c photosynthesis-team -c conda-forge -c PyTorch
Next, run it.
For Training
python training.py --img_root=./dataset/wood/ --gpus=2 --accelerator="ddp" --batch_size=64 --max_epochs=500
For inference
The training and inference parts are separated into two files.
- training.py
- inference.py (todo)
We use pytorch-lightning for organizing the code.
Training starting point is main()
method.