With a generative adversarial network (CNN U-net framework), which can generate new defect images from normal images. This project is a simple implementation of defect fusion gan.
- make data folder
data ├── train │ ├── image0.png │ └── image1.png | └── ... └── trainannot │ ├── image0.png │ └── image1.png | └── ... - annot are mask of defects, which are 0 for normal pixels and non-0 for defect pixels
- run
python train.pyto train the model
- run
python test.pyto test the model, here provides a pretrained weights dftg.w with my own private dataset.
This is a MvTec test demo without training: defect defect mask mask target target target target result
Recommended images in grayscale.