Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Latest commit

 

History

History
105 lines (76 loc) · 4.17 KB

install.md

File metadata and controls

105 lines (76 loc) · 4.17 KB

Installation

System Requirement

  • Linux

Packages Requirements

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
  • 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 execute sh 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

Pretrain Models

Optical Flow

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.

Detection

This project will use Detector, and we choose Detectron2. So please download the models and change the location in configuration.

Install PyAnomaly

Get the Package

Method1-From the Release(Recommended)
  1. Download the zip file from Release
    • Please download the latest version
  2. Unzip the zip file
Method2-For Stable branch
  • 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.
Method3-Using Docker

Using the docker, please refer to DOCKER

Dataset Preparing

  1. Make the data folder in PyAnomaly:

    cd PyAnomaly
    mkdir data
  2. 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
  3. 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.