Official PyTorch Implementation of "Attribute-based Representations for Accurate and Interpretable Video Anomaly Detection".
python==3.7
torch==1.12.0+cu102
Download this file (195 MB npy file) and place it in the following path: ./data/shanghaitech/train/pose.npy
.
To download the evaluation datasets, please follow the instructions.
The training and testing datasets should be preprocessed according to the these instructions.
For extracting velocity and deep representations, run the following command:
python feature_extraction.py [--dataset_name]
Pose representations have already been provided by us.
To compute calibration parameters for each representation, run the following command:
python score_calibration.py [--dataset_name]
Finally, you can evaluate by running the following command:
python evaluate.py [--dataset_name] [--sigma]
We usually use --sigma=3
for Ped2 and Avenue, and --sigma=7
for ShanghaiTech.
You can download our set of representations for Ped2, Avenue and ShanghaiTech datasets from here.
UCSD Ped2 | CUHK Avenue | ShanghaiTech |
---|---|---|
99.1% | 93.6% | 85.9% |
If you find this useful, please cite our paper:
@article{reiss2022attribute,
title={Attribute-based Representations for Accurate and Interpretable Video Anomaly Detection},
author={Reiss, Tal and Hoshen, Yedid},
journal={arXiv preprint arXiv:2212.00789},
year={2022}
}