solangii / Anomaly-Detection

Anomaly detection using VAE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Course Project of CSE545 Advanced Computer Vision, UNIST

Anomaly Detection

Prepare data

  1. Download the dataset from this link. You can select and download each object.

  2. mkdir datasets and cd datasets

  3. Move the downloaded dataset to this location.

  4. tar -xvf [file_name].tar.xz

Execution Method

  1. first, install all necessary packages to run
pip install -r requirements.txt
  1. In script folder, you can see shell file. Also, you can run file using train.sh or test.sh.
sh train.sh
sh test.sh
  1. When excuting the shell file, modify the argument such as path.
optional arguments:
  -h, --help            show this help message and exit
  --dataset {toothbrush,bottle,capsule}
  --dataroot DATAROOT
  --mode {train,test/defective,test/poke,test/squeeze,test/broken_large,test/broken_small,test/contamination,test/crack}
  --seed SEED
  --epochs EPOCHS
  --batch_size BATCH_SIZE
  --lr LR
  --constant CONSTANT   constant for loss
  --weight_path WEIGHT_PATH
                        used for test
  --threshold THRESHOLD
                        using at calculating difference
  --save_root SAVE_ROOT
  --memo MEMO           make folder with value of parameter at
                        `result/[dataset]/img`

overall

Result

toothbrush/test/defective/010.png

About

Anomaly detection using VAE


Languages

Language:Python 97.0%Language:Shell 3.0%