Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepFake Detection – Face Preprocessing Module

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

▶️ Extract Faces From an Image

img_path = "sample_input/test_image.jpg"

Detect, crop and save face images in 'output_faces'

▶️ Extract Faces From a Video

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages