Skip to content

armgit / facex

Public Imported from GitHub
0

Full face stack that runs entirely in the browser. Detection, 576-point 3D mesh, recognition, anti-spoof, smile — all WebAssembly, zero server. Apache 2.0.

Fix mobile speed: detect at 96px first (~500ms on iPhone), fallback to 160px

atynov9140f0d40313
diff --git a/docs/demo/index.html b/docs/demo/index.html
index 7f216ba..afb5f48 100644
--- a/docs/demo/index.html
+++ b/docs/demo/index.html
@@ -342,12 +342,12 @@ $('btnCapture').onclick = () => {
setTimeout(() => { doCapture(); }, 50);
};
function doCapture() {
- // Try 160 first (fast), fall back to 320 if no face found
- let { faces, detMs } = runDetect(160);
+ // Try 96 first (fast on mobile), fall back to 160 if no face
+ let { faces, detMs } = runDetect(96);
if (!faces.length) {
$('resultBar').textContent = 'Retrying at higher resolution...';
- const r2 = runDetect(320);
- faces = r2.faces; detMs = r2.detMs;
+ const r2 = runDetect(160);
+ faces = r2.faces; detMs += r2.detMs;
}
$('btnCapture').disabled = false;
$('btnCapture').textContent = 'Set Reference';