Surgical privacy technology combining YOLOv11, Kornia (YuNet), Kalman Tracking, and Knowledge Graphs (GraphRAG)
The OccultaShield backend is the intensive processing core of the system. Designed to run on servers with GPU acceleration, this module orchestrates a complex pipeline of computer vision and legal reasoning.
- Intelligent Hybrid Detection:
- Uses YOLOv11-seg (Instance Segmentation) to obtain precise contours of pedestrians and vehicles, avoiding rectangular "black boxes" that hide irrelevant information.
- Integrates Kornia FaceDetector (YuNet) for high-fidelity face detection, capable of detecting faces as small as 10x10 pixels in dense crowds.
- Temporal Tracking (MOT):
- Implements SORT/DeepSORT algorithms with Kalman filters to maintain identity coherence (ID) for each subject throughout the video, preventing masks from "flickering".
- Legal Verification (Brain):
- It doesn't just hide; it asks. A RAG (Retrieval-Augmented Generation) engine queries a vector database in Neo4j with GDPR regulations to justify whether a detection is a violation.
- GPU Tensor Editing:
- Final rendering doesn't use classic ffmpeg for effects. It uses direct tensor operations on VRAM (via Kornia), applying Gaussian blurs or cryptographically secure pixelation.
- FastAPI: High-performance asynchronous REST API with native
asynciosupport. - Package Manager:
uv(Rust-based) for instant dependency management. - Vision:
ultralytics(YOLO) +kornia(PyTorch Vision). - Data:
SurrealDB(Logs, Auth, Metadata) +Neo4j(Graph Knowledge). - LLM: Integration with Ollama/HuggingFace for legal reasoning (
verificationmodule).
- OS: Linux (Ubuntu 22.04+ recommended).
- Python: 3.11 or higher.
- GPU: NVIDIA Pascal or higher (with drivers 535+ and CUDA 12) for optimal performance.
cd backend
# Create virtual environment and install dependencies (including torch and kornia)
uv syncIt is critical to properly configure environment variables for connecting to models and databases.
cd app
cp .env.example .env
nano .envKey Variables:
DETECTION_MODEL_PATH: Path to YOLO model (e.g.,yolo11n-seg.pt).NEO4J_URI/NEO4J_PASSWORD: Legal Graph credentials.SURREALDB_URL: SurrealDB connection URL (usuallyws://localhost:8000/rpc).
Before processing, load the initial legal knowledge:
# Activate the environment
source .venv/bin/activate
# Ingest the GDPR PDF into Neo4j
python app/modules/verification/ingest_gdpr.py path/to/gdpr.pdf# Development mode with hot reload
cd app
uvicorn main:app --host 0.0.0.0 --port 8980 --reload- Swagger API Docs:
http://localhost:8980/docs - Health Endpoint:
http://localhost:8980/api/v1/health
app/modules/detection/:detector.py: Hybrid orchestrator (YOLO + Kornia).tracker.py: Kalman Filter logic.
app/modules/verification/:rag_engine.py: Interface with Neo4j and LLM.legal_brain.py: Compliance decision logic.
app/modules/edition/:video_editor.py: Tensor-based renderer (Kornia).
app/api/v1/: REST Routes and Websockets (SSE).
- Kornia: The system will automatically try to use CUDA. If you see "Falling back to CPU" logs, verify your PyTorch installation.
- Models: The first run will download several GB of weights (YOLO, Embeddings, YuNet). Ensure you have a good connection.