@ultralytics/yolo 0.0.54 → 0.0.55

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.
package/README.md CHANGED
@@ -193,14 +193,12 @@ await annotate(canvas, img, results, { keypointRadius: 4, skeleton: [[0, 1]] });
193
193
  `YOLO.load("/models/yolo26n.onnx", { device: "webgpu" | "cpu" })` (default `"auto"`). If
194
194
  WebGPU cannot engage, the load falls back to CPU; `model.device` reports what
195
195
  actually ran.
196
+ - **Workers**: LiteRT image inputs and timing support worker globals; LiteRT's own worker asset
197
+ loading requirements still apply. The ONNX Runtime Web loader requires a browser window.
196
198
  - **RT-DETR**: supported for detection. An RT-DETR `.onnx` runs on WebGPU like any other
197
- model. An RT-DETR `.tflite` is routed to CPU/wasm under the default `device: "auto"`: its
198
- deformable-attention decoder reshapes to rank 5 and indexes with `int64`, which the LiteRT
199
- WebGPU delegate rejected on every driver tested (Linux/Vulkan and Apple Metal-3). An
200
- explicit `device: "webgpu"` is still attempted rather than overridden, so the delegate can
201
- be re-tested as it gains ops; on current drivers that attempt fails and LiteRT falls back
202
- to CPU/wasm, and `model.device` reports what ran. Export one yourself, since no RT-DETR
203
- ONNX or LiteRT model is published.
199
+ model. LiteRT models that cannot be fully delegated to WebGPU run on CPU/wasm;
200
+ `model.device` reports the selected device. Export an RT-DETR model yourself, since
201
+ no ONNX or LiteRT model is published.
204
202
  - **Model format**: export your model to ONNX with Ultralytics `>=8.4.142` so the metadata
205
203
  (task, class names, `imgsz`) is embedded:
206
204
 
@@ -302,19 +300,14 @@ Notes:
302
300
  embedded metadata) ships in
303
301
  [v8.4.83](https://github.com/ultralytics/ultralytics/releases/tag/v8.4.83) and
304
302
  later. Earlier versions emit the legacy TFLite format and won't load here.
305
- - **Keep the one-to-many head for WebGPU** (`nms=None`): the NMS-free YOLO26 head, exported
306
- with `nms=False`, has `int64` / `gather_nd` ops the LiteRT **WebGPU** delegate cannot
307
- run, so those exports fall back to CPU/wasm. Use Ultralytics `>=8.4.142` for this recipe; it exports
308
- the one-to-many head by default, so NMS runs in this package's Rust and inference stays
309
- on WebGPU:
303
+ - **NMS-free models**: recent YOLO26 LiteRT exports use GPU-compatible operators. Older
304
+ exports contain operations that may prevent full WebGPU delegation; those run on CPU/wasm.
305
+ Alternatively, export the one-to-many head to run NMS in Rust:
310
306
 
311
307
  ```bash
312
308
  yolo export model=yolo26n.pt format=litert nms=None
313
309
  ```
314
310
 
315
- If you load an NMS-free `.tflite`, the backend auto-switches it to wasm
316
- (slower) and logs a warning rather than returning empty results.
317
-
318
311
  - **Tasks**: detect, segment, semantic, depth, classify, pose, and obb are all supported.
319
312
  - **Cross-origin isolation**: LiteRT's threaded wasm wants `SharedArrayBuffer`,
320
313
  so serve with `Cross-Origin-Opener-Policy: same-origin` and
@@ -336,8 +329,7 @@ ONNX Runtime Web (`.onnx`):
336
329
 
337
330
  Apple M4, Chrome 153, `@ultralytics/yolo` 0.0.48 (ONNX Runtime Web 1.27, LiteRT.js 2.5.3). FP32 640×640 models
338
331
  exported with Ultralytics 8.4.163 (`nms=None`), cycling through the 128 COCO128 images after warmup (128 timed runs on
339
- WebGPU, 50 on CPU). NMS-free exports (`nms=False`) run at the same speed on ONNX Runtime Web, but LiteRT.js falls back
340
- to CPU/wasm for them, so keep `nms=None` for WebGPU.
332
+ WebGPU, 50 on CPU). Recent NMS-free LiteRT exports (`nms=False`) can also run on WebGPU.
341
333
 
342
334
  ## 🔨 Building From Source
343
335
 
package/README.zh-CN.md CHANGED
@@ -184,13 +184,11 @@ await annotate(canvas, img, results, { keypointRadius: 4, skeleton: [[0, 1]] });
184
184
  `YOLO.load` 会自动回退到通用的 **CPU/wasm** 构建,随处可用。可通过
185
185
  `YOLO.load("/models/yolo26n.onnx", { device: "webgpu" | "cpu" })` 指定设备(默认 `"auto"`)。若 WebGPU
186
186
  无法启用,加载会回退到 CPU;`model.device` 会报告实际使用的设备。
187
- - **RT-DETR**:支持检测任务。RT-DETR 的 `.onnx` 可以像其他模型一样在 WebGPU 上运行;而
188
- RT-DETR 的 `.tflite` 在默认的 `device: "auto"` 下会被路由到 CPU/wasm,因为它的可变形注意力
189
- 解码器会 reshape 到 5 维并使用 `int64` 索引,目前测试过的所有驱动(Linux/Vulkan 与 Apple
190
- Metal-3)上 LiteRT 的 WebGPU delegate 都会拒绝这些算子。显式指定 `device: "webgpu"` 仍会
191
- 尝试使用 delegate,而不会被强制覆盖,便于在 delegate 补齐算子后重新测试;在当前驱动上该
192
- 尝试会失败,LiteRT 会回退到 CPU/wasm,`model.device` 会报告实际使用的设备。官方没有发布
193
- RT-DETR 的 ONNX 或 LiteRT 模型,需要自行导出。
187
+ - **Worker**:LiteRT 图像输入和计时支持 worker 环境,但仍须满足 LiteRT 自身的 worker 资源加载要求。
188
+ ONNX Runtime Web 加载器需要浏览器窗口。
189
+ - **RT-DETR**:支持检测任务。RT-DETR 的 `.onnx` 可以像其他模型一样在 WebGPU 上运行。
190
+ 无法完全委托给 WebGPU 的 LiteRT 模型会在 CPU/wasm 上运行,`model.device` 会报告实际使用的设备。
191
+ 官方没有发布 RT-DETR 的 ONNX 或 LiteRT 模型,需要自行导出。
194
192
  - **模型格式**:请使用 Ultralytics `>=8.4.142` 导出为 ONNX,以便元数据(任务、类别名称、`imgsz`)被嵌入模型:
