runntime 0.0.1-alpha.0 → 0.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,671 @@
1
+ import { n as initRunntime, t as Yolo26Variant } from "../config-UyxIidZc.mjs";
2
+ //#region src/core/weights/cache.d.ts
3
+ /** Platform-neutral weight-cache contract: the loaders accept any
4
+ * implementation (web: OPFS via zoo's createOpfsCache; React Native:
5
+ * expo-file-system in apps/mobile). Values must be non-empty — zero-byte
6
+ * entries are treated as misses (crash artifacts of interrupted writes). */
7
+ interface WeightCache {
8
+ get(key: string): Promise<ArrayBuffer | undefined>;
9
+ getOrCompute(key: string, compute: () => Promise<ArrayBufferView>): Promise<ArrayBuffer>;
10
+ /** Drop every entry whose key starts with `prefix`. One file's entries
11
+ * share a key prefix (cachedRangeSource writes `st/<fileId>/<range>` per
12
+ * tensor), so evicting a bad download means dropping a prefix, not a
13
+ * single key. Callers recovering from one corrupt file MUST use this —
14
+ * clear() throws away every other model the app has cached. */
15
+ deletePrefix(prefix: string): Promise<void>;
16
+ /** Drop everything. For a user-facing "clear cache", not error recovery. */
17
+ clear(): Promise<void>;
18
+ }
19
+ //#endregion
20
+ //#region src/core/weights/safetensors.d.ts
21
+ /** Bytes [begin, end) of a checkpoint file. Must return a standalone
22
+ * Uint8Array at byteOffset 0, viewable at any width. */
23
+ interface RangeSource {
24
+ read(begin: number, end: number): Promise<Uint8Array>;
25
+ }
26
+ export declare function bufferSource(buf: ArrayBuffer | Uint8Array): RangeSource;
27
+ //#endregion
28
+ //#region src/core/weights/opfsCache.d.ts
29
+ /** OPFS-backed cache; returns undefined when OPFS is unavailable. */
30
+ export declare function createOpfsCache(namespace: string): Promise<WeightCache | undefined>;
31
+ //#endregion
32
+ //#region src/zoo/load.d.ts
33
+ /** Where the weights come from: a URL, or any byte-range reader. */
34
+ type ModelPath = string | RangeSource;
35
+ /** Options accepted by every create<Task>() factory. */
36
+ interface LoadOptions {
37
+ /** Saves fetched bytes. The next load reads them from here, no network. */
38
+ cache?: WeightCache;
39
+ /** Cache key. Defaults to the URL's file name; required for a RangeSource. */
40
+ cacheId?: string;
41
+ /** Called while tensors upload: tensor name, bytes done, bytes total. */
42
+ onProgress?: (name: string, doneBytes: number, totalBytes: number) => void;
43
+ /** Called per fetched network chunk with its size in bytes. */
44
+ onBytes?: (chunkBytes: number) => void;
45
+ /** Stops the load between steps. A step already running finishes first. */
46
+ signal?: AbortSignal;
47
+ }
48
+ //#endregion
49
+ //#region src/zoo/models.d.ts
50
+ /** Ready-made model configs: the Hugging Face URLs of the weights and the
51
+ * tokenizer, plus the options each variant needs. Pass one to a
52
+ * create<Task>() call, or spread it and change a field.
53
+ *
54
+ * Every family has a DEFAULT, the smallest download that runs everywhere,
55
+ * and one entry per hosted precision or size. The files live in the
56
+ * software-mansion `runntime-*` repos, one per model, laid out as
57
+ * `<size>/<precision>/model.safetensors` with `tokenizer.json` at the
58
+ * root where the model has one. */
59
+ export declare const models: {
60
+ readonly textEmbedding: {
61
+ /** 384-dim sentence embeddings, 22M parameters. */
62
+ readonly ALL_MINILM_L6_V2: {
63
+ DEFAULT: {
64
+ tokenizerPath: string;
65
+ } & {
66
+ modelPath: string;
67
+ };
68
+ F16: {
69
+ tokenizerPath: string;
70
+ } & {
71
+ dtype: "f16";
72
+ modelPath: string;
73
+ };
74
+ F32: {
75
+ tokenizerPath: string;
76
+ } & {
77
+ modelPath: string;
78
+ dtype: "f32";
79
+ };
80
+ };
81
+ };
82
+ readonly privacyFilter: {
83
+ /** OpenAI's privacy-filter: 1.5B parameters, 50M active per token,
84
+ * int8 weights in groups of 640. The one hosted format. */
85
+ readonly PRIVACY_FILTER: {
86
+ readonly DEFAULT: {
87
+ modelPath: string;
88
+ };
89
+ };
90
+ };
91
+ readonly speechToText: {
92
+ /** English. */
93
+ readonly MOONSHINE: {
94
+ /** 27M parameters. */
95
+ readonly TINY: {
96
+ DEFAULT: {
97
+ arch: "moonshine";
98
+ tokenizerPath: string;
99
+ } & {
100
+ modelPath: string;
101
+ };
102
+ F16: {
103
+ arch: "moonshine";
104
+ tokenizerPath: string;
105
+ } & {
106
+ dtype: "f16";
107
+ modelPath: string;
108
+ };
109
+ F32: {
110
+ arch: "moonshine";
111
+ tokenizerPath: string;
112
+ } & {
113
+ modelPath: string;
114
+ dtype: "f32";
115
+ };
116
+ };
117
+ /** 61M parameters. More accurate, slower. */
118
+ readonly BASE: {
119
+ DEFAULT: {
120
+ arch: "moonshine";
121
+ tokenizerPath: string;
122
+ } & {
123
+ modelPath: string;
124
+ };
125
+ F16: {
126
+ arch: "moonshine";
127
+ tokenizerPath: string;
128
+ } & {
129
+ dtype: "f16";
130
+ modelPath: string;
131
+ };
132
+ F32: {
133
+ arch: "moonshine";
134
+ tokenizerPath: string;
135
+ } & {
136
+ modelPath: string;
137
+ dtype: "f32";
138
+ };
139
+ };
140
+ };
141
+ /** English, the streaming family. */
142
+ readonly MOONSHINE_STREAMING: {
143
+ /** 34M parameters. */
144
+ readonly TINY: {
145
+ DEFAULT: {
146
+ arch: "moonshine-streaming";
147
+ tokenizerPath: string;
148
+ } & {
149
+ modelPath: string;
150
+ };
151
+ F16: {
152
+ arch: "moonshine-streaming";
153
+ tokenizerPath: string;
154
+ } & {
155
+ dtype: "f16";
156
+ modelPath: string;
157
+ };
158
+ F32: {
159
+ arch: "moonshine-streaming";
160
+ tokenizerPath: string;
161
+ } & {
162
+ modelPath: string;
163
+ dtype: "f32";
164
+ };
165
+ };
166
+ };
167
+ };
168
+ readonly objectDetection: {
169
+ /** YOLO26 detect, COCO-80 classes, f16 weights. */
170
+ readonly YOLO26: {
171
+ readonly DEFAULT: {
172
+ modelPath: string;
173
+ };
174
+ /** The nano size, 5 MB. */
175
+ readonly N: {
176
+ modelPath: string;
177
+ };
178
+ /** The small size, 18 MB. */
179
+ readonly S: {
180
+ modelPath: string;
181
+ };
182
+ /** The medium size, 39 MB. More accurate, slower. */
183
+ readonly M: {
184
+ modelPath: string;
185
+ };
186
+ };
187
+ };
188
+ readonly instanceSegmentation: {
189
+ /** YOLO26 segment, COCO-80 classes with a mask per object, f16 weights. */
190
+ readonly YOLO26_SEG: {
191
+ readonly DEFAULT: {
192
+ modelPath: string;
193
+ };
194
+ /** The nano size, 5 MB. */
195
+ readonly N: {
196
+ modelPath: string;
197
+ };
198
+ /** The small size, 20 MB. */
199
+ readonly S: {
200
+ modelPath: string;
201
+ };
202
+ /** The medium size, 45 MB. More accurate, slower. */
203
+ readonly M: {
204
+ modelPath: string;
205
+ };
206
+ };
207
+ };
208
+ readonly keypointDetection: {
209
+ /** YOLO26 pose, people with 17 COCO landmarks, f16 weights. */
210
+ readonly YOLO26_POSE: {
211
+ readonly DEFAULT: {
212
+ modelPath: string;
213
+ };
214
+ /** The nano size, 6 MB. */
215
+ readonly N: {
216
+ modelPath: string;
217
+ };
218
+ /** The small size, 20 MB. */
219
+ readonly S: {
220
+ modelPath: string;
221
+ };
222
+ /** The medium size, 42 MB. More accurate, slower. */
223
+ readonly M: {
224
+ modelPath: string;
225
+ };
226
+ };
227
+ };
228
+ readonly depthEstimation: {
229
+ /** DepthART relative depth at 448×448, f16 weights. */
230
+ readonly DEPTHART: {
231
+ readonly DEFAULT: {
232
+ modelPath: string;
233
+ };
234
+ /** The small size, 13 MB. */
235
+ readonly S: {
236
+ modelPath: string;
237
+ };
238
+ /** The base size, 24 MB. More detail, slower. */
239
+ readonly B: {
240
+ modelPath: string;
241
+ };
242
+ };
243
+ };
244
+ readonly imageClassification: {
245
+ /** MobileNetV4 conv, ImageNet-1k, f16 weights. The model runs in f16
246
+ * only, so each size has one entry. */
247
+ readonly MOBILENETV4: {
248
+ readonly DEFAULT: {
249
+ modelPath: string;
250
+ };
251
+ /** The small size, 3.8M parameters, 10 MB. */
252
+ readonly SMALL: {
253
+ modelPath: string;
254
+ };
255
+ };
256
+ };
257
+ };
258
+ //#endregion
259
+ //#region src/zoo/tasks/nlp/textEmbedding.d.ts
260
+ /** What to load. Every field is optional; a missing one comes from
261
+ * models.textEmbedding.ALL_MINILM_L6_V2.default. */
262
+ interface TextEmbedderModel {
263
+ /** The safetensors checkpoint. */
264
+ readonly modelPath?: ModelPath;
265
+ /** The tokenizer JSON: a Hugging Face tokenizer.json or our compact asset. */
266
+ readonly tokenizerPath?: string;
267
+ /** Precision on the GPU. `f16` runs the whole model in half precision,
268
+ * weights and activations, for half the memory traffic; results move by
269
+ * about 1e-3. Needs a device with `shader-f16`. Default: `f16` where
270
+ * the device has it, `f32` elsewhere. Either loads any weight file. */
271
+ readonly dtype?: 'f32' | 'f16';
272
+ /** Longest input in tokens, [CLS] and [SEP] included. Longer text is cut.
273
+ * Default 256, the model card's limit. */
274
+ readonly maxTokens?: number;
275
+ }
276
+ interface TextEmbedder {
277
+ /** Length of every returned vector. */
278
+ readonly dim: number;
279
+ /** One text → unit-length vector. */
280
+ embed(input: string): Promise<Float32Array>;
281
+ /** Many texts in one GPU pass. Much faster than embed() in a loop. */
282
+ embedBatch(inputs: readonly string[]): Promise<Float32Array[]>;
283
+ /** Frees the weights and every GPU buffer the runner holds. */
284
+ dispose(): void;
285
+ }
286
+ /** Dot product of two unit-length embeddings, which is their cosine
287
+ * similarity: 1 for the same meaning, near 0 for unrelated text. */
288
+ export declare function similarity(a: Float32Array, b: Float32Array): number;
289
+ /** Loads the checkpoint and the tokenizer, warms every GPU path once, and
290
+ * returns the runner. With no config, loads all-MiniLM-L6-v2 from the
291
+ * Hugging Face Hub. */
292
+ export declare function createTextEmbedder(config?: TextEmbedderModel, opts?: LoadOptions): Promise<TextEmbedder>;
293
+ //#endregion
294
+ //#region src/zoo/tasks/nlp/privacyFilter.d.ts
295
+ /** What to load. With no config, the int8 export from the Hugging Face
296
+ * Hub, models.privacyFilter.PRIVACY_FILTER.DEFAULT. */
297
+ interface PrivacyFilterModel {
298
+ /** The safetensors checkpoint: the hosted int8 export, or your own int8,
299
+ * f16 or bf16 export of the official file. The weight format comes from
300
+ * the file. */
301
+ readonly modelPath?: ModelPath;
302
+ }
303
+ /** One piece of personal data found in the text. */
304
+ interface PrivacySpan {
305
+ /** The kind of data: `private_person`, `private_email`, `private_phone`,
306
+ * `private_address`, `private_date`, `private_url`, `account_number`
307
+ * or `secret`. */
308
+ readonly label: string;
309
+ /** Where it sits in the text, as string indices. `end` is exclusive. */
310
+ readonly start: number;
311
+ readonly end: number;
312
+ /** The matched text, `text.slice(start, end)`. */
313
+ readonly text: string;
314
+ /** A tag to put in its place, like `<PRIVATE_EMAIL>`. */
315
+ readonly placeholder: string;
316
+ }
317
+ interface PrivacyFilter {
318
+ /** Text in, every span of personal data in it out, in text order.
319
+ * Empty text gives an empty list. */
320
+ detect(text: string): Promise<PrivacySpan[]>;
321
+ /** Frees the weights and every GPU buffer the runner holds. */
322
+ dispose(): void;
323
+ }
324
+ /** Loads the checkpoint, warms the GPU path once, and returns the runner. */
325
+ export declare function createPrivacyFilter(config?: PrivacyFilterModel, opts?: LoadOptions): Promise<PrivacyFilter>;
326
+ //#endregion
327
+ //#region src/zoo/tasks/audio/speechToText.d.ts
328
+ /** The two Moonshine families. Each has its own weights and decoder. */
329
+ type SpeechToTextArch = 'moonshine' | 'moonshine-streaming';
330
+ /** What to load. Every field is optional; a missing one comes from the
331
+ * family's default entry in models.speechToText. */
332
+ interface SpeechToTextModel {
333
+ /** The family the weights belong to. Default `moonshine`. */
334
+ readonly arch?: SpeechToTextArch;
335
+ /** The safetensors checkpoint. */
336
+ readonly modelPath?: ModelPath;
337
+ /** The tokenizer JSON: a Hugging Face tokenizer.json or our compact asset. */
338
+ readonly tokenizerPath?: string;
339
+ /** Precision on the GPU. `f16` runs the whole model in half precision,
340
+ * weights and activations, for half the memory traffic; the text stays
341
+ * the same. Needs a device with `shader-f16`. Default: `f16` where the
342
+ * device has it, `f32` elsewhere. Either loads any weight file. */
343
+ readonly dtype?: 'f32' | 'f16';
344
+ }
345
+ /** One update of a live stream: the whole transcript so far. */
346
+ interface SpeechStreamUpdate {
347
+ /** The sentences the speaker finished. Each ended in a pause. */
348
+ readonly committed: string;
349
+ /** The sentence being spoken now. It changes until it commits. */
350
+ readonly nonCommitted: string;
351
+ }
352
+ interface SpeechToText {
353
+ /** Mono samples at 16 kHz in, the spoken text out. Long clips are split
354
+ * on quiet moments. Clips shorter than one model frame give ''. */
355
+ transcribe(audio: Float32Array): Promise<string>;
356
+ /** Starts live transcription: feed samples with streamInsert, read the
357
+ * updates here. An update comes when the text changes; the iterator
358
+ * ends after streamStop or dispose. One stream at a time. */
359
+ stream(): AsyncIterable<SpeechStreamUpdate>;
360
+ /** Adds microphone samples, mono at 16 kHz, to the open stream. */
361
+ streamInsert(samples: Float32Array): void;
362
+ /** Commits what is left in the open stream and ends its iterator. */
363
+ streamStop(): void;
364
+ /** Frees the weights and every GPU buffer the runner holds. */
365
+ dispose(): void;
366
+ }
367
+ /** Loads the checkpoint and the tokenizer, warms every GPU path once, and
368
+ * returns the runner. With no config, loads Moonshine tiny from the
369
+ * Hugging Face Hub. */
370
+ export declare function createSpeechToText(config?: SpeechToTextModel, opts?: LoadOptions): Promise<SpeechToText>;
371
+ //#endregion
372
+ //#region src/zoo/tasks/audio/audioInput.d.ts
373
+ /** Audio input helpers: an encoded clip or raw microphone samples in, the
374
+ * 16 kHz mono Float32Array the speech models take out. Both use the
375
+ * browser's own decoder and resampler through an OfflineAudioContext, so
376
+ * they run in the browser only. Importing the file is safe anywhere, the
377
+ * browser objects appear only inside the functions. */
378
+ /** Sample rate the speech models take. */
379
+ export declare const SPEECH_SAMPLE_RATE = 16000;
380
+ /** Decodes any clip the browser can play (wav, mp3, ogg, ...) to 16 kHz
381
+ * mono samples. Stereo is mixed down to one channel. */
382
+ export declare function decodeAudio(data: ArrayBuffer): Promise<Float32Array>;
383
+ /** Resamples raw mono samples recorded at `sourceRate` to 16 kHz. Returns
384
+ * the input as is when it is already at 16 kHz. Use it on microphone
385
+ * samples, a lossy re-encode is not needed. */
386
+ export declare function resampleAudio(samples: Float32Array, sourceRate: number): Promise<Float32Array>;
387
+ //#endregion
388
+ //#region src/zoo/tasks/cv/image.d.ts
389
+ /** Raw CPU image types shared by every vision task. */
390
+ /** Pixel formats an ImageBuffer can carry: which channels, in what order. */
391
+ type ImageFormat = 'rgb' | 'rgba' | 'bgr' | 'bgra' | 'gray';
392
+ /** A raw image in memory: one row after another, all channels of one pixel
393
+ * together (the way a canvas or a camera gives it). */
394
+ interface ImageBuffer {
395
+ readonly data: Uint8Array | Uint8ClampedArray;
396
+ readonly width: number;
397
+ readonly height: number;
398
+ readonly format: ImageFormat;
399
+ readonly layout: 'hwc';
400
+ }
401
+ /** How an image is fitted into the model's input size.
402
+ * - `stretch`: scale width and height separately; nothing is cut or padded.
403
+ * - `letterbox`: keep the aspect ratio, pad the rest with a flat color.
404
+ * - `crop`: keep the aspect ratio, cut the centered square, then scale. */
405
+ type ResizeMode = 'stretch' | 'letterbox' | 'crop';
406
+ /** Wraps raw bytes as an ImageBuffer. Checks the size and the byte count. */
407
+ export declare function imageBuffer(data: Uint8Array | Uint8ClampedArray, width: number, height: number, format?: ImageFormat): ImageBuffer;
408
+ /** Views canvas ImageData as an ImageBuffer. No copy. */
409
+ export declare function imageBufferFromImageData(img: ImageData): ImageBuffer;
410
+ //#endregion
411
+ //#region src/zoo/tasks/cv/ops/point.d.ts
412
+ interface Point {
413
+ readonly x: number;
414
+ readonly y: number;
415
+ }
416
+ interface Size {
417
+ readonly width: number;
418
+ readonly height: number;
419
+ }
420
+ //#endregion
421
+ //#region src/zoo/tasks/cv/ops/box.d.ts
422
+ /** Each box format and the fields it carries. */
423
+ type BoxMap = Readonly<{
424
+ xyxy: Readonly<{
425
+ xmin: number;
426
+ ymin: number;
427
+ xmax: number;
428
+ ymax: number;
429
+ }>;
430
+ xywh: Readonly<{
431
+ xmin: number;
432
+ ymin: number;
433
+ w: number;
434
+ h: number;
435
+ }>;
436
+ cxcywh: Readonly<{
437
+ cx: number;
438
+ cy: number;
439
+ w: number;
440
+ h: number;
441
+ }>;
442
+ }>;
443
+ type BoxFormat = keyof BoxMap;
444
+ /** A box tagged with its format. */
445
+ type BoundingBox<F extends BoxFormat = BoxFormat> = F extends BoxFormat ? {
446
+ readonly format: F;
447
+ } & BoxMap[F] : never;
448
+ //#endregion
449
+ //#region src/zoo/tasks/cv/objectDetection.d.ts
450
+ /** What to load. Every field is optional; a missing `modelPath` comes from
451
+ * models.objectDetection.YOLO26.DEFAULT. */
452
+ interface ObjectDetectorModel {
453
+ /** The weights: a safetensors export of a YOLO26 detect checkpoint. */
454
+ readonly modelPath?: ModelPath;
455
+ /** Model size, `n` to `x`. Default: read from the weights. */
456
+ readonly variant?: Yolo26Variant;
457
+ /** Input width and height in pixels, a multiple of 32. Default 640.
458
+ * Smaller runs faster and misses more small objects. */
459
+ readonly inputSize?: number;
460
+ /** How an image is fitted into the model input. Default `letterbox`. */
461
+ readonly resizeMode?: ResizeMode;
462
+ }
463
+ interface DetectObjectsOptions {
464
+ /** Drops objects scored below this, 0 to 1. Default 0.3. */
465
+ readonly confidenceThreshold?: number;
466
+ /** At most this many objects, best first. Default 300. */
467
+ readonly maxDetections?: number;
468
+ }
469
+ /** One object found in the image. */
470
+ interface ObjectDetection {
471
+ /** The class name, like `person` or `bus`. */
472
+ readonly label: string;
473
+ /** The class index into `labels`. */
474
+ readonly classId: number;
475
+ /** The score, 0 to 1. */
476
+ readonly confidence: number;
477
+ /** Where it sits, in pixels of the input image. */
478
+ readonly box: BoundingBox<'xyxy'>;
479
+ }
480
+ interface ObjectDetector {
481
+ /** The class names, by class index. */
482
+ readonly labels: readonly string[];
483
+ /** Image in, the objects in it out, best first. */
484
+ detectObjects(image: ImageBuffer, options?: DetectObjectsOptions): Promise<ObjectDetection[]>;
485
+ /** Frees the weights and every GPU buffer the runner holds. */
486
+ dispose(): void;
487
+ }
488
+ /** Loads the checkpoint, warms the GPU path once, and returns the runner.
489
+ * Needs a device with `shader-f16`. */
490
+ export declare function createObjectDetector(config?: ObjectDetectorModel, opts?: LoadOptions): Promise<ObjectDetector>;
491
+ //#endregion
492
+ //#region src/zoo/tasks/cv/instanceSegmentation.d.ts
493
+ /** What to load. Every field is optional; a missing `modelPath` comes from
494
+ * models.instanceSegmentation.YOLO26_SEG.DEFAULT. */
495
+ interface InstanceSegmenterModel {
496
+ /** The weights: a safetensors export of a YOLO26 segment checkpoint. */
497
+ readonly modelPath?: ModelPath;
498
+ /** Model size, `n` to `x`. Default: read from the weights. */
499
+ readonly variant?: Yolo26Variant;
500
+ /** Input width and height in pixels, a multiple of 32. Default 640.
501
+ * Smaller runs faster and misses more small objects. */
502
+ readonly inputSize?: number;
503
+ /** How an image is fitted into the model input. Default `letterbox`. */
504
+ readonly resizeMode?: ResizeMode;
505
+ }
506
+ interface SegmentInstancesOptions {
507
+ /** Drops objects scored below this, 0 to 1. Default 0.3. */
508
+ readonly confidenceThreshold?: number;
509
+ /** At most this many objects, best first. Default 300. */
510
+ readonly maxDetections?: number;
511
+ }
512
+ /** One object found in the image. */
513
+ interface InstanceSegmentation {
514
+ /** The class name, like `person` or `bus`. */
515
+ readonly label: string;
516
+ /** The class index into `labels`. */
517
+ readonly classId: number;
518
+ /** The score, 0 to 1. */
519
+ readonly confidence: number;
520
+ /** Where it sits, in pixels of the input image. */
521
+ readonly box: BoundingBox<'xyxy'>;
522
+ /** Which pixels of `box` are the object: a `gray` image that covers the
523
+ * box, at about a quarter of the model input's resolution. 0 is outside
524
+ * the object, 255 inside, in between along the edge. Stretch it over
525
+ * `box` when drawing. */
526
+ readonly mask: ImageBuffer;
527
+ }
528
+ interface InstanceSegmenter {
529
+ /** The class names, by class index. */
530
+ readonly labels: readonly string[];
531
+ /** Image in, the objects in it out, best first. */
532
+ segmentInstances(image: ImageBuffer, options?: SegmentInstancesOptions): Promise<InstanceSegmentation[]>;
533
+ /** Frees the weights and every GPU buffer the runner holds. */
534
+ dispose(): void;
535
+ }
536
+ /** Loads the checkpoint, warms the GPU path once, and returns the runner.
537
+ * Needs a device with `shader-f16`. */
538
+ export declare function createInstanceSegmenter(config?: InstanceSegmenterModel, opts?: LoadOptions): Promise<InstanceSegmenter>;
539
+ //#endregion
540
+ //#region src/zoo/yolo26/pipeline.d.ts
541
+ /** The 17 COCO body landmarks, in model output order. */
542
+ export declare const COCO_LANDMARKS: readonly ["nose", "leftEye", "rightEye", "leftEar", "rightEar", "leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee", "leftAnkle", "rightAnkle"];
543
+ type CocoLandmark = (typeof COCO_LANDMARKS)[number];
544
+ //#endregion
545
+ //#region src/zoo/tasks/cv/keypointDetection.d.ts
546
+ /** What to load. Every field is optional; a missing `modelPath` comes from
547
+ * models.keypointDetection.YOLO26_POSE.DEFAULT. */
548
+ interface KeypointDetectorModel {
549
+ /** The weights: a safetensors export of a YOLO26 pose checkpoint. */
550
+ readonly modelPath?: ModelPath;
551
+ /** Model size, `n` to `x`. Default: read from the weights. */
552
+ readonly variant?: Yolo26Variant;
553
+ /** Input width and height in pixels, a multiple of 32. Default 640.
554
+ * Smaller runs faster and misses more small people. */
555
+ readonly inputSize?: number;
556
+ /** How an image is fitted into the model input. Default `letterbox`. */
557
+ readonly resizeMode?: ResizeMode;
558
+ }
559
+ interface DetectKeypointsOptions {
560
+ /** Drops people scored below this, 0 to 1. Default 0.3. */
561
+ readonly confidenceThreshold?: number;
562
+ /** At most this many people, best first. Default 300. */
563
+ readonly maxDetections?: number;
564
+ }
565
+ /** One landmark of a person, in pixels of the input image. */
566
+ interface Landmark extends Point {
567
+ /** How sure the model is the landmark is visible, 0 to 1. A hidden one
568
+ * keeps a position guess with a low value. */
569
+ readonly confidence: number;
570
+ }
571
+ /** One person found in the image. */
572
+ interface KeypointDetection {
573
+ /** Where the person sits, in pixels of the input image. */
574
+ readonly box: BoundingBox<'xyxy'>;
575
+ /** The score, 0 to 1. */
576
+ readonly confidence: number;
577
+ /** The 17 COCO landmarks by name, `nose` to `rightAnkle`. A landmark
578
+ * outside the image keeps its position. */
579
+ readonly landmarks: Readonly<Record<CocoLandmark, Landmark>>;
580
+ }
581
+ interface KeypointDetector {
582
+ /** The landmark names, in `COCO_LANDMARKS` order. */
583
+ readonly landmarkNames: readonly CocoLandmark[];
584
+ /** Pairs of landmark names to draw as limbs. */
585
+ readonly skeleton: readonly (readonly [CocoLandmark, CocoLandmark])[];
586
+ /** Image in, the people in it out, best first. */
587
+ detectKeypoints(image: ImageBuffer, options?: DetectKeypointsOptions): Promise<KeypointDetection[]>;
588
+ /** Frees the weights and every GPU buffer the runner holds. */
589
+ dispose(): void;
590
+ }
591
+ /** Loads the checkpoint, warms the GPU path once, and returns the runner.
592
+ * Needs a device with `shader-f16`. */
593
+ export declare function createKeypointDetector(config?: KeypointDetectorModel, opts?: LoadOptions): Promise<KeypointDetector>;
594
+ //#endregion
595
+ //#region src/zoo/depthart/estimator.d.ts
596
+ type DepthartVariant = 'b' | 's';
597
+ //#endregion
598
+ //#region src/zoo/tasks/cv/depthEstimation.d.ts
599
+ /** What to load. Every field is optional; a missing `modelPath` comes from
600
+ * models.depthEstimation.DEPTHART.DEFAULT. */
601
+ interface DepthEstimatorModel {
602
+ /** The weights: a safetensors export of a DepthART relative checkpoint. */
603
+ readonly modelPath?: ModelPath;
604
+ /** Model size, `b` or `s`. Default: read from the weights. */
605
+ readonly variant?: DepthartVariant;
606
+ /** How an image is fitted into the model input. Default `stretch`, so
607
+ * the map covers the whole image. */
608
+ readonly resizeMode?: ResizeMode;
609
+ }
610
+ /** Relative depth of the model input, one value per pixel, row by row.
611
+ * Smaller = nearer. Values have no unit: compare them within one map. */
612
+ interface DepthMap {
613
+ readonly width: number;
614
+ readonly height: number;
615
+ readonly data: Float32Array;
616
+ }
617
+ interface DepthEstimator {
618
+ /** Width and height of every returned map. */
619
+ readonly inputSize: number;
620
+ /** Image in, its depth map out. */
621
+ estimateDepth(image: ImageBuffer): Promise<DepthMap>;
622
+ /** Frees the weights and every GPU buffer the runner holds. */
623
+ dispose(): void;
624
+ }
625
+ /** Loads the checkpoint, warms the GPU path once, and returns the runner. */
626
+ export declare function createDepthEstimator(config?: DepthEstimatorModel, opts?: LoadOptions): Promise<DepthEstimator>;
627
+ //#endregion
628
+ //#region src/zoo/mobilenetv4/pipeline.d.ts
629
+ /** CPU pre/post-processing around the MobileNetV4 GPU forward.
630
+ * Preprocess: RGBA canvas pixels → [3, S, S] CHW f32, ImageNet-normalized.
631
+ */
632
+ interface Classification {
633
+ classId: number;
634
+ confidence: number;
635
+ }
636
+ //#endregion
637
+ //#region src/zoo/tasks/cv/imageClassification.d.ts
638
+ /** What to load. With no config, MobileNetV4-Conv-S from the Hugging Face
639
+ * Hub with the ImageNet class names. */
640
+ interface ImageClassifierModel {
641
+ /** The weights: a MobileNetV4-Conv-S safetensors file, 1000 ImageNet classes. */
642
+ readonly modelPath?: ModelPath;
643
+ /** The class names, by class index; as many as the model has classes.
644
+ * Default: the 1000 ImageNet names. */
645
+ readonly labels?: readonly string[];
646
+ /** How an image is fitted into the model input. Default `crop`, the
647
+ * middle 87.5% of the centered square, the crop the model was evaluated
648
+ * with; it keeps the subject's proportions. */
649
+ readonly resizeMode?: ResizeMode;
650
+ }
651
+ interface ClassifyOptions {
652
+ /** How many classes to return, best first. Default: all of them. */
653
+ readonly topk?: number;
654
+ }
655
+ interface ImageClassifier {
656
+ /** The class names, by class index. */
657
+ readonly labels: readonly string[];
658
+ /** Width and height of the model input in pixels. */
659
+ readonly inputSize: number;
660
+ /** Image in, its most likely classes out, best first. */
661
+ classify(image: ImageBuffer, options?: ClassifyOptions): Promise<(Classification & {
662
+ label: string;
663
+ })[]>;
664
+ /** Frees the weights and every GPU buffer the runner holds. */
665
+ dispose(): void;
666
+ }
667
+ /** Loads the checkpoint, warms the GPU path once, and returns the runner.
668
+ * Needs a device with `shader-f16`. */
669
+ export declare function createImageClassifier(config?: ImageClassifierModel, opts?: LoadOptions): Promise<ImageClassifier>;
670
+ //#endregion
671
+ export { type BoundingBox, type BoxFormat, type BoxMap, type Classification, type ClassifyOptions, type CocoLandmark, type DepthEstimator, type DepthEstimatorModel, type DepthMap, type DepthartVariant, type DetectKeypointsOptions, type DetectObjectsOptions, type ImageBuffer, type ImageClassifier, type ImageClassifierModel, type ImageFormat, type InstanceSegmentation, type InstanceSegmenter, type InstanceSegmenterModel, type KeypointDetection, type KeypointDetector, type KeypointDetectorModel, type Landmark, type LoadOptions, type ModelPath, type ObjectDetection, type ObjectDetector, type ObjectDetectorModel, type Point, type PrivacyFilter, type PrivacyFilterModel, type PrivacySpan, type RangeSource, type ResizeMode, type SegmentInstancesOptions, type Size, type SpeechStreamUpdate, type SpeechToText, type SpeechToTextArch, type SpeechToTextModel, type TextEmbedder, type TextEmbedderModel, type WeightCache, type Yolo26Variant, initRunntime };