Code Monkey home page Code Monkey logo

skeleton_based_anomaly_detection's Introduction

This is the code for the CVPR'19 paper "Learning Regularity in Skeleton Trajectories for Anomaly Detection in Videos".

Environment Setup

First please create an appropriate environment using conda:

conda env create -f environment.yml

conda activate tbad

Download Data

Due to space constraints in the Github repository, please download the data from the following link and place the data folder in this directory.

Link: trajectories

Test Pre-Trained Models

To evaluate pre-trained models run the evaluate.py script. Some examples:

Evaluate MPED-RNN on all cameras individually and all cameras combined on HR-ShanghaiTech.

python evaluate.py --gpu_ids 0 --gpu_memory 0.2 combined_models ./pretrained/CVPR19/ShanghaiTech/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_ ./data/HR-ShanghaiTech/testing/trajectories ./data/HR-ShanghaiTech/testing/frame_level_masks --video_resolution 856x480 --overlapping_trajectories

Evaluate MPED-RNN on HR-Avenue.

python evaluate.py --gpu_ids 0 --gpu_memory 0.2 combined_model ./pretrained/CVPR19/Avenue/combined_model/_mp_Grobust_Lrobust_Orobust_concatdown_/01_2018_11_13_06_36_20 ./data/HR-Avenue/testing/trajectories/01 ./data/HR-Avenue/testing/frame_level_masks/01 --video_resolution 640x360 --overlapping_trajectories

Train Models from Scratch

To train a model from scratch you should look up the model's configuration options using the option --help on the training.py script. Here is one example:

Train MPED-RNN on the ShanghaiTech data set.

python train.py --gpu_ids 0 --gpu_memory 0.1 combined_model ./data/HR-ShanghaiTech/training/trajectories/00 --video_resolution 856x480 --message_passing --reconstruct_original_data --multiple_outputs --multiple_outputs_before_concatenation --input_length 12 --rec_length 12 --pred_length 6 --reconstruct_reverse --cell gru --global_hidden 8 --local_hidden 16 --output_activation linear --optimiser adam --learning_rate 0.001 --loss mse --epochs 5 --batch_size 256 --global_normalisation robust --local_normalisation robust --out_normalisation robust

skeleton_based_anomaly_detection's People

Contributors

romerobarata avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.