This repository contains the implementation of FAPM (2023 ICASSP).
https://arxiv.org/abs/2211.07381
We propose a new method called Fast Adaptive Patch Memory (FAPM) for real-time industrial anomaly detection. FAPM utilizes patch-wise and layer-wise memory banks that store the embedding features of images at the patch and layer level, respectively, which eliminates unnecessary repetitive computations. We also propose patch-wise adaptive coreset sampling for faster and more accurate detection.
- Inference Code
- Pretrained Memory
- Training Code
conda environment
git clone https://github.com/donghyung87/FAPM_official.git
conda create -n FAPM
conda activate FAPM
pip install -r requirements.txt
Please download the MVTec dataset from this website.
Inference Code
python test.py --dataset_path=$DATASET_PATH --result_path=$RESULT_PATH --category=capsule --project_root_path=$PRETRAINED_MEMORY_DIRECTORY
You can download pretrained memory from this google link.
Cite as below if you find this repository is helpful to your project:
@article{kim2022fapm,
title={FAPM: Fast Adaptive Patch Memory for Real-time Industrial Anomaly Detection},
author={Kim, Donghyeong and Park, Chaewon and Cho, Suhwan and Lee, Sangyoun},
journal={arXiv preprint arXiv:2211.07381},
year={2022}
}
Some code snippets are borrowed from PatchCore_anomaly_detection and patchcore-inspection. I'm really appreciate to your great projects!!