How jerlee123/deep_fake_api-main works
This repository is a FastAPI video-authenticity backend with two user-facing flows: upload a video for deepfake analysis, or stream camera frames for live eKYC presentation-attack detection. The upload workflow produces predictions, metadata and frame-level review; the live workflow buffers frames and returns ongoing REAL/SPOOF results. Integrity signing and verification are separate API capabilities. The main API and model sources are sampled, but live-route internals and some report/training wiring are not, so uncertain connections are omitted. README also cautions that live inference may lack a trained checkpoint.
Main entry points: apiForAppNewOne.py REST upload API · realtime_ekyc_api.py Realtime PAD API · ekyc_pad_pipeline.py PAD pipeline · llm_report_generator.py LLM reports
Components 22
API workflows
- REST upload API
apiForAppNewOne.py - Live eKYC WebSocket
apiForAppNewOne.py - Realtime PAD API
realtime_ekyc_api.py
Video analysis
- Video preprocessing
apiForAppNewOne.py - Video metadata
apiForAppNewOne.py - Frame sampling
apiForAppNewOne.py - Face detection
apiForAppNewOne.py - Prediction explanation
apiForAppNewOne.py - Frame-level analysis
apiForAppNewOne.py
Inference models
- PAD pipeline
ekyc_pad_pipeline.py - Deepfake model
deepfake_model.py - ViViT model
vivit_model.py - ViViT BiLSTM model
vivit_bilstm_model.py - LLM reports
llm_report_generator.py - Model checkpoints
ekyc_checkpoint.pth
Integrity services
- Signature endpoints
apiForAppNewOne.py - RSA key files
keys
Other components
- Mobile or API client
- LLM provider
- Analysis results
- Live predictions
- Signature response
Connections 19
- Mobile or API client → REST upload API: uploads video
- REST upload API → Video preprocessing: processes upload
- REST upload API → Video metadata: extracts metadata
- REST upload API → Frame-level analysis: dispatches CSV analysis
- Video preprocessing → Frame sampling: samples frames
- Video preprocessing → Face detection: detects faces
- REST upload API → Deepfake model: runs inference
- REST upload API → Prediction explanation: builds explanation
- REST upload API → Analysis results: returns results
- Mobile or API client → Live eKYC WebSocket: streams frames
- Live eKYC WebSocket → Realtime PAD API: dispatches stream
- Realtime PAD API → ViViT model: runs PAD inference
- Realtime PAD API → Live predictions: sends predictions
- Mobile or API client → Signature endpoints: requests signing
- Signature endpoints → RSA key files: uses RSA keys
- Signature endpoints → Signature response: returns signature
- PAD pipeline → ViViT BiLSTM model: trains or predicts
- LLM reports → LLM provider: requests report text
- PAD pipeline → Model checkpoints: loads or saves