Deep fake detection Django Application
Requirements:
Note : Nvidia GPU is mandatory to run the application.
- CUDA version >= 10.0 for GPU
- GPU Compute Capability > 3.0
You can find the list of requirements in requirements.txt. Main requirements are listed below:
Python >= v3.6
Django >= v3.0
Directory Structure
- ml_app -> Directory containing code in views.py file
- project_settings -> Contains Django settings and files to run in production
- static -> Contains all css, js and json files (for face-api)
- templates -> Template files for HTML
Note: Before running the project make sure you have created directories namely models, uploaded_images, uploaded_videos in the project root and that you have proper permissions to access them.
Running application on Docker
Step 1: Install docker desktop and start the Docker daemon
Step 2: Run the deepfake detection docker docker image
docker run --rm --gpus all -v static_volume:/home/app/staticfiles/ -v media_volume:/app/uploaded_videos/ --name=deepfakeapplication abhijitjadhav1998/deefake-detection-20framemodel
Step 3: Run the Ngnix reverse proxy server docker image
docker run -p 80:80 --volumes-from deepfakeapplication -v static_volume:/home/app/staticfiles/ -v media_volume:/app/uploaded_videos/ abhijitjadhav1998/deepfake-nginx-proxyserver
Step 4: All set now launch up your application at http://localhost:80
Step 5: Star⭐ this repo 😉 on
and Star⭐ this image on
We deserve a Coffee ☕
Please note that currently we have only pushed the image of 20 Frames model, If you can to create your own image of other frames model follow the steps given in the blog.
Running application locally on your machine
Prerequisite
- Copy your trained model to the models folder.
- You can download our trained models from the Google Drive or you can train your models using the steps mentioned in Model Creation directory.
Step 1 : Clone the repo and Navigate to Django Application
git clone https://github.com/abhijitjadhav1998/Deepfake_detection_using_deep_learning.git
Step 2: Create virtualenv (optional)
python -m venv venv
Step 3: Activate virtualenv (optional)
venv\Scripts\activate
Step 4: Install requirements
pip install -r requirements.txt
Step 5: Copy Models
Copy your trained model to the models folder i.e Django Application/models/
- You can download our trained models from Google Drive
Note : The model name must be in specified format only i.e model_84_acc_10_frames_final_data.pt. Make sure that no of frames must be mentioned after certain 3 underscores _ , in the above example the model is for 10 frames.
Step 6: Run project
python manage.py runserver
Demo
You can watch the youtube video for demo