Skip to content

cuteboyqq/GANomaly-Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

151 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GANomaly-Pytorch

(Back to top)

Generator + Discriminator model

Table of contents

Requirement

pip install -r requirements.txt

implement

(Back to top)

  1. Encoder--Decoder--Encoder

  2. loss function

  3. Encoder/Decoder : Use paper network, conv--batchnorm--leakyrelu

  4. Discriminator (2022/08/30 updated)

image

Train-on-custom-dataset

(Back to top)

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

(Back to top)

python train.py --img-dir "[train dataset dir]" --batch-size 64 --img-size 32 --epoch 20

Test

(Back to top)

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 image

dataset :factory noline , top: input images, bottom: reconstruct images image

Lose-value-distribution

(Back to top)

Blue : normal dataset

Orange : abnormal dataset

image

Reference

(Back to top)

https://arxiv.org/abs/1805.06725

About

GAN, semi-supervised, abnormal detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages