This project detects face-swap-based deepfake videos using a deep learning model built with CNN (ResNext) and RNN (LSTM). The model analyzes video frames to determine whether a video is real or fake.
- Deepfake Detection: Analyzes videos frame by frame.
- Confidence Score: Provides a probability of whether the video is fake.
- PDF Report Generation: Generates a detailed report on the analysis.
- User-Friendly Web Interface: Allows easy video uploads and model predictions.
- Python 3.8+
- pip (Python package manager)
- Virtual environment (optional but recommended)
git clone https://github.com/SakshiAher-Codes/Detection-of-Face-Swap-based-Deep-Fake-Videos.git
cd Detection-of-Face-Swap-based-Deep-Fake-VideosEnsure you have all required dependencies installed by running:
pip install -r requirements.txtstreamlit run main.pyThis will open the Streamlit web app in your browser.
- Extracts frames from the uploaded video.
- Preprocesses frames by resizing and normalizing them.
- Each frame is passed through the trained ResNext + LSTM model.
- The model assigns a confidence score indicating if the frame is fake or real.
- Calculates an overall confidence score for the video.
- Generates a detailed PDF report with frame-wise analysis.
📁 Detection-of-Face-Swap-based-Deep-Fake-Videos
│── 📄 main.py # Streamlit app interface
│── 📄 deepfake_model.py # Deepfake detection functions
│── 📄 requirements.txt # Required Python packages
│── 📄 README.txt # Project documentation
Fix: Install gdown manually:
pip install gdownFix: Ensure import streamlit as st is present at the top of main.py.
Fix: Store the model on Google Drive and use:
import gdown
gdown.download("https://drive.google.com/uc?id=1UiYjPQBC-mZO4qETov4C6oFlnSNeSf2i", "deepfake_model.h5", quiet=False)- Python (Version 3.8+) – Core language for the project
- pip – Python package manager for installing dependencies
- Streamlit – To create the web interface
- TensorFlow / Keras – For deep learning model operations
- OpenCV – To process video frames
- ReportLab – To generate PDF reports
- gdown – To download the model from Google Drive
- Operating System: Works on Windows, macOS, and Linux
- Python Environment: Recommended to use virtual environment for package isolation
- Google Drive: To store and access the trained deepfake model
- Streamlit Cloud (optional): If deploying the application online
For any queries, feel free to reach out at biz.sakshiaher@gmail.com.
Happy Coding! 🚀