Pytorch implementation of video anomaly detection paper for CVPR 2018: Future Frame Prediction for Anomaly Detection โ A New Baseline.
Most codes were obtained from the following GitHub page: [Link]
To understand the code, please refer to the Google Colab page (Korean): [Link]
I only trained the ped2
dataset, the result:
AUC |
USCD Ped2 |
original implementation |
95.4% |
this implementation |
95.5% |
PyTorch >= 1.1.
Python >= 3.6.
opencv
sklearn
Other common packages.
- Download the ped2 dataset and put it under the
data
folder.
- Download the FlowNet2-SD weight and put it under the
flownet/pretrained
folder.
- Download the trained model and put it under the
weights
folder.
# default option.
python train.py --dataset=ped2
# change 'seed'.
python train.py --dataset=ped2 --manualseed=50
# change 'max iteration'.
python train.py --dataset=ped2 --iters=60000
# change 'model save interval'.
python train.py --dataset=ped2 --save_interval=10000
# change 'validation interval'.
python train.py --dataset=ped2 --val_interval=1000
# Continue training with latest model
python train.py --dataset=ped2 --resume=latest_ped2
# default option.
python eval.py --dataset=ped2 --trained_model=best_model_ped2
# change 'show heatmap'.
python eval.py --dataset=ped2 --trained_model=best_model_ped2 --show_heatmap=True
# change 'show roc_curve'.
python eval.py --dataset=ped2 --trained_model=best_model_ped2 --show_curve=True
Validation results can be found on the path results
by AUC graph.
AUC graph (ped2) |
|
Evaluation results can be found on the path results/ped2/{best_iter}
by ROC Curve, Anomaly Score, etc.
ROC Curve with AUC (ped2) |
|
Anomaly Score (ped2-04) |
|
Frame Comparison (ped2-04) |
|
- Frame-Prediction lecture note: [Link] (24.04.18)