Pytorch version of - https://github.com/WaqasSultani/AnomalyDetectionCVPR2018
In this section, I list the future improvements I intend to add to this repository. Please feel free to recommend new features. I also happily accept PR's! 😏
- I3D feature extraction
- MFNET feature extraction
- AUC is not exactly as reported in the paper (0.70 vs 0.75) - might be affected by the weights of C3D
- Faulty video_demo
conda env create -f environment.yml
conda activate adCVPR18
I couldn't upload here the weights for the C3D model because the file is too big, but it can be found here: https://github.com/DavideA/c3d-pytorch
Can be downloaded from: https://drive.google.com/drive/folders/1rhOuAdUqyJU4hXIhToUnh5XVvYjQiN50?usp=sharing
Check out exps/models for for trained models on the pre-computed features
The loss graph during training is shown here:
python feature_extractor.py --dataset_path "path-to-dataset" --pretrained_3d "path-to-pretrained-fe"
python TrainingAnomalyDetector_public.py --features_path "path-to-dataset" --annotation_path "path-to-train-annos"
python generate_ROC.py --features_path "path-to-dataset" --annotation_path "path-to-annos" --model_path "path-to-model"
Using my pre-trained model after 40K iterations, I achieve this following performance on the test-set. I'm aware that the current model doesn't achieve AUC of 0.75 as reported in the original paper. This can be caused by different weights of the C3D model.
python video_demo.py --feature_extractor "path-to-pretrained-fe" --feature_method "fe-method" --ad_model "path-to-pretrained-ad-model" --n_segments "number-of-segments"
The GUI would let you load a video and run the Anomaly Detection code (including feature extraction) and output a video with a graph of the Anomaly Detection prediction below.
python annotation_methods.py --path_list LIST_OF_VIDEO_PATH --dir_list LIST_OF_LIST_WITH_PATH_AND_VIDEO_NAME --normal_or_not LIST_TRUE_FALUE
This is currently just for demo but will allow training with nex videos
*Contrbuted by Peter Overbury of Sussex Universty IISP Group
@misc{anomaly18cvpr-pytorch,
author = "Eitan Kosman",
title = "Pytorch implementation of Real-World Anomaly Detection in Surveillance Videos",
howpublished = "\url{https://github.com/ekosman/AnomalyDetectionCVPR2018-Pytorch}",
note = "Accessed: 20xx-xx-xx"
}
Q: video_demo doesn't show videos
A: Downlaod and install LAVFilters: http://forum.doom9.org/showthread.php?t=156191