This repository contains two Python scripts and two pre-trained .h5
models for real-time video processing:
-
real-time-de-identification.py
- Identifies faces in real-time from a video feed or video file.
- Blurs or de-identifies recognized faces using various methods.
-
outside_remover.py
- Classifies frames from a video as
inside
oroutside
using a pre-trained model. - Saves frames classified as
inside
to a new video file.
- Classifies frames from a video as
The scripts require the following libraries:
opencv-python
numpy
tensorflow
scipy
Install dependencies using pip:
pip install opencv-python numpy tensorflow scipy
face_classifier.h5
: Used inreal-time-de-identification.py
to classify faces asme
ornot_me
.inside_outside.h5
: Used inoutside_remover.py
to classify video frames asinside
oroutside
.
Place the .h5
files in the following directories:
face_classifier.h5
inmodels/
inside_outside.h5
inDocuments/5th_sem/Project/
Run the real-time-de-identification.py
script to process a live video feed or a saved video file.
- Set
VIDEO_FILE
to the path of your video file if not using a live feed. - Ensure
face_classifier.h5
is in themodels/
directory.
python real-time-de-identification.py
- Identifies faces using OpenCV's Haar Cascade.
- Uses a pre-trained classifier to determine if a face matches
me
. - Blurs or de-identifies recognized faces using:
- Gaussian blur
- Pixelation (mosaic effect)
Run the outside_remover.py
script to process a video file and save only inside
frames to a new video file.
- Set
video
to the path of your input video file. - Set
output
to the desired path for the processed video. - Ensure
inside_outside.h5
is in theDocuments/5th_sem/Project/
directory.
python outside_remover.py
- Classifies frames as
inside
oroutside
using a pre-trained model. - Saves frames classified as
inside
to a new video file.
project/
├── models/
│ └── face_classifier.h5
├── Documents/
│ └── 5th_sem/
│ └── Project/
│ └── inside_outside.h5
├── real-time-de-identification.py
├── outside_remover.py
└── README.md
- Ensure your Python environment has all the required dependencies.
- Modify file paths in the scripts to match your local directory structure if needed.
This project is licensed under the MIT License. See the LICENSE
file for details.
Praharsh Gurudatta