Skip to content

Deekshashakyawal/deepfake_project

 
 

Repository files navigation

Deepfake Detection Django Application

Requirements

Note: Nvidia GPU is recommended to run the application efficiently.

  • CUDA version >= 10.0
  • GPU Compute Capability > 3.0

Main requirements:

Python >= 3.8
Django >= 4.0
PyTorch
Torchvision
OpenCV
NumPy

Install all dependencies using:

pip install -r requirements.txt

Directory Structure

  • ml_app → Contains machine learning and prediction logic in views.py
  • project_settings → Django settings and production configuration
  • static → CSS, JavaScript, images and frontend assets
  • templates → HTML template files
  • models → Trained deep learning models
  • uploaded_images → Extracted frames from videos
  • uploaded_videos → User uploaded videos

Important: Before running the project, create the following folders in the project root:

models
uploaded_images
uploaded_videos

Running Application Using Docker

Step 1: Install Docker Desktop and start Docker

Step 2: Run Deepfake Detection Container

docker run --rm --gpus all \
-v static_volume:/home/app/staticfiles/ \
-v media_volume:/app/uploaded_videos/ \
--name=deepfakeapplication deepfake-detection-image

Step 3: Run Nginx Reverse Proxy Container

docker run -p 80:80 \
--volumes-from deepfakeapplication \
-v static_volume:/home/app/staticfiles/ \
-v media_volume:/app/uploaded_videos/ \
deepfake-nginx-proxy

Step 4: Open Application

http://localhost:8000

Running Application Locally

Prerequisite

Copy your trained model into the models folder before running the project.

Model naming format:

model_accuracy_frames.pt
Example:
model_87_acc_10_frames.pt

Step 1: Create Virtual Environment

python -m venv venv

Step 2: Activate Virtual Environment

venv\Scripts\activate

Step 3: Install Requirements

pip install -r requirements.txt

Step 4: Run Django Server

python manage.py runserver

Open in browser:

http://127.0.0.1:8000/

How the System Works

  1. User uploads a video
  2. Video is converted into frames
  3. Faces are extracted from frames
  4. Frames are passed to the deep learning model
  5. Model predicts whether video is Real or Fake
  6. Result is displayed with confidence score

Features

  • Video Upload
  • Frame Extraction
  • Face Detection
  • Deepfake Prediction
  • Confidence Score Display
  • Django Web Interface
  • GPU Support
  • Docker Support

Tech Stack

  • Python
  • Django
  • PyTorch
  • OpenCV
  • HTML, CSS, JavaScript
  • Bootstrap
  • Docker
  • Nginx

Author

Deepfake Detection System Django + Deep Learning Project

About

Deepfake Detection System that identifies manipulated videos and images using Deep Learning techniques. The project uses CNN/LSTM-based models with Python, PyTorch, OpenCV, and Django to analyze facial inconsistencies, frame patterns, and temporal features for detecting fake content.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 55.7%
  • CSS 24.0%
  • Python 19.1%
  • Other 1.2%