Cloud GPU face acceleration (opt-in)
Smriti can offload face embedding to a free GPU notebook you own. Default behaviour is unchanged — local ONNX Runtime stays primary. The bridge is strictly additive and never required.
What it sends
Only 112×112 aligned face JPEG crops (~5 KB each, quality 85). No photos, no metadata, no telemetry. You control the endpoint URL.
Model must match
The notebook’s /health advertises which face-embedding model it has loaded.
Smriti refuses to send work when the bridge’s model differs from the one
configured in Settings — embeddings from different models live in incompatible
metric spaces, and mixing them would corrupt clustering.
Smriti uses AdaFace (adaface_ir101_webface12m) as its face recognizer.
The notebook downloads the same ONNX model as scripts/setup_assets.*; nothing
to change.
Setup paths
Kaggle (free, 30 hrs GPU/week, T4×2)
- Open kaggle.com, create an account (free).
- Create a new Notebook. Choose GPU T4×2 as the accelerator.
- Upload
notebooks/face_bridge.ipynbfrom the Smriti repo. - Sign up for ngrok (free). Copy your auth token from the dashboard.
- Paste your ngrok token in the notebook’s cell 5.
- Run all cells. The last cell prints a public URL — copy it.
Colab (free with limits / Pro $10/mo for A100)
- Open colab.research.google.com.
- File → Upload notebook →
notebooks/face_bridge.ipynb. - Runtime → Change runtime type → T4 GPU (or A100 on Pro).
- Set up ngrok as above (or use the cloudflared alternative commented out).
- Run all cells. Copy the printed URL.
Local LAN GPU server (no internet)
- Run
notebooks/face_bridge.ipynbon a local machine with a GPU. - Skip the tunnel cells. The server binds to
0.0.0.0:8000. - In Smriti Settings, enter
http://<lan-ip>:8000as the bridge URL.
How to connect Smriti
- Open Smriti → Settings → Cloud face acceleration (advanced).
- Toggle “Use a remote GPU for face embedding” on.
- Paste the bridge URL (e.g.
https://abc.ngrok.io). - Click Test connection → should show “✓ CUDAExecutionProvider @ XXms”.
- Run face detection. Embedding goes remote; detection stays local.
ngrok auth token (60-second setup)
- Sign up at ngrok.com (free, no credit card).
- Copy your authtoken from dashboard.ngrok.com/get-started/your-authtoken.
- Paste it in the notebook’s
ngrok.set_auth_token("YOUR_TOKEN_HERE")cell.
cloudflared alternative (no account needed)
The notebook includes a commented-out cloudflared section. It doesn’t need an account but requires fetching the binary and parsing the tunnel URL from its stdout.
Automatic fallback
If the bridge is unreachable or returns errors on 3 consecutive batches, Smriti falls back to local CPU embedding for the remainder of the job. The job completes normally — just slower.
Expected speed
| Library size | Local (i7-7567U) | T4 GPU | Speed-up |
|---|---|---|---|
| 10k photos (~30k faces) | ~5 min | ~30 s | 10× |
| 90k photos (~200k faces) | ~3 hrs | ~2.5 min | 70× |
Troubleshooting
Test connection says “Unreachable”
- Check that the notebook is still running. Colab/Kaggle sessions time out after 30–90 min of inactivity.
- Verify the ngrok URL hasn’t changed (free ngrok URLs rotate on restart).
Embedding is slow — still on CPU
- Check the Smriti logs (Help → Open logs folder). You should see either
“Remote GPU bridge at
unhealthy or wrong model” or “Remote bridge model mismatch” if the bridge failed. - The most common cause is a model mismatch — see the Model must match section above.
- Restart the notebook. Get a fresh ngrok URL. Update in Settings.
ngrok free plan limits
- 1 online tunnel at a time, 40 connections/min, 1 GB/month bandwidth. Face crops at 5 KB each × 200k faces = ~1 GB. For a 90k-photo library, this fits within the free plan but is near the limit.
- If you hit the limit, use cloudflared (no limits) or Colab Pro ($10/mo).
Privacy notes
- Smriti sends only 112×112 face crops, not the original photos.
- No metadata (location, filenames, EXIF) is sent.
- No telemetry or analytics from Smriti itself.
- The bridge URL is set by you; Smriti never phones home.
- The notebook runs on your Kaggle/Colab account, not a shared service.
Cost
All paths are free or nominal:
- Kaggle: Free (30 hrs/week GPU quota, resets weekly)
- Colab free: Free (limits apply; sessions may throttle)
- Colab Pro: $10/mo (A100 GPU, unmetered)
- ngrok: Free (1 online tunnel, 1 GB/month)
- cloudflared: Free (no account needed)