Skip-SelfAttension-GANomaly-Pytorch
Generator + Discriminator model
Table of contents
- Skip-SelfAttension-GANomaly-Pytorch
- Requirement
- implement
- Unet-Network
- Train-on-custom-dataset
- Train
- Test
- Lose-value-distribution
- Reference
Requirement
pip install -r requirements.txt
implement
- Encoder-Decoder use Unet
- Use self-Attension
Unet-Network
Train-on-custom-dataset
Custom Dataset
├── test
│ ├── 0.normal
│ │ └── normal_tst_img_0.png
│ │ └── normal_tst_img_1.png
│ │ ...
│ │ └── normal_tst_img_n.png
│ ├── 1.abnormal
│ │ └── abnormal_tst_img_0.png
│ │ └── abnormal_tst_img_1.png
│ │ ...
│ │ └── abnormal_tst_img_m.png
├── train
│ ├── 0.normal
│ │ └── normal_tst_img_0.png
│ │ └── normal_tst_img_1.png
│ │ ...
│ │ └── normal_tst_img_t.png
Train
python train.py --img-dir "[train dataset dir]" --batch-size 64 --img-size 32 --epoch 20
Test
python test.py --nomal-dir "[test normal dataset dir]" --abnormal-dir "[test abnormal dataset dir]" --view-img --img-size 32
Example : Train dataset : factory line only
dataset :factory line , top: input images, bottom: reconstruct images
dataset :factory noline , top: input images, bottom: reconstruct images
Lose-value-distribution
Blue : normal dataset
Orange : abnormal dataset