Giter VIP home page Giter VIP logo

dsr_anomaly_detection's Introduction

DSR - A dual subspace re-projection network for surface anomaly detection

This repository contains the implementation of DSR as proposed in the paper DSR -- A dual subspace re-projection network for surface anomaly detection

Requirements

You can create a conda environment with: conda create --name --file requirements.txt

But the main packages used are:

PyTorch 1.11, opencv-python, sklearn, numpy

DSR evaluation on MVTec

Downloading the MVTec benchmark

Set up the MVTec AD benchmark by downloading it from: https://www.mvtec.com/company/research/datasets/mvtec-ad, and extracting it. For training and evaluation pass the base directory of the extracted files (for example ./data/mvtec/) as the --data_path argument.

Download the pretrained models

Download the pretrained models and extract the zip so that the checkpoints folder will be located in the base directory of this repository.

Download link: https://drive.google.com/file/d/15plhikrUjYCcx23JVxxBKb-HBwKAb8UK/view?usp=sharing

Running the evaluation

#BASE_PATH -- the base directory of mvtec
#i -- the gpu id used for evaluation
python test_dsr.py $i $BASE_PATH DSR

Training DSR

#BASE_PATH -- the base directory of mvtec
#OUT_PATH -- where the trained models will be saved
#i -- the index of the object class in the obj_batch list in train_dsr.py
python train_dsr.py --gpu_id 0 --obj_id $i --lr 0.0002 --bs 8 --epochs 100 --data_path $BASE_PATH --out_path $OUT_PATH

dsr_anomaly_detection's People

Contributors

vitjanz avatar

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.