@mauriciobenjamin700/ort-vision-sdk-web 0.5.1 → 0.6.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.
- package/CHANGELOG.md +185 -2
- package/README.md +48 -0
- package/dist/core/canvas.d.ts +11 -2
- package/dist/core/canvas.d.ts.map +1 -1
- package/dist/core/canvas.js +12 -3
- package/dist/core/canvas.js.map +1 -1
- package/dist/core/exceptions.d.ts +26 -0
- package/dist/core/exceptions.d.ts.map +1 -1
- package/dist/core/exceptions.js +26 -0
- package/dist/core/exceptions.js.map +1 -1
- package/dist/core/metadata.d.ts +12 -0
- package/dist/core/metadata.d.ts.map +1 -1
- package/dist/core/metadata.js +15 -1
- package/dist/core/metadata.js.map +1 -1
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +23 -2
- package/dist/core/session.js.map +1 -1
- package/dist/fusion.d.ts +105 -0
- package/dist/fusion.d.ts.map +1 -0
- package/dist/fusion.js +141 -0
- package/dist/fusion.js.map +1 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/labels.d.ts +16 -0
- package/dist/labels.d.ts.map +1 -1
- package/dist/labels.js +21 -0
- package/dist/labels.js.map +1 -1
- package/dist/postprocess/detection.d.ts +8 -14
- package/dist/postprocess/detection.d.ts.map +1 -1
- package/dist/postprocess/detection.js +10 -28
- package/dist/postprocess/detection.js.map +1 -1
- package/dist/postprocess/segmentation.d.ts +0 -4
- package/dist/postprocess/segmentation.d.ts.map +1 -1
- package/dist/postprocess/segmentation.js +0 -10
- package/dist/postprocess/segmentation.js.map +1 -1
- package/dist/preprocess/pipeline.d.ts +117 -0
- package/dist/preprocess/pipeline.d.ts.map +1 -0
- package/dist/preprocess/pipeline.js +153 -0
- package/dist/preprocess/pipeline.js.map +1 -0
- package/dist/results.d.ts +33 -0
- package/dist/results.d.ts.map +1 -1
- package/dist/results.js +48 -0
- package/dist/results.js.map +1 -1
- package/dist/tasks/base.d.ts +21 -0
- package/dist/tasks/base.d.ts.map +1 -1
- package/dist/tasks/base.js +46 -0
- package/dist/tasks/base.js.map +1 -1
- package/dist/tasks/detectClassify.d.ts +171 -0
- package/dist/tasks/detectClassify.d.ts.map +1 -0
- package/dist/tasks/detectClassify.js +448 -0
- package/dist/tasks/detectClassify.js.map +1 -0
- package/dist/tasks/detector.d.ts +42 -0
- package/dist/tasks/detector.d.ts.map +1 -1
- package/dist/tasks/detector.js +66 -16
- package/dist/tasks/detector.js.map +1 -1
- package/dist/tasks/segmenter.d.ts +33 -0
- package/dist/tasks/segmenter.d.ts.map +1 -1
- package/dist/tasks/segmenter.js +57 -16
- package/dist/tasks/segmenter.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,182 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.6.1] - 2026-08-08
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **The threshold quoted in a `NoDetectionsError` now reads the same in both
|
|
15
|
+
SDKs.** This side rendered a whole threshold as `confThreshold=1` where the
|
|
16
|
+
Python SDK rendered `conf_threshold=1.0`, and wrote `0.0000001` where Python
|
|
17
|
+
switched to `1e-07`. A fused pipeline is built once and runs under both
|
|
18
|
+
runtimes from the same file, so the two SDKs were describing one run with two
|
|
19
|
+
different numbers. Both sides now render six decimals with the trailing zeros
|
|
20
|
+
trimmed, and the same table in both test suites fails if either side drifts.
|
|
21
|
+
|
|
22
|
+
- **The changelog's link table is no longer stuck at 0.2.0.** `[Unreleased]`
|
|
23
|
+
compared against `web-v0.2.0`, so following it showed four releases of shipped
|
|
24
|
+
history as unreleased work, and `[0.3.0]` through `[0.6.0]` had no link
|
|
25
|
+
definition at all — they rendered as literal `[0.6.0]` text. The table is
|
|
26
|
+
rebuilt through 0.6.1. `[0.1.0]` loses its definition on purpose: no
|
|
27
|
+
`web-v0.1.0` tag was ever pushed, so that link was a 404.
|
|
28
|
+
|
|
29
|
+
## [0.6.0] - 2026-08-07
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- **`DetectClassify` runs through the fused letterbox pipeline, and can be
|
|
34
|
+
warmed up.** It was written against the pre-`LetterboxPipeline` preprocessing
|
|
35
|
+
and would otherwise have been the only task left on the slow path — and the
|
|
36
|
+
only one unable to pay its shader compilation up front, which is the task that
|
|
37
|
+
needs it most: two models plus the bridge compile on the first inference.
|
|
38
|
+
|
|
39
|
+
- **`raiseOnEmpty` — opt in to treating an empty result as an error.** Mirrors
|
|
40
|
+
the Python SDK: `Detector`, `Segmenter` and `DetectClassify` resolve to an
|
|
41
|
+
empty envelope by default, and throw the new `NoDetectionsError` when the flag
|
|
42
|
+
is set. Available on the construction options and as a per-call override, with
|
|
43
|
+
the same message — which names the threshold that applied, plus the image and
|
|
44
|
+
the class filter when either narrowed the search.
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const det = await Detector.create("/models/yolov8n.onnx", {
|
|
48
|
+
confThreshold: 0.7,
|
|
49
|
+
raiseOnEmpty: true,
|
|
50
|
+
});
|
|
51
|
+
await det.predict("/img.jpg");
|
|
52
|
+
// NoDetectionsError: No detections in /img.jpg: nothing cleared confThreshold=0.7.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- **`DetectClassify` — run a fused detect→classify pipeline in the browser.**
|
|
56
|
+
A pipeline built by the Python SDK's `ort_vision_sdk.compose` (0.7.0) already
|
|
57
|
+
contains both models plus the crop-and-resize bridge between them. That matters
|
|
58
|
+
more in a tab than anywhere else: two models mean two `.onnx` downloads, two
|
|
59
|
+
WASM/WebGPU session initializations, and a per-crop round trip through
|
|
60
|
+
JavaScript to slice, resize and restack the regions before the second model can
|
|
61
|
+
see them. A fused pipeline has one download, one session, and no round trip.
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import { DetectClassify } from "@mauriciobenjamin700/ort-vision-sdk-web";
|
|
65
|
+
|
|
66
|
+
const pipeline = await DetectClassify.create("/models/pipeline.onnx");
|
|
67
|
+
for (const d of (await pipeline.predict("/images/flock.jpg"))[0]) {
|
|
68
|
+
console.log(d.name, d.conf, d.classification?.name);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- **`readFusionSpec()` and the pipeline contract** (`FusionSpec`, `CropSource`,
|
|
73
|
+
the `INPUT_*` / `OUTPUT_*` names, `METADATA_PREFIX`). The letterbox resolution,
|
|
74
|
+
the crop size, whether the classifier output still needs a softmax and the class
|
|
75
|
+
names of both stages are read out of the model's own `ovs.` metadata — the same
|
|
76
|
+
keys, encodings and fallbacks the Python side writes. A pipeline fused once
|
|
77
|
+
therefore behaves identically in both runtimes, off the same file.
|
|
78
|
+
|
|
79
|
+
- **`DetectionResult.classification`** (optional, absent for a plain detector) and
|
|
80
|
+
the `DetectClassifyResults` envelope, which carries `names` and
|
|
81
|
+
`classifierNames` separately because the two stages have unrelated label spaces.
|
|
82
|
+
|
|
83
|
+
- **`FusionError`** and `parseNames()`, split out of `modelNames()` so both class
|
|
84
|
+
maps of a pipeline can be parsed with the same reader.
|
|
85
|
+
|
|
86
|
+
- **`warmup()` on `Detector` and `Segmenter`.** The first inference of a session
|
|
87
|
+
is not representative: WebGPU compiles its shaders on it and the WASM backend
|
|
88
|
+
faults in its arenas, so on a phone the first frame can take seconds while
|
|
89
|
+
every later frame takes tens of milliseconds. `await det.warmup()` runs the
|
|
90
|
+
model once on a zero tensor, moving that cost to wherever the user is already
|
|
91
|
+
watching a spinner.
|
|
92
|
+
|
|
93
|
+
- **`LetterboxPipeline`, exported.** The fused preprocessing path the tasks now
|
|
94
|
+
take, available to a custom pipeline that wants the same allocation-free
|
|
95
|
+
behaviour. `letterboxToTensorData` is the one-shot form.
|
|
96
|
+
|
|
97
|
+
### Changed
|
|
98
|
+
|
|
99
|
+
- **Preprocessing is ~2x faster and allocates nothing per frame.** Chaining the
|
|
100
|
+
composable primitives cost eleven full-buffer passes and six large allocations
|
|
101
|
+
per frame: `getImageData` → RGBA→RGB → RGB→RGBA → `putImageData` →
|
|
102
|
+
`drawImage` → `getImageData` → RGBA→RGB → fill → row copies → `toFloat32` →
|
|
103
|
+
`toCHW`. The tasks now go through `LetterboxPipeline`, which collapses the
|
|
104
|
+
second half into one `drawImage` — resizing *and* positioning the content
|
|
105
|
+
inside the padded target in a single accelerated operation — plus one loop
|
|
106
|
+
that reads the resulting RGBA and writes planar float32 straight into a buffer
|
|
107
|
+
reused across frames.
|
|
108
|
+
|
|
109
|
+
Measured in Chromium, median of 31 runs, letterboxing into 640x640:
|
|
110
|
+
|
|
111
|
+
| Source | Before | After | Speedup |
|
|
112
|
+
| --- | --- | --- | --- |
|
|
113
|
+
| 1920x1080 | 19.8 ms | 10.7 ms | 1.85x |
|
|
114
|
+
| 1280x720 | 13.8 ms | 7.8 ms | 1.77x |
|
|
115
|
+
| 640x480 | 6.8 ms | 3.1 ms | 2.19x |
|
|
116
|
+
|
|
117
|
+
**The output is bit-identical**, verified in a real browser against the
|
|
118
|
+
primitive-chained path across four source sizes — maximum difference 0.
|
|
119
|
+
|
|
120
|
+
The primitives are unchanged and still exported: they are what makes a custom
|
|
121
|
+
pipeline writable. Only the path the built-in tasks take has changed.
|
|
122
|
+
|
|
123
|
+
- **The preprocessing canvas is created with `willReadFrequently`.** It is read
|
|
124
|
+
back with `getImageData` on every frame, which is what the hint exists for.
|
|
125
|
+
Measured effect on speed in Chromium: none beyond noise. What it removes is
|
|
126
|
+
the `Canvas2D: Multiple readback operations using getImageData are faster with
|
|
127
|
+
the willReadFrequently attribute set to true` warning the browser was printing
|
|
128
|
+
into every consumer's console, once per frame.
|
|
129
|
+
|
|
130
|
+
### Removed
|
|
131
|
+
|
|
132
|
+
- **`decodeYoloV8`, `decodeYoloV8Anchors`, `decodeYoloV8Seg` and the
|
|
133
|
+
`DecodeYoloV8*Options` type aliases are gone.** Deprecated in 0.2.0 with
|
|
134
|
+
"will be removed in 0.4.0", and still shipping at 0.5.1. Use `decodeYolo`,
|
|
135
|
+
`decodeYoloAnchors`, `decodeYoloSeg` and their `DecodeYolo*Options` types:
|
|
136
|
+
same functions, honest names, since the decoder covers every anchor-free YOLO
|
|
137
|
+
head from v8 through v12.
|
|
138
|
+
|
|
139
|
+
`test/deprecations.test.ts` now guards the removal rather than the
|
|
140
|
+
deprecation, so a re-add fails loudly.
|
|
141
|
+
|
|
142
|
+
### Fixed
|
|
143
|
+
|
|
144
|
+
- **A custom model with no baked-in `names` no longer fails to create.** Same
|
|
145
|
+
defect as the Python SDK: the fallback was the 80-name COCO preset, so a
|
|
146
|
+
3-class detector threw `Resolved 80 labels but the model has 3 classes`.
|
|
147
|
+
Labels now come up as `class_0`, `class_1`, ..., and the COCO preset applies
|
|
148
|
+
only when the model really does have 80 classes. `defaultLabels` is exported.
|
|
149
|
+
|
|
150
|
+
- **A model URL that cannot be fetched for its metadata now says so.** The
|
|
151
|
+
fallback — hand the URL to ORT and let it load the model itself — is right,
|
|
152
|
+
but it was silent, and the symptom it produces is remote from the cause:
|
|
153
|
+
class names come back as `class_0`, `class_1`, ... with nothing explaining
|
|
154
|
+
why. It warns now, and names `labels` as the way out.
|
|
155
|
+
|
|
156
|
+
- **Score ties in `nms` and `batchedNms` break by index explicitly.** Both
|
|
157
|
+
relied on `Array.prototype.sort` being stable to order tied scores. It is, in
|
|
158
|
+
every engine that matters, but leaning on it left the tie behaviour implicit —
|
|
159
|
+
and in `batchedNms` the surviving order also depended on `Map` insertion order,
|
|
160
|
+
which the Python SDK (iterating classes in sorted order) does not share. The
|
|
161
|
+
comparators now fall back to `a - b`, so a tie resolves to the lowest index on
|
|
162
|
+
both sides, matching `torchvision`.
|
|
163
|
+
|
|
164
|
+
Only exact ties are affected. The Python SDK was the one actually producing a
|
|
165
|
+
different survivor — it visited ties in descending index order — and this is
|
|
166
|
+
the other half of that fix.
|
|
167
|
+
|
|
168
|
+
### Notes
|
|
169
|
+
|
|
170
|
+
- Fusing models stays a Python-side build step; there is no ONNX protobuf writer
|
|
171
|
+
here and no reason for one. The browser only loads the result.
|
|
172
|
+
- ORT Web returns `int64` outputs as `BigInt64Array`. The pipeline's class ids and
|
|
173
|
+
detection count are widened to `number` internally, so no caller has to handle
|
|
174
|
+
`BigInt`.
|
|
175
|
+
|
|
176
|
+
### Internal
|
|
177
|
+
|
|
178
|
+
- **Parity tests against shared fixtures** (`test/parity.test.ts`, reading
|
|
179
|
+
`fixtures/parity/` at the repository root). They feed the web implementation
|
|
180
|
+
the same inputs the Python SDK was given and require the same outputs, with
|
|
181
|
+
mask bitmaps compared pixel for pixel. Two published artifacts promising the
|
|
182
|
+
same numbers had nothing checking the promise; this is that check, and it
|
|
183
|
+
found a mask-resampling divergence on its first run (fixed on the Python
|
|
184
|
+
side, see that package's changelog).
|
|
185
|
+
|
|
10
186
|
## [0.5.1] - 2026-08-05
|
|
11
187
|
|
|
12
188
|
### Fixed
|
|
@@ -287,6 +463,13 @@ console.log(r.boxes.xyxy, r.boxes.cls, r.boxes.conf, r.names);
|
|
|
287
463
|
- Execution-provider resolution defaulting to `["webgpu", "wasm"]`.
|
|
288
464
|
- Public types mirroring the Python SDK: `BoundingBox`, `ClassProbability`, `ClassificationResult`, `DetectionResult`, `RGBImage`.
|
|
289
465
|
|
|
290
|
-
[Unreleased]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.
|
|
466
|
+
[Unreleased]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.6.1...HEAD
|
|
467
|
+
[0.6.1]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.6.0...web-v0.6.1
|
|
468
|
+
[0.6.0]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.5.1...web-v0.6.0
|
|
469
|
+
[0.5.1]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.5.0...web-v0.5.1
|
|
470
|
+
[0.5.0]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.4.0...web-v0.5.0
|
|
471
|
+
[0.4.0]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.3.0...web-v0.4.0
|
|
472
|
+
[0.3.0]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.2.2...web-v0.3.0
|
|
473
|
+
[0.2.2]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.2.1...web-v0.2.2
|
|
474
|
+
[0.2.1]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.2.0...web-v0.2.1
|
|
291
475
|
[0.2.0]: https://github.com/mauriciobenjamin700/ort-vision-sdk/releases/tag/web-v0.2.0
|
|
292
|
-
[0.1.0]: https://github.com/mauriciobenjamin700/ort-vision-sdk/releases/tag/web-v0.1.0
|
package/README.md
CHANGED
|
@@ -66,6 +66,54 @@ for (const d of detections) {
|
|
|
66
66
|
}
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
### Fused detect → classify pipeline
|
|
70
|
+
|
|
71
|
+
A pipeline fused by the Python SDK's `ort_vision_sdk.compose` puts a detector,
|
|
72
|
+
the crop-and-resize bridge and a classifier into **one** `.onnx`. In a browser
|
|
73
|
+
that is one download and one session instead of two, and no per-crop round trip
|
|
74
|
+
through JavaScript.
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { DetectClassify } from "@mauriciobenjamin700/ort-vision-sdk-web";
|
|
78
|
+
|
|
79
|
+
const pipeline = await DetectClassify.create("/models/pipeline.onnx");
|
|
80
|
+
const result = (await pipeline.predict("/images/flock.jpg"))[0];
|
|
81
|
+
|
|
82
|
+
for (const d of result) {
|
|
83
|
+
console.log(d.name, d.conf, d.box.asXyxy()); // what the detector found
|
|
84
|
+
console.log(d.classification?.name, d.classification?.conf); // what the classifier said
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The resolution, crop size, thresholds and both class maps come out of the file's
|
|
89
|
+
own metadata, so nothing is restated here. Building the pipeline is a Python-side
|
|
90
|
+
step; the browser only loads the result. Full guide:
|
|
91
|
+
[Fused pipelines](https://mauriciobenjamin700.github.io/ort-vision-sdk/en/guia/pipeline/).
|
|
92
|
+
|
|
93
|
+
### When finding nothing is an error
|
|
94
|
+
|
|
95
|
+
`predict()` resolves to an empty envelope when nothing is detected. When an
|
|
96
|
+
empty result instead means the surrounding flow should stop, opt in:
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { Detector, NoDetectionsError } from "@mauriciobenjamin700/ort-vision-sdk-web";
|
|
100
|
+
|
|
101
|
+
const det = await Detector.create("/models/yolov8n.onnx", {
|
|
102
|
+
confThreshold: 0.7,
|
|
103
|
+
raiseOnEmpty: true,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
const result = (await det.predict("/img.jpg"))[0];
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (error instanceof NoDetectionsError) console.log(error.message);
|
|
110
|
+
// No detections in /img.jpg: nothing cleared confThreshold=0.7.
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Available on `Detector`, `Segmenter` and `DetectClassify`, and overridable per
|
|
115
|
+
call (`predict(img, { raiseOnEmpty: false })`).
|
|
116
|
+
|
|
69
117
|
## Inference speed
|
|
70
118
|
|
|
71
119
|
Every result envelope carries a per-stage timing breakdown:
|
package/dist/core/canvas.d.ts
CHANGED
|
@@ -12,8 +12,17 @@ export type Canvas2D = HTMLCanvasElement | OffscreenCanvas;
|
|
|
12
12
|
export type Context2D = CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
|
|
13
13
|
/** Allocate a `Canvas2D`, preferring `OffscreenCanvas` when available. */
|
|
14
14
|
export declare function createCanvas(width: number, height: number): Canvas2D;
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Get a 2D context from a canvas, throwing a typed error if the browser refuses.
|
|
17
|
+
*
|
|
18
|
+
* @param canvas The canvas to obtain a context for.
|
|
19
|
+
* @param options Context attributes, forwarded verbatim. `willReadFrequently`
|
|
20
|
+
* tells the browser the canvas is read back with `getImageData` repeatedly,
|
|
21
|
+
* which moves the backing store to software: faster readback, slower
|
|
22
|
+
* compositing. Whether it pays depends on the surface, so it is the caller's
|
|
23
|
+
* call rather than a default here.
|
|
24
|
+
*/
|
|
25
|
+
export declare function get2DContext(canvas: Canvas2D, options?: CanvasRenderingContext2DSettings): Context2D;
|
|
17
26
|
/** Convert RGBA `ImageData` into the canonical HWC RGB `RGBImage`. */
|
|
18
27
|
export declare function imageDataToRGB(imageData: ImageData): RGBImage;
|
|
19
28
|
/** Convert an `RGBImage` into RGBA `ImageData` (alpha forced to 255). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../../src/core/canvas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,iBAAiB,GAAG,eAAe,CAAC;AAC3D,MAAM,MAAM,SAAS,GACjB,wBAAwB,GACxB,iCAAiC,CAAC;AAEtC,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAWpE;AAED
|
|
1
|
+
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../../src/core/canvas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,iBAAiB,GAAG,eAAe,CAAC;AAC3D,MAAM,MAAM,SAAS,GACjB,wBAAwB,GACxB,iCAAiC,CAAC;AAEtC,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAWpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,QAAQ,EAChB,OAAO,GAAE,gCAAqC,GAC7C,SAAS,CAMX;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,QAAQ,CAgB7D;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,CASzD"}
|
package/dist/core/canvas.js
CHANGED
|
@@ -22,9 +22,18 @@ export function createCanvas(width, height) {
|
|
|
22
22
|
}
|
|
23
23
|
throw new ImageLoadError("No canvas implementation available in this environment.");
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Get a 2D context from a canvas, throwing a typed error if the browser refuses.
|
|
27
|
+
*
|
|
28
|
+
* @param canvas The canvas to obtain a context for.
|
|
29
|
+
* @param options Context attributes, forwarded verbatim. `willReadFrequently`
|
|
30
|
+
* tells the browser the canvas is read back with `getImageData` repeatedly,
|
|
31
|
+
* which moves the backing store to software: faster readback, slower
|
|
32
|
+
* compositing. Whether it pays depends on the surface, so it is the caller's
|
|
33
|
+
* call rather than a default here.
|
|
34
|
+
*/
|
|
35
|
+
export function get2DContext(canvas, options = {}) {
|
|
36
|
+
const ctx = canvas.getContext("2d", options);
|
|
28
37
|
if (ctx === null) {
|
|
29
38
|
throw new ImageLoadError("Failed to obtain 2D rendering context.");
|
|
30
39
|
}
|
package/dist/core/canvas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas.js","sourceRoot":"","sources":["../../src/core/canvas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,MA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C,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,cAAc,CAAC,KAAe;IAC5C,MAAM,IAAI,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7D,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAW,CAAC;QAClC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAW,CAAC;QAC1C,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAW,CAAC;QAC1C,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IACpB,CAAC;IACD,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -22,4 +22,30 @@ export declare class ImageLoadError extends OrtVisionError {
|
|
|
22
22
|
/** Raised when class labels cannot be resolved from the supplied spec. */
|
|
23
23
|
export declare class LabelMapError extends OrtVisionError {
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Raised when a detection task finds nothing and was asked to treat that as an error.
|
|
27
|
+
*
|
|
28
|
+
* Only raised when the caller opts in with `raiseOnEmpty: true`. The default
|
|
29
|
+
* stays an empty result, because "the model looked and found nothing" is a
|
|
30
|
+
* successful inference, not a failure — a photo of an empty field is a valid
|
|
31
|
+
* photo. What the flag is for is the opposite situation: a pipeline step whose
|
|
32
|
+
* *precondition* is that something is there, where an empty result means the
|
|
33
|
+
* caller should stop rather than quietly carry on with zero rows.
|
|
34
|
+
*
|
|
35
|
+
* "Nothing was detected" and "nothing was confident enough" are the same
|
|
36
|
+
* condition here, since the confidence threshold is what decides what counts as
|
|
37
|
+
* a detection in the first place.
|
|
38
|
+
*/
|
|
39
|
+
export declare class NoDetectionsError extends OrtVisionError {
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Raised when a model cannot be driven as a fused detect→classify pipeline.
|
|
43
|
+
*
|
|
44
|
+
* In the browser this means the file carries no `ovs.*` metadata — it is a
|
|
45
|
+
* plain detector or classifier rather than something `ort_vision_sdk.compose`
|
|
46
|
+
* produced — or the graph is missing an output the pipeline contract requires.
|
|
47
|
+
* Building a pipeline is a Python-side build step; the browser only runs one.
|
|
48
|
+
*/
|
|
49
|
+
export declare class FusionError extends OrtVisionError {
|
|
50
|
+
}
|
|
25
51
|
//# sourceMappingURL=exceptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.d.ts","sourceRoot":"","sources":["../../src/core/exceptions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD;AAED,4EAA4E;AAC5E,qBAAa,cAAe,SAAQ,cAAc;CAAG;AAErD,8DAA8D;AAC9D,qBAAa,cAAe,SAAQ,cAAc;CAAG;AAErD,mEAAmE;AACnE,qBAAa,yBAA0B,SAAQ,cAAc;CAAG;AAEhE,8EAA8E;AAC9E,qBAAa,cAAe,SAAQ,cAAc;CAAG;AAErD,0EAA0E;AAC1E,qBAAa,aAAc,SAAQ,cAAc;CAAG"}
|
|
1
|
+
{"version":3,"file":"exceptions.d.ts","sourceRoot":"","sources":["../../src/core/exceptions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD;AAED,4EAA4E;AAC5E,qBAAa,cAAe,SAAQ,cAAc;CAAG;AAErD,8DAA8D;AAC9D,qBAAa,cAAe,SAAQ,cAAc;CAAG;AAErD,mEAAmE;AACnE,qBAAa,yBAA0B,SAAQ,cAAc;CAAG;AAEhE,8EAA8E;AAC9E,qBAAa,cAAe,SAAQ,cAAc;CAAG;AAErD,0EAA0E;AAC1E,qBAAa,aAAc,SAAQ,cAAc;CAAG;AAEpD;;;;;;;;;;;;;GAaG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;CAAG;AAExD;;;;;;;GAOG;AACH,qBAAa,WAAY,SAAQ,cAAc;CAAG"}
|
package/dist/core/exceptions.js
CHANGED
|
@@ -25,4 +25,30 @@ export class ImageLoadError extends OrtVisionError {
|
|
|
25
25
|
/** Raised when class labels cannot be resolved from the supplied spec. */
|
|
26
26
|
export class LabelMapError extends OrtVisionError {
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Raised when a detection task finds nothing and was asked to treat that as an error.
|
|
30
|
+
*
|
|
31
|
+
* Only raised when the caller opts in with `raiseOnEmpty: true`. The default
|
|
32
|
+
* stays an empty result, because "the model looked and found nothing" is a
|
|
33
|
+
* successful inference, not a failure — a photo of an empty field is a valid
|
|
34
|
+
* photo. What the flag is for is the opposite situation: a pipeline step whose
|
|
35
|
+
* *precondition* is that something is there, where an empty result means the
|
|
36
|
+
* caller should stop rather than quietly carry on with zero rows.
|
|
37
|
+
*
|
|
38
|
+
* "Nothing was detected" and "nothing was confident enough" are the same
|
|
39
|
+
* condition here, since the confidence threshold is what decides what counts as
|
|
40
|
+
* a detection in the first place.
|
|
41
|
+
*/
|
|
42
|
+
export class NoDetectionsError extends OrtVisionError {
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Raised when a model cannot be driven as a fused detect→classify pipeline.
|
|
46
|
+
*
|
|
47
|
+
* In the browser this means the file carries no `ovs.*` metadata — it is a
|
|
48
|
+
* plain detector or classifier rather than something `ort_vision_sdk.compose`
|
|
49
|
+
* produced — or the graph is missing an output the pipeline contract requires.
|
|
50
|
+
* Building a pipeline is a Python-side build step; the browser only runs one.
|
|
51
|
+
*/
|
|
52
|
+
export class FusionError extends OrtVisionError {
|
|
53
|
+
}
|
|
28
54
|
//# sourceMappingURL=exceptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/core/exceptions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAED,4EAA4E;AAC5E,MAAM,OAAO,cAAe,SAAQ,cAAc;CAAG;AAErD,8DAA8D;AAC9D,MAAM,OAAO,cAAe,SAAQ,cAAc;CAAG;AAErD,mEAAmE;AACnE,MAAM,OAAO,yBAA0B,SAAQ,cAAc;CAAG;AAEhE,8EAA8E;AAC9E,MAAM,OAAO,cAAe,SAAQ,cAAc;CAAG;AAErD,0EAA0E;AAC1E,MAAM,OAAO,aAAc,SAAQ,cAAc;CAAG"}
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/core/exceptions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAED,4EAA4E;AAC5E,MAAM,OAAO,cAAe,SAAQ,cAAc;CAAG;AAErD,8DAA8D;AAC9D,MAAM,OAAO,cAAe,SAAQ,cAAc;CAAG;AAErD,mEAAmE;AACnE,MAAM,OAAO,yBAA0B,SAAQ,cAAc;CAAG;AAEhE,8EAA8E;AAC9E,MAAM,OAAO,cAAe,SAAQ,cAAc;CAAG;AAErD,0EAA0E;AAC1E,MAAM,OAAO,aAAc,SAAQ,cAAc;CAAG;AAEpD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,iBAAkB,SAAQ,cAAc;CAAG;AAExD;;;;;;;GAOG;AACH,MAAM,OAAO,WAAY,SAAQ,cAAc;CAAG"}
|
package/dist/core/metadata.d.ts
CHANGED
|
@@ -36,4 +36,16 @@ export declare function readModelMetadata(model: Uint8Array | ArrayBufferLike):
|
|
|
36
36
|
* usable `names` entry.
|
|
37
37
|
*/
|
|
38
38
|
export declare function modelNames(metadata: Readonly<Record<string, string>> | undefined): readonly string[] | null;
|
|
39
|
+
/**
|
|
40
|
+
* Parse a `repr`-encoded `dict[int, str]` class map.
|
|
41
|
+
*
|
|
42
|
+
* Split out of {@link modelNames} because the same encoding is reused by a
|
|
43
|
+
* fused pipeline, which carries one class map per stage and therefore cannot
|
|
44
|
+
* store both under the single `names` key Ultralytics uses.
|
|
45
|
+
*
|
|
46
|
+
* @param encoded The encoded map — e.g. `"{0: 'deworm', 1: 'not_deworm'}"`.
|
|
47
|
+
* @returns Class names in class-id order, or `null` when the value is missing,
|
|
48
|
+
* unparseable, not a `dict`, or not keyed by contiguous integers from zero.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseNames(encoded: string | undefined): readonly string[] | null;
|
|
39
51
|
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/core/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAyIH;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,GAAG,eAAe,GAClC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAqBlC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,GACrD,SAAS,MAAM,EAAE,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/core/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAyIH;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,GAAG,eAAe,GAClC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAqBlC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,GACrD,SAAS,MAAM,EAAE,GAAG,IAAI,CAE1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,CA6BhF"}
|
package/dist/core/metadata.js
CHANGED
|
@@ -182,7 +182,21 @@ export function readModelMetadata(model) {
|
|
|
182
182
|
* usable `names` entry.
|
|
183
183
|
*/
|
|
184
184
|
export function modelNames(metadata) {
|
|
185
|
-
|
|
185
|
+
return parseNames(metadata?.names);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Parse a `repr`-encoded `dict[int, str]` class map.
|
|
189
|
+
*
|
|
190
|
+
* Split out of {@link modelNames} because the same encoding is reused by a
|
|
191
|
+
* fused pipeline, which carries one class map per stage and therefore cannot
|
|
192
|
+
* store both under the single `names` key Ultralytics uses.
|
|
193
|
+
*
|
|
194
|
+
* @param encoded The encoded map — e.g. `"{0: 'deworm', 1: 'not_deworm'}"`.
|
|
195
|
+
* @returns Class names in class-id order, or `null` when the value is missing,
|
|
196
|
+
* unparseable, not a `dict`, or not keyed by contiguous integers from zero.
|
|
197
|
+
*/
|
|
198
|
+
export function parseNames(encoded) {
|
|
199
|
+
const raw = encoded?.trim();
|
|
186
200
|
if (!raw || !raw.startsWith("{") || !raw.endsWith("}"))
|
|
187
201
|
return null;
|
|
188
202
|
const body = raw.slice(1, -1).trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/core/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,0FAA0F;AAC1F,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,sEAAsE;AACtE,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,mDAAmD;AACnD,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,CAAC;AAShC;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,MAAc;IAChC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAE,CAAC;QACvC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;QAChB,MAAM,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,MAAM,CAAC;QACvC,KA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,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC3B,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAY,EAAE,EAAE;QAChD,IAAI,IAAI,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAC9B,IAAI,IAAI,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAC9B,IAAI,IAAI,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,YAAY,CAAC;AAIpE,kDAAkD;AAClD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,eAAe,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,KAAK,GAAG,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,YAAY,CAAC;AAIpE,kDAAkD;AAClD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,eAAe,GAAG,UAAU,CAAC;AA+ChE,MAAM,WAAW,iBAAiB;I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AC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAChC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAWvC"}
|
package/dist/core/session.js
CHANGED
|
@@ -19,14 +19,35 @@ import { resolveProviders } from "./providers.js";
|
|
|
19
19
|
async function fetchModel(url) {
|
|
20
20
|
try {
|
|
21
21
|
const response = await fetch(url);
|
|
22
|
-
if (!response.ok)
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
warnMetadataUnavailable(url, `HTTP ${response.status} ${response.statusText}`);
|
|
23
24
|
return url;
|
|
25
|
+
}
|
|
24
26
|
return new Uint8Array(await response.arrayBuffer());
|
|
25
27
|
}
|
|
26
|
-
catch {
|
|
28
|
+
catch (err) {
|
|
29
|
+
warnMetadataUnavailable(url, err.message);
|
|
27
30
|
return url;
|
|
28
31
|
}
|
|
29
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Warn that a model's metadata could not be read, and say what that costs.
|
|
35
|
+
*
|
|
36
|
+
* The fallback itself is right — losing the metadata beats failing a load that
|
|
37
|
+
* ORT could have completed on its own — but it used to be silent, and the
|
|
38
|
+
* symptom it produces is remote from the cause: class names come back as
|
|
39
|
+
* `class_0`, `class_1`, ... with nothing anywhere explaining why. Whoever hits
|
|
40
|
+
* this needs to be told that passing `labels` is the way out.
|
|
41
|
+
*
|
|
42
|
+
* @param url The model URL that could not be fetched here.
|
|
43
|
+
* @param reason What went wrong, as reported by `fetch`.
|
|
44
|
+
*/
|
|
45
|
+
function warnMetadataUnavailable(url, reason) {
|
|
46
|
+
console.warn(`[@ort-vision-sdk/web] Could not fetch ${url} to read its metadata (${reason}). ` +
|
|
47
|
+
"Letting ONNX Runtime load it instead: the model will work, but its baked-in " +
|
|
48
|
+
"class names are unavailable, so labels fall back to class_0, class_1, ... " +
|
|
49
|
+
"Pass `labels` explicitly to name them.");
|
|
50
|
+
}
|
|
30
51
|
/**
|
|
31
52
|
* Wrap an ONNX Runtime Web `InferenceSession` with convenient metadata access.
|
|
32
53
|
*
|
package/dist/core/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAsB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKlD;;;;;;;;;GASG;AACH,KAAK,UAAU,UAAU,CAAC,GAAW;IACnC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAsB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKlD;;;;;;;;;GASG;AACH,KAAK,UAAU,UAAU,CAAC,GAAW;IACnC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,uBAAuB,CAAC,GAAG,EAAE,QAAQ,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,C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