• Stars
    star
    336
  • Rank 125,564 (Top 3 %)
  • Language
    Python
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An official implementation of "Learning Memory-guided Normality for Anomaly Detection" (CVPR 2020) in PyTorch.

PyTorch implementation of "Learning Memory-guided Normality for Anomaly Detection"

no_imageno_image

This is the implementation of the paper "Learning Memory-guided Normality for Anomaly Detection (CVPR 2020)".

For more information, checkout the project site [website] and the paper [PDF].

Dependencies

  • Python 3.6
  • PyTorch 1.1.0
  • Numpy
  • Sklearn

Datasets

These datasets are from an official github of "Future Frame Prediction for Anomaly Detection - A New Baseline (CVPR 2018)".

Download the datasets into dataset folder, like ./dataset/ped2/

Update

  • 02/04/21: We uploaded the codes based on reconstruction method, and pretrained wieghts for Ped2 reconstruction, Avenue prediction and Avenue reconstruction.

Training

  • The training and testing codes are based on prediction method
  • Now you can implemnet the codes based on both prediction and reconstruction methods.
  • The codes are basically based on the prediction method, and you can easily implement this as
git clone https://github.com/cvlab-yonsei/projects
cd projects/MNAD/code
python Train.py # for training
  • You can freely define parameters with your own settings like
python Train.py --gpus 1 --dataset_path 'your_dataset_directory' --dataset_type avenue --exp_dir 'your_log_directory'
  • For the reconstruction task, you need to newly set the parameters, e.g,, the target task, the weights of the losses and the number of the time sequence.
python Train.py --method recon --loss_compact 0.01 --loss_separate 0.01 --t_length 1 # for training

Evaluation

  • Test your own model
  • Check your dataset_type (ped2, avenue or shanghai)
python Evaluate.py --dataset_type ped2 --model_dir your_model.pth --m_items_dir your_m_items.pt
  • For the reconstruction task, you need to set the parameters as
python Evaluate.py --method recon --t_length 1 --alpha 0.7 --th 0.015 --dataset_type ped2 --model_dir your_model.pth --m_items_dir your_m_items.pt
  • Test the model with our pre-trained model and memory items
python Evaluate.py --dataset_type ped2 --model_dir pretrained_model.pth --m_items_dir m_items.pt

Pre-trained model and memory items

Bibtex

@inproceedings{park2020learning,
  title={Learning Memory-guided Normality for Anomaly Detection},
  author={Park, Hyunjong and Noh, Jongyoun and Ham, Bumsub},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={14372--14381},
  year={2020}
}

More Repositories

1

PISR

An official implementation of "Learning with Privileged Information for Efficient Image Super-Resolution" (ECCV2020) in PyTorch.
Python
243
star
2

projects

HTML
99
star
3

SFNet

An official implementation of "SFNet: Learning Object-aware Semantic Correspondence" (CVPR 2019, TPAMI 2020) in PyTorch.
Python
91
star
4

EWGS

An official implementation of "Network Quantization with Element-wise Gradient Scaling" (CVPR 2021) in PyTorch.
Python
88
star
5

dkn

An official implementation of "Deformable Kernel Network for Joint Image Filtering" (IJCV 2020) in PyTorch.
Python
75
star
6

RRID

An official implementation of "Relation Network for Person Re-identification" (AAAI 2020) in PyTorch.
Python
73
star
7

BANA

An official implementation of "Background-Aware Pooling and Noise-Aware Loss for Weakly-Supervised Semantic Segmentation" (CVPR 2021) in PyTorch.
Python
70
star
8

ISGAN

An official implementation of "Learning Disentangled Representation for Robust Person Re-identification" (NeurIPS 2019) in PyTorch.
Python
67
star
9

ACLS

An official implementation of "ACLS:Adaptive and Conditional Label Smoothing for Network Calibration" (ICCV 2023) in PyTorch.
Python
52
star
10

DKD

An official implementation of "Decomposed Knowledge Distillation for Class-incremental Semantic Segmentation" (NeurIPS 2022) in PyTorch.
Python
49
star
11

DAQ

An official PyTorch implementation of the paper "Distance-aware Quantization", ICCV 2021.
Python
46
star
12

HVPR

An official implementation of "HVPR: Hybrid Voxel-Point Representation for Single-stage 3D Object Detection" (CVPR 2021) in PyTorch.
Python
46
star
13

STMN

An official implementation of "Video-based Person Re-identification with Spatial and Temporal Memory Networks" (ICCV 2021) in PyTorch.
Python
46
star
14

DASS

An official PyTorch implementation of "Bi-directional Contrastive Learning for Domain Adaptive Semantic Segmentation", ECCV 2022.
Python
43
star
15

OIMNetPlus

An official PyTorch implementation of "OIMNet++: Prototypical Normalization and Localization-aware Learning for Person Search", ECCV 2022.
Python
41
star
16

AZ-NAS

An official implementation of "AZ-NAS: Assembling Zero-Cost Proxies for Network Architecture Search" (CVPR 2024) in PyTorch.
Python
41
star
17

ALIFE

An official implementation of "ALIFE: Adaptive Logit Regularizer and Feature Replay for Incremental Semantic Segmentation" (NeurIPS 2022) in PyTorch.
Python
40
star
18

Few-Shot-NAS

Python
39
star
19

LbA

An official PyTorch implementation of the paper "Learning by Aligning: Visible-Infrared Person Re-identification using Cross-Modal Correspondences", ICCV 2021.
Python
38
star
20

JoEm

An official implementation of "Exploiting a Joint Embedding Space for Generalized Zero-Shot Semantic Segmentation" (ICCV 2021) in PyTorch.
Python
37
star
21

FlowGRU

An official implementation of "Temporally Consistent Depth Prediction with Flow-Guided Memory Units" (TITS 2019) in Tensorflow.
Python
36
star
22

mixing-augmentation

Python
11
star
23

One-Shot-NAS

Jupyter Notebook
9
star
24

RankMixup

An official implementation of "RankMixup: Ranking-Based Mixup Training for Network Calibration" (ICCV 2023) in PyTorch.
Python
8
star
25

FYI

An official implementation of "FYI: Flip Your Images for Dataset Distillation" (ECCV 2024) in PyTorch.
Python
4
star
26

Multi-Task-Learning

Python
3
star