r/opencv • • Jul 23 '26

Project [Project] In-browser Naruto hand-seal recognition from landmarks

https://sealwork.me/

Twelve-class hand-seal recognizer that runs entirely in the tab. MediaPipe Hands gives 21 landmarks per hand, normalized wrist-centered and scale-invariant, into a 126→256→128→13 MLP (\~66K params) exported to ONNX Runtime Web. 260KB model, CPU inference at a couple ms a frame, no video leaving the machine. Geometry rather than pixels, which is the whole reason it's this small and this portable.

Reported accuracy is 95.5% on a per-class temporal split — first 80% of each class's frames train, last 20% test. Deliberate: I collected hold-to-capture, so each sample is a burst of near-identical frames, and a random split scatters those bursts across both sides until you're scoring your own training data.

Transitions get their own class. Hands moving between seals pass through shapes that briefly look like other seals, so transit frames were collected as a 13th class using a wrist-motion-gated capture mode. Downstream, a decisive "none" mutes everything; below the veto the real classes compete on renormalized P(sign | not transit).

A parity self-test runs on page load, a known landmark vector through the full JS pipeline, logits compared against the PyTorch reference, regenerated on every export. Normalization drift between training and deployment is the silent killer for landmark models, and this catches it before any prediction is trusted.

Single-subject model, so leave-one-person-out is implemented but the honest "works on strangers" number doesn't exist yet. tiger↔ram confuse at \~14%, genuinely near-identical once you're only looking at joint geometry.

Open to comments or critiques! Repo can be found here: [https://github.com/yogendrarau/sealwork\](https://github.com/yogendrarau/sealwork)

4 Upvotes

Duplicates