├── .gitattributes ├── .gitignore ├── README.md ├── download.py ├── download_imagenet.py ├── images ├── ex1.png ├── ex2.png ├── model_plot.png └── result.png ├── infer.py ├── infer_cam.py └── requirements.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.zip 2 | *.wmv 3 | *.mpg 4 | *.mpeg 5 | *.mp4 6 | *.mov 7 | *.flv 8 | *.avi 9 | *.ogv 10 | *.ogg 11 | *.webm -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Violence Detection using CNN LSTM 2 | 3 | ## Introduction 4 | 5 | Today, the amount of public violence has increased dramatically. As much in high schools as in the street. This has resulted in the ubiquitous use of surveillance cameras. This has helped the authorities to identify these events and take the necessary measures. But almost all systems today require the human-inspection of these videos to identify such events, which is virtually inefficient. It is therefore necessary to have such a practical system that can automatically monitor and identify the surveillance videos. The development of various deep learning techniques, thanks to the availability of large data sets and computational resources, has resulted in a historic change in the community of computer vision. Various techniques have been developed to address problems such as object detection, recognition, tracking, action recognition, legend generation, etc. 6 | 7 | ## Architecture 8 | 9 | ![Decoder model architecture](images/model_plot.png) 10 | 11 | **Fig: Decoder Network Architecture** 12 | 13 | ## Dataset 14 | 15 | data path are defined as follows: 16 | 17 | - hocky - [Data_Link](http://academictorrents.com/details/38d9ed996a5a75a039b84cf8a137be794e7cee89/tech) 18 | - violentflow - [Data_Link](https://www.openu.ac.il/home/hassner/data/violentflows/) 19 | - movies - [Data_Link](http://academictorrents.com/details/70e0794e2292fc051a13f05ea6f5b6c16f3d3635) 20 | 21 | ## Usage of pretrained model 22 | 23 | - Clone this repository and change directory to this repository 24 | 25 | ```bash 26 | git clone https://github.com/manncodes/Violence-Detection-CNNLSTM.git 27 | cd Violence-Detection-CNNLSTM 28 | ``` 29 | 30 | - Download Inbuilt Keras VGG16 model by running the following script: 31 | 32 | ```bash 33 | python download_imagenet.py 34 | ``` 35 | 36 | - Now download the pretrained model H5 file from [here](https://drive.google.com/drive/folders/1SYD0dbfOLRBcidaACw5aiQsbtN4ySXLh?usp=sharing) and put it inside the model folder so it'll be "model/vlstm_92.h5". 37 | 38 | - Install Dependencies 39 | 40 | ```bash 41 | pip install -r requirements.txt 42 | ``` 43 | 44 | - to run inference on a video existing in 'data' folder run following command: 45 | 46 | ```bash 47 | python infer.py