Skip to content

vt-le/CrossAnomaly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

CrossAnomaly

This is the code for Reconstruction-Guided Cross-Modal Learning for Video Anomaly Detection.

Related Works

DualAnomaly: See DualAnomaly: Dual Spatio-Temporal Cross-Attention Network for Robust Video Anomaly Detection.

HSTforU: See HSTforU: Anomaly Detection in Aerial and Ground-based Videos with Hierarchical Spatio-Temporal Transformer for U-net.

ASTNet: See Attention-based Residual Autoencoder for Video Anomaly Detection.

Setup

The code can be run under any environment with Python 3.7 and above. (It may run with lower versions, but we have not tested it).

Install the required packages:

pip install -r requirements.txt

Clone this repo:

git clone https://github.com/vt-le/CrossAnomaly.git
cd CrossAnomaly/

We evaluate CrossAnomaly on:

Dataset Link
UCSD Ped2 Google drive
CUHK Avenue Google drive
ShanghaiTech Google drive

Training

To train CrosssAnomaly on a dataset, run:

 python -m torch.distributed.launch --nproc_per_node <num-of-gpus-to-use> --master_port 12345  train.py --cfg <config-file>

Evaluation

Please first download the pre-trained model

Dataset Pretrained Model
UCSD Ped2 Google drive
CUHK Avenue Google drive
ShanghaiTech Google drive

To evaluate a pretrained CrossAnomaly on a dataset, run:

 python test.py \
    --cfg <path/to/config/file> \
    --pretrained </path/to/pre-trained/model> \
    [--batch-size <batch-size> --tag <job-tag>]

For example, to evaluate CrossAnomaly on Ped2:

python test.py \
    --cfg config/scripts/ped2/ped2_pvt2_hst.yaml \
    --model-file path/to/checkpoint/ckpt_ped2.pth

Configuration

  • We use YAML for configuration.
  • We provide a couple preset configurations.
  • Please refer to config.py for documentation on what each configuration does.

Citing

If you find our work useful, please consider citing:

@Article{le2026crossanomaly,
author={Le, Viet-Tuan
and Kim, Yong-Guk},
title={Reconstruction-Guided Cross-Modal Learning for Video Anomaly Detection},
}

Contact

For any question, please file an issue or contact:

Viet-Tuan Le: vt-le@outlook.com

About

This is an official implement for "Reconstruction-Guided Cross-Modal Learning for Video Anomaly Detection"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors