So I made a faster version using Rust and WASM, running entirely in browser. This cuts the classification time down to ~7ms - fast enough to run on every mouse move, giving you live predictions as you draw.
So I made a faster version using Rust and WASM, running entirely in browser. This cuts the classification time down to ~7ms - fast enough to run on every mouse move, giving you live predictions as you draw.
captures•1h ago
The features: - Stroke count - Point density across 6 horizontal and 6 vertical bands (where is the ink?) - Direction histogram across 8 compass directions (which way are strokes going?) - Aspect ratio and total stroke length - First stroke start position, last stroke end position
The training set is ~64k hand-drawn samples from the original Detexify project. Each sample gets preprocessed and converted to this 27D vector. Classification is then just finding the k nearest training samples by Euclidean distance and returning the most common symbols among them.