Shapes.
Formerkennung auf dem Gerät, die einen handgezeichneten Strich in Rechteck, Ellipse, Dreieck, Stern oder Linie verwandelt, in unter 10 ms.
Demo
Grobe Skizze. Perfekte Form.
Zeichnen Sie einen groben Kreis, und Shapes lässt ihn zu einem sauberen einrasten. Shapes legt präzise Vektorgeometrie an, rastet an Achsen, Kreisen, Quadraten und 15-Grad-Drehungen ein und weist Gekritzel ab, das keine Form ist.
Auf Apple ergänzt ein einziger Aufruf eine PencilKit-Zeichenfläche um Smart-Shape-Einrasten im Stil von Notizen, und die Live-Vorschau bleibt erhalten. Apples eigenes „Snap to Shape“ ist eine private API, die Apps von Drittanbietern nicht aufrufen können; Shapes erledigt dasselbe in einer Zeile.
Das Modell ist klein genug, um in der App ausgeliefert zu werden, ohne Download. Im Browser läuft Shapes über LiteRT.js.
Unter 10 ms pro Strich.
Unter 10 ms pro Strich, aus einem 0,2 MB großen Modell auf Apple und 1,3 MB auf Android und im Web.
Interne Messungen. Core ML auf Apple, LiteRT.js im Browser, vorgebaute native Bibliotheken in Node.
Smart Shapes im Stil von Notizen
Fügen Sie einer PencilKit-Zeichenfläche mit canvasView.enableShapeSnapping() Einrasten auf Formen hinzu. Live-Vorschau, Rückgängig und Wiederholen bleiben erhalten und schließen die Lücke, die Apples private Snap-to-Shape-API hinterlässt.
Eine Freihandskizze in Form bringen
Machen Sie aus groben Strichen präzise Geometrie, in einem Diagramm- oder Whiteboard-Tool. Funktioniert mit Strichdaten von tldraw und Excalidraw.
Plattformübergreifendes Zeichnen
Ein Erkenner deckt iOS, Android und das Web ab, Sie schreiben den Einrast-Code also nur einmal.
In der App ausliefern, nicht als Download
Auf Apple ist der Erkenner 0,2 MB groß und steckt in der Binärdatei, und das Android-Paket bündelt ihn standardmäßig. Im Browser lädt das SDK einmal 1,3 MB und legt sie im Cache ab.
Inspiration
Ideen zum Bauen mit Shapes. Kopieren Sie einen Prompt in Ihren Coding-Agenten und los.
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.
Was das Modell macht
- Ein Strich nach dem anderen, übergeben als seine
[x, y]-Punkte, aus PencilKit, tldraw, Excalidraw oder Ihrem eigenen Canvas. - Erkennt Rechteck, Ellipse, Dreieck, Stern und Linie und weist Nicht-Formen ab.
- Rastet an Achsen, Kreisen, Quadraten und 15-Grad-Drehungen ein.
- Live-Einrasten in PencilKit über einen Aufruf:
canvasView.enableShapeSnapping(). - Läuft im Browser über LiteRT.js. Node nutzt vorkompilierte native Bibliotheken.
Erste Schritte
Fügen Sie formerkennung mit wenigen Zeilen Code zu Ihrer iOS or macOS, Android or web-App hinzu. 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: Einstrich-Formerkennung auf dem Gerät. 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: Einstrich-Formerkennung auf dem Gerät.
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: Einstrich-Formerkennung auf dem Gerät. 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.
Technische Daten
- Formklassen
- Rechteck, Ellipse, Dreieck, Stern, Linie
- Größe auf dem Gerät
- 0,2 MB Core ML (Apple); 1,3 MB LiteRT (Android, Web)
- Geschwindigkeit
- < 10 ms
- Web-Laufzeit
- LiteRT.js im Browser, native Bibliotheken in Node
Shapes liest immer nur einen Strich, eine in zwei Zügen gezeichnete Form wird also nicht erkannt. Sehr grobe oder mehrdeutige Striche verwirft das Modell mit Absicht, damit aus einem Gekritzel nie ein Dreieck wird.
Für Diagramme aus mehreren Strichen brauchen Sie zuerst einen eigenen Schritt, der sie gruppiert.
FAQ
Was ist Shapes?
Formerkennung auf dem Gerät, die einen handgezeichneten Strich in Rechteck, Ellipse, Dreieck, Stern oder Linie verwandelt, in unter 10 ms.
Läuft Shapes auf dem Gerät?
Ja. Shapes läuft auf dem Gerät, ohne Serveraufruf, sodass die Daten beim Nutzer bleiben.
Welche Plattformen unterstützt Shapes?
Shapes wird als natives On-Device-SDK für Swift, Kotlin, JavaScript / TypeScript ausgeliefert.
Was kostet Shapes?
Jedes Modell ist kostenlos für bis zu 100k monatlich aktive Geräte pro SDK. Unbegrenzte Inferenz pro Nutzer. Kontaktieren Sie uns für individuelle Lizenzen.
Wie genau oder schnell ist Shapes?
Unter 10 ms pro Strich, aus einem 0,2 MB großen Modell auf Apple und 1,3 MB auf Android und im Web.