Skip to content

cgdhanush/deepfake

Repository files navigation

Deepfake Detection

This Deepfake Detection project provides a complete pipeline for identifying manipulated videos using deep learning. It includes tools for extracting faces from video frames, training a model to distinguish real from fake faces, and evaluating its accuracy. A FastAPI-powered web app allows users to upload videos and receive deepfake detection results through an intuitive interface. The system also manages user data automatically and follows a modular structure, making it easy to extend, customize, or debug.

Features

  • 🎥 Face Extraction: Automatically extracts faces from video frames for training/testing.
  • 🤖 Deep Learning Model: Trains a model to differentiate between real and fake faces.
  • 🧪 Testing & Evaluation: Evaluate model performance on a test dataset.
  • 🌐 FastAPI Web App: Upload a video and detect deepfakes through a user-friendly web interface.
  • 🗂️ User Data Management: Automatically manages user directories and video uploads.
  • 🧩 Modular Design: Easy to extend and debug.

🔧 Setup Instructions

1. Clone the Repository

git clone https://github.com/cgdhanush/deepfake
cd deepfake

2. Create a Conda Environment

conda create --name deepfake python=3.11 -y
conda activate deepfake

3. Install Dependencies

pip install -r requirements.txt

4. Create User Directory (for storing datasets and results)

python -m deepfake create-userdir


🚀 Running the Project

⚠️ Ensure the dataset is placed in the user_data/data folder before proceeding.

1. Extract Faces from Dataset

Extract frames and faces from videos for training or testing by default 80% for traing and 20% for tesing:

python -m deepfake extract 

2. Train the Model

python -m deepfake train

3. Test the Model

python -m deepfake test

4. Launch the Web App

python -m deepfake start

This command starts the FastAPI server. Visit http://localhost:8000 to:

  • Sign up or log in
  • Upload videos
  • View detection results

About

Major project on detecting face swaps and deepfakes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •