@ultralytics/yolo 0.0.50 → 0.0.52
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 +13 -11
- package/README.zh-CN.md +10 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -1
- package/package.json +1 -1
- package/pkg/package.json +1 -1
- package/pkg/snippets/{ort-web-4c80a52e3fc0a0d5 → ort-web-d1ef36df9bbdf0c7}/_loader.js +13 -13
- package/pkg/ultralytics_inference_web.d.ts +6 -6
- package/pkg/ultralytics_inference_web.js +44 -37
- package/pkg/ultralytics_inference_web_bg.wasm +0 -0
- package/pkg/ultralytics_inference_web_bg.wasm.d.ts +4 -4
- /package/pkg/snippets/{ort-web-4c80a52e3fc0a0d5 → ort-web-d1ef36df9bbdf0c7}/_telemetry.js +0 -0
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
|
-
Run [Ultralytics](https://www.ultralytics.com) YOLO models directly in the browser, with no server and no Python. It runs on **WebGPU** (with an automatic CPU/wasm fallback) and covers [object detection](https://docs.ultralytics.com/tasks/detect), [instance segmentation](https://docs.ultralytics.com/tasks/segment), [
|
|
35
|
+
Run [Ultralytics](https://www.ultralytics.com) YOLO models directly in the browser, with no server and no Python. It runs on **WebGPU** (with an automatic CPU/wasm fallback) and covers [object detection](https://docs.ultralytics.com/tasks/detect), [instance segmentation](https://docs.ultralytics.com/tasks/segment), [semantic segmentation](https://docs.ultralytics.com/tasks/semantic), [depth estimation](https://docs.ultralytics.com/tasks/depth), [image classification](https://docs.ultralytics.com/tasks/classify), [pose estimation](https://docs.ultralytics.com/tasks/pose), and [oriented bounding boxes](https://docs.ultralytics.com/tasks/obb), behind a small TypeScript API with a built-in `annotate()` that draws results straight to a canvas.
|
|
36
36
|
|
|
37
37
|
```ts
|
|
38
38
|
import { YOLO, annotate } from "@ultralytics/yolo";
|
|
@@ -89,6 +89,8 @@ const results = await model.predict(canvas, { conf: 0.25, iou: 0.7 });
|
|
|
89
89
|
console.log(model.device); // "webgpu" or "cpu"
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
+
Pass `classes: [0, 2]` to keep only those class ids.
|
|
93
|
+
|
|
92
94
|
`YOLO.load` also takes a `Blob`/`File`, so you can load a model the user drops or
|
|
93
95
|
picks. The backend is detected from the bytes, so the same call handles `.onnx`
|
|
94
96
|
and `.tflite`:
|
|
@@ -124,13 +126,13 @@ Runs [Ultralytics YOLOv8](https://docs.ultralytics.com/models/yolov8),
|
|
|
124
126
|
[Ultralytics YOLO26](https://docs.ultralytics.com/models/yolo26) ONNX exports for
|
|
125
127
|
[detection](https://docs.ultralytics.com/tasks/detect),
|
|
126
128
|
[segmentation](https://docs.ultralytics.com/tasks/segment),
|
|
127
|
-
[
|
|
128
|
-
[
|
|
129
|
+
[semantic segmentation](https://docs.ultralytics.com/tasks/semantic),
|
|
130
|
+
[depth estimation](https://docs.ultralytics.com/tasks/depth),
|
|
129
131
|
[classification](https://docs.ultralytics.com/tasks/classify),
|
|
130
|
-
[
|
|
131
|
-
[
|
|
132
|
+
[pose](https://docs.ultralytics.com/tasks/pose), and
|
|
133
|
+
[OBB](https://docs.ultralytics.com/tasks/obb).
|
|
132
134
|
|
|
133
|
-
`YOLO.load` takes a URL or path,
|
|
135
|
+
`YOLO.load` takes a URL or path, which the browser fetches like any other asset. Download the weights you want from the [Ultralytics assets release](https://github.com/ultralytics/assets/releases) (the same files the native crate and Python use) and host them **same-origin**, or behind a CORS-enabled origin:
|
|
134
136
|
|
|
135
137
|
```ts
|
|
136
138
|
await YOLO.load("/models/yolo26n.onnx");
|
|
@@ -141,7 +143,7 @@ GitHub release assets send no `Access-Control-Allow-Origin`, so a browser cannot
|
|
|
141
143
|
## 📐 Results Shape
|
|
142
144
|
|
|
143
145
|
`predict()` resolves to a `Results` object whose field names match the
|
|
144
|
-
Rust/Ultralytics `Results` API
|
|
146
|
+
Rust/Ultralytics `Results` API one-to-one:
|
|
145
147
|
|
|
146
148
|
| Field | Type | Tasks |
|
|
147
149
|
| ------------------ | -------------------------------------------------------------------- | --------------------- |
|
|
@@ -219,9 +221,9 @@ await annotate(canvas, img, results, { depthAlpha: 0.6 });
|
|
|
219
221
|
The folder must contain the ONNX Runtime Web entry scripts (`ort.webgpu.min.js`
|
|
220
222
|
and `ort.wasm.min.js` for the CPU fallback) plus the
|
|
221
223
|
`ort-wasm-simd-threaded.{jsep,asyncify,}.{mjs,wasm}` binaries.
|
|
222
|
-
- **Telemetry**: `ort-web`
|
|
223
|
-
creation.
|
|
224
|
-
|
|
224
|
+
- **Telemetry**: `ort-web` can report the page domain to pyke on first session
|
|
225
|
+
creation. This package turns that off, so nothing is sent. See the
|
|
226
|
+
[ort-web docs](https://ort.pyke.io/backends/web) for what it would send.
|
|
225
227
|
|
|
226
228
|
## ⚡ LiteRT.js backend
|
|
227
229
|
|
|
@@ -299,7 +301,7 @@ Notes:
|
|
|
299
301
|
If you load an NMS-free `.tflite`, the backend auto-switches it to wasm
|
|
300
302
|
(slower) and logs a warning rather than returning empty results.
|
|
301
303
|
|
|
302
|
-
- **Tasks**: detect, segment,
|
|
304
|
+
- **Tasks**: detect, segment, semantic, depth, classify, pose, and obb are all supported.
|
|
303
305
|
- **Cross-origin isolation**: LiteRT's threaded wasm wants `SharedArrayBuffer`,
|
|
304
306
|
so serve with `Cross-Origin-Opener-Policy: same-origin` and
|
|
305
307
|
`Cross-Origin-Embedder-Policy: require-corp`.
|
package/README.zh-CN.md
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
|
-
直接在浏览器中运行 [Ultralytics](https://www.ultralytics.com) YOLO 模型,无需服务器,也无需 Python。本库基于 **WebGPU**(并自动回退到 CPU/wasm),支持[目标检测](https://docs.ultralytics.com/tasks/detect)、[实例分割](https://docs.ultralytics.com/tasks/segment)、[
|
|
35
|
+
直接在浏览器中运行 [Ultralytics](https://www.ultralytics.com) YOLO 模型,无需服务器,也无需 Python。本库基于 **WebGPU**(并自动回退到 CPU/wasm),支持[目标检测](https://docs.ultralytics.com/tasks/detect)、[实例分割](https://docs.ultralytics.com/tasks/segment)、[语义分割](https://docs.ultralytics.com/tasks/semantic)、[深度估计](https://docs.ultralytics.com/tasks/depth)、[图像分类](https://docs.ultralytics.com/tasks/classify)、[姿态估计](https://docs.ultralytics.com/tasks/pose)和[旋转边界框](https://docs.ultralytics.com/tasks/obb),接口是一个小巧的 TypeScript API,内置的 `annotate()` 可直接把结果绘制到 canvas 上。
|
|
36
36
|
|
|
37
37
|
```ts
|
|
38
38
|
import { YOLO, annotate } from "@ultralytics/yolo";
|
|
@@ -86,6 +86,8 @@ const results = await model.predict(canvas, { conf: 0.25, iou: 0.7 });
|
|
|
86
86
|
console.log(model.device); // "webgpu" 或 "cpu"
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
传入 `classes: [0, 2]` 可只保留这些类别 ID。
|
|
90
|
+
|
|
89
91
|
`YOLO.load` 同样接受 `Blob`/`File`,因此可以加载用户拖入或选择的模型。后端根据字节内容自动检测,
|
|
90
92
|
所以同一个调用可同时处理 `.onnx` 和 `.tflite`:
|
|
91
93
|
|
|
@@ -120,11 +122,11 @@ async function frame() {
|
|
|
120
122
|
[Ultralytics YOLO26](https://docs.ultralytics.com/models/yolo26) 的 ONNX 导出模型,覆盖
|
|
121
123
|
[检测](https://docs.ultralytics.com/tasks/detect)、
|
|
122
124
|
[分割](https://docs.ultralytics.com/tasks/segment)、
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
+
[语义分割](https://docs.ultralytics.com/tasks/semantic)、
|
|
126
|
+
[深度估计](https://docs.ultralytics.com/tasks/depth)、
|
|
125
127
|
[分类](https://docs.ultralytics.com/tasks/classify)、
|
|
126
|
-
[
|
|
127
|
-
[
|
|
128
|
+
[姿态](https://docs.ultralytics.com/tasks/pose)和
|
|
129
|
+
[OBB](https://docs.ultralytics.com/tasks/obb)。
|
|
128
130
|
|
|
129
131
|
`YOLO.load` 接受 URL 或路径,浏览器会像加载其他静态资源一样获取它。请从 [Ultralytics assets release](https://github.com/ultralytics/assets/releases) 下载所需权重(与原生 crate 和 Python 使用的是同一份文件),并部署在**同源**位置,或放在启用了 CORS 的源之后:
|
|
130
132
|
|
|
@@ -204,8 +206,8 @@ await annotate(canvas, img, results, { depthAlpha: 0.6 });
|
|
|
204
206
|
```
|
|
205
207
|
该目录需包含 ONNX Runtime Web 的入口脚本(`ort.webgpu.min.js`,以及 CPU 回退所需的
|
|
206
208
|
`ort.wasm.min.js`)和 `ort-wasm-simd-threaded.{jsep,asyncify,}.{mjs,wasm}` 二进制文件。
|
|
207
|
-
- **遥测**:`ort-web`
|
|
208
|
-
[ort-web 文档](https://ort.pyke.io/backends/web)。
|
|
209
|
+
- **遥测**:`ort-web` 可以在首次创建会话时向 pyke 上报页面域名。本包已将其关闭,不会发送任何数据。
|
|
210
|
+
上报内容见 [ort-web 文档](https://ort.pyke.io/backends/web)。
|
|
209
211
|
|
|
210
212
|
## ⚡ LiteRT.js 后端
|
|
211
213
|
|
|
@@ -275,7 +277,7 @@ wasm 默认从 jsDelivr CDN 加载;向 `YOLO.load` 传入 `litertWasmUrl: "/li
|
|
|
275
277
|
|
|
276
278
|
如果加载了无 NMS 的 `.tflite`,后端会自动切换到 wasm(较慢)并打印警告,而不是返回空结果。
|
|
277
279
|
|
|
278
|
-
- **支持的任务**:detect、segment、
|
|
280
|
+
- **支持的任务**:detect、segment、semantic、depth、classify、pose 和 obb 均已支持。
|
|
279
281
|
- **跨源隔离**:LiteRT 的多线程 wasm 需要 `SharedArrayBuffer`,因此请以
|
|
280
282
|
`Cross-Origin-Opener-Policy: same-origin` 和 `Cross-Origin-Embedder-Policy: require-corp`
|
|
281
283
|
提供服务。
|
package/dist/index.d.ts
CHANGED
|
@@ -172,7 +172,7 @@ export declare class YOLO {
|
|
|
172
172
|
/** Load the LiteRT (`.tflite`) backend. Metadata (task, class names, `imgsz`)
|
|
173
173
|
* is read from the single `.tflite` file, the same as the `.onnx` path. */
|
|
174
174
|
private static loadLiteRt;
|
|
175
|
-
/** The model's task (`detect`, `segment`, `
|
|
175
|
+
/** The model's task (`detect`, `segment`, `semantic`, `depth`, `classify`, `pose`, `obb`). */
|
|
176
176
|
get task(): string;
|
|
177
177
|
/** The active device that ran inference (`"webgpu"` or `"cpu"`). */
|
|
178
178
|
get device(): string;
|
package/dist/index.js
CHANGED
|
@@ -75,9 +75,21 @@ function decodeResults(raw) {
|
|
|
75
75
|
}
|
|
76
76
|
let initialized = false;
|
|
77
77
|
/** Initialize the wasm module exactly once. */
|
|
78
|
+
/**
|
|
79
|
+
* `ort-web` 0.4.0 reads tensor dims as 64-bit integers, but ONNX Runtime Web returns plain
|
|
80
|
+
* numbers, which the wasm glue then rejects with "Cannot convert 1 to a BigInt". Accept number
|
|
81
|
+
* arrays in `BigUint64Array.set`, which only ever threw for them before.
|
|
82
|
+
*/
|
|
83
|
+
function allowNumberDims() {
|
|
84
|
+
const set = BigUint64Array.prototype.set;
|
|
85
|
+
BigUint64Array.prototype.set = function (src, offset) {
|
|
86
|
+
set.call(this, Array.isArray(src) ? src.map((v) => BigInt(v)) : src, offset);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
78
89
|
async function ensureInit(wasmUrl) {
|
|
79
90
|
if (initialized)
|
|
80
91
|
return;
|
|
92
|
+
allowNumberDims();
|
|
81
93
|
await init(wasmUrl ? { module_or_path: wasmUrl } : undefined);
|
|
82
94
|
start();
|
|
83
95
|
initialized = true;
|
|
@@ -412,7 +424,7 @@ export class YOLO {
|
|
|
412
424
|
pipeline.setInputShape(new Int32Array(shape));
|
|
413
425
|
return new YOLO(new LiteRtEngine(pipeline, backend));
|
|
414
426
|
}
|
|
415
|
-
/** The model's task (`detect`, `segment`, `
|
|
427
|
+
/** The model's task (`detect`, `segment`, `semantic`, `depth`, `classify`, `pose`, `obb`). */
|
|
416
428
|
get task() {
|
|
417
429
|
return this.engine.task;
|
|
418
430
|
}
|
package/package.json
CHANGED
package/pkg/package.json
CHANGED
|
@@ -14,7 +14,7 @@ const FEATURES_ALL = FEATURES_WEBGL | FEATURES_WEBGPU;
|
|
|
14
14
|
* @property {Record<'main' | 'wrapper' | 'binary', string> | null} integrities
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const DEFAULT_DIST_BASE = 'https://cdn.pyke.io/0/pyke:ort-rs/web@1.
|
|
17
|
+
const DEFAULT_DIST_BASE = 'https://cdn.pyke.io/0/pyke:ort-rs/web@1.30.0/';
|
|
18
18
|
|
|
19
19
|
/** @type {Record<number, Dist>} */
|
|
20
20
|
const DEFAULT_DIST = {
|
|
@@ -23,9 +23,9 @@ const DEFAULT_DIST = {
|
|
|
23
23
|
scriptName: 'ort.wasm.min.js',
|
|
24
24
|
binaryName: 'ort-wasm-simd-threaded.wasm',
|
|
25
25
|
integrities: {
|
|
26
|
-
main: '
|
|
27
|
-
wrapper: '
|
|
28
|
-
binary: '
|
|
26
|
+
main: 'Bw6URI+Gvoadw0do7/QrSHUC9D1vCYYK5OSqChFyhyV5mzPL4oe2rOAFljAnS8Sq',
|
|
27
|
+
wrapper: 'XcXA/MtAf0WpB8e023xQH9CM7RIjiugakT7x99DIwpFf7k56BIFFcAPerIF7FDad',
|
|
28
|
+
binary: 'vjBJ1z7qrhkTyYsNqKeF6c7N+nOJSU94czEo+tvZcu8G75JparGq9kB+kTnEUNVM'
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
[FEATURES_WEBGL]: {
|
|
@@ -33,9 +33,9 @@ const DEFAULT_DIST = {
|
|
|
33
33
|
scriptName: 'ort.webgl.min.js',
|
|
34
34
|
binaryName: 'ort-wasm-simd-threaded.wasm',
|
|
35
35
|
integrities: {
|
|
36
|
-
main: '
|
|
37
|
-
wrapper: '
|
|
38
|
-
binary: '
|
|
36
|
+
main: '1bLj2rkGOwkzpfv9FmPoYNfEZMR+0sniZJQyRhUO6hw1oytXWrtWrTsxYTVNNa7u',
|
|
37
|
+
wrapper: 'XcXA/MtAf0WpB8e023xQH9CM7RIjiugakT7x99DIwpFf7k56BIFFcAPerIF7FDad',
|
|
38
|
+
binary: 'vjBJ1z7qrhkTyYsNqKeF6c7N+nOJSU94czEo+tvZcu8G75JparGq9kB+kTnEUNVM'
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
[FEATURES_WEBGPU]: {
|
|
@@ -43,9 +43,9 @@ const DEFAULT_DIST = {
|
|
|
43
43
|
scriptName: 'ort.webgpu.min.js',
|
|
44
44
|
binaryName: 'ort-wasm-simd-threaded.jsep.wasm',
|
|
45
45
|
integrities: {
|
|
46
|
-
main: '
|
|
47
|
-
wrapper: '
|
|
48
|
-
binary: '
|
|
46
|
+
main: '6BOUZhMpgaXRZBIj89pTWET0c7xcMe1yHACreuaBy2kUZwLd2tzCmv7MzwZccHYH',
|
|
47
|
+
wrapper: 'oE7XJ3WFQfuTdk0T1EGXViKSjtupvq5xVNx8ODzs7dq8qjGnN5P2tZBPr8XKceJ4',
|
|
48
|
+
binary: 'Ueht0ynFKexyaENvQBCXJQmjjdEzUgnesolNNQPAhnDeYvh1YA53nYHw1mrWvaM1'
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
[FEATURES_ALL]: {
|
|
@@ -53,9 +53,9 @@ const DEFAULT_DIST = {
|
|
|
53
53
|
scriptName: 'ort.all.min.js',
|
|
54
54
|
binaryName: 'ort-wasm-simd-threaded.jsep.wasm',
|
|
55
55
|
integrities: {
|
|
56
|
-
main: '
|
|
57
|
-
wrapper: '
|
|
58
|
-
binary: '
|
|
56
|
+
main: '5URwgKAGS31PQX06sHDOIB6bk/2FTNB7z3n4trPAWV9sCv5xwV+qiGRxPkuHv6Gf',
|
|
57
|
+
wrapper: 'oE7XJ3WFQfuTdk0T1EGXViKSjtupvq5xVNx8ODzs7dq8qjGnN5P2tZBPr8XKceJ4',
|
|
58
|
+
binary: 'Ueht0ynFKexyaENvQBCXJQmjjdEzUgnesolNNQPAhnDeYvh1YA53nYHw1mrWvaM1'
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
};
|
|
@@ -65,8 +65,8 @@ export class YoloModel {
|
|
|
65
65
|
*/
|
|
66
66
|
readonly names: any;
|
|
67
67
|
/**
|
|
68
|
-
* The model's task (`"detect"`, `"segment"`, `"
|
|
69
|
-
* `"
|
|
68
|
+
* The model's task (`"detect"`, `"segment"`, `"semantic"`, `"depth"`,
|
|
69
|
+
* `"classify"`, `"pose"`, or `"obb"`).
|
|
70
70
|
*/
|
|
71
71
|
readonly task: string;
|
|
72
72
|
}
|
|
@@ -207,10 +207,10 @@ export interface InitOutput {
|
|
|
207
207
|
readonly yolopipeline_rtdetr: (a: number) => number;
|
|
208
208
|
readonly yolopipeline_setInputShape: (a: number, b: number, c: number) => void;
|
|
209
209
|
readonly yolopipeline_task: (a: number, b: number) => void;
|
|
210
|
-
readonly
|
|
211
|
-
readonly
|
|
212
|
-
readonly
|
|
213
|
-
readonly
|
|
210
|
+
readonly __wasm_bindgen_func_elem_2003: (a: number, b: number, c: number, d: number) => void;
|
|
211
|
+
readonly __wasm_bindgen_func_elem_2003_20: (a: number, b: number, c: number, d: number) => void;
|
|
212
|
+
readonly __wasm_bindgen_func_elem_2632: (a: number, b: number, c: number, d: number) => void;
|
|
213
|
+
readonly __wasm_bindgen_func_elem_2656: (a: number, b: number, c: number, d: number) => void;
|
|
214
214
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
215
215
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
216
216
|
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-
|
|
3
|
-
import { trackSessionInit } from './snippets/ort-web-
|
|
2
|
+
import { initRuntime } from './snippets/ort-web-d1ef36df9bbdf0c7/_loader.js';
|
|
3
|
+
import { trackSessionInit } from './snippets/ort-web-d1ef36df9bbdf0c7/_telemetry.js';
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -162,8 +162,8 @@ export class YoloModel {
|
|
|
162
162
|
return takeObject(ret);
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
-
* The model's task (`"detect"`, `"segment"`, `"
|
|
166
|
-
* `"
|
|
165
|
+
* The model's task (`"detect"`, `"segment"`, `"semantic"`, `"depth"`,
|
|
166
|
+
* `"classify"`, `"pose"`, or `"obb"`).
|
|
167
167
|
* @returns {string}
|
|
168
168
|
*/
|
|
169
169
|
get task() {
|
|
@@ -557,21 +557,21 @@ function __wbg_get_imports() {
|
|
|
557
557
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
558
558
|
return addHeapObject(ret);
|
|
559
559
|
}, arguments); },
|
|
560
|
-
|
|
561
|
-
const ret = ort.InferenceSession.create(
|
|
560
|
+
__wbg_create_92add3f2dd5e9fec: function() { return handleError(function (arg0, arg1, arg2) {
|
|
561
|
+
const ret = ort.InferenceSession.create(getStringFromWasm0(arg0, arg1), takeObject(arg2));
|
|
562
562
|
return addHeapObject(ret);
|
|
563
563
|
}, arguments); },
|
|
564
|
-
|
|
565
|
-
const ret = ort.InferenceSession.create(
|
|
564
|
+
__wbg_create_c3bda381e473821b: function() { return handleError(function (arg0, arg1) {
|
|
565
|
+
const ret = ort.InferenceSession.create(getObject(arg0), takeObject(arg1));
|
|
566
566
|
return addHeapObject(ret);
|
|
567
567
|
}, arguments); },
|
|
568
|
-
|
|
568
|
+
__wbg_data_7ea15a3ce3038789: function() { return handleError(function (arg0) {
|
|
569
569
|
const ret = getObject(arg0).data;
|
|
570
570
|
return addHeapObject(ret);
|
|
571
571
|
}, arguments); },
|
|
572
|
-
|
|
572
|
+
__wbg_dims_ad4921ea2a0e2688: function(arg0, arg1) {
|
|
573
573
|
const ret = getObject(arg1).dims;
|
|
574
|
-
const ptr1 =
|
|
574
|
+
const ptr1 = passArray64ToWasm0(ret, wasm.__wbindgen_export);
|
|
575
575
|
const len1 = WASM_VECTOR_LEN;
|
|
576
576
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
577
577
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
@@ -599,7 +599,7 @@ function __wbg_get_imports() {
|
|
|
599
599
|
const ret = Array.from(getObject(arg0));
|
|
600
600
|
return addHeapObject(ret);
|
|
601
601
|
},
|
|
602
|
-
|
|
602
|
+
__wbg_getData_636da3f54c76e83d: function() { return handleError(function (arg0) {
|
|
603
603
|
const ret = getObject(arg0).getData();
|
|
604
604
|
return addHeapObject(ret);
|
|
605
605
|
}, arguments); },
|
|
@@ -623,18 +623,18 @@ function __wbg_get_imports() {
|
|
|
623
623
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
624
624
|
return addHeapObject(ret);
|
|
625
625
|
},
|
|
626
|
-
|
|
626
|
+
__wbg_initRuntime_b299fae72b0dc4e0: function() { return handleError(function (arg0, arg1) {
|
|
627
627
|
const ret = initRuntime(arg0, takeObject(arg1));
|
|
628
628
|
return addHeapObject(ret);
|
|
629
629
|
}, arguments); },
|
|
630
|
-
|
|
630
|
+
__wbg_inputMetadata_d393d214fc106b6b: function(arg0, arg1) {
|
|
631
631
|
const ret = getObject(arg1).inputMetadata;
|
|
632
632
|
const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
|
|
633
633
|
const len1 = WASM_VECTOR_LEN;
|
|
634
634
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
635
635
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
636
636
|
},
|
|
637
|
-
|
|
637
|
+
__wbg_inputNames_724b40f0a2d8fba4: function(arg0, arg1) {
|
|
638
638
|
const ret = getObject(arg1).inputNames;
|
|
639
639
|
const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
|
|
640
640
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -705,7 +705,7 @@ function __wbg_get_imports() {
|
|
|
705
705
|
const ret = getObject(arg0).length;
|
|
706
706
|
return ret;
|
|
707
707
|
},
|
|
708
|
-
|
|
708
|
+
__wbg_location_348911e2e503af1d: function(arg0) {
|
|
709
709
|
const ret = getObject(arg0).location;
|
|
710
710
|
return (__wbindgen_enum_DataLocation.indexOf(ret) + 1 || 7) - 1;
|
|
711
711
|
},
|
|
@@ -729,7 +729,7 @@ function __wbg_get_imports() {
|
|
|
729
729
|
const ret = new Array();
|
|
730
730
|
return addHeapObject(ret);
|
|
731
731
|
},
|
|
732
|
-
|
|
732
|
+
__wbg_new_from_buffer_raw_1a36905fc3da3c96: function() { return handleError(function (arg0, arg1, arg2) {
|
|
733
733
|
const ret = new ort.Tensor(__wbindgen_enum_DataType[arg0], takeObject(arg1), takeObject(arg2));
|
|
734
734
|
return addHeapObject(ret);
|
|
735
735
|
}, arguments); },
|
|
@@ -744,7 +744,7 @@ function __wbg_get_imports() {
|
|
|
744
744
|
const a = state0.a;
|
|
745
745
|
state0.a = 0;
|
|
746
746
|
try {
|
|
747
|
-
return
|
|
747
|
+
return __wasm_bindgen_func_elem_2656(a, state0.b, arg0, arg1);
|
|
748
748
|
} finally {
|
|
749
749
|
state0.a = a;
|
|
750
750
|
}
|
|
@@ -811,14 +811,14 @@ function __wbg_get_imports() {
|
|
|
811
811
|
const ret = getObject(arg0).now();
|
|
812
812
|
return ret;
|
|
813
813
|
},
|
|
814
|
-
|
|
814
|
+
__wbg_outputMetadata_7300f513b14cec51: function(arg0, arg1) {
|
|
815
815
|
const ret = getObject(arg1).outputMetadata;
|
|
816
816
|
const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
|
|
817
817
|
const len1 = WASM_VECTOR_LEN;
|
|
818
818
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
819
819
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
820
820
|
},
|
|
821
|
-
|
|
821
|
+
__wbg_outputNames_9d56e41945ee91d5: function(arg0, arg1) {
|
|
822
822
|
const ret = getObject(arg1).outputNames;
|
|
823
823
|
const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
|
|
824
824
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -854,7 +854,7 @@ function __wbg_get_imports() {
|
|
|
854
854
|
const ret = Promise.resolve(getObject(arg0));
|
|
855
855
|
return addHeapObject(ret);
|
|
856
856
|
},
|
|
857
|
-
|
|
857
|
+
__wbg_run_9e09e7300abe14f9: function() { return handleError(function (arg0, arg1) {
|
|
858
858
|
const ret = getObject(arg0).run(takeObject(arg1));
|
|
859
859
|
return addHeapObject(ret);
|
|
860
860
|
}, arguments); },
|
|
@@ -917,11 +917,11 @@ function __wbg_get_imports() {
|
|
|
917
917
|
const ret = getObject(arg0).toString();
|
|
918
918
|
return addHeapObject(ret);
|
|
919
919
|
},
|
|
920
|
-
|
|
920
|
+
__wbg_trackSessionInit_802b774d44772d22: function() { return handleError(function (arg0, arg1) {
|
|
921
921
|
const ret = trackSessionInit(getStringFromWasm0(arg0, arg1));
|
|
922
922
|
return addHeapObject(ret);
|
|
923
923
|
}, arguments); },
|
|
924
|
-
|
|
924
|
+
__wbg_type_80ea00300eb18928: function(arg0) {
|
|
925
925
|
const ret = getObject(arg0).type;
|
|
926
926
|
return (__wbindgen_enum_DataType.indexOf(ret) + 1 || 16) - 1;
|
|
927
927
|
},
|
|
@@ -934,18 +934,18 @@ function __wbg_get_imports() {
|
|
|
934
934
|
return addHeapObject(ret);
|
|
935
935
|
},
|
|
936
936
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
937
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
938
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
937
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 690, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
938
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_2003);
|
|
939
939
|
return addHeapObject(ret);
|
|
940
940
|
},
|
|
941
941
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
942
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
943
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
942
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 933, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
943
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_2632);
|
|
944
944
|
return addHeapObject(ret);
|
|
945
945
|
},
|
|
946
946
|
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
947
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("boolean")], shim_idx:
|
|
948
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
947
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("boolean")], shim_idx: 690, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
948
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_2003_20);
|
|
949
949
|
return addHeapObject(ret);
|
|
950
950
|
},
|
|
951
951
|
__wbindgen_generic_0000000000000004: function(arg0) {
|
|
@@ -1032,14 +1032,14 @@ function __wbg_get_imports() {
|
|
|
1032
1032
|
};
|
|
1033
1033
|
}
|
|
1034
1034
|
|
|
1035
|
-
function
|
|
1036
|
-
wasm.
|
|
1035
|
+
function __wasm_bindgen_func_elem_2656(arg0, arg1, arg2, arg3) {
|
|
1036
|
+
wasm.__wasm_bindgen_func_elem_2656(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
|
-
function
|
|
1039
|
+
function __wasm_bindgen_func_elem_2003(arg0, arg1, arg2) {
|
|
1040
1040
|
try {
|
|
1041
1041
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1042
|
-
wasm.
|
|
1042
|
+
wasm.__wasm_bindgen_func_elem_2003(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1043
1043
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1044
1044
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1045
1045
|
if (r1) {
|
|
@@ -1050,10 +1050,10 @@ function __wasm_bindgen_func_elem_1996(arg0, arg1, arg2) {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
|
|
1053
|
-
function
|
|
1053
|
+
function __wasm_bindgen_func_elem_2632(arg0, arg1, arg2) {
|
|
1054
1054
|
try {
|
|
1055
1055
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1056
|
-
wasm.
|
|
1056
|
+
wasm.__wasm_bindgen_func_elem_2632(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1057
1057
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1058
1058
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1059
1059
|
if (r1) {
|
|
@@ -1064,10 +1064,10 @@ function __wasm_bindgen_func_elem_2603(arg0, arg1, arg2) {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
1067
|
-
function
|
|
1067
|
+
function __wasm_bindgen_func_elem_2003_20(arg0, arg1, arg2) {
|
|
1068
1068
|
try {
|
|
1069
1069
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1070
|
-
wasm.
|
|
1070
|
+
wasm.__wasm_bindgen_func_elem_2003_20(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1071
1071
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1072
1072
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1073
1073
|
if (r1) {
|
|
@@ -1370,6 +1370,13 @@ function passArray32ToWasm0(arg, malloc) {
|
|
|
1370
1370
|
return ptr;
|
|
1371
1371
|
}
|
|
1372
1372
|
|
|
1373
|
+
function passArray64ToWasm0(arg, malloc) {
|
|
1374
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
1375
|
+
getBigUint64ArrayMemory0().set(arg, ptr / 8);
|
|
1376
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1377
|
+
return ptr;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1373
1380
|
function passArray8ToWasm0(arg, malloc) {
|
|
1374
1381
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1375
1382
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
Binary file
|
|
@@ -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
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
23
|
+
export const __wasm_bindgen_func_elem_2003: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
+
export const __wasm_bindgen_func_elem_2003_20: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
+
export const __wasm_bindgen_func_elem_2632: (a: number, b: number, c: number, d: number) => void;
|
|
26
|
+
export const __wasm_bindgen_func_elem_2656: (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;
|
|
File without changes
|