All models
VISION / DRAWN-SHAPE RECOGNITION

Glyph

A rough sketch. A familiar shape.

Draw a circle, square, triangle, or line. A tiny local classifier finds the closest shape.

Artifact size12.4 KB
RunsLocally
Output classes4
Release stageResearch
01 / WHAT IT DOES

One focused task.
A closer look.

Glyph maps an ordered pen stroke to a circle, square, triangle, or line. It compares a normalized drawing with four learned class averages. The input is a sequence of points, not an image or photograph.

CircleSquareTriangleLine

Research v0.1.0 · A statistical classifier, not a generative foundation model.

  1. 01

    Normalize the stroke

    Center the drawing and scale its longest dimension into a 16 × 16 grid.

  2. 02

    Build an occupancy grid

    Interpolate the stroke and mark nearby cells, producing 256 features.

  3. 03

    Find the nearest class

    Compare squared distances to the four learned centroids and return ranked scores.

02 / TRY IT HERE

Get a feel for Glyph.

Actual model inference, inside your browser.
No input is uploaded.

DRAW ONE SHAPE

Draw an upright shape in one stroke, or choose an example.

MODEL OUTPUT

Ready when
you are.

Scores are relative model outputs, not calibrated confidence.

Know the boundaries. Trained on procedural, mostly upright strokes. This recognizes four drawn shapes, not photographs. Rotation, incomplete strokes, and complex drawings can reduce accuracy.
03 / IDEAS TO EXPLORE

What could you make?

Starting points for prototypes.
Validate the model for your use case.

01

Prototype a sketch-to-shape drawing tool.

Prototype a drawing tool that suggests a clean geometric shape after a pen stroke.

Build with Glyph
02

Create an interactive geometry lesson.

Build an interactive geometry lesson using the four supported shapes.

Build with Glyph
03

Explore on-device stroke recognition.

Explore the effects of rotation, noise, and incomplete strokes on a simple classifier.

Build with Glyph
04 / DATA, WITH CONTEXT

What went into Glyph.

Read the model card

Where the examples came from

Procedural circles, squares, triangles, and lines. Each example adds small coordinate noise, slight rotation (about ±7°), and horizontal stretching. No human drawings, images, or photo datasets are included.

How the split works

120 generated strokes per class train the centroids. Another 30 per class use different random seeds. Both sets contain the same four geometric recipes.

No third-party model weights, external datasets, or user inputs were used to train this version. Training records are kept private. We publish weights, model cards, aggregate results, and the limitations of each release.

TRAINING SUMMARY

Nearest class centroid · 16 × 16 stroke occupancy

Weights you can inspect.

Each release includes its model card, measured artifact size, and SHA-256 checksum. Training data and working checkpoints stay private.

Download model card
05 / GETTING STARTED

Build with Glyph.

Full SDK guide

Use the local workspace packages today. These packages have not been published to npm or Maven Central.

Node.js / TypeScript

Run from the repository root, then import the model from a workspace example.

bun install
bun run sdk:build

Kotlin / JVM

With JDK 17+ and Gradle 8.10+, publish the modules to your local Maven repository.

gradle test
gradle publishToMavenLocal
Local Gradle dependency
repositories {
    mavenLocal()
    mavenCentral()
}
dependencies {
    implementation("dev.embermote:glyph:0.1.0")
}

Kotlin/JVM tests pass. Android device validation, Swift, and native Core ML/LiteRT adapters are not available.

import { createModel } from '@embermote/glyph';
import { shapeFeatures } from '@embermote/core';

const model = createModel();
// One continuous square stroke.
const input = shapeFeatures([
  [0, 0], [100, 0], [100, 100], [0, 100], [0, 0],
]);

const result = model.predict(input);
console.log(result.label);
// Scores are not calibrated confidence.
Local artifact → local inferenceNo API key.
06 / SPECIFICATIONS

Specs.

Model
Nearest class centroid · 16 × 16 stroke occupancy
Input
One ordered stroke of 2–20,000 finite [x, y] points. Separate strokes would be connected.
Output
A label, ranked scores, and a supported flag. Scores are uncalibrated; supported is not a guarantee that the input is in distribution.
Classes
Circle, Square, Triangle, Line
On-device size
12.4 KB · downloadable JSON weights · v0.1.0
Size includes
Labels, vocabulary or numeric statistics, and learned weights. Excludes SDK code, application assets, download compression, and runtime memory.
Platforms
Browser and Node.js via TypeScript runtime; Kotlin/JVM via bundled resources.
License
MIT for the original code and research artifacts.
Status
Research baseline · not published to package registries
SHA-256
0330b3fd31a02270d85143dee2b08831080bc874ec9bcc9116f4ca2e0e452838
07 / GOOD QUESTIONS

A little more clarity.

Can it recognize objects in photos?

No. Glyph accepts stroke coordinates and recognizes only four shape classes. It does not accept image pixels, detect objects, or perform general computer vision.

Does my input leave the device?

Inference runs locally. The website and artifact download make ordinary network requests, but the demos do not upload your input. Bundled SDK inference does not need an inference server.

Why is the model so small?

Glyph stores a compact statistical representation for a narrow task. Its 12.4 KB artifact is not equivalent to a neural model of a different size, and the file size is not its total runtime memory.

Is the model ready to ship in my product?

This is a research baseline. Independent evaluation, task-specific acceptance criteria, real-device measurements, and release packaging remain necessary before production use.

KEEP EXPLORING

The open notebook.

Inspect the pieces behind this model.