This repository contains the Face Detection & Preprocessing module used in a DeepFake Detection system. The module extracts faces from images/videos and prepares them for model training.
📌 Features
- Detects faces using OpenCV Haarcascade
- Extracts and saves cropped face images
- Resizes all faces to 112×112
- Handles both images and videos
- Creates clean, standardized inputs for DeepFake models
📁 Project Structure
Deep_Fake_Module_Preprocessing/
│
├── sample_input/
│ ├── test_image.jpg
│ └── sample_video.mp4
│
├── output_faces/ # faces from images
├── video_faces/ # faces from videos
│
└── deepfake_preprocessing.ipynb
🛠️ Technologies Used
- Python
- OpenCV (cv2)
- Matplotlib
img_path = "sample_input/test_image.jpg"
extract_faces("sample_input/sample_video.mp4", "video_faces")
📌 Importance of This Module
- Removes noise and background
- Produces uniform face crops
- Improves DeepFake model accuracy
- Acts as the first stage of the detection pipeline