This web application allows users to upload a video, which is then analyzed to detect whether it contains deepfake content. The app processes the video, extracts frames, and uses a pre-trained deep learning model to evaluate each frame's authenticity.
- Video upload via a web interface
- Frame extraction from the uploaded video
- Deepfake detection on extracted frames
- Results displayed with confidence scores
To run this application, you'll need the following libraries installed:
opencv-python-headless
numpy
tensorflow
django
-
Clone the repository:
git clone https://github.com/gitone912/deepfaker_deepfake_detector.git cd deepfaker_deepfake_detector -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required libraries:
pip install -r requirements.txt
-
Set up Django:
-
Apply migrations:
python manage.py migrate
-
Create a superuser for the admin interface:
python manage.py createsuperuser
-
-
Run the Django development server:
python manage.py runserver
-
Open your web browser and navigate to:
http://127.0.0.1:8000/ -
Upload a video:
- Click on upload video to upload a video file.
- The server will process the video, extract frames, and evaluate them using the deepfake detection model.
-
View the results:
- The results page will display each frame's evaluation, including the confidence score and the overall prediction for the video.
- models/deepfake_detection_model.h5: The pre-trained deepfake detection model.
- media/: Directory for storing uploaded videos and extracted frames.
- app_name/: Replace
app_namewith your actual Django app name containing:views.py: Contains the logic for video upload, frame extraction, and evaluation.forms.py: Contains the form for video upload.templates/: Directory for HTML templates.
- FrameCapture(path): Extracts frames from the video located at
path. - evaluate_frames(directory): Evaluates extracted frames for deepfake content.
- upload_video(request): Handles video upload and initiates the frame extraction and evaluation process.
- Ensure the pre-trained model
deepfake_detection_model.h5is placed in themodelsdirectory. - The app is configured to delete and recreate the
mediadirectory with each new video upload to ensure a clean processing environment.
This project is licensed under the MIT License.
For any questions or feedback, please contact akash verma on my insta @frozen_blink.