Shapes.
Vormherkenning op het apparaat die één handgetekende haal omzet in een rechthoek, ellips, driehoek, ster of lijn, in minder dan 10 ms.
Demo
Ruwe schets. Perfecte vorm.
Teken een ruwe cirkel en Shapes klikt hem vast op een strakke. Shapes past precieze vectorgeometrie toe, klikt vast op assen, cirkels, vierkanten en rotaties van 15 graden, en wijst krabbels af die geen vorm zijn.
Op Apple voegt één aanroep slim vastklikken van vormen zoals in Notities toe aan een PencilKit-canvas, en de live preview blijft gewoon staan. “Snap to Shape” van Apple zelf is private API die apps van derden niet kunnen aanroepen; Shapes doet hetzelfde werk in één regel.
Het model is klein genoeg om mee te leveren in de app, zonder download. In de browser draait Shapes via LiteRT.js.
Minder dan 10 ms per haal.
Minder dan 10 ms per haal, uit een model van 0,2 MB op Apple en 1,3 MB op Android en web.
Interne metingen. Core ML op Apple, LiteRT.js in de browser, voorgebouwde native libraries op Node.
Slimme vormen zoals in Notities
Voeg snap-to-shape toe aan een PencilKit-canvas met canvasView.enableShapeSnapping(). Live preview, undo en redo blijven behouden, en daarmee vul je het gat dat de private Snap to Shape-API van Apple openlaat.
Een diagram uit de losse hand opschonen
Zet in een diagram- of whiteboardtool ruwe halen om in precieze geometrie. Werkt met de haaldata van tldraw en Excalidraw.
Cross-platform tekenen
Eén herkenner dekt iOS, Android en web, dus je schrijft de code voor het vastklikken maar één keer.
Meegeleverd in de app, geen download
Op Apple is de herkenner 0,2 MB en zit hij in de binary, en het Android-pakket levert hem standaard mee. In de browser haalt de SDK eenmalig 1,3 MB op en bewaart die in de cache.
Inspiratie
Ideeën om te bouwen met Shapes. Kopieer een prompt naar je coding-agent en ga.
Build a whiteboard that snaps rough sketches into clean shapes.
Build a drawing canvas where a freehand stroke is passed to Desert Ant's Shapes on-device and snapped to a clean rectangle, ellipse, triangle, star, or line in under 10ms. Keep the ink as an undo. Works offline. Build it with the Desert Ant SDK. Shapes (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/shapes/. Install: SwiftPM desert-ant-core; Maven ai.desertant:shapes:3.1.0; npm i @desert-ant-labs/shapes @litertjs/core. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Clean up a freehand diagram into crisp shapes.
In a diagramming tool, run Desert Ant's Shapes on each stroke to convert rough sketches into clean geometry as the user draws. Build it with the Desert Ant SDK. Shapes (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/shapes/. Install: SwiftPM desert-ant-core; Maven ai.desertant:shapes:3.1.0; npm i @desert-ant-labs/shapes @litertjs/core. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Add shape recognition to a web canvas with no download.
Add Desert Ant's Shapes to a browser drawing app (WebAssembly), so a hand-drawn stroke snaps to a clean shape with nothing to download and no server. Build it with the Desert Ant SDK. Shapes (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/shapes/. Install: SwiftPM desert-ant-core; Maven ai.desertant:shapes:3.1.0; npm i @desert-ant-labs/shapes @litertjs/core. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Snap flowchart boxes and connector lines as you sketch them.
In a diagram or flowchart tool, run Desert Ant's Shapes on each stroke so hand-drawn boxes and connector lines snap to clean geometry live. (Add your own arrowheads on a recognized line.) Build it with the Desert Ant SDK. Shapes (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/shapes/. Install: SwiftPM desert-ant-core; Maven ai.desertant:shapes:3.1.0; npm i @desert-ant-labs/shapes @litertjs/core. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Add smart-shape drawing to a kids' learning app.
Use Desert Ant's Shapes on-device so a child's rough drawing of a circle or triangle snaps to a clean shape, teaching by doing. Works offline. Build it with the Desert Ant SDK. Shapes (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/shapes/. Install: SwiftPM desert-ant-core; Maven ai.desertant:shapes:3.1.0; npm i @desert-ant-labs/shapes @litertjs/core. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Recognize gesture shapes to trigger app actions.
Use Desert Ant's Shapes to turn a drawn gesture (a circle, a triangle) into an app action, recognized on-device in under 10ms. Build it with the Desert Ant SDK. Shapes (Swift, Kotlin, JavaScript / TypeScript). Install and API: https://desertant.com/docs/shapes/. Install: SwiftPM desert-ant-core; Maven ai.desertant:shapes:3.1.0; npm i @desert-ant-labs/shapes @litertjs/core. SDK source: https://github.com/Desert-Ant-Labs/desert-ant-core. Machine-readable catalog of every model and SDK: https://desertant.com/llms.txt.
Wat het model doet
- Eén haal tegelijk, doorgegeven als zijn
[x, y]-punten, vanuit PencilKit, tldraw, Excalidraw of je eigen canvas. - Herkent rechthoek, ellips, driehoek, ster en lijn, en wijst niet-vormen af.
- Klikt vast op assen, cirkels, vierkanten en rotaties van 15 graden.
- Live vastklikken in PencilKit via één aanroep:
canvasView.enableShapeSnapping(). - Draait via LiteRT.js in de browser. Node gebruikt vooraf gebouwde native libraries.
Aan de slag
Voeg vormherkenning toe aan je iOS or macOS, Android or web-app in een paar regels code. Shapes docs.
// Swift Package Manager
.package(url: "https://github.com/Desert-Ant-Labs/desert-ant-core", from: "3.1.0")
// target dependency
.product(name: "Shapes", package: "desert-ant-core")
import Shapes
let shapes = Shapes()
let shape = try await shapes.recognize(points: stroke)
// Shape? -> rectangle, ellipse, triangle, star, line
import PencilKit
import Shapes
// Live smart-shape snapping on a PencilKit canvas, in one line.
// Pause after a stroke to preview the fit, lift to snap. Undo-safe,
// and it uses the same recognizer, bundled by default.
canvasView.enableShapeSnapping()
Add Shapes from Desert Ant Labs to this Swift project (iOS, macOS). What it does: on-device vormherkenning met één haal. SDK: Swift (iOS, macOS) Repo: https://github.com/Desert-Ant-Labs/desert-ant-core#readme // Swift Package Manager .package(url: "https://github.com/Desert-Ant-Labs/desert-ant-core", from: "3.1.0") // target dependency .product(name: "Shapes", package: "desert-ant-core") Reference: - Model page: https://desertant.com/models/shapes/ - Full catalog and other models: https://desertant.com/llms.txt Add the SDK, then follow its README for the exact API and current version. Do not invent API names or method signatures; confirm them against the README.
// build.gradle.kts (Maven Central)
implementation("ai.desertant:shapes:3.1.0")
import ai.desertant.shapes.Shapes
val shapes = Shapes(context)
val shape = shapes.recognize(points)
// Shape? -> rectangle, ellipse, triangle, star, line
Add Shapes from Desert Ant Labs to this Kotlin project (Android).
What it does: on-device vormherkenning met één haal.
SDK:
Kotlin (Android)
Repo: https://github.com/Desert-Ant-Labs/desert-ant-core#readme
// build.gradle.kts (Maven Central)
implementation("ai.desertant:shapes:3.1.0")
Reference:
- Model page: https://desertant.com/models/shapes/
- Full catalog and other models: https://desertant.com/llms.txt
Add the SDK, then follow its README for the exact API and current version. Do not invent API names or method signatures; confirm them against the README.
npm i @desert-ant-labs/shapes @litertjs/core
import { Shapes } from "@desert-ant-labs/shapes"; // browser
// import { Shapes } from "@desert-ant-labs/shapes/native"; // server-side Node
const shapes = await Shapes.load();
const shape = await shapes.recognize(points);
// { kind: "ellipse", center: {...}, ... } or null
Add Shapes from Desert Ant Labs to this JavaScript / TypeScript project (Web, Node.js). What it does: on-device vormherkenning met één haal. SDK: JavaScript / TypeScript (Web, Node.js) Repo: https://github.com/Desert-Ant-Labs/desert-ant-core#readme npm i @desert-ant-labs/shapes @litertjs/core Reference: - Model page: https://desertant.com/models/shapes/ - Full catalog and other models: https://desertant.com/llms.txt Add the SDK, then follow its README for the exact API and current version. Do not invent API names or method signatures; confirm them against the README.
Specs
- Vormklassen
- Rechthoek, ellips, driehoek, ster, lijn
- Grootte op het apparaat
- 0,2 MB Core ML (Apple); 1,3 MB LiteRT (Android, web)
- Snelheid
- <10 ms
- Web-runtime
- LiteRT.js in de browser, native libraries op Node
Shapes leest één haal per keer, dus een vorm die je in twee halen tekent, wordt niet herkend. Heel ruwe of dubbelzinnige halen worden bewust geweigerd, zodat een krabbel nooit vastklikt op een driehoek.
Voor diagrammen met meerdere halen moet je zelf eerst groeperen.
FAQ
Wat is Shapes?
Vormherkenning op het apparaat die één handgetekende haal omzet in een rechthoek, ellips, driehoek, ster of lijn, in minder dan 10 ms.
Draait Shapes op het apparaat?
Ja. Shapes draait op het apparaat, zonder serveraanroep, dus de data blijft bij de gebruiker.
Welke platforms ondersteunt Shapes?
Shapes wordt geleverd als een native on-device SDK voor Swift, Kotlin, JavaScript / TypeScript.
Hoeveel kost Shapes?
Elk model is gratis voor maximaal 100k maandelijks actieve apparaten per SDK. Onbeperkte inference per gebruiker. Neem contact op voor aangepaste licenties.
Hoe nauwkeurig of snel is Shapes?
Minder dan 10 ms per haal, uit een model van 0,2 MB op Apple en 1,3 MB op Android en web.