Skip to content

Sayan090807/DeepSight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepSight — Real-Time Deepfake Detection

A sleek web app that flags AI-generated video in seconds with frame-by-frame analysis.

FastAPI React PyTorch License: MIT

Built for ACMHacks 2025 — UCSC ACM’s annual hackathon.
Team: Sayan Sharma, Yash Khot.


✨ What it does

Upload a short video (.mp4/.mov). DeepSight:

  • Detects faces per frame (OpenCV)
  • Runs a fine-tuned Xception model (FaceForensics++ weights)
  • Provides a deepfake probability score and a synced frame-by-frame chart
  • Returns an overall verdict + JSON for further analysis

🧱 Tech Stack

Frontend

  • React (Vite)
  • Modern, dark UI (CSS)
  • Video panel + probability HUD
  • Live chart rendering (frame vs. fake probability) (MatPlotLib)

Backend

  • FastAPI + Uvicorn
  • Multipart uploads
  • Model inference endpoint /api/predict

ML / CV

  • PyTorch, torchvision, timm (Xception backbone)
  • OpenCV (face detection)
  • NumPy, Pandas, Matplotlib (frame analytics/plots)
  • MoviePy (video IO)

🚀 Quick Start (Docker)

  1. Build the Docker Image
  • docker build -t deepsight .
  1. Run the Container
  • docker run -p 8000:8000 deepsight
  1. Open DeepSight

🚀 Quick Start (Manual)

Requirements: Python 3.10–3.12, Node 18+, ffmpeg installed.

  1. Clone
  1. Python deps
  • python -m venv venv && source venv/bin/activate # Windows: venv\Scripts\activate
  • pip install -r requirements.txt
  1. Pull LFS weights
  • git lfs install
  • git lfs pull # downloads the FaceForensics++ Xception weights
  1. Build the React UI
  • cd app/frontend
  • npm install
  • npm run build
  • cd ../../
  1. Run Project

🧰 Makefile targets

make build # builds the React frontend make run # starts FastAPI (serves the built UI) make clean # removes frontend build artifacts


📡 API

POST /api/predict

Multipart form upload (file).

Response Example: { "frames_analyzed": 30, "average_fake_probability": 0.12, "frame_probs": [0.08, 0.11, 0.14, "..."], "plot_png": "/plots/last_run.png" }


🧭 Design Choices

  • Model: Xception trained on FaceForensics++
  • Safe loading: Weights from older checkpoints are handled defensively
  • Performance: Frame skipping + face cropping → real-time on CPU
  • Explainability: Per-frame timeline exposes where the model spikes

🧩 Skills & Libraries

Skills: ML inference, computer vision, web dev, API design, data visualization, model integration, deployment.

Libraries:
FastAPI, Uvicorn, PyTorch, torchvision, timm, OpenCV, MoviePy, NumPy, Pandas, Matplotlib, React (Vite).


Acknowledgements

  • FaceForensics++ and the broader deepfake research community
  • FastAPI & PyTorch teams
  • UCSC ACM organizers and mentors for ACMHacks 2025

📜 License

MIT — see LICENSE.


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors