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.

demo: production-ready visual redesign (hero, chips, specs grid, gradient frame)

facexd239be4adc41
diff --git a/docs/demo/index.html b/docs/demo/index.html
index ae59d34..50a4123 100644
--- a/docs/demo/index.html
+++ b/docs/demo/index.html
@@ -6,71 +6,214 @@
<title>FaceX — 576-point face mesh (in-browser, encrypted)</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
- body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; background:#0a0a0a; color:#e0e0e0; }
- .wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
- h1 { color:#fff; font-size: 22px; margin-bottom: 4px; }
- h1 span { color:#10b981; }
- p.sub { color:#666; font-size: 13px; margin-bottom: 16px; }
- .status { padding: 8px 12px; font-size: 13px; border-radius: 6px; margin-bottom: 12px; }
- .status.loading { background:#1c1408; color:#f59e0b; }
- .status.ready { background:#052e16; color:#10b981; }
- .status.error { background:#1c0a0a; color:#ef4444; }
-
+ :root {
+ --bg: #07090b;
+ --bg-2: #0e1216;
+ --bg-3: #141a20;
+ --border: #1d242b;
+ --border-2: #2a333c;
+ --text: #d8dee5;
+ --text-dim: #6b7681;
+ --text-faint: #4a525b;
+ --green: #10b981;
+ --green-soft: rgba(16,185,129,0.10);
+ --green-glow: rgba(16,185,129,0.35);
+ --amber: #f59e0b;
+ --red: #ef4444;
+ }
+ html, body {
+ background: var(--bg);
+ color: var(--text);
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
+ -webkit-font-smoothing: antialiased;
+ min-height: 100%;
+ }
+ body {
+ background:
+ radial-gradient(1200px 600px at 50% -200px, rgba(16,185,129,0.06), transparent 60%),
+ radial-gradient(800px 400px at 100% 100%, rgba(99,102,241,0.04), transparent 60%),
+ var(--bg);
+ background-attachment: fixed;
+ }
+ .wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
+
+ /* ===== Hero ===== */
+ .hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
+ .hero img {
+ height: 64px; border-radius: 14px;
+ box-shadow: 0 0 36px var(--green-glow), 0 0 1px var(--border-2) inset;
+ }
+ .hero h1 {
+ font-size: 26px; font-weight: 700; color: #fff;
+ letter-spacing: -0.02em; line-height: 1.05;
+ }
+ .hero h1 span {
+ background: linear-gradient(90deg, #34d399, #10b981);
+ -webkit-background-clip: text; background-clip: text;
+ -webkit-text-fill-color: transparent;
+ }
+ .hero .tag {
+ color: var(--text-dim); font-size: 12px;
+ margin-top: 4px; letter-spacing: 0.04em; text-transform: uppercase;
+ }
+
+ /* ===== Pipeline badges ===== */
+ .pipeline {
+ display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 16px;
+ }
+ .chip {
+ padding: 5px 10px; border-radius: 999px; font-size: 11px;
+ background: var(--bg-2); border: 1px solid var(--border);
+ color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px;
+ font-family: ui-monospace, "SF Mono", Menlo, monospace;
+ }
+ .chip.ours { color: #34d399; border-color: rgba(16,185,129,0.30); background: rgba(16,185,129,0.05); }
+ .chip.apache { color: #a78bfa; border-color: rgba(167,139,250,0.30); background: rgba(167,139,250,0.05); }
+ .chip .num { color: var(--text); }
+ .chip .src { color: var(--text-faint); }
+
+ /* ===== Status ===== */
+ .status {
+ padding: 10px 14px; font-size: 13px; border-radius: 10px;
+ margin-bottom: 14px; border: 1px solid transparent;
+ font-family: ui-monospace, "SF Mono", Menlo, monospace;
+ }
+ .status.loading { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.20); color: var(--amber); }
+ .status.ready { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.25); color: var(--green); }
+ .status.error { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.25); color: var(--red); }
+
+ /* ===== Stage ===== */
+ .stage-wrap {
+ position: relative; padding: 1px;
+ background: linear-gradient(140deg, rgba(16,185,129,0.35), rgba(16,185,129,0.05) 40%, var(--border) 70%);
+ border-radius: 16px;
+ }
.stage {
- position: relative; width: 100%; max-width: 640px; margin: 0 auto;
- aspect-ratio: 4/3; background:#111; border: 2px solid #222;
- border-radius: 14px; overflow: hidden;
+ position: relative; width: 100%; aspect-ratio: 4/3;
+ background: #050608; border-radius: 15px; overflow: hidden;
}
- video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
- canvas.overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
+ video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
+ canvas.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
- #hud { position:absolute; top: 8px; left: 8px; display:flex; gap:6px; flex-wrap:wrap; pointer-events:none; }
+ #hud {
+ position: absolute; top: 10px; left: 10px;
+ display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none;
+ }
.hud-tag {
- background: rgba(0,0,0,0.7); color:#10b981;
- padding: 4px 10px; border-radius: 12px;
- font-family: monospace; font-size: 12px;
- }
-
- .controls { display: flex; gap: 8px; justify-content:center; flex-wrap: wrap; margin: 12px 0; }
- .btn { padding: 10px 18px; border: none; border-radius: 8px;
- font-size: 13px; font-weight: 600; cursor: pointer;
- background:#1a1a1a; color:#aaa; border: 1px solid #2a2a2a; }
- .btn.primary { background:#10b981; color:#fff; border-color:#059669; }
- .btn:disabled { opacity: 0.35; cursor: not-allowed; }
-
- .picker { display: flex; gap: 8px; justify-content:center; flex-wrap: wrap; margin: 8px 0 12px; }
- .pick { padding: 6px 12px; background:#111; border-radius: 8px;
- border: 1px solid #222; cursor: pointer; font-size: 13px; }
- .pick.active { border-color:#10b981; background:#052e16; }
-
- .info { margin-top: 16px; padding: 14px; background:#0d0d0d; border:1px solid #1a1a1a;
- border-radius: 10px; font-size: 12px; color:#777; line-height: 1.6; }
- .info code { background:#1a1a1a; padding:1px 6px; border-radius:3px; color:#10b981; }
+ background: rgba(7,9,11,0.78); backdrop-filter: blur(6px);
+ color: var(--green); padding: 5px 11px; border-radius: 999px;
+ font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px;
+ border: 1px solid rgba(255,255,255,0.06);
+ }
+
+ /* ===== Picker (mode pills) ===== */
+ .picker {
+ display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
+ margin: 16px 0;
+ }
+ .pick {
+ padding: 7px 14px; border-radius: 999px;
+ background: var(--bg-2); border: 1px solid var(--border);
+ color: var(--text-dim); cursor: pointer; font-size: 12px;
+ font-weight: 500; letter-spacing: 0.02em;
+ transition: all 0.18s ease;
+ }
+ .pick:hover { color: var(--text); border-color: var(--border-2); }
+ .pick.active {
+ background: rgba(16,185,129,0.12);
+ border-color: rgba(16,185,129,0.50);
+ color: #34d399;
+ box-shadow: 0 0 16px rgba(16,185,129,0.20);
+ }
+
+ /* ===== Buttons ===== */
+ .controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
+ .btn {
+ padding: 11px 22px; border-radius: 10px; border: 1px solid var(--border);
+ background: var(--bg-2); color: var(--text-dim);
+ font-size: 13px; font-weight: 600; cursor: pointer;
+ transition: all 0.15s ease;
+ }
+ .btn:hover { color: var(--text); border-color: var(--border-2); }
+ .btn.primary {
+ background: linear-gradient(180deg, #10b981, #059669);
+ color: #fff; border-color: #047857;
+ box-shadow: 0 6px 18px rgba(16,185,129,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
+ }
+ .btn.primary:hover { color: #fff; transform: translateY(-1px); }
+ .btn:disabled { opacity: 0.30; cursor: not-allowed; transform: none !important; }
+
+ /* ===== Info / footer ===== */
+ .info {
+ margin-top: 18px; padding: 16px 18px;
+ background: var(--bg-2); border: 1px solid var(--border);
+ border-radius: 12px; font-size: 12.5px; color: var(--text-dim); line-height: 1.65;
+ }
+ .info strong { color: var(--text); font-weight: 600; }
+ .info em { color: #34d399; font-style: normal; }
+ .info p + p { margin-top: 6px; }
+ .info code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #34d399; }
+
+ /* ===== Specs grid ===== */
+ .specs {
+ margin-top: 14px;
+ display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
+ gap: 8px;
+ }
+ .spec {
+ padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border);
+ border-radius: 10px;
+ }
+ .spec .v { font-size: 17px; color: #fff; font-weight: 700; letter-spacing: -0.01em; }
+ .spec .k { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
+
+ /* ===== Footer ===== */
+ .footer {
+ margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border);
+ color: var(--text-faint); font-size: 11.5px; text-align: center;
+ letter-spacing: 0.03em;
+ }
+ .footer a { color: #34d399; text-decoration: none; }
+ .footer a:hover { text-decoration: underline; }
+
+ @media (max-width: 520px) {
+ .hero h1 { font-size: 22px; }
+ .hero img { height: 52px; }
+ .wrap { padding: 20px 12px 32px; }
+ }
</style>
</head>
<body>
<div class="wrap">
- <div style="display:flex;align-items:center;gap:14px;margin-bottom:10px;">
- <img src="logo.jpg" alt="FaceX" height="56"
- style="box-shadow:0 0 24px rgba(16,185,129,0.25);">
+ <header class="hero">
+ <img src="logo.jpg" alt="FaceX">
<div>
- <h1 style="margin:0;line-height:1.1;">Face<span>X</span> — 576-point face mesh</h1>
- <p style="margin:2px 0 0;color:#666;font-size:12px;">Detect · Mesh · Recognize · Anti-spoof — all in your browser.</p>
+ <h1>Face<span>X</span> &mdash; 576-point face mesh</h1>
+ <div class="tag">Detect &middot; Mesh &middot; Recognize &middot; Anti-spoof &mdash; entirely in your browser</div>
</div>
+ </header>
+
+ <div class="pipeline">
+ <span class="chip ours">✦ ours <span class="num">401KB</span> <span class="src">detect</span></span>
+ <span class="chip ours">✦ ours <span class="num">1.1MB</span> <span class="src">98pt landmarks</span></span>
+ <span class="chip ours">✦ ours <span class="num">5.6MB</span> <span class="src">478pt 3D mesh</span></span>
+ <span class="chip ours">✦ ours <span class="num">1.8MB</span> <span class="src">recognition</span></span>
+ <span class="chip apache">Apache <span class="num">3.4MB</span> <span class="src">anti-spoof</span></span>
</div>
- <p class="sub">All-WASM pipeline: <strong>our</strong> face detector → 98 WFLW landmarks (drive the warp) + 478-point 3D mesh distilled from MediaPipe = <strong>576 points</strong> → 512-dim recognition → MiniFASNet anti-spoof. Weights are <strong>AES-256-GCM encrypted</strong>, decrypted in-browser; nothing leaves your device.</p>
<div id="status" class="status loading">Loading…</div>
- <div class="stage">
- <video id="video" autoplay playsinline muted></video>
- <canvas id="overlay" class="overlay"></canvas>
- <div id="hud"></div>
+ <div class="stage-wrap">
+ <div class="stage">
+ <video id="video" autoplay playsinline muted></video>
+ <canvas id="overlay" class="overlay"></canvas>
+ <div id="hud"></div>
+ </div>
</div>
<div class="picker" id="picker">
- <div class="pick active" data-mode="hybrid">hybrid</div>
+ <div class="pick active" data-mode="hybrid">hybrid mesh</div>
<div class="pick" data-mode="true3d">true 3D</div>
<div class="pick" data-mode="dense">tps</div>
<div class="pick" data-mode="scan">scan</div>
@@ -87,9 +230,22 @@
<button id="btnStop" class="btn" disabled>Stop</button>
</div>
+ <div class="specs">
+ <div class="spec"><div class="v">576</div><div class="k">mesh points</div></div>
+ <div class="spec"><div class="v">~17 MB</div><div class="k">encrypted weights</div></div>
+ <div class="spec"><div class="v">AES-256</div><div class="k">WebCrypto-GCM</div></div>
+ <div class="spec"><div class="v">0 servers</div><div class="k">frames stay local</div></div>
+ </div>
+
<div class="info">
<p><strong>Pipeline.</strong> Every frame: <em>our</em> face detector (FCOS-style, 100K params, trained from scratch on WIDER FACE) → 98-point WFLW landmark ConvNet → 478-point 3D mesh distilled from MediaPipe → 512-dim embedding (MobileFaceNet + ArcFace on MS1M, LFW 96.9%) → MiniFASNet anti-spoof ensemble.</p>
- <p><strong>All custom (except antispoof).</strong> Detector, landmarks, 3D mesh, recognition — trained from scratch. Only anti-spoof uses MinivisionAI's MiniFASNet under Apache 2.0. Every weight is AES-256-GCM encrypted on disk and decrypted in-browser via WebCrypto.</p>
+ <p><strong>All custom (except antispoof).</strong> Detector, landmarks, 3D mesh, recognition &mdash; trained from scratch. Only anti-spoof uses MinivisionAI's MiniFASNet under Apache 2.0. Every weight is AES-256-GCM encrypted on disk and decrypted in-browser via WebCrypto.</p>
+ </div>
+
+ <div class="footer">
+ <a href="https://github.com/facex-engine/facex" target="_blank">GitHub</a> &middot;
+ Apache 2.0 &middot;
+ Made by <a href="https://github.com/bauratynov" target="_blank">Baurzhan Atinov</a>
</div>
</div>
diff --git a/wasm/demo_mesh.html b/wasm/demo_mesh.html
index ae59d34..50a4123 100644
--- a/wasm/demo_mesh.html
+++ b/wasm/demo_mesh.html
@@ -6,71 +6,214 @@
<title>FaceX — 576-point face mesh (in-browser, encrypted)</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
- body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; background:#0a0a0a; color:#e0e0e0; }
- .wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
- h1 { color:#fff; font-size: 22px; margin-bottom: 4px; }
- h1 span { color:#10b981; }
- p.sub { color:#666; font-size: 13px; margin-bottom: 16px; }
- .status { padding: 8px 12px; font-size: 13px; border-radius: 6px; margin-bottom: 12px; }
- .status.loading { background:#1c1408; color:#f59e0b; }
- .status.ready { background:#052e16; color:#10b981; }
- .status.error { background:#1c0a0a; color:#ef4444; }
-
+ :root {
+ --bg: #07090b;
+ --bg-2: #0e1216;
+ --bg-3: #141a20;
+ --border: #1d242b;
+ --border-2: #2a333c;
+ --text: #d8dee5;
+ --text-dim: #6b7681;
+ --text-faint: #4a525b;
+ --green: #10b981;
+ --green-soft: rgba(16,185,129,0.10);
+ --green-glow: rgba(16,185,129,0.35);
+ --amber: #f59e0b;
+ --red: #ef4444;
+ }
+ html, body {
+ background: var(--bg);
+ color: var(--text);
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
+ -webkit-font-smoothing: antialiased;
+ min-height: 100%;
+ }
+ body {
+ background:
+ radial-gradient(1200px 600px at 50% -200px, rgba(16,185,129,0.06), transparent 60%),
+ radial-gradient(800px 400px at 100% 100%, rgba(99,102,241,0.04), transparent 60%),
+ var(--bg);
+ background-attachment: fixed;
+ }
+ .wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
+
+ /* ===== Hero ===== */
+ .hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
+ .hero img {
+ height: 64px; border-radius: 14px;
+ box-shadow: 0 0 36px var(--green-glow), 0 0 1px var(--border-2) inset;
+ }
+ .hero h1 {
+ font-size: 26px; font-weight: 700; color: #fff;
+ letter-spacing: -0.02em; line-height: 1.05;
+ }
+ .hero h1 span {
+ background: linear-gradient(90deg, #34d399, #10b981);
+ -webkit-background-clip: text; background-clip: text;
+ -webkit-text-fill-color: transparent;
+ }
+ .hero .tag {
+ color: var(--text-dim); font-size: 12px;
+ margin-top: 4px; letter-spacing: 0.04em; text-transform: uppercase;
+ }
+
+ /* ===== Pipeline badges ===== */
+ .pipeline {
+ display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 16px;
+ }
+ .chip {
+ padding: 5px 10px; border-radius: 999px; font-size: 11px;
+ background: var(--bg-2); border: 1px solid var(--border);
+ color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px;
+ font-family: ui-monospace, "SF Mono", Menlo, monospace;
+ }
+ .chip.ours { color: #34d399; border-color: rgba(16,185,129,0.30); background: rgba(16,185,129,0.05); }
+ .chip.apache { color: #a78bfa; border-color: rgba(167,139,250,0.30); background: rgba(167,139,250,0.05); }
+ .chip .num { color: var(--text); }
+ .chip .src { color: var(--text-faint); }
+
+ /* ===== Status ===== */
+ .status {
+ padding: 10px 14px; font-size: 13px; border-radius: 10px;
+ margin-bottom: 14px; border: 1px solid transparent;
+ font-family: ui-monospace, "SF Mono", Menlo, monospace;
+ }
+ .status.loading { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.20); color: var(--amber); }
+ .status.ready { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.25); color: var(--green); }
+ .status.error { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.25); color: var(--red); }
+
+ /* ===== Stage ===== */
+ .stage-wrap {
+ position: relative; padding: 1px;
+ background: linear-gradient(140deg, rgba(16,185,129,0.35), rgba(16,185,129,0.05) 40%, var(--border) 70%);
+ border-radius: 16px;
+ }
.stage {
- position: relative; width: 100%; max-width: 640px; margin: 0 auto;
- aspect-ratio: 4/3; background:#111; border: 2px solid #222;
- border-radius: 14px; overflow: hidden;
+ position: relative; width: 100%; aspect-ratio: 4/3;
+ background: #050608; border-radius: 15px; overflow: hidden;
}
- video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
- canvas.overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
+ video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
+ canvas.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
- #hud { position:absolute; top: 8px; left: 8px; display:flex; gap:6px; flex-wrap:wrap; pointer-events:none; }
+ #hud {
+ position: absolute; top: 10px; left: 10px;
+ display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none;
+ }
.hud-tag {
- background: rgba(0,0,0,0.7); color:#10b981;
- padding: 4px 10px; border-radius: 12px;
- font-family: monospace; font-size: 12px;
- }
-
- .controls { display: flex; gap: 8px; justify-content:center; flex-wrap: wrap; margin: 12px 0; }
- .btn { padding: 10px 18px; border: none; border-radius: 8px;
- font-size: 13px; font-weight: 600; cursor: pointer;
- background:#1a1a1a; color:#aaa; border: 1px solid #2a2a2a; }
- .btn.primary { background:#10b981; color:#fff; border-color:#059669; }
- .btn:disabled { opacity: 0.35; cursor: not-allowed; }
-
- .picker { display: flex; gap: 8px; justify-content:center; flex-wrap: wrap; margin: 8px 0 12px; }
- .pick { padding: 6px 12px; background:#111; border-radius: 8px;
- border: 1px solid #222; cursor: pointer; font-size: 13px; }
- .pick.active { border-color:#10b981; background:#052e16; }
-
- .info { margin-top: 16px; padding: 14px; background:#0d0d0d; border:1px solid #1a1a1a;
- border-radius: 10px; font-size: 12px; color:#777; line-height: 1.6; }
- .info code { background:#1a1a1a; padding:1px 6px; border-radius:3px; color:#10b981; }
+ background: rgba(7,9,11,0.78); backdrop-filter: blur(6px);
+ color: var(--green); padding: 5px 11px; border-radius: 999px;
+ font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px;
+ border: 1px solid rgba(255,255,255,0.06);
+ }
+
+ /* ===== Picker (mode pills) ===== */
+ .picker {
+ display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
+ margin: 16px 0;
+ }
+ .pick {
+ padding: 7px 14px; border-radius: 999px;
+ background: var(--bg-2); border: 1px solid var(--border);
+ color: var(--text-dim); cursor: pointer; font-size: 12px;
+ font-weight: 500; letter-spacing: 0.02em;
+ transition: all 0.18s ease;
+ }
+ .pick:hover { color: var(--text); border-color: var(--border-2); }
+ .pick.active {
+ background: rgba(16,185,129,0.12);
+ border-color: rgba(16,185,129,0.50);
+ color: #34d399;
+ box-shadow: 0 0 16px rgba(16,185,129,0.20);
+ }
+
+ /* ===== Buttons ===== */
+ .controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
+ .btn {
+ padding: 11px 22px; border-radius: 10px; border: 1px solid var(--border);
+ background: var(--bg-2); color: var(--text-dim);
+ font-size: 13px; font-weight: 600; cursor: pointer;
+ transition: all 0.15s ease;
+ }
+ .btn:hover { color: var(--text); border-color: var(--border-2); }
+ .btn.primary {
+ background: linear-gradient(180deg, #10b981, #059669);
+ color: #fff; border-color: #047857;
+ box-shadow: 0 6px 18px rgba(16,185,129,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
+ }
+ .btn.primary:hover { color: #fff; transform: translateY(-1px); }
+ .btn:disabled { opacity: 0.30; cursor: not-allowed; transform: none !important; }
+
+ /* ===== Info / footer ===== */
+ .info {
+ margin-top: 18px; padding: 16px 18px;
+ background: var(--bg-2); border: 1px solid var(--border);
+ border-radius: 12px; font-size: 12.5px; color: var(--text-dim); line-height: 1.65;
+ }
+ .info strong { color: var(--text); font-weight: 600; }
+ .info em { color: #34d399; font-style: normal; }
+ .info p + p { margin-top: 6px; }
+ .info code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #34d399; }
+
+ /* ===== Specs grid ===== */
+ .specs {
+ margin-top: 14px;
+ display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
+ gap: 8px;
+ }
+ .spec {
+ padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border);
+ border-radius: 10px;
+ }
+ .spec .v { font-size: 17px; color: #fff; font-weight: 700; letter-spacing: -0.01em; }
+ .spec .k { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
+
+ /* ===== Footer ===== */
+ .footer {
+ margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border);
+ color: var(--text-faint); font-size: 11.5px; text-align: center;
+ letter-spacing: 0.03em;
+ }
+ .footer a { color: #34d399; text-decoration: none; }
+ .footer a:hover { text-decoration: underline; }
+
+ @media (max-width: 520px) {
+ .hero h1 { font-size: 22px; }
+ .hero img { height: 52px; }
+ .wrap { padding: 20px 12px 32px; }
+ }
</style>
</head>
<body>
<div class="wrap">
- <div style="display:flex;align-items:center;gap:14px;margin-bottom:10px;">
- <img src="logo.jpg" alt="FaceX" height="56"
- style="box-shadow:0 0 24px rgba(16,185,129,0.25);">
+ <header class="hero">
+ <img src="logo.jpg" alt="FaceX">
<div>
- <h1 style="margin:0;line-height:1.1;">Face<span>X</span> — 576-point face mesh</h1>
- <p style="margin:2px 0 0;color:#666;font-size:12px;">Detect · Mesh · Recognize · Anti-spoof — all in your browser.</p>
+ <h1>Face<span>X</span> &mdash; 576-point face mesh</h1>
+ <div class="tag">Detect &middot; Mesh &middot; Recognize &middot; Anti-spoof &mdash; entirely in your browser</div>
</div>
+ </header>
+
+ <div class="pipeline">
+ <span class="chip ours">✦ ours <span class="num">401KB</span> <span class="src">detect</span></span>
+ <span class="chip ours">✦ ours <span class="num">1.1MB</span> <span class="src">98pt landmarks</span></span>
+ <span class="chip ours">✦ ours <span class="num">5.6MB</span> <span class="src">478pt 3D mesh</span></span>
+ <span class="chip ours">✦ ours <span class="num">1.8MB</span> <span class="src">recognition</span></span>
+ <span class="chip apache">Apache <span class="num">3.4MB</span> <span class="src">anti-spoof</span></span>
</div>
- <p class="sub">All-WASM pipeline: <strong>our</strong> face detector → 98 WFLW landmarks (drive the warp) + 478-point 3D mesh distilled from MediaPipe = <strong>576 points</strong> → 512-dim recognition → MiniFASNet anti-spoof. Weights are <strong>AES-256-GCM encrypted</strong>, decrypted in-browser; nothing leaves your device.</p>
<div id="status" class="status loading">Loading…</div>
- <div class="stage">
- <video id="video" autoplay playsinline muted></video>
- <canvas id="overlay" class="overlay"></canvas>
- <div id="hud"></div>
+ <div class="stage-wrap">
+ <div class="stage">
+ <video id="video" autoplay playsinline muted></video>
+ <canvas id="overlay" class="overlay"></canvas>
+ <div id="hud"></div>
+ </div>
</div>
<div class="picker" id="picker">
- <div class="pick active" data-mode="hybrid">hybrid</div>
+ <div class="pick active" data-mode="hybrid">hybrid mesh</div>
<div class="pick" data-mode="true3d">true 3D</div>
<div class="pick" data-mode="dense">tps</div>
<div class="pick" data-mode="scan">scan</div>
@@ -87,9 +230,22 @@
<button id="btnStop" class="btn" disabled>Stop</button>
</div>
+ <div class="specs">
+ <div class="spec"><div class="v">576</div><div class="k">mesh points</div></div>
+ <div class="spec"><div class="v">~17 MB</div><div class="k">encrypted weights</div></div>
+ <div class="spec"><div class="v">AES-256</div><div class="k">WebCrypto-GCM</div></div>
+ <div class="spec"><div class="v">0 servers</div><div class="k">frames stay local</div></div>
+ </div>
+
<div class="info">
<p><strong>Pipeline.</strong> Every frame: <em>our</em> face detector (FCOS-style, 100K params, trained from scratch on WIDER FACE) → 98-point WFLW landmark ConvNet → 478-point 3D mesh distilled from MediaPipe → 512-dim embedding (MobileFaceNet + ArcFace on MS1M, LFW 96.9%) → MiniFASNet anti-spoof ensemble.</p>
- <p><strong>All custom (except antispoof).</strong> Detector, landmarks, 3D mesh, recognition — trained from scratch. Only anti-spoof uses MinivisionAI's MiniFASNet under Apache 2.0. Every weight is AES-256-GCM encrypted on disk and decrypted in-browser via WebCrypto.</p>
+ <p><strong>All custom (except antispoof).</strong> Detector, landmarks, 3D mesh, recognition &mdash; trained from scratch. Only anti-spoof uses MinivisionAI's MiniFASNet under Apache 2.0. Every weight is AES-256-GCM encrypted on disk and decrypted in-browser via WebCrypto.</p>
+ </div>
+
+ <div class="footer">
+ <a href="https://github.com/facex-engine/facex" target="_blank">GitHub</a> &middot;
+ Apache 2.0 &middot;
+ Made by <a href="https://github.com/bauratynov" target="_blank">Baurzhan Atinov</a>
</div>
</div>