Comments (1)
Hi, @18813223994. Thank you for using this repository.
This image looks selecting a small epoch number. Could you try to select big epoch number.
Example:
$ python train_wgangp.py "DAGM2007/Class6/train" --seed 1 --n_epochs 1000 --channels 3 --lr 0.0001
$ python train_encoder_izif.py "DAGM2007/Class6/train" --seed 1 --n_epochs 200 --channels 1 --lr 0.0001
$ python test_anomaly_detection.py "DAGM2007/Class6/test" --channels 3
$ python save_compared_images.py "DAGM2007/Class6/test" --n_grid_lines 10 --channels 3
We can check no scratches on the reconstructed images.
However, this abnormal detection score isn't high.
The existing model seems weak for tasks such as a carpet from my experience.
Training GAN and Encoder setting grayscale maybe give you a little more score because images in DAGM2007 are gray color.
Example:
$ python train_wgangp.py "DAGM2007/Class6/train" --seed 1 --n_epochs 1000 --channels 1 --lr 0.0001
$ python train_encoder_izif.py "DAGM2007/Class6/train" --seed 1 --n_epochs 200 --channels 1 --lr 0.0001
$ python test_anomaly_detection.py "DAGM2007/Class6/test" --channels 1
$ python save_compared_images.py "DAGM2007/Class6/test" --n_grid_lines 10 --channels 1
Before run the above, you should rewritten as follows in your_own_dataset/train_wgangp.py and your_own_dataset/train_encoder_izif.py:
transform = transforms.Compose([transforms.Resize([opt.img_size]*2),
transforms.RandomHorizontalFlip(),
transforms.RandomVerticalFlip(),
transforms.Grayscale(num_output_channels=1),
transforms.ToTensor(),
transforms.Normalize([0.5], [0.5])])
Moreover, rewritten in your_own_dataset/test_anomaly_detection.py and your_own_dataset/save_compared_images.py:
transform = transforms.Compose([transforms.Resize([opt.img_size]*2),
transforms.Grayscale(num_output_channels=1),
transforms.ToTensor(),
transforms.Normalize([0.5], [0.5])])
DL the Class6 dataset and split data.
$ wget https://conferences.mpi-inf.mpg.de/dagm/2007/Class6.zip
$ wget https://conferences.mpi-inf.mpg.de/dagm/2007/Class6_def.zip
$ mkdir -p DAGM2007/Class6
$ unzip -d DAGM2007/Class6/train Class6.zip
$ unzip -d DAGM2007/Class6/test Class6_def.zip
import glob
import shutil
import os
output_dir = "DAGM2007/Class6/test/Class6/"
os.makedirs(output_dir, exist_ok=True)
path = "DAGM2007/Class6/train/Class6/*"
file_paths = sorted(glob.glob(path))
for file_path in file_paths[len(file_paths)//2:]:
new_path = shutil.move(file_path, output_dir)
from f-anogan.
Related Issues (12)
- Question about images_e encoder output HOT 2
- I want to train this f-anoGAN networks with my image datasets. HOT 8
- python setup.py install HOT 3
- Huge generator and tiny discriminator? HOT 3
- How can I implement a validation dataset? HOT 5
- G_loss and D_loss are negative numbers when running train_wgangp.py using my own image dataset HOT 7
- Train AnoGAN on pcam dataset in h5 format HOT 3
- Need absolute value for image subtraction HOT 1
- wrong line in mvtec jupyter notebook HOT 3
- Graph values is off. HOT 4
- I want to train this f-anoGAN networks with my image datasets. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from f-anogan.