Shapes.
Riconoscimento forme sul dispositivo che trasforma un tratto a mano libera in rettangolo, ellisse, triangolo, stella o linea in meno di 10 ms.
Demo
Schizzo grezzo. Forma perfetta.
Disegna un cerchio approssimativo e Shapes lo aggancia a uno pulito. Shapes ricava una geometria vettoriale precisa, si aggancia ad assi, cerchi, quadrati e rotazioni di 15 gradi, e scarta gli scarabocchi che non sono forme.
Su Apple una sola chiamata aggiunge a un canvas PencilKit l'aggancio alle forme intelligenti in stile Note, e l'anteprima in tempo reale resta. La funzione «Snap to Shape» di Apple è un'API privata che le app di terze parti non possono richiamare, quindi Shapes fa lo stesso lavoro in una riga.
Il modello è abbastanza piccolo da stare dentro l'app, senza download. Nel browser Shapes gira tramite LiteRT.js.
Meno di 10 ms per tratto.
Meno di 10 ms per tratto, da un modello da 0,2 MB su Apple e 1,3 MB su Android e sul web.
Misurazioni interne. Core ML su Apple, LiteRT.js nel browser, librerie native precompilate su Node.
Forme intelligenti in stile Note
Aggiungi l'aggancio alle forme a un canvas PencilKit con canvasView.enableShapeSnapping(). Anteprima in tempo reale, annulla e ripeti preservati, colmando la lacuna lasciata dall'API privata Snap to Shape di Apple.
Ripulisci un diagramma a mano libera
Trasforma i tratti approssimativi in geometrie precise dentro uno strumento per diagrammi o una lavagna. Funziona con i dati dei tratti di tldraw ed Excalidraw.
Disegno multipiattaforma
Un solo riconoscitore copre iOS, Android e il web, così il codice di aggancio lo scrivi una volta sola.
Dentro l'app, senza download
Su Apple il riconoscitore pesa 0,2 MB ed è incluso nel binario, e il pacchetto Android lo include per impostazione predefinita. Nel browser l'SDK scarica 1,3 MB una volta sola e li tiene in cache.
Ispirazione
Idee da costruire con Shapes. Copia un prompt nel tuo coding agent e parti.
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.
Cosa fa il modello
- Un tratto alla volta, passato come i suoi punti
[x, y], da PencilKit, tldraw, Excalidraw o il tuo canvas. - Riconosce rettangolo, ellisse, triangolo, stella e linea, e scarta ciò che non è una forma.
- Si aggancia ad assi, cerchi, quadrati e rotazioni di 15 gradi.
- Aggancio in tempo reale su PencilKit con una sola chiamata:
canvasView.enableShapeSnapping(). - Gira tramite LiteRT.js nel browser. Node usa librerie native precompilate.
Per iniziare
Aggiungi riconoscimento di forme alla tua app iOS or macOS, Android or web in poche righe di codice. Documentazione di Shapes.
// 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: riconoscimento di forme a tratto singolo on-device. 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: riconoscimento di forme a tratto singolo on-device.
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: riconoscimento di forme a tratto singolo on-device. 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.
Specifiche
- Classi di forme
- Rettangolo, ellisse, triangolo, stella, linea
- Dimensione sul dispositivo
- 0,2 MB Core ML (Apple); 1,3 MB LiteRT (Android, web)
- Velocità
- <10 ms
- Runtime web
- LiteRT.js nel browser, librerie native su Node
Shapes legge un tratto alla volta, quindi una forma disegnata con due gesti non viene riconosciuta. I segni molto grezzi o ambigui vengono scartati di proposito, così uno scarabocchio non diventa mai un triangolo.
Per i diagrammi a più tratti serve prima un tuo passaggio di raggruppamento.
FAQ
Cos'è Shapes?
Riconoscimento forme sul dispositivo che trasforma un tratto a mano libera in rettangolo, ellisse, triangolo, stella o linea in meno di 10 ms.
Shapes funziona sul dispositivo?
Sì. Shapes funziona sul dispositivo, senza chiamate a un server, quindi i dati restano con l'utente.
Quali piattaforme supporta Shapes?
Shapes è distribuito come SDK nativo on-device per Swift, Kotlin, JavaScript / TypeScript.
Quanto costa Shapes?
Ogni modello è gratuito fino a 100k dispositivi attivi mensili per SDK. Inferenza illimitata per utente. Contattaci per licenze personalizzate.
Quanto è preciso o veloce Shapes?
Meno di 10 ms per tratto, da un modello da 0,2 MB su Apple e 1,3 MB su Android e sul web.