DeepScan API is a FastAPI-based service that processes videos to detect deepfake content using deep learning models. It provides real-time analysis and visualization of the detection process.
- Deep learning-based deepfake detection
- GradCAM visualization for model interpretability
- Efficient frame processing and MinIO storage
- Integration with Laravel backend
- Configurable settings via YAML
- Python 3.8+
- CUDA-capable GPU (recommended)
Vagrantfile for this repository can be found out at recluzegeek/deepscan-web, under vagrant/fastapi.sh
. The script is used for provisioning the ubuntu jammy configured to host this API, in a multivm vagrant environment, but it can be configured according to your needs.
- Clone the repository:
git clone https://github.com/recluzegeek/deepscan-api.git
cd deepscan-api
- Create and activate a virtual environment:
python -m venv .venv && source .venv/bin/activate
OR for windows
python -m venv .venv && .\venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Configure settings:
cp config/settings.example.yaml config/settings.yaml
Edit the settings.yaml file to configure the API host, port, and other parameters.
.
├── config
│ ├── settings.example.yaml
│ └── settings.yaml
├── models
│ ├── __init__.py
│ └── swin_model.pth
├── routers
│ ├── __init.py__
│ └── video_router.py
├── services
│ ├── frame_services.py
│ └── video_service.py
├── temp-frames
├── utils
│ ├── classification.py
│ ├── __init.py__
│ ├── model_manager.py
│ └── video_processing.py
├── Dockerfile
├── __init__.py
├── main.py
├── README.md
└── requirements.txt
- Run the API:
fastapi run main.py --reload --host 0.0.0.0 --port 9010
- API Endpoints:
- POST
/upload
: Process video frames for deepfake detection
- Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc