- Linux
The requirement packages are as follows, and if users have some problems in installation, please submit an issue, and we will solve it ASAP.
- PyTorch >= 1.3
- cuda == 10.0
- This one can be installed through anaconda,
cudatoolkit
- This one can be installed through anaconda,
- Detectron2
- we use this package to get the object detection.
- Flownet2
- Installing this means that users should install the dependency packages of Flownet2 and build the layers.
- Users should go the
scripts
and executesh install.sh
cupy
cupy
must match the CUDA version, if having the problem, please try this:pip install cupy-cudaxxx
.xxx
is the version of the CUDA, e.g. cuda101 is CUDA 10.1
tensorboard
- torchvison
torchsnooper
- This package is in Link. This is a package that help users to print the tensors' shape during the debug process
tsnecuda
scikit-image
mmcv
imgaug
opencv
This package will use Flownet2 and Liteflownet, so please follow the instructions on their Github to get the models and users should change the location of these models in configuration.
This project will use Detector, and we choose Detectron2. So please download the models and change the location in configuration.
- Download the zip file from Release
- Please download the latest version
- Unzip the zip file
- the master branch contains some new features which may not
cd ROOT/PATH
git clone https://github.com/YuhaoCheng/PyAnomaly.git
cd PyAnomaly
- At present, you should change the branch to
stable
to use the stable version of the package. If you choose use other branches, there may be some bugs. In the future, we will change this.
Using the docker, please refer to DOCKER
-
Make the
data
folder inPyAnomaly
:cd PyAnomaly mkdir data
-
Download the data into the
data
folder:- If you only need the following dataset:
- Ped2: is a widely-used dataset in video anomaly detection, it contains two parts: Ped1 and Ped2. Ped1 contains 34 normal training videos and 36 testing videos, and Ped2 contains 16 normal training videos and 12 testing videos. As a result of that most methods only use the Ped2 part, we also use the Ped2 part in our tools to demonstrate the accuracy of reproduced methods
- Avenue:contains anomalies such as strange actions, wrong directions, and abnormal objects, and it also is a widely-used dataset in video anomaly detection. It contains 16 training and 21 testing video clips
- ShanghaiTech Campus: is a very challenging dataset whose anomalies are diverse and realistic. It contains normal 330 training videos and 107 testing videos, which is captured from 13 different scenes You can choose to download the data from this link, which is provided by previous researchers
- If you only need the following dataset:
-
Change the structure of the data:
- Please change the structure of the data into the following structure.
--data |--dataset1 |--training |--frames |--video1 |--1.jpg |--2.jpg ... |--video2 |--testing |--frames
- Please put the annotations in the path which is written in the configuration file.
- Please check the data path in the configuration file.