Shapes.
Formigenkänning på enheten som gör ett handritat streck till rektangel, ellips, triangel, stjärna eller linje på under 10 ms.
Demo
Grov skiss. Perfekt form.
Rita en grov cirkel och Shapes fäster den till en ren. Shapes passar in exakt vektorgeometri, fäster mot axlar, cirklar, kvadrater och 15-gradersrotationer, och avvisar klotter som inte är former.
På Apple lägger ett enda anrop till smart formfästning i Notes-stil på en PencilKit-yta, och live-förhandsvisningen finns kvar. Apples egen ”Snap to Shape” är ett privat API som appar från tredje part inte kan anropa; Shapes gör samma jobb på en rad.
Modellen är liten nog att levereras inuti appen, utan någon nedladdning. I webbläsaren körs Shapes via LiteRT.js.
Under 10 ms per penndrag.
Under 10 ms per penndrag, från en modell på 0,2 MB på Apple och 1,3 MB på Android och webben.
Interna mätningar. Core ML på Apple, LiteRT.js i webbläsaren och förbyggda nativa bibliotek i Node.
Smarta former i Notes-stil
Lägg till formfästning på en PencilKit-canvas med canvasView.enableShapeSnapping(). Live-förhandsvisning, ångra och gör om bevaras. Shapes fyller luckan efter Apples privata Snap to Shape-API.
Städa upp en frihandsskiss
Gör om grova streck till exakt geometri i ett diagram- eller whiteboardverktyg. Fungerar med streckdata från tldraw och Excalidraw.
Plattformsoberoende ritande
En igenkännare täcker iOS, Android och webben, så du skriver koden för formfästningen en enda gång.
Levereras i appen, inte som en nedladdning
På Apple är igenkännaren 0,2 MB och följer med inuti binären, och Android-paketet har den med som standard. I webbläsaren hämtar SDK:n 1,3 MB en gång och cachar det.
Inspiration
Idéer att bygga med Shapes. Kopiera en prompt till din kodningsagent och kör.
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.
Vad modellen gör
- Ett penndrag i taget, skickat som sina
[x, y]-punkter, från PencilKit, tldraw, Excalidraw eller din egen canvas. - Känner igen rektangel, ellips, triangel, stjärna och linje, och avvisar sådant som inte är former.
- Fäster mot axlar, cirklar, kvadrater och 15-gradersrotationer.
- PencilKit-formfästning i realtid via ett anrop:
canvasView.enableShapeSnapping(). - Körs via LiteRT.js i webbläsaren. Node använder förbyggda nativa bibliotek.
Kom igång
Lägg till formigenkänning i din iOS or macOS, Android or web-app med några rader kod. Shapes-dokumentation.
// 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: Formigenkänning med ett penndrag på enheten. 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: Formigenkänning med ett penndrag på enheten.
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: Formigenkänning med ett penndrag på enheten. 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.
Specifikationer
- Formklasser
- Rektangel, ellips, triangel, stjärna, linje
- Storlek på enheten
- 0,2 MB Core ML (Apple) och 1,3 MB LiteRT (Android, webben)
- Hastighet
- <10 ms
- Runtime på webben
- LiteRT.js i webbläsaren och nativa bibliotek i Node
Shapes läser ett penndrag i taget, så en form som ritas med två drag känns inte igen. Väldigt grova eller tvetydiga streck avvisas medvetet, så att ett klotter aldrig fäster mot en triangel.
Diagram med flera drag kräver att du grupperar strecken själv först.
Vanliga frågor
Vad är Shapes?
Formigenkänning på enheten som gör ett handritat streck till rektangel, ellips, triangel, stjärna eller linje på under 10 ms.
Körs Shapes lokalt på enheten?
Ja. Shapes körs på enheten, utan något serveranrop, så att data stannar hos användaren.
Vilka plattformar stöder Shapes?
Shapes levereras som en nativ SDK på enheten för Swift, Kotlin, JavaScript / TypeScript.
Vad kostar Shapes?
Varje modell är gratis upp till 100k månadsaktiva enheter per SDK. Obegränsad inferens per användare. Kontakta oss för anpassade licenser.
Hur träffsäker eller snabb är Shapes?
Under 10 ms per penndrag, från en modell på 0,2 MB på Apple och 1,3 MB på Android och webben.