Skip to content

Deep learning project for shot detection in videos using CNNs. Extracts and classifies frames into action categories.

Notifications You must be signed in to change notification settings

Andre9220/shot-detector-cnn

Repository files navigation

shot-detector-cnn : Video Processing with a CNN Model

Description

This project implements a video processing pipeline using a Convolutional Neural Network (CNN) model. The goal is to extract images from a video, preprocess them, and use them to train a classification model.

Project Structure

The project is organized as follows:

  • projet.mp4 : Source video
  • extracted_frames/ : Folder containing extracted images
  • tp_VIDEO_CNN/ : Contains scripts and resources for the CNN
  • CONSIGNES.pdf : Project instructions
  • annotated_video.mp4 : Annotated video after analysis
  • video_test_3.mp4 : Test video

Main Features

  1. Frame Extraction:

    • Load the video
    • Convert frames to grayscale
    • Store frames in a folder
  2. Image Preprocessing:

    • Classify frames into two categories: shoot and no_shoot
    • Convert images into numpy arrays
    • Normalize and resize images
  3. CNN Model Training:

    • Build a CNN model using TensorFlow/Keras
    • Train the model on the extracted images
    • Validate the model
  4. Evaluation and Visualization:

    • Display model performance
    • Visualize accuracy and loss curves
    • Apply the model to a test video

Execution

Prerequisites

Make sure you have installed the following dependencies:

pip install numpy tensorflow opencv-python scikit-learn matplotlib

Run Frame Extraction

python extract_frames.py

Train the Model

python train_model.py

Test the Model

python test_model.py

Results

  • The model achieves an accuracy of 97-100% on the validation set.
  • The accuracy and loss curves show good convergence.
  • The model accurately identifies shooting scenes.

Possible Improvements

  • Optimize the model architecture
  • Increase data augmentation to improve robustness
  • Integrate a real-time detection system

Author

Andre KHELLA


License: This project is open-source. You are free to modify and share it while respecting copyright rules.

About

Deep learning project for shot detection in videos using CNNs. Extracts and classifies frames into action categories.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published