Spaces:
Sleeping
Download README.md from PixelNavigation/Unmask: direct link, hf CLI and curl.
- Browser
- Download file 4.63 kB
-
https://huggingface.co/spaces/PixelNavigation/Unmask/resolve/main/README.md
- Command line
-
hf download hf://spaces/PixelNavigation/Unmask/README.md
-
curl -L -o README.md https://huggingface.co/spaces/PixelNavigation/Unmask/resolve/main/README.md
title: Unmask
emoji: ๐ต๏ธโโ๏ธ
colorFrom: purple
colorTo: indigo
sdk: docker
sdk_version: '1.0'
app_file: app.py
pinned: false
UnMask - Enhanced Deepfake Detection
This project integrates multiple deepfake detection models with a modern web interface.
๐ Quick Start
Backend Setup
Updated the model to tf_efficientnet_b7_ns_0_40
Navigate to backend directory:
cd backendInstall Python dependencies:
pip install opencv-python numpy flask flask-cors torch torchvision dlibStart the server:
Option A: Using the batch file (Windows):
start_server.batOption B: Using Python directly:
python simple_server.pyOption C: Using the Flask API (if dependencies available):
python app.py
The backend will start on http://localhost:8000 (simple server) or http://localhost:5000 (Flask API).
Frontend Setup
Navigate to frontend directory:
cd frontendInstall dependencies:
npm installStart the development server:
npm run dev
The frontend will be available at http://localhost:3000.
๐ฏ Features
Detection Models
- MesoNet (Meso4 & MesoInception4): Lightweight CNN architectures
- Enhanced Xception: Deep learning model optimized for deepfake detection
- Ensemble Voting: Combines multiple models for better accuracy
Web Interface
- Drag & Drop Upload: Easy file upload interface
- Real-time Processing: Live feedback during analysis
- Detailed Results: Comprehensive detection metrics
- Multi-model Analysis: Shows individual model predictions
๐ API Endpoints
Flask API (app.py)
GET /- Server status and informationPOST /api/detect- Upload video for deepfake detectionGET /api/models- Get information about loaded models
Simple Server (simple_server.py)
GET /- API status (JSON)GET /detect- Upload interface (HTML)POST /upload- Process uploaded video
๐ง Technical Details
Supported Formats
- Video: MP4, AVI, MOV, MKV, WebM
- Maximum Size: 100MB
- Processing: Automatic face detection and analysis
Models Integration
The project integrates the HongguLiu/Deepfake-Detection repository, providing:
- MesoNet Models: Specialized for deepfake detection
- Transfer Learning: Pre-trained Xception networks
- Face Detection: Automatic face extraction from videos
- Statistical Analysis: Advanced frame-level analysis
Architecture
frontend/ # Next.js React application
โโโ src/
โ โโโ app/ # Main application pages
โ โโโ Components/ # Reusable UI components
โ
backend/ # Python detection server
โโโ Deepfake-Detection/ # Cloned detection models
โโโ app.py # Flask API server
โโโ simple_server.py # Standalone HTTP server
โโโ requirements.txt # Python dependencies
๐ ๏ธ Troubleshooting
Backend Issues
Python dependencies missing: Install required packages:
pip install -r requirements.txtPort conflicts: Change port in server files if needed
Model loading errors: Ensure the Deepfake-Detection repository is properly cloned
Frontend Issues
CORS errors: Ensure backend server is running and accessible
Upload failures: Check file format and size limits
Connection refused: Verify backend server is running on correct port
๐ Performance
Processing Speed
- Face Detection: ~1-2 seconds per video
- Model Inference: ~0.5-1 second per model
- Total Analysis: ~3-5 seconds average
Accuracy
- Ensemble Model: Combines multiple approaches for better reliability
- False Positive Rate: Reduced through multi-model voting
- Confidence Scoring: Provides reliability metrics
๐ฎ Future Enhancements
- Additional Models: Integration of more detection algorithms
- Batch Processing: Multiple file uploads
- Real-time Streaming: Live video analysis
- Model Training: Custom model training interface
- Advanced Analytics: Detailed forensic analysis
๐ Notes
- This is a research/educational tool - results should be verified
- Processing time depends on video length and system performance
- GPU acceleration available if PyTorch CUDA is installed
- Regular model updates recommended for best performance