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
- 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
docker run --rm --gpus all \
-v static_volume:/home/app/staticfiles/ \
-v media_volume:/app/uploaded_videos/ \
--name=deepfakeapplication deepfake-detection-image
docker run -p 80:80 \
--volumes-from deepfakeapplication \
-v static_volume:/home/app/staticfiles/ \
-v media_volume:/app/uploaded_videos/ \
deepfake-nginx-proxy
http://localhost:8000
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
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python manage.py runserver
Open in browser:
http://127.0.0.1:8000/
- User uploads a video
- Video is converted into frames
- Faces are extracted from frames
- Frames are passed to the deep learning model
- Model predicts whether video is Real or Fake
- Result is displayed with confidence score
- Video Upload
- Frame Extraction
- Face Detection
- Deepfake Prediction
- Confidence Score Display
- Django Web Interface
- GPU Support
- Docker Support
- Python
- Django
- PyTorch
- OpenCV
- HTML, CSS, JavaScript
- Bootstrap
- Docker
- Nginx
Deepfake Detection System Django + Deep Learning Project