CoolFace
Modelpublic

desert-ant-labs/shapes

sourceHugging Faceotherupdated 9h agoView on Hugging Face
4likes6.9kdownloads
Model Card

<!-- card-header:start (generated from manifest.json, edit below this block) -->

Shapes

Rough sketch. Perfect shape.

On-device single-stroke shape recognition.

  • SDKs, install and examples: https://github.com/Desert-Ant-Labs/desert-ant-core/blob/main/docs/models/shapes.md
  • Website: https://desertant.com/models/shapes/

<!-- card-header:end -->

Turn a rough circle drawing into a clean shape, with fitted vector geometry ready to snap to. Built for PencilKit-style "smart shapes": draw, pause, and the rough stroke becomes a crisp shape. The model is tiny (200KB Core ML, 1.3MB LiteRT) and runs in a few milliseconds on device.

✏️ ➜ ▭ · ✏️ ➜ △ · ✏️ ➜ ◯ · ✏️ ➜ ★

Try it

<!-- card-install:start (generated from manifest.json, edit below this block) --> | | | | --- | --- | | Platforms | iOS, macOS, tvOS, visionOS, Android, Linux, Windows, Browser, Node | | Weights | v0.3.0 |

Install

Swift (requirements)

swift
.package(url: "https://github.com/Desert-Ant-Labs/desert-ant-core.git", from: "3.3.0")

Then add the Shapes product to your target.

Kotlin (requirements)

kotlin
implementation("ai.desertant:shapes:3.3.0")

JavaScript (requirements)

bash
npm i @desert-ant-labs/shapes @litertjs/core   # browser
npm i @desert-ant-labs/shapes                  # Node, prebuilt native core

<!-- card-install:end -->

Files

FileFormatSizeContents
shapes.tfliteLiteRT / TFLite (fp32)1.3MBFixed [1,256,3] features + [1,256] mask window; runs on Android, Linux, Node, and the web (bundled by default in the Kotlin SDK; downloaded on demand by the JavaScript SDK)
shapes.mlmodelcCompiled Core ML200KB4-bit-palettized classifier, ready to load on Apple platforms (used by the Swift SDK)
shapes_meta.jsonJSONtinyclasses, preprocessing constants, model dims, and snap gates
shapes.safetensorssafetensors200KBPacked weights for SDK versions before the LiteRT migration (tag v0.1.0)

Inputs and outputs

  • Input: an ordered list of stroke points in canvas coordinates. Single stroke.
  • Output: a shape class plus fitted geometry, or nothing if the stroke is rejected.

Classes

line, rectangle, triangle, ellipse, star, plus none (the reject class: scribbles, partial shapes, and other non-shape strokes). Squares and circles are covered by rectangle and ellipse (snapped when near-regular).

Limitations

  • Single stroke only; multi-stroke shapes aren't recognized.
  • Tuned for deliberate shapes; very rough or ambiguous strokes are rejected by design.

<!-- card-footer:start (generated from manifest.json, edit above this block) -->

License

Desert Ant Labs Source-Available License. Free for most apps, and a commercial license is required at scale. Full terms are at the link. Licensing: <licensing@desertant.com>.

See `THIRD_PARTY_NOTICES.md`.

Citation

bibtex
@software{shapes_2026,
  title  = {Shapes: On-device single-stroke shape recognition},
  author = {Desert Ant Labs},
  year   = {2026},
  url    = {https://huggingface.co/desert-ant-labs/shapes},
}

© 2026 Desert Ant Labs · <https://desertant.com> <!-- card-footer:end -->