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.
npm i @desert-ant-labs/shapes @litertjs/core # browser
npm i @desert-ant-labs/shapes # Node, prebuilt native core
Files
File
Format
Size
Contents
shapes.tflite
LiteRT / TFLite (fp32)
1.3MB
Fixed
[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.mlmodelc
Compiled Core ML
200KB
4-bit-palettized classifier, ready to load on Apple platforms (used by the Swift SDK)
shapes_meta.json
JSON
tiny
classes, preprocessing constants, model dims, and snap gates
shapes.safetensors
safetensors
200KB
Packed 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.
shapes huggingface.co is an AI model on huggingface.co that provides shapes's model effect (), which can be used instantly with this desert-ant-labs shapes model. huggingface.co supports a free trial of the shapes model, and also provides paid use of the shapes. Support call shapes model through api, including Node.js, Python, http.
shapes huggingface.co is an online trial and call api platform, which integrates shapes's modeling effects, including api services, and provides a free online trial of shapes, you can try shapes online for free by clicking the link below.
desert-ant-labs shapes online free url in huggingface.co:
shapes is an open source model from GitHub that offers a free installation service, and any user can find shapes on GitHub to install. At the same time, huggingface.co provides the effect of shapes install, users can directly use shapes installed effect in huggingface.co for debugging and trial. It also supports api for free installation.