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.
The project is organized as follows:
projet.mp4
: Source videoextracted_frames/
: Folder containing extracted imagestp_VIDEO_CNN/
: Contains scripts and resources for the CNNCONSIGNES.pdf
: Project instructionsannotated_video.mp4
: Annotated video after analysisvideo_test_3.mp4
: Test video
-
Frame Extraction:
- Load the video
- Convert frames to grayscale
- Store frames in a folder
-
Image Preprocessing:
- Classify frames into two categories:
shoot
andno_shoot
- Convert images into numpy arrays
- Normalize and resize images
- Classify frames into two categories:
-
CNN Model Training:
- Build a CNN model using TensorFlow/Keras
- Train the model on the extracted images
- Validate the model
-
Evaluation and Visualization:
- Display model performance
- Visualize accuracy and loss curves
- Apply the model to a test video
Make sure you have installed the following dependencies:
pip install numpy tensorflow opencv-python scikit-learn matplotlib
python extract_frames.py
python train_model.py
python test_model.py
- 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.
- Optimize the model architecture
- Increase data augmentation to improve robustness
- Integrate a real-time detection system
Andre KHELLA
License: This project is open-source. You are free to modify and share it while respecting copyright rules.