Personal Project · 2024–2025
Full-Stack · Computer Vision · NAS

Son
Drive

A self-hosted web file manager with AI-powered biometric login — face recognition with liveness detection and gaze tracking, connected to a private SMB NAS, accessible from any browser.

FaceNet / VGGFace2 MTCNN Detector Anti-Spoofing CNN Gaze Tracking FastAPI SMB Protocol MediaPipe PyTorch
512-dFaceNet embed
MTCNNface detect
livenessanti-spoof
LIVE
👤
IDENTIFYING...

Computer Vision Core

Face Authentication
Pipeline

512
Embedding Dims
3
Security Layers
<1s
Inference Time
0
Password Needed
face_recognize_from_image() — full pipeline
01 · input
📷
Capture
WebRTC live frame
02 · detect
🔲
MTCNN
facenet_pytorch
03 · presence
👁️
Gaze Check
MediaPipe iris
04 · liveness
🛡️
Anti-Spoof
Silent-Face CNN
05 · encode
🧠
FaceNet
InceptionResnetV1
06 · match
Cosine Match
threshold 0.75
Detection · MTCNN
Multi-Task CNN Face Detector
facenet_pytorch MTCNN runs a 3-stage cascade (P-Net → R-Net → O-Net) to detect, align, and crop the face region before encoding — handles off-angle and partial occlusion.
Embedding · FaceNet
InceptionResnetV1 on VGGFace2
Pretrained InceptionResnetV1 extracts a 512-dim face embedding. Runs under torch.no_grad(). Each user's embedding is stored as a .npy file.
Liveness · Anti-Spoof
CNN Ensemble Liveness Detection
Silent-Face-Anti-Spoofing crops face at multiple scales, runs each model, sums predictions. Defends against printed photos, screen replay, and 3D mask attacks.
Presence · MediaPipe
Iris Gaze Tracking
FaceMesh refine landmarks extract iris center (indices 469–477). If iris X position falls outside 0.25–0.75 normalized range, access is denied.
Matching · Top-K Cosine
Scored Ranking with Threshold
Computes cosine similarity against all enrolled users simultaneously. Picks best match above threshold 0.75. Logs all scores for observability.
Enrollment
One-Shot Web Registration
Browser webcam → base64 → FastAPI → MTCNN → FaceNet encode → save {name}.npy. SMB credentials encrypted with Fernet, bound to face profile.

What It Does

File Manager
Features

📁
Full File Management
Browse, upload, download, create folders, move and delete — web UI talking directly to SMB NAS over the internet.
🎬
Media Streaming
HTTP Range-based video/audio streaming. In-browser preview for images, PDF (pdf.js), code files, and HEIC photos converted on-the-fly.
🔗
Share Links
Permanent shareable links for any file or folder. Optional password, download toggle. Persistent across restarts via SQLite.
⏱️
Expiring View Links
24-hour view-only links that hide the real file token. Auto-expire server-side — no cleanup needed.
📦
Streaming ZIP Download
Entire folders streamed as ZIP on-the-fly via zipstream — zero temp files, minimal disk usage on server.
🌐
Zero-Framework Frontend
Entire UI is vanilla JS + HTML served from FastAPI. WebRTC camera, Canvas API for face capture — no build step, no dependencies.

System Design

Architecture

┌──────────────────────────────────────────────────────────────────────┐ BROWSER WebRTC camera · File UI · Share/View pages · pdf.js └──────────────────────────────┬───────────────────────────────────────┘ │ HTTP/REST · multipart · Range ┌──────────────────────────────▼───────────────────────────────────────┐ FASTAPI (Python) ┌───────────────────────────────────────┐ ┌─────────────────────┐ │ face_v3.py (CV core) │ │ Share / View API │ │ │ │ SQLite · Fernet │ │ MTCNN │ └─────────────────────┘ │ → GazeDetector (MediaPipe iris) │ │ → predict_liveness (CNN ensemble) │ ┌─────────────────────┐ │ → InceptionResnetV1 (512-d embed) │ │ SMB Session Mgr │ │ → cosine_similarity → auth token │ │ smbprotocol │ └───────────────────────────────────────┘ │ Range stream │ └──────────┬──────────┘ ┌────────────────────┐ │ embedded_face/ │ SMB 445 │ │ *.npy (512-dim) │ └────────────────────┘ └──────────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────┐ NAS / SMB Server AdminHome · NasStorage · sample (shares) └──────────────────────────────────────────────────────────────────────┘

Technology

Full Stack

FaceNet · InceptionResnetV1
512-d face embedding · pretrained VGGFace2
MTCNN (facenet_pytorch)
Multi-task CNN face detection & alignment
Silent-Face Anti-Spoofing
CNN ensemble liveness detection
MediaPipe FaceMesh
Iris landmark gaze tracking (refine mode)
PyTorch · OpenCV · NumPy
Inference runtime · image processing
FastAPI + Uvicorn
Async REST API server
smbprotocol
Pure-Python SMB2/3 client
SQLite
Share link & view link persistence
cryptography · Fernet · PBKDF2
Credential encryption at rest
zipstream · pillow-heif
Streaming ZIP · HEIC photo preview
WebRTC · Canvas API · pdf.js
Vanilla JS frontend — zero build step