Giter Site home page Giter Site logo

Comments (1)

A03ki avatar A03ki commented on July 26, 2024

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

000650

We can check no scratches on the reconstructed images.
However, this abnormal detection score isn't high.

ROC-AUC
PR-AUC
scores

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])])

000650
ROC-AUC
PR-AUC
scores


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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.