Skip to content

souhaiel1/CNN-LSTM-Violence-detection

Repository files navigation

CNN-LSTM-Violence-detection

This project is a re-implementation of the model described in the paper : https://ieeexplore.ieee.org/document/8852616

Dependencies

  • Python ( I used 3.8.3)
  • opencv
  • tensorflow 2.x
  • keras

Use

  • make sure you have all the necessary dependencies like Tensorflow 2, Keras, numpy, opencv, especially cuda tools for gpu support as the process is computationally heavy.
  • Clone the project and download the trained weights and put them in the same directory (you can put them wherever you want but then you must add the path for the weights in the "violencemodel.py" file).
  • Open a terminal or command prompt if you are on windows and deploy using a command like :
python predict_video2.py --input input_path/violence_video.mp4 --output output_path/results.avi --size 128
  • keep in mind that the input and output arguments are required.

script at work :

the model takes 30 frames as an input : the first 2 videos are obtained by using a rolling average and in the other 2 we only showcase the first frame the model takes every loop run.

Datasets :

About

Violence Detection using a CNN-LSTM model

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published