yishou 一手 - Counting to ten on one hand

A small model that reads the ten Chinese number gestures from a webcam, entirely in the browser.

01// problem

The problem

In China, one hand counts to ten, and each number from 6 to 10 has its own shape. Counting raised fingers is not enough to read them. The French 2, thumb and index, is the Chinese 8, so the model has to learn what a shape means.

I also wanted to see how far a small, home-made dataset could go.

02// approach

The approach

MediaPipe finds 21 landmarks on the hand. They are normalised for position, scale, rotation and left or right hand, which leaves 63 numbers that only describe the shape.

A small PyTorch network of about 17,000 weights maps them to 13 classes, the ten numbers, "none" and two Easter eggs. Because it never sees pixels, it trains in seconds on a CPU and does not depend on lighting or background.

The model is exported to plain JavaScript, so it runs on the visitor's device and no image leaves it. Predictions are averaged over several frames so the number does not flicker.

03// results

The results

The model reads more than 97% of the validation frames correctly. These frames come from recordings held out whole, so near-identical images do not inflate the score.

The code is open source with tests and CI, and the model is published on Hugging Face.

04// limits

The limits

All the data was recorded on my own hand with one webcam, so accuracy is lower on other hands, cameras and lighting. Going to production would take many more hands.

Most misses come from shapes where fingers fold, cross or bunch together, such as 9 and 10, where the landmarks are least reliable.

05// stack

The stack

  • Python
  • Computer vision
  • MediaPipe
  • PyTorch
  • Hugging Face
  • JavaScript
  • Docker
// contact

Contact

If you'd like to discuss a role, request a demo, or ask about my projects, feel free to reach out.

I'm looking for a hands-on senior AI/ML engineer or AI tech lead role, in Lyon or remote. I'm also happy to talk about AI projects, consulting, or leading an AI team.