Giter Club home page Giter Club logo

saqib727 / deepfake-detector Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 2 KB

A Gradio-based web application that detects whether an image is a deepfake. The application uses a pre-trained InceptionResnetV1 model from the facenet_pytorch library for face recognition, and pytorch-grad-cam for visual explainability.

Home Page: https://huggingface.co/spaces/saqib129/DeepFake-Detector

Python 100.00%
deep-learning deepface deepfake-detection deepfakes deepfakes-classification gradio mtcnn mtcnn-face-detection

deepfake-detector's Introduction

Deepfake Detection App

This repository contains a Gradio-based web application that detects whether an image is a deepfake. The application uses a pre-trained InceptionResnetV1 model from the facenet_pytorch library for face recognition, and pytorch-grad-cam for visual explainability.

How It Works

  1. Face Detection: The application uses the MTCNN model to detect faces in the input image.
  2. Face Classification: The detected face is then passed through an InceptionResnetV1 model to classify it as real or fake.
  3. Explainability: The application uses Grad-CAM to generate a visual explanation of the model's decision.

Dependencies

The following libraries are required to run the application:

  • torch
  • torchvision
  • facenet-pytorch
  • numpy
  • pillow
  • opencv-python
  • pytorch-grad-cam
  • gradio

You can install these dependencies using the following command:

pip install -r requirements.txt

File Structure

  • app.py: The main application script.
  • resnetinceptionv1_epoch_32.pth: The model checkpoint file. Download from here or Download Via Pinata through this hash QmUrarTy82uk2bUzty7Rhtc2XNCJHnsJy9UQhh7sMmAj78
  • requirements.txt: List of dependencies.
  • README.md: This file.

Running the Application

To run the application locally, execute the following command:

python app.py

This will launch the Gradio interface in your default web browser. You can then upload an image and get the prediction along with the explainability visualization.

How to Use

Go over to this Hugging Face Space: Deep Fake Detection

  • Upload an Image: Click on the "Upload" button and select an image file.
  • Get Prediction: The app will process the image and display whether it is "real" or "fake" along with confidence scores.
  • Explainability: The app will also display an image with visual explainability using Grad-CAM.

Acknowledgments

This project uses the following open-source libraries:

  • Gradio
  • PyTorch
  • FaceNet-PyTorch
  • PyTorch-Grad-CAM

License

This project is licensed under the MIT License.

Any Contribution is highly appreciated for this Project!

deepfake-detector's People

Contributors

saqib727 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

jireh-jam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.