Giter Site home page Giter Site logo

nagatoyuki0943 / memseg-tootouch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tootouch/memseg

0.0 0.0 0.0 11.34 MB

Unofficial Re-implementation of MemSeg for Anomaly Detection

License: MIT License

Python 2.69% Jupyter Notebook 97.30% Dockerfile 0.01%

memseg-tootouch's Introduction

MemSeg

Unofficial Re-implementation for MemSeg: A semi-supervised method for image surface defect detection using differences and commonalities

Environments

  • Docker image: nvcr.io/nvidia/pytorch:20.12-py3
anomalib
opencv
einops
timm
wandb

Process

1. Anomaly Simulation Strategy

2. Model Process

Train

python main.py --yaml_config ./configs/bottle.yaml

Train custom data

configs/custom.yaml

EXP_NAME: MemSeg
SEED: 42

DATASET:
  datadir: './datasets'
  texture_source_dir: './datasets/dtd/images'
  target: 'custom'
  resize: !!python/tuple
    - 256 # height
    - 256 # width
  structure_grid_size: 8
  transparency_range:
    - 0.15 # under bound
    - 1. # upper bound
  perlin_scale: 6
  min_perlin_scale: 0
  perlin_noise_threshold: 0.5

将自定义数据放到 datasets/custom文件夹下

格式如下

└─datasets
   └─custom
      ├─test
      │  ├─bad/  <- 这一个级别内存放图片
      │  ├─good/
      │  └─.../
      └─train
          ├─good/
          └─.../

train

python main.py --yaml_config ./configs/custom.yaml

export

Onnx is exported by default during training

You can export custom format by using export.py

Demo

voila "[demo] model inference.ipynb" --port ${port} --Voila.ip ${ip}

Results

TBD

target AUROC-image AUROC-pixel AUPRO-pixel
0 leather 100 93.93 90.44
1 wood 99.12 92.71 84.96
2 carpet 91.33 91.32 78.34
3 capsule 95.77 88.55 81.56
4 cable 92.41 81.77 64.45
5 metal_nut 99.9 71.13 79.92
6 tile 100 98.1 95.41
7 grid 96.57 76.78 59.63
8 bottle 99.92 95 89.95
9 zipper 97.58 93.76 83.94
10 transistor 97.71 71.78 66.86
11 hazelnut 95.29 91.73 87.83
12 pill 83.69 91.91 72.62
Average 96.1 87.57 79.69

Citation

@article{DBLP:journals/corr/abs-2205-00908,
  author    = {Minghui Yang and
               Peng Wu and
               Jing Liu and
               Hui Feng},
  title     = {MemSeg: {A} semi-supervised method for image surface defect detection
               using differences and commonalities},
  journal   = {CoRR},
  volume    = {abs/2205.00908},
  year      = {2022},
  url       = {https://doi.org/10.48550/arXiv.2205.00908},
  doi       = {10.48550/arXiv.2205.00908},
  eprinttype = {arXiv},
  eprint    = {2205.00908},
  timestamp = {Tue, 03 May 2022 15:52:06 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2205-00908.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

memseg-tootouch's People

Contributors

tootouch avatar nagatoyuki0943 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.