How parthsavaliya01/liveliness-ditection works
Face Liveness Detection is a Streamlit anti-spoofing application with a separate dataset-evaluation workflow. The main user flow accepts a camera capture or uploaded image, decodes and previews it, runs single-image inference, then displays a live/spoof result with confidence and timing. Internally, inference detects and crops a face before scoring it with an ONNX model. The README also documents webcam and CLI workflows; their implementation details are not fully sampled, so the graph focuses on the evidenced application and evaluator paths.
Main entry points: evaluate.py Dataset evaluator · detector.py Face detection · app.py App entry · selfie_liveness.py Single-image analysis
Components 16
Streamlit application
- App entry
app.py - UI rendering
app/ui.py - UI components
app/components.py - Image handling
app/utils.py - Inference service
app/services.py
Liveness inference
- Single-image analysis
src/selfie_liveness.py - Face detection
src/detector.py - Face preprocessing
src/utils.py - ONNX predictor
src/detector.py - Inference configuration
src/config.py
Dataset evaluation
- Dataset evaluator
src/evaluate.py - Evaluation samples
dataset - Evaluation report
results
Other components
- User
- InsightFace
- ONNX Runtime
Connections 21
- User → App entry: uses app
- App entry → UI rendering: renders interface
- UI rendering → UI components: renders components
- App entry → Image handling: validates and decodes
- App entry → Inference service: requests analysis
- Inference service → Single-image analysis: analyzes image
- Single-image analysis → Face detection: detects face
- Face detection → InsightFace: detects faces
- Face detection → Face preprocessing: aligns and crops
- Single-image analysis → ONNX predictor: scores face crops
- ONNX predictor → ONNX Runtime: runs inference
- Face detection → Inference configuration: uses thresholds
- Single-image analysis → Inference configuration: uses thresholds
- ONNX predictor → Inference configuration: uses model settings
- User → Dataset evaluator: runs evaluation
- Dataset evaluator → Evaluation samples: reads samples
- Dataset evaluator → Face detection: detects faces
- Dataset evaluator → ONNX predictor: scores crops
- Dataset evaluator → Face preprocessing: collects media, computes metrics
- Dataset evaluator → Inference configuration: uses dataset settings
- Dataset evaluator → Evaluation report: writes report