JimLee1996 / AVSS2019

Efficient Violence Detection Using 3D Convolutional Neural Networks
MIT License
15 stars 10 forks source link

Running the model on a video #1

Open bilel-bj opened 4 years ago

bilel-bj commented 4 years ago

I would like to thank you for your interesting work. How can I run your model on a video to detect violence per frame? Thanks again for your interesting work.

JimLee1996 commented 4 years ago

I've extracted the videos into frames using FFmpeg to save time on training,

To apply this model on videos, simply, load video using OpenCV or scikit-video. Next is to transform these frames into clips with shape 3x16x112x112 (please refer to transforms code and pytorch doc), then input them into model for inference.

bilel-bj commented 4 years ago

Thanks a lot for your kind reply. Could you please provide to the community the code for running the model on webcam. It will be very useful for the community. Thanks

JimLee1996 commented 4 years ago

Please see https://github.com/JimLee1996/AVSS2019/tree/master/src/Demo

bilel-bj commented 4 years ago

Thanks a lot for providing the code to the community. I am interested in your code for research purposes. I found that you are the state of the art currently in violence detection in surveillance videos.

But there is one problem. I tested your pre-trained weight 'DenseNetLean_Kinetics.pth' on a video from the Hockey Fight dataset. Your model does not detect violence at all. It detects all the video as normal. Could you please provide the right weights?

JimLee1996 commented 4 years ago

DenseNetLean_Kinetics.pth is pre-trained weight on kinetics and was not trained on violence datasets. I've upload the right weights trained on mix dataset to Demo.

bilel-bj commented 4 years ago

Thanks a lot for your great gift to the community!!!

JimLee1996 commented 4 years ago

😉