https://github.com/vt-le/mogup
MoGuP: This repo is the official implementation of "MoGuP: Motion-guided Prediction for Video Anomaly Detection".
https://github.com/vt-le/mogup
anomalydetection avenue guidedmotion hierarchicaltransformer mogup opticalflow ped2 shanghaitech transformer videoanomalydetection
Last synced: 6 months ago
JSON representation
MoGuP: This repo is the official implementation of "MoGuP: Motion-guided Prediction for Video Anomaly Detection".
- Host: GitHub
- URL: https://github.com/vt-le/mogup
- Owner: vt-le
- Created: 2023-10-09T05:29:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-28T05:03:15.000Z (over 2 years ago)
- Last Synced: 2025-02-02T05:28:59.098Z (over 1 year ago)
- Topics: anomalydetection, avenue, guidedmotion, hierarchicaltransformer, mogup, opticalflow, ped2, shanghaitech, transformer, videoanomalydetection
- Homepage: https://moguprediction.github.io/
- Size: 3.91 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MoGuP
This repository is the official implementation of [MoGuP](https://moguprediction.github.io/) [](https://hits.seeyoufarm.com).
**[MoGuP: Motion-Guided Prediction for Video Anomaly Detection](https://moguprediction.github.io/)**
[Viet-Tuan Le](https://vt-le.github.io/),
[Yong-Guk Kim](http://home.sejong.ac.kr/~ykim/)
[](https://moguprediction.github.io/)
## News
- [11/24/2023] Pre-trained MoGuP models are released!
## Setup
### Requirements
```shell
pip install -r requirements.txt
```
We evaluate `MoGuP` on:
| Dataset | Link |
|--|---------------------------------------------------------------------------------------|
| UCSD Ped2 | [](http://www.svcl.ucsd.edu/projects/anomaly/dataset.html) |
| CUHK Avenue | [](http://www.cse.cuhk.edu.hk/leojia/projects/detectabnormal/dataset.html) |
| ShanghaiTech | [](https://svip-lab.github.io/dataset/campus_dataset.html) |
A dataset is a directory with the following structure:
```bash
$ tree data
ped2/avenue
├── training
│ └── frames
│ ├── ${video_1}$
│ │ ├── 000.jpg
│ │ ├── 001.jpg
│ │ └── ...
│ ├── ${video_2}$
│ │ ├── 00.jpg
│ │ └── ...
│ └── ...
├── testing
│ └── frames
│ ├── ${video_1}$
│ │ ├── 000.jpg
│ │ ├── 001.jpg
│ │ └── ...
│ ├── ${video_2}$
│ │ ├── 000.jpg
│ │ └── ...
│ └── ...
└── ped2/avenue.mat
shanghaitech
├── training
│ └── frames
│ ├── ${video_1}$
│ │ ├── 000.jpg
│ │ ├── 001.jpg
│ │ └── ...
│ ├── ${video_2}$
│ │ ├── 00.jpg
│ │ └── ...
│ └── ...
├── testing
│ └── frames
│ ├── ${video_1}$
│ │ ├── 000.jpg
│ │ ├── 001.jpg
│ │ └── ...
│ ├── ${video_2}$
│ │ ├── 000.jpg
│ │ └── ...
│ └── ...
└── test_frame_mask
├── 01_0014.npy
├── 01_0015.npy
└── ...
```
## Data preprocessing
- Object detecion: [Cascade R-CNN](https://github.com/open-mmlab/mmaction2)
- Extracting optical flow frames: [FlowNet2.0](https://github.com/NVIDIA/flownet2-pytorch)
## Evaluation
Please first download the pre-trained model
| Dataset | Pretrained Model |
|--|---------------------------------------------------------------------------------------|
| UCSD Ped2 | [](https://drive.google.com/drive/folders/1Jq8vEGS9eEV2a6rK3TmjhUKcbbbuLcYd?usp=sharing) |
| CUHK Avenue | [](https://drive.google.com/drive/folders/1UxPg9u6Bmhh5YBMfU31Gj4BZmL-ghIeq?usp=sharing) |
| ShanghaiTech | [](https://drive.google.com/drive/folders/1Jq8vEGS9eEV2a6rK3TmjhUKcbbbuLcYd?usp=sharing) |
## Usage
### Training
```bash
python hybrid_train.py \
--cfg
```
### Evaluation
Once the training is done, run inference:
```bash
python hybrid_eval.py \
--cfg
```
## Visualization
UCSD Ped22
CUHK Avenue

## Citation
If you make use of our work, please cite our paper.
```bibtex
@article{le2024mogup,
title={MoGuP: Motion-guided Prediction for Video Anomaly Detection},
author={Le, Viet-Tuan and Kim, Yong-Guk},
}
```