195
193
 
196
194
  ```python
@@ -280,17 +278,13 @@ wasm 默认从 jsDelivr CDN 加载;向 `YOLO.load` 传入 `litertWasmUrl: "/li
280
278
  - **现有模型兼容性**:带内嵌元数据的单文件 LiteRT 导出自
281
279
  [v8.4.83](https://github.com/ultralytics/ultralytics/releases/tag/v8.4.83) 起提供。更早的版本
282
280
  会导出旧版 TFLite 格式,无法在这里加载。
283
- - **为 WebGPU 保留一对多检测头**(`nms=None`):以 `nms=False` 导出的 YOLO26 无 NMS 检测头包含
284
- `int64` / `gather_nd` 算子,无法在 LiteRT 的 **WebGPU** delegate 上运行,因此这类导出会
285
- 回退到 CPU/wasm。以下命令需要 Ultralytics `>=8.4.142`,默认导出一对多检测头,NMS 由本包的 Rust 代码执行,
286
- 推理得以保持在 WebGPU 上:
281
+ - **无 NMS 模型**:较新的 YOLO26 LiteRT 导出使用兼容 GPU 的算子。旧版导出可能包含无法完全委托给
282
+ WebGPU 的算子,此时模型会在 CPU/wasm 上运行。也可以导出一对多检测头,由 Rust 执行 NMS:
287
283
 
288
284
  ```bash
289
285
  yolo export model=yolo26n.pt format=litert nms=None
290
286
  ```
291
287
 
292
- 如果加载了无 NMS 的 `.tflite`,后端会自动切换到 wasm(较慢)并打印警告,而不是返回空结果。
293
-
294
288
  - **支持的任务**:detect、segment、semantic、depth、classify、pose 和 obb 均已支持。
295
289
  - **跨源隔离**:LiteRT 的多线程 wasm 需要 `SharedArrayBuffer`,因此请以
296
290
  `Cross-Origin-Opener-Policy: same-origin` 和 `Cross-Origin-Embedder-Policy: require-corp`
@@ -312,8 +306,7 @@ Web(`.onnx`):
312
306
 
313
307
  测试环境:Apple M4、Chrome 153、`@ultralytics/yolo` 0.0.48(ONNX Runtime Web 1.27、LiteRT.js 2.5.3)。模型为使用
314
308
  Ultralytics 8.4.163 导出的 FP32 640×640 模型(`nms=None`),预热后循环使用 COCO128 的 128 张图像(WebGPU 计时 128 次,CPU
315
- 计时 50 次)。无 NMS 导出(`nms=False`)在 ONNX Runtime Web 上速度相同,但 LiteRT.js 会回退到 CPU/wasm 运行,因此 WebGPU
316
- 请保持 `nms=None`。
309
+ 计时 50 次)。较新的无 NMS LiteRT 导出(`nms=False`)也可以在 WebGPU 上运行。
317
310
 
318
311
  ## 🔨 从源码构建
319
312
 
package/dist/index.d.ts CHANGED
@@ -161,13 +161,14 @@ export interface AnnotateOptions {
161
161
  depthAlpha?: number;
162
162
  }
163
163
  /** Image-like inputs accepted by {@link YOLO.predict}. */
164
- export type ImageInput = string | URL | Blob | ArrayBuffer | Uint8Array | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap;
164
+ export type ImageInput = string | URL | Blob | ArrayBuffer | Uint8Array | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas | ImageBitmap;
165
165
  /**
166
166
  * A loaded YOLO model. Loading is asynchronous, so use {@link YOLO.load} instead
167
167
  * of a constructor.
168
168
  */
169
169
  export declare class YOLO {
170
170
  private readonly engine;
171
+ private queue;
171
172
  private constructor();
172
173
  /**
173
174
  * Load a model and initialize the inference backend.
@@ -193,7 +194,7 @@ export declare class YOLO {
193
194
  * Run inference on an image.
194
195
  *
195
196
  * Drawable sources (`ImageData`, `HTMLImageElement`, `HTMLCanvasElement`,
196
- * `HTMLVideoElement`, `ImageBitmap`) take a fast path that reads raw pixels
197
+ * `HTMLVideoElement`, `OffscreenCanvas`, `ImageBitmap`) take a fast path that reads raw pixels
197
198
  * with no re-encoding, ideal for webcam/video. URLs, `Blob`s, and raw bytes
198
199
  * are decoded (in wasm for `ort`, via a canvas for `litert`).
199
200
  *
package/dist/index.js CHANGED
@@ -73,33 +73,24 @@ function decodeResults(raw) {
73
73
  r.semantic_mask = sem && sem.length ? new Uint16Array(sem.buffer, sem.byteOffset, sem.length / 2) : undefined;
74
74
  return r;
75
75
  }
76
- let initialized = false;
77
- /**
78
- * `ort-web` 0.4.0 reads tensor dims as 64-bit integers, but ONNX Runtime Web returns plain
79
- * numbers, which the wasm glue then rejects with "Cannot convert 1 to a BigInt". Accept number
80
- * arrays in `BigUint64Array.set`, which only ever threw for them before.
81
- */
82
- function allowNumberDims() {
83
- const set = BigUint64Array.prototype.set;
84
- BigUint64Array.prototype.set = function (src, offset) {
85
- set.call(this, Array.isArray(src) ? src.map((v) => BigInt(v)) : src, offset);
86
- };
87
- }
76
+ let initialized;
88
77
  /** Initialize the wasm module exactly once. */
89
- async function ensureInit(wasmUrl) {
90
- if (initialized)
91
- return;
92
- allowNumberDims();
93
- await init(wasmUrl ? { module_or_path: wasmUrl } : undefined);
94
- start();
95
- initialized = true;
78
+ function ensureInit(wasmUrl) {
79
+ initialized ?? (initialized = init(wasmUrl ? { module_or_path: wasmUrl } : undefined)
80
+ .then(() => start())
81
+ .catch((error) => {
82
+ initialized = undefined;
83
+ throw error;
84
+ }));
85
+ return initialized;
96
86
  }
97
87
  function isDrawable(input) {
98
- return (input instanceof ImageData ||
99
- input instanceof HTMLImageElement ||
100
- input instanceof HTMLCanvasElement ||
101
- input instanceof HTMLVideoElement ||
102
- input instanceof ImageBitmap);
88
+ return ((typeof ImageData !== "undefined" && input instanceof ImageData) ||
89
+ (typeof HTMLImageElement !== "undefined" && input instanceof HTMLImageElement) ||
90
+ (typeof HTMLCanvasElement !== "undefined" && input instanceof HTMLCanvasElement) ||
91
+ (typeof HTMLVideoElement !== "undefined" && input instanceof HTMLVideoElement) ||
92
+ (typeof OffscreenCanvas !== "undefined" && input instanceof OffscreenCanvas) ||
93
+ (typeof ImageBitmap !== "undefined" && input instanceof ImageBitmap));
103
94
  }
104
95
  /** Fetch a URL and throw a clear error naming `what` if the response is not OK. */
105
96
  async function fetchOk(url, what) {
@@ -121,15 +112,20 @@ async function toBytes(input, what) {
121
112
  }
122
113
  /** Read a drawable source as raw RGBA pixels (the fast path, no re-encoding). */
123
114
  function toImageData(input) {
124
- if (input instanceof ImageData) {
125
- return { data: new Uint8Array(input.data.buffer), width: input.width, height: input.height };
115
+ if (typeof ImageData !== "undefined" && input instanceof ImageData) {
116
+ return {
117
+ // Snapshot caller-owned pixels before a queued prediction can yield.
118
+ data: new Uint8Array(input.data),
119
+ width: input.width,
120
+ height: input.height,
121
+ };
126
122
  }
127
123
  let width;
128
124
  let height;
129
- if (input instanceof HTMLImageElement) {
125
+ if (typeof HTMLImageElement !== "undefined" && input instanceof HTMLImageElement) {
130
126
  [width, height] = [input.naturalWidth, input.naturalHeight];
131
127
  }
132
- else if (input instanceof HTMLVideoElement) {
128
+ else if (typeof HTMLVideoElement !== "undefined" && input instanceof HTMLVideoElement) {
133
129
  [width, height] = [input.videoWidth, input.videoHeight];
134
130
  }
135
131
  else {
@@ -139,7 +135,7 @@ function toImageData(input) {
139
135
  const ctx = get2d(canvas, { willReadFrequently: true });
140
136
  ctx.drawImage(input, 0, 0, width, height);
141
137
  const img = ctx.getImageData(0, 0, width, height);
142
- return { data: new Uint8Array(img.data.buffer), width, height };
138
+ return { data: new Uint8Array(img.data.buffer, img.data.byteOffset, img.data.byteLength), width, height };
143
139
  }
144
140
  function makeCanvas(width, height) {
145
141
  if (typeof OffscreenCanvas !== "undefined")
@@ -233,16 +229,22 @@ class LiteRtBackend {
233
229
  static async load(tflite, wasmUrl, accelerator) {
234
230
  const litert = await importLiteRt();
235
231
  await ensureLiteRtRuntime(litert, wasmUrl);
232
+ let model;
236
233
  try {
237
- const model = await litert.loadAndCompile(tflite, { accelerator });
238
- return new LiteRtBackend(litert, model, accelerator);
234
+ model = await litert.loadAndCompile(tflite, { accelerator });
239
235
  }
240
236
  catch (e) {
241
237
  if (accelerator === "wasm")
242
238
  throw e;
243
- const model = await litert.loadAndCompile(tflite, { accelerator: "wasm" });
244
- return new LiteRtBackend(litert, model, "wasm");
239
+ model = await litert.loadAndCompile(tflite, { accelerator: "wasm" });
245
240
  }
241
+ // This runtime is loaded without JSPI. A partially delegated model needs it to
242
+ // switch between GPU and CPU, even when the browser itself supports JSPI.
243
+ if (model.options.accelerator === "webgpu" && !model.isFullyAccelerated) {
244
+ model.delete?.();
245
+ model = await litert.loadAndCompile(tflite, { accelerator: "wasm" });
246
+ }
247
+ return new LiteRtBackend(litert, model, model.options.accelerator);
246
248
  }
247
249
  /** Upload the input tensor, run, and read every output back to the CPU. */
248
250
  async run(input, shape) {
@@ -254,16 +256,15 @@ class LiteRtBackend {
254
256
  const tensors = await this.model.run(gpuIn);
255
257
  const outputs = [];
256
258
  const shapes = [];
257
- for (const t of tensors) {
258
- const host = await t.moveTo("wasm");
259
- // Copy out before deleting; toTypedArray() may view the freed buffer.
260
- outputs.push(new Float32Array(host.toTypedArray()));
259
+ for (const tensor of tensors) {
260
+ const host = await tensor.moveTo("wasm");
261
+ // LiteRT's toTypedArray() already copies the host data.
262
+ const data = host.toTypedArray();
263
+ outputs.push(data instanceof Float32Array ? data : new Float32Array(data));
261
264
  shapes.push(Array.from(host.type.layout.dimensions));
262
265
  host.delete?.();
263
- // moveTo("wasm") returns the same tensor when it is already on wasm; only
264
- // delete the original separately when it is a distinct GPU tensor.
265
- if (t !== host)
266
- t.delete?.();
266
+ if (tensor !== host)
267
+ tensor.delete?.();
267
268
  }
268
269
  return { outputs, shapes, inferenceMs: performance.now() - t0 };
269
270
  }
@@ -307,10 +308,6 @@ class LiteRtEngine {
307
308
  constructor(pipeline, backend) {
308
309
  this.pipeline = pipeline;
309
310
  this.backend = backend;
310
- // `YoloPipeline` keeps exactly one pending frame in wasm state between
311
- // `preprocess_rgba` and `postprocess`, so predictions must not interleave.
312
- // Serialize them: a new call waits for the in-flight one to finish.
313
- this.queue = Promise.resolve();
314
311
  }
315
312
  get task() {
316
313
  return this.pipeline.task;
@@ -324,32 +321,24 @@ class LiteRtEngine {
324
321
  return this.pipeline.names;
325
322
  }
326
323
  predictDrawable(data, width, height, p) {
327
- return this.serialize(() => this.runDrawable(data, width, height, p));
324
+ return this.runDrawable(data, width, height, p);
328
325
  }
329
326
  /** LiteRT takes raw pixels, so decode encoded inputs to RGBA in JS first. */
330
- predictEncoded(bytes, p) {
331
- return this.serialize(async () => {
332
- const bitmap = await createImageBitmap(new Blob([bytes]));
333
- try {
334
- const { data, width, height } = toImageData(bitmap);
335
- return await this.runDrawable(data, width, height, p);
336
- }
337
- finally {
338
- bitmap.close();
339
- }
340
- });
327
+ async predictEncoded(bytes, p) {
328
+ const bitmap = await createImageBitmap(new Blob([bytes]));
329
+ try {
330
+ const { data, width, height } = toImageData(bitmap);
331
+ return await this.runDrawable(data, width, height, p);
332
+ }
333
+ finally {
334
+ bitmap.close();
335
+ }
341
336
  }
342
337
  async runDrawable(data, width, height, p) {
343
338
  const input = this.pipeline.preprocess_rgba(data, width, height);
344
339
  const { outputs, shapes, inferenceMs } = await this.backend.run(input, Array.from(this.pipeline.inputShape));
345
340
  return this.pipeline.postprocess(outputs, shapes.map((s) => new Uint32Array(s)), inferenceMs, p.conf, p.iou, p.classes, p.colormap, p.depthViz);
346
341
  }
347
- /** Chain `fn` after any in-flight prediction so wasm frame state is never shared. */
348
- serialize(fn) {
349
- const result = this.queue.then(fn, fn);
350
- this.queue = result.then(() => undefined, () => undefined);
351
- return result;
352
- }
353
342
  free() {
354
343
  this.pipeline.free();
355
344
  this.backend.free();
@@ -362,6 +351,8 @@ class LiteRtEngine {
362
351
  export class YOLO {
363
352
  constructor(engine) {
364
353
  this.engine = engine;
354
+ // The wasm models keep mutable per-frame state; run one prediction per model at a time.
355
+ this.queue = Promise.resolve();
365
356
  }
366
357
  /**
367
358
  * Load a model and initialize the inference backend.
@@ -391,25 +382,7 @@ export class YOLO {
391
382
  const wasmUrl = options?.litertWasmUrl ? options.litertWasmUrl.toString() : DEFAULT_LITERT_WASM;
392
383
  // Honor `device` including `"auto"`, which feature-detects WebGPU (so a
393
384
  // browser without it goes straight to wasm instead of a failed compile).
394
- let accelerator = (await resolveDevice(options?.device)) === "webgpu" ? "webgpu" : "wasm";
395
- // NMS-free exports (YOLO26, `nms=False`) do top-k selection with int64 + gather_nd ops the
396
- // LiteRT WebGPU delegate cannot run: it fails to invoke and returns zeros.
397
- // Force CPU/wasm so the model works. For WebGPU speed, re-export the model
398
- // with Ultralytics >=8.4.142 and `nms=None` for the one-to-many head (NMS in Rust).
399
- if (accelerator === "webgpu" && pipeline.end2end) {
400
- accelerator = "wasm";
401
- console.warn("LiteRT: this is an NMS-free model; its WebGPU delegate can't run the int64 ops, so it runs on CPU/wasm. Re-export with Ultralytics >=8.4.142 and `nms=None` for WebGPU.");
402
- }
403
- // RT-DETR's deformable-attention decoder reshapes to rank 5 and indexes with int64,
404
- // which the LiteRT WebGPU delegate rejects: Vulkan logs a RESHAPE error per offending
405
- // node and falls back per-op, Metal-3 fails the compile outright. `"auto"` therefore
406
- // goes straight to wasm and skips the noise and the wasted GPU compile. An explicit
407
- // `device: "webgpu"` is still honored, so this can be re-tested when the delegate
408
- // grows the missing ops, without patching the library.
409
- if (accelerator === "webgpu" && pipeline.rtdetr && options?.device !== "webgpu") {
410
- accelerator = "wasm";
411
- console.warn('LiteRT: RT-DETR\'s decoder uses rank-5 reshapes and int64 indices that the WebGPU delegate could not run on the drivers tested, so it runs on CPU/wasm. Pass device: "webgpu" to try it anyway.');
412
- }
385
+ const accelerator = (await resolveDevice(options?.device)) === "webgpu" ? "webgpu" : "wasm";
413
386
  const backend = await LiteRtBackend.load(tflite, wasmUrl, accelerator);
414
387
  // The compiled model outranks the metadata: `pipeline.inputShape` is what sizes the
415
388
  // input tensor below, so a stale `imgsz` would build one the model rejects.
@@ -436,7 +409,7 @@ export class YOLO {
436
409
  * Run inference on an image.
437
410
  *
438
411
  * Drawable sources (`ImageData`, `HTMLImageElement`, `HTMLCanvasElement`,
439
- * `HTMLVideoElement`, `ImageBitmap`) take a fast path that reads raw pixels
412
+ * `HTMLVideoElement`, `OffscreenCanvas`, `ImageBitmap`) take a fast path that reads raw pixels
440
413
  * with no re-encoding, ideal for webcam/video. URLs, `Blob`s, and raw bytes
441
414
  * are decoded (in wasm for `ort`, via a canvas for `litert`).
442
415
  *
@@ -453,12 +426,22 @@ export class YOLO {
453
426
  colormap: options?.colormap ?? "",
454
427
  depthViz: options?.depthViz ?? "",
455
428
  };
429
+ let predict;
456
430
  if (isDrawable(image)) {
457
431
  const { data, width, height } = toImageData(image);
458
- return decodeResults(await this.engine.predictDrawable(data, width, height, p));
432
+ predict = () => this.engine.predictDrawable(data, width, height, p);
459
433
  }
460
- const bytes = await toBytes(image, "image");
461
- return decodeResults(await this.engine.predictEncoded(bytes, p));
434
+ else {
435
+ const bytes = image instanceof Uint8Array
436
+ ? image.slice()
437
+ : image instanceof ArrayBuffer
438
+ ? new Uint8Array(image.slice(0))
439
+ : await toBytes(image, "image");
440
+ predict = () => this.engine.predictEncoded(bytes, p);
441
+ }
442
+ const result = this.queue.then(async () => decodeResults(await predict()));
443
+ this.queue = result.then(() => undefined, () => undefined);
444
+ return result;
462
445
  }
463
446
  /** Release the underlying wasm model/engine. Call when you are done with it. */
464
447
  free() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultralytics/yolo",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "Run Ultralytics YOLO models in the browser on WebGPU (WebAssembly, ONNX Runtime Web via ort-web).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/pkg/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ultralytics-inference-web",
3
3
  "type": "module",
4
4
  "description": "Browser/WebAssembly bindings for ultralytics-inference (WebGPU via ort-web)",
5
- "version": "0.0.54",
5
+ "version": "0.0.55",
6
6
  "license": "AGPL-3.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -140,9 +140,7 @@ export class YoloPipeline {
140
140
  */
141
141
  setInputShape(shape: Int32Array): void;
142
142
  /**
143
- * Whether this is an NMS-free export, e.g. YOLO26 with `nms=False`. Its head runs
144
- * top-k selection with `int64`/`gather_nd` ops that the LiteRT WebGPU delegate
145
- * cannot execute, so such models must run on the CPU (wasm) accelerator.
143
+ * Whether this is an NMS-free export, e.g. YOLO26 with `nms=False`.
146
144
  */
147
145
  readonly end2end: boolean;
148
146
  /**
@@ -159,9 +157,7 @@ export class YoloPipeline {
159
157
  */
160
158
  readonly names: any;
161
159
  /**
162
- * Whether this is an RT-DETR export. Its deformable-attention decoder reshapes to
163
- * rank 5 and indexes with `int64`, neither of which the LiteRT WebGPU delegate
164
- * supports, so such models must run on the CPU (wasm) accelerator.
160
+ * Whether this is an RT-DETR export.
165
161
  */
166
162
  readonly rtdetr: boolean;
167
163
  /**
@@ -207,10 +203,10 @@ export interface InitOutput {
207
203
  readonly yolopipeline_rtdetr: (a: number) => number;
208
204
  readonly yolopipeline_setInputShape: (a: number, b: number, c: number) => void;
209
205
  readonly yolopipeline_task: (a: number, b: number) => void;
210
- readonly __wasm_bindgen_func_elem_1159: (a: number, b: number, c: number, d: number) => void;
211
- readonly __wasm_bindgen_func_elem_1159_20: (a: number, b: number, c: number, d: number) => void;
212
- readonly __wasm_bindgen_func_elem_1786: (a: number, b: number, c: number, d: number) => void;
213
- readonly __wasm_bindgen_func_elem_1810: (a: number, b: number, c: number, d: number) => void;
206
+ readonly __wasm_bindgen_func_elem_1192: (a: number, b: number, c: number, d: number) => void;
207
+ readonly __wasm_bindgen_func_elem_1823: (a: number, b: number, c: number, d: number) => void;
208
+ readonly __wasm_bindgen_func_elem_1847: (a: number, b: number, c: number, d: number) => void;
209
+ readonly __wasm_bindgen_func_elem_377: (a: number, b: number, c: number, d: number) => void;
214
210
  readonly __wbindgen_export: (a: number, b: number) => number;
215
211
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
216
212
  readonly __wbindgen_export3: (a: number) => void;
@@ -1,6 +1,6 @@
1
1
  /* @ts-self-types="./ultralytics_inference_web.d.ts" */
2
- import { initRuntime } from './snippets/ort-web-d1ef36df9bbdf0c7/_loader.js';
3
- import { trackSessionInit } from './snippets/ort-web-d1ef36df9bbdf0c7/_telemetry.js';
2
+ import { initRuntime } from './snippets/ort-web-d8e9a032d14319ec/_loader.js';
3
+ import { trackSessionInit } from './snippets/ort-web-d8e9a032d14319ec/_telemetry.js';
4
4
 
5
5
 
6
6
  /**
@@ -208,9 +208,7 @@ export class YoloPipeline {
208
208
  wasm.__wbg_yolopipeline_free(ptr, 0);
209
209
  }
210
210
  /**
211
- * Whether this is an NMS-free export, e.g. YOLO26 with `nms=False`. Its head runs
212
- * top-k selection with `int64`/`gather_nd` ops that the LiteRT WebGPU delegate
213
- * cannot execute, so such models must run on the CPU (wasm) accelerator.
211
+ * Whether this is an NMS-free export, e.g. YOLO26 with `nms=False`.
214
212
  * @returns {boolean}
215
213
  */
216
214
  get end2end() {
@@ -370,9 +368,7 @@ export class YoloPipeline {
370
368
  }
371
369
  }
372
370
  /**
373
- * Whether this is an RT-DETR export. Its deformable-attention decoder reshapes to
374
- * rank 5 and indexes with `int64`, neither of which the LiteRT WebGPU delegate
375
- * supports, so such models must run on the CPU (wasm) accelerator.
371
+ * Whether this is an RT-DETR export.
376
372
  * @returns {boolean}
377
373
  */
378
374
  get rtdetr() {
@@ -557,25 +553,28 @@ function __wbg_get_imports() {
557
553
  const ret = getObject(arg0).call(getObject(arg1));
558
554
  return addHeapObject(ret);
559
555
  }, arguments); },
560
- __wbg_create_92add3f2dd5e9fec: function() { return handleError(function (arg0, arg1, arg2) {
556
+ __wbg_create_07db378e252080ec: function() { return handleError(function (arg0, arg1, arg2) {
561
557
  const ret = ort.InferenceSession.create(getStringFromWasm0(arg0, arg1), takeObject(arg2));
562
558
  return addHeapObject(ret);
563
559
  }, arguments); },
564
- __wbg_create_c3bda381e473821b: function() { return handleError(function (arg0, arg1) {
560
+ __wbg_create_573b47018e76ad99: function() { return handleError(function (arg0, arg1) {
565
561
  const ret = ort.InferenceSession.create(getObject(arg0), takeObject(arg1));
566
562
  return addHeapObject(ret);
567
563
  }, arguments); },
568
- __wbg_data_7ea15a3ce3038789: function() { return handleError(function (arg0) {
564
+ __wbg_data_e242aa3d2f3b3ce2: function() { return handleError(function (arg0) {
569
565
  const ret = getObject(arg0).data;
570
566
  return addHeapObject(ret);
571
567
  }, arguments); },
572
- __wbg_dims_ad4921ea2a0e2688: function(arg0, arg1) {
568
+ __wbg_dims_b9c966d20c2a4d79: function(arg0, arg1) {
573
569
  const ret = getObject(arg1).dims;
574
- const ptr1 = passArray64ToWasm0(ret, wasm.__wbindgen_export);
570
+ const ptr1 = passArrayF64ToWasm0(ret, wasm.__wbindgen_export);
575
571
  const len1 = WASM_VECTOR_LEN;
576
572
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
577
573
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
578
574
  },
575
+ __wbg_dispose_17a92fe091ac456b: function() { return handleError(function (arg0) {
576
+ getObject(arg0).dispose();
577
+ }, arguments); },
579
578
  __wbg_done_b41a1d26cdb37fb6: function(arg0) {
580
579
  const ret = getObject(arg0).done;
581
580
  return ret;
@@ -599,7 +598,7 @@ function __wbg_get_imports() {
599
598
  const ret = Array.from(getObject(arg0));
600
599
  return addHeapObject(ret);
601
600
  },
602
- __wbg_getData_636da3f54c76e83d: function() { return handleError(function (arg0) {
601
+ __wbg_getData_ae0be7023598e2c2: function() { return handleError(function (arg0) {
603
602
  const ret = getObject(arg0).getData();
604
603
  return addHeapObject(ret);
605
604
  }, arguments); },
@@ -623,18 +622,18 @@ function __wbg_get_imports() {
623
622
  const ret = getObject(arg0)[getObject(arg1)];
624
623
  return addHeapObject(ret);
625
624
  },
626
- __wbg_initRuntime_b299fae72b0dc4e0: function() { return handleError(function (arg0, arg1) {
625
+ __wbg_initRuntime_cfc81535b182a89a: function() { return handleError(function (arg0, arg1) {
627
626
  const ret = initRuntime(arg0, takeObject(arg1));
628
627
  return addHeapObject(ret);
629
628
  }, arguments); },
630
- __wbg_inputMetadata_d393d214fc106b6b: function(arg0, arg1) {
629
+ __wbg_inputMetadata_b0480cebe7a00667: function(arg0, arg1) {
631
630
  const ret = getObject(arg1).inputMetadata;
632
631
  const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
633
632
  const len1 = WASM_VECTOR_LEN;
634
633
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
635
634
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
636
635
  },
637
- __wbg_inputNames_724b40f0a2d8fba4: function(arg0, arg1) {
636
+ __wbg_inputNames_2897599e914f9792: function(arg0, arg1) {
638
637
  const ret = getObject(arg1).inputNames;
639
638
  const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
640
639
  const len1 = WASM_VECTOR_LEN;
@@ -661,20 +660,20 @@ function __wbg_get_imports() {
661
660
  const ret = result;
662
661
  return ret;
663
662
  },
664
- __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
663
+ __wbg_instanceof_Performance_cbec0dbedaa91be1: function(arg0) {
665
664
  let result;
666
665
  try {
667
- result = getObject(arg0) instanceof Uint8Array;
666
+ result = getObject(arg0) instanceof Performance;
668
667
  } catch (_) {
669
668
  result = false;
670
669
  }
671
670
  const ret = result;
672
671
  return ret;
673
672
  },
674
- __wbg_instanceof_Window_82d71df4eddf88bc: function(arg0) {
673
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
675
674
  let result;
676
675
  try {
677
- result = getObject(arg0) instanceof Window;
676
+ result = getObject(arg0) instanceof Uint8Array;
678
677
  } catch (_) {
679
678
  result = false;
680
679
  }
@@ -709,10 +708,14 @@ function __wbg_get_imports() {
709
708
  const ret = getObject(arg0).length;
710
709
  return ret;
711
710
  },
712
- __wbg_location_348911e2e503af1d: function(arg0) {
711
+ __wbg_location_02e5bf0e6b80a0f5: function(arg0) {
713
712
  const ret = getObject(arg0).location;
714
713
  return (__wbindgen_enum_DataLocation.indexOf(ret) + 1 || 7) - 1;
715
714
  },
715
+ __wbg_message_5f8387f0c32b90a7: function(arg0) {
716
+ const ret = getObject(arg0).message;
717
+ return addHeapObject(ret);
718
+ },
716
719
  __wbg_new_1dbf7428bba60a42: function(arg0) {
717
720
  const ret = new Uint8Array(getObject(arg0));
718
721
  return addHeapObject(ret);
@@ -733,10 +736,14 @@ function __wbg_get_imports() {
733
736
  const ret = new Array();
734
737
  return addHeapObject(ret);
735
738
  },
736
- __wbg_new_from_buffer_raw_1a36905fc3da3c96: function() { return handleError(function (arg0, arg1, arg2) {
739
+ __wbg_new_from_buffer_raw_eb33cdffdf32a27b: function() { return handleError(function (arg0, arg1, arg2) {
737
740
  const ret = new ort.Tensor(__wbindgen_enum_DataType[arg0], takeObject(arg1), takeObject(arg2));
738
741
  return addHeapObject(ret);
739
742
  }, arguments); },
743
+ __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
744
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
745
+ return addHeapObject(ret);
746
+ },
740
747
  __wbg_new_from_slice_ca6ad97db1f4779a: function(arg0, arg1) {
741
748
  const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
742
749
  return addHeapObject(ret);
@@ -748,7 +755,7 @@ function __wbg_get_imports() {
748
755
  const a = state0.a;
749
756
  state0.a = 0;
750
757
  try {
751
- return __wasm_bindgen_func_elem_1810(a, state0.b, arg0, arg1);
758
+ return __wasm_bindgen_func_elem_1847(a, state0.b, arg0, arg1);
752
759
  } finally {
753
760
  state0.a = a;
754
761
  }
@@ -759,48 +766,44 @@ function __wbg_get_imports() {
759
766
  state0.a = 0;
760
767
  }
761
768
  },
762
- __wbg_new_with_byte_offset_and_length_2f5d7fc2a828b74d: function(arg0, arg1, arg2) {
763
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
769
+ __wbg_new_with_byte_offset_and_length_1dc9f6fbbe046da6: function(arg0, arg1, arg2) {
770
+ const ret = new Uint16Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
764
771
  return addHeapObject(ret);
765
772
  },
766
- __wbg_new_with_length_10ec131ed0376a89: function(arg0) {
767
- const ret = new Int8Array(arg0 >>> 0);
768
- return addHeapObject(ret);
769
- },
770
- __wbg_new_with_length_1135aa9e3c0fb17c: function(arg0) {
771
- const ret = new BigUint64Array(arg0 >>> 0);
773
+ __wbg_new_with_byte_offset_and_length_2f5d7fc2a828b74d: function(arg0, arg1, arg2) {
774
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
772
775
  return addHeapObject(ret);
773
776
  },
774
- __wbg_new_with_length_178f83910c35a379: function(arg0) {
775
- const ret = new BigInt64Array(arg0 >>> 0);
777
+ __wbg_new_with_byte_offset_and_length_40c170286adc9005: function(arg0, arg1, arg2) {
778
+ const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
776
779
  return addHeapObject(ret);
777
780
  },
778
- __wbg_new_with_length_31d0d732d07f3195: function(arg0) {
779
- const ret = new Uint32Array(arg0 >>> 0);
781
+ __wbg_new_with_byte_offset_and_length_6e8c68600a3ecb84: function(arg0, arg1, arg2) {
782
+ const ret = new BigUint64Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
780
783
  return addHeapObject(ret);
781
784
  },
782
- __wbg_new_with_length_3827645dc5adb679: function(arg0) {
783
- const ret = new Float64Array(arg0 >>> 0);
785
+ __wbg_new_with_byte_offset_and_length_820ea3ecbd1a4828: function(arg0, arg1, arg2) {
786
+ const ret = new Int16Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
784
787
  return addHeapObject(ret);
785
788
  },
786
- __wbg_new_with_length_3da0ad195f6f63ba: function(arg0) {
787
- const ret = new Uint8Array(arg0 >>> 0);
789
+ __wbg_new_with_byte_offset_and_length_915c5de4270ab7e5: function(arg0, arg1, arg2) {
790
+ const ret = new Int8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
788
791
  return addHeapObject(ret);
789
792
  },
790
- __wbg_new_with_length_42910c27ec097fc3: function(arg0) {
791
- const ret = new Int32Array(arg0 >>> 0);
793
+ __wbg_new_with_byte_offset_and_length_b93e61c4e9440336: function(arg0, arg1, arg2) {
794
+ const ret = new Int32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
792
795
  return addHeapObject(ret);
793
796
  },
794
- __wbg_new_with_length_6b2193ba95fe514b: function(arg0) {
795
- const ret = new Uint16Array(arg0 >>> 0);
797
+ __wbg_new_with_byte_offset_and_length_bf3e693fe2fffb6f: function(arg0, arg1, arg2) {
798
+ const ret = new Uint32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
796
799
  return addHeapObject(ret);
797
800
  },
798
- __wbg_new_with_length_a29f4581839a9ad6: function(arg0) {
799
- const ret = new Int16Array(arg0 >>> 0);
801
+ __wbg_new_with_byte_offset_and_length_c14d867a5878f875: function(arg0, arg1, arg2) {
802
+ const ret = new BigInt64Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
800
803
  return addHeapObject(ret);
801
804
  },
802
- __wbg_new_with_length_cc0362bfe8499e5a: function(arg0) {
803
- const ret = new Float32Array(arg0 >>> 0);
805
+ __wbg_new_with_byte_offset_and_length_edf873b0b3173456: function(arg0, arg1, arg2) {
806
+ const ret = new Float64Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
804
807
  return addHeapObject(ret);
805
808
  },
806
809
  __wbg_next_33784799010f1bbe: function(arg0) {
@@ -815,14 +818,14 @@ function __wbg_get_imports() {
815
818
  const ret = getObject(arg0).now();
816
819
  return ret;
817
820
  },
818
- __wbg_outputMetadata_7300f513b14cec51: function(arg0, arg1) {
821
+ __wbg_outputMetadata_d74fba311b0cce30: function(arg0, arg1) {
819
822
  const ret = getObject(arg1).outputMetadata;
820
823
  const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
821
824
  const len1 = WASM_VECTOR_LEN;
822
825
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
823
826
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
824
827
  },
825
- __wbg_outputNames_9d56e41945ee91d5: function(arg0, arg1) {
828
+ __wbg_outputNames_26deb7d052bac410: function(arg0, arg1) {
826
829
  const ret = getObject(arg1).outputNames;
827
830
  const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
828
831
  const len1 = WASM_VECTOR_LEN;
@@ -833,10 +836,6 @@ function __wbg_get_imports() {
833
836
  const ret = Reflect.ownKeys(getObject(arg0));
834
837
  return addHeapObject(ret);
835
838
  }, arguments); },
836
- __wbg_performance_d0d7b03fc649b694: function(arg0) {
837
- const ret = getObject(arg0).performance;
838
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
839
- },
840
839
  __wbg_prototypesetcall_06eb15da165dee8f: function(arg0, arg1, arg2) {
841
840
  Uint32Array.prototype.set.call(getArrayU32FromWasm0(arg0, arg1), getObject(arg2));
842
841
  },
@@ -857,18 +856,25 @@ function __wbg_get_imports() {
857
856
  __wbg_queueMicrotask_a72f977e97f23c5f: function(arg0) {
858
857
  queueMicrotask(getObject(arg0));
859
858
  },
859
+ __wbg_release_0dd02e33b7cd324c: function() { return handleError(function (arg0) {
860
+ const ret = getObject(arg0).release();
861
+ return addHeapObject(ret);
862
+ }, arguments); },
860
863
  __wbg_resolve_0076e10020304ede: function(arg0) {
861
864
  const ret = Promise.resolve(getObject(arg0));
862
865
  return addHeapObject(ret);
863
866
  },
864
- __wbg_run_9e09e7300abe14f9: function() { return handleError(function (arg0, arg1) {
865
- const ret = getObject(arg0).run(takeObject(arg1));
867
+ __wbg_run_2893666784c8891d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
868
+ const ret = getObject(arg0).run(takeObject(arg1), takeObject(arg2), takeObject(arg3));
866
869
  return addHeapObject(ret);
867
870
  }, arguments); },
868
871
  __wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
869
872
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
870
873
  return ret;
871
874
  }, arguments); },
875
+ __wbg_set_34d08fd992d43d61: function(arg0, arg1, arg2) {
876
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
877
+ },
872
878
  __wbg_set_575d3ddb70fe831d: function(arg0, arg1, arg2) {
873
879
  getObject(arg0).set(getArrayU8FromWasm0(arg1, arg2));
874
880
  },
@@ -924,11 +930,11 @@ function __wbg_get_imports() {
924
930
  const ret = getObject(arg0).toString();
925
931
  return addHeapObject(ret);
926
932
  },
927
- __wbg_trackSessionInit_802b774d44772d22: function() { return handleError(function (arg0, arg1) {
933
+ __wbg_trackSessionInit_b37a6598a5541f10: function() { return handleError(function (arg0, arg1) {
928
934
  const ret = trackSessionInit(getStringFromWasm0(arg0, arg1));
929
935
  return addHeapObject(ret);
930
936
  }, arguments); },
931
- __wbg_type_80ea00300eb18928: function(arg0) {
937
+ __wbg_type_e1fd5cc29b264a06: function(arg0) {
932
938
  const ret = getObject(arg0).type;
933
939
  return (__wbindgen_enum_DataType.indexOf(ret) + 1 || 16) - 1;
934
940
  },
@@ -941,18 +947,18 @@ function __wbg_get_imports() {
941
947
  return addHeapObject(ret);
942
948
  },
943
949
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
944
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 351, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
945
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1159);
950
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 364, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
951
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1192);
946
952
  return addHeapObject(ret);
947
953
  },
948
954
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
949
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 593, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
950
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1786);
955
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 648, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
956
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1823);
951
957
  return addHeapObject(ret);
952
958
  },
953
959
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
954
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("boolean")], shim_idx: 351, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
955
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1159_20);
960
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("boolean")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
961
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_377);
956
962
  return addHeapObject(ret);
957
963
  },
958
964
  __wbindgen_generic_0000000000000004: function(arg0) {
@@ -1039,14 +1045,14 @@ function __wbg_get_imports() {
1039
1045
  };
1040
1046
  }
1041
1047
 
1042
- function __wasm_bindgen_func_elem_1810(arg0, arg1, arg2, arg3) {
1043
- wasm.__wasm_bindgen_func_elem_1810(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1048
+ function __wasm_bindgen_func_elem_1847(arg0, arg1, arg2, arg3) {
1049
+ wasm.__wasm_bindgen_func_elem_1847(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1044
1050
  }
1045
1051
 
1046
- function __wasm_bindgen_func_elem_1159(arg0, arg1, arg2) {
1052
+ function __wasm_bindgen_func_elem_1192(arg0, arg1, arg2) {
1047
1053
  try {
1048
1054
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1049
- wasm.__wasm_bindgen_func_elem_1159(retptr, arg0, arg1, addHeapObject(arg2));
1055
+ wasm.__wasm_bindgen_func_elem_1192(retptr, arg0, arg1, addHeapObject(arg2));
1050
1056
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1051
1057
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1052
1058
  if (r1) {
@@ -1057,10 +1063,10 @@ function __wasm_bindgen_func_elem_1159(arg0, arg1, arg2) {
1057
1063
  }
1058
1064
  }
1059
1065
 
1060
- function __wasm_bindgen_func_elem_1786(arg0, arg1, arg2) {
1066
+ function __wasm_bindgen_func_elem_1823(arg0, arg1, arg2) {
1061
1067
  try {
1062
1068
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1063
- wasm.__wasm_bindgen_func_elem_1786(retptr, arg0, arg1, addHeapObject(arg2));
1069
+ wasm.__wasm_bindgen_func_elem_1823(retptr, arg0, arg1, addHeapObject(arg2));
1064
1070
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1065
1071
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1066
1072
  if (r1) {
@@ -1071,10 +1077,10 @@ function __wasm_bindgen_func_elem_1786(arg0, arg1, arg2) {
1071
1077
  }
1072
1078
  }
1073
1079
 
1074
- function __wasm_bindgen_func_elem_1159_20(arg0, arg1, arg2) {
1080
+ function __wasm_bindgen_func_elem_377(arg0, arg1, arg2) {
1075
1081
  try {
1076
1082
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1077
- wasm.__wasm_bindgen_func_elem_1159_20(retptr, arg0, arg1, addHeapObject(arg2));
1083
+ wasm.__wasm_bindgen_func_elem_377(retptr, arg0, arg1, addHeapObject(arg2));
1078
1084
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1079
1085
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1080
1086
  if (r1) {
@@ -1377,16 +1383,16 @@ function passArray32ToWasm0(arg, malloc) {
1377
1383
  return ptr;
1378
1384
  }
1379
1385
 
1380
- function passArray64ToWasm0(arg, malloc) {
1381
- const ptr = malloc(arg.length * 8, 8) >>> 0;
1382
- getBigUint64ArrayMemory0().set(arg, ptr / 8);
1386
+ function passArray8ToWasm0(arg, malloc) {
1387
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1388
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1383
1389
  WASM_VECTOR_LEN = arg.length;
1384
1390
  return ptr;
1385
1391
  }
1386
1392
 
1387
- function passArray8ToWasm0(arg, malloc) {
1388
- const ptr = malloc(arg.length * 1, 1) >>> 0;
1389
- getUint8ArrayMemory0().set(arg, ptr / 1);
1393
+ function passArrayF64ToWasm0(arg, malloc) {
1394
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
1395
+ getFloat64ArrayMemory0().set(arg, ptr / 8);
1390
1396
  WASM_VECTOR_LEN = arg.length;
1391
1397
  return ptr;
1392
1398
  }
@@ -20,10 +20,10 @@ export const yolopipeline_preprocess_rgba: (a: number, b: number, c: number, d:
20
20
  export const yolopipeline_rtdetr: (a: number) => number;
21
21
  export const yolopipeline_setInputShape: (a: number, b: number, c: number) => void;
22
22
  export const yolopipeline_task: (a: number, b: number) => void;
23
- export const __wasm_bindgen_func_elem_1159: (a: number, b: number, c: number, d: number) => void;
24
- export const __wasm_bindgen_func_elem_1159_20: (a: number, b: number, c: number, d: number) => void;
25
- export const __wasm_bindgen_func_elem_1786: (a: number, b: number, c: number, d: number) => void;
26
- export const __wasm_bindgen_func_elem_1810: (a: number, b: number, c: number, d: number) => void;
23
+ export const __wasm_bindgen_func_elem_1192: (a: number, b: number, c: number, d: number) => void;
24
+ export const __wasm_bindgen_func_elem_1823: (a: number, b: number, c: number, d: number) => void;
25
+ export const __wasm_bindgen_func_elem_1847: (a: number, b: number, c: number, d: number) => void;
26
+ export const __wasm_bindgen_func_elem_377: (a: number, b: number, c: number, d: number) => void;
27
27
  export const __wbindgen_export: (a: number, b: number) => number;
28
28
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
29
29
  export const __wbindgen_export3: (a: number) => void;