@mauriciobenjamin700/ort-vision-sdk-web 0.8.1 → 0.9.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 CHANGED
@@ -7,6 +7,80 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.1] - 2026-09-13
11
+
12
+ ### Fixed
13
+
14
+ - **`readModelInputTypes` gave up on every model anyone would actually load
15
+ (#54).** Descending into the `ModelProto`'s `graph` went through the same
16
+ helper that reads a metadata *string*, which caps a field at 1 MB as a guard
17
+ against a corrupt length. A real export's graph is the file: 21.79 MB, 10.92
18
+ MB and 5.35 MB on the three models this was reported against. The reader
19
+ returned `{}`, the session fell back to "assume float32", and 0.9.0's fix was
20
+ undone for exactly the models it was written for.
21
+
22
+ The ceiling now applies to leaf fields being read *out* of the file, not to
23
+ the messages walked *through* to reach them; the graph descent is bounded by
24
+ the buffer length instead.
25
+
26
+ The suite could not see this: its fixtures run from 856 B to 14.8 kB, all of
27
+ them comfortably under the cap. Two regression tests build a `ModelProto` with
28
+ a 2 MB graph by hand — cheaper than committing a multi-megabyte `.onnx` — and
29
+ one of them declares float32, because the old code was equally broken there
30
+ and merely guessed right by accident.
31
+
32
+ ### Added
33
+
34
+ - **A warning when the model's bytes yield no input type at all.** Every ONNX
35
+ graph declares at least one input, so an empty read from bytes means the
36
+ reader failed rather than that the model said nothing. Falling back silently
37
+ is what let #54 ship and reach a consumer: float32 is right for most models
38
+ and wrong for precisely the half-precision ones this reader exists to serve,
39
+ so nothing looks broken until `predict()` throws `Unexpected input data type`.
40
+
41
+
42
+ ## [0.9.0] - 2026-09-13
43
+
44
+ ### Fixed
45
+
46
+ - **A model exported with `half=True` now runs (#50).** Every task built its
47
+ feed as `Float32Array` and nothing read the element type the graph declares,
48
+ so a half-precision export loaded fine and threw on the first `predict()`:
49
+ `Unexpected input data type. Actual: (tensor(float)) , expected:
50
+ (tensor(float16))`. FP16 halves the artifact — 5.11 MB against 10.11 MB on a
51
+ detector, 10.41 against 20.78 on a classifier — which in a browser is the
52
+ difference between the page opening and not.
53
+
54
+ The declared type now comes out of the model file itself, in the same pass
55
+ the SDK already makes for `names`: `session.inputMetadata` is `undefined` on
56
+ `onnxruntime-web` 1.20.1, so the session cannot answer this. `OrtSession`
57
+ exposes it as `inputDtype`/`inputDtypes`, and `run()` converts any float32
58
+ feed whose input declares `float16` — one boundary, rather than the fourteen
59
+ `toFloat32Tensor` call sites the tasks are built from. Preprocessing stays in
60
+ `Float32Array` on purpose: `(value / 255 - mean) / std` in half precision
61
+ loses exactly the small differences normalization exists to preserve.
62
+
63
+ Outputs are widened back before decoding. Float16 resolves to 0.5 px around
64
+ coordinate 640 and 1.0 px around 1280, so decoding boxes in that type would
65
+ quantise every coordinate before NMS and the scale-back to original-image
66
+ pixels ever ran.
67
+
68
+ - **A browser without `Float16Array` is refused at `create()`, not at the first
69
+ frame.** ORT requires a real `Float16Array` for a half tensor — the same bits
70
+ in a `Uint16Array` are rejected — and not every browser has one. Loading a
71
+ half-precision model there now fails immediately with a message naming the
72
+ inputs and the missing global, instead of throwing from inside preprocessing
73
+ one frame later.
74
+
75
+ ### Added
76
+
77
+ - **`readModelInputTypes`, `tensorTypeFor`, `asFloat32Array`,
78
+ `hasFloat16Array`** and the `DEFAULT_TENSOR_TYPE` constant, for callers
79
+ driving `OrtSession` directly. `asFloat32Array` is the one to reach for when
80
+ reading a raw output: it passes a `Float32Array` through and widens anything
81
+ else.
82
+
83
+
10
84
  ## [0.8.1] - 2026-09-04
11
85
 
12
86
  ### Performance
@@ -646,7 +720,9 @@ console.log(r.boxes.xyxy, r.boxes.cls, r.boxes.conf, r.names);
646
720
  - Execution-provider resolution defaulting to `["webgpu", "wasm"]`.
647
721
  - Public types mirroring the Python SDK: `BoundingBox`, `ClassProbability`, `ClassificationResult`, `DetectionResult`, `RGBImage`.
648
722
 
649
- [Unreleased]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.8.1...HEAD
723
+ [Unreleased]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.9.1...HEAD
724
+ [0.9.1]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.9.0...web-v0.9.1
725
+ [0.9.0]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.8.1...web-v0.9.0
650
726
  [0.8.1]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.8.0...web-v0.8.1
651
727
  [0.8.0]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.7.1...web-v0.8.0
652
728
  [0.7.1]: https://github.com/mauriciobenjamin700/ort-vision-sdk/compare/web-v0.7.0...web-v0.7.1
@@ -0,0 +1,81 @@
1
+ /**
2
+ * What element type the graph declares, and what typed array that means.
3
+ *
4
+ * A model exported with `half=True` declares its input as `float16`, and ONNX
5
+ * Runtime refuses a float32 feed against it:
6
+ *
7
+ * ```text
8
+ * Unexpected input data type. Actual: (tensor(float)) , expected: (tensor(float16))
9
+ * ```
10
+ *
11
+ * The session opens without complaint, so the failure lands on the caller's
12
+ * first `predict()` rather than on `create()`. Preprocessing stays in
13
+ * `Float32Array` because that is where the normalization arithmetic belongs —
14
+ * `(value / 255 - mean) / std` in half precision loses exactly the small
15
+ * differences normalization exists to preserve — and the conversion happens
16
+ * once, at the feed boundary.
17
+ *
18
+ * Outputs travel the other way. Float16 carries 11 bits of mantissa, so at
19
+ * pixel scale its neighbouring values are 0.5 apart around coordinate 640 and
20
+ * 1.0 apart around 1280: decoding boxes in that type quantises every coordinate
21
+ * before NMS and the scale-back to original-image pixels ever run. {@link
22
+ * asFloat32Array} widens a half-precision output before the decoders touch it.
23
+ *
24
+ * `Float16Array` is what ORT requires for a half tensor — a `Uint16Array` of
25
+ * the same bits is rejected — and it is not in every browser yet, so
26
+ * {@link hasFloat16Array} exists to refuse at session creation instead of on
27
+ * the first frame.
28
+ */
29
+ /** The element type every task preprocesses to, and the fallback when unknown. */
30
+ export declare const DEFAULT_TENSOR_TYPE = "float32";
31
+ /**
32
+ * The structural surface of `Float16Array` this module needs.
33
+ *
34
+ * Declared here rather than pulled from `lib.es2025`: the package targets
35
+ * ES2022 so it builds for consumers on older TypeScript, and the only thing
36
+ * needed is "an array-like of numbers ORT recognises as half precision".
37
+ */
38
+ export interface Float16ArrayLike {
39
+ readonly length: number;
40
+ readonly buffer: ArrayBufferLike;
41
+ [index: number]: number;
42
+ }
43
+ /**
44
+ * Whether this environment can build a half-precision tensor at all.
45
+ *
46
+ * @returns `true` when the runtime exposes `Float16Array`. ORT rejects any
47
+ * other typed array for a `float16` tensor, so a `false` here means half
48
+ * precision is unreachable in this browser no matter what the model declares.
49
+ */
50
+ export declare function hasFloat16Array(): boolean;
51
+ /**
52
+ * Name the tensor type an ONNX element type maps to.
53
+ *
54
+ * @param elemType A `TensorProto.DataType` value read off the graph.
55
+ * @returns The ORT tensor type name, or `"float32"` for anything unrecognised —
56
+ * which is what every task produces anyway, so an unknown type surfaces as
57
+ * ORT's own type error against the real graph rather than as a lookup miss.
58
+ */
59
+ export declare function tensorTypeFor(elemType: number | undefined): string;
60
+ /**
61
+ * Convert a preprocessed float32 buffer to the type a feed must carry.
62
+ *
63
+ * @param data The preprocessed planar buffer.
64
+ * @param tensorType The tensor type the input declares, from
65
+ * {@link tensorTypeFor}.
66
+ * @returns `data` itself for a float32 input, or a `Float16Array` holding the
67
+ * same values for a half-precision one.
68
+ * @throws {RangeError} If half precision is asked for and the runtime has no
69
+ * `Float16Array`. Callers convert this into a `ModelLoadError` at session
70
+ * creation, so it never reaches a `predict()`.
71
+ */
72
+ export declare function toFeedData(data: Float32Array, tensorType: string): Float32Array | Float16ArrayLike;
73
+ /**
74
+ * Widen a model output to `Float32Array`, without copying when it already is.
75
+ *
76
+ * @param data A tensor's `data`, as ORT returned it.
77
+ * @returns The same values as a `Float32Array`. A float32 output is passed
78
+ * through untouched; anything else is copied once.
79
+ */
80
+ export declare function asFloat32Array(data: unknown): Float32Array;
81
+ //# sourceMappingURL=dtypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dtypes.d.ts","sourceRoot":"","sources":["../../src/core/dtypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAkBH,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAQD;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGlE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY,GAAG,gBAAgB,CAQlG;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAG1D"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * What element type the graph declares, and what typed array that means.
3
+ *
4
+ * A model exported with `half=True` declares its input as `float16`, and ONNX
5
+ * Runtime refuses a float32 feed against it:
6
+ *
7
+ * ```text
8
+ * Unexpected input data type. Actual: (tensor(float)) , expected: (tensor(float16))
9
+ * ```
10
+ *
11
+ * The session opens without complaint, so the failure lands on the caller's
12
+ * first `predict()` rather than on `create()`. Preprocessing stays in
13
+ * `Float32Array` because that is where the normalization arithmetic belongs —
14
+ * `(value / 255 - mean) / std` in half precision loses exactly the small
15
+ * differences normalization exists to preserve — and the conversion happens
16
+ * once, at the feed boundary.
17
+ *
18
+ * Outputs travel the other way. Float16 carries 11 bits of mantissa, so at
19
+ * pixel scale its neighbouring values are 0.5 apart around coordinate 640 and
20
+ * 1.0 apart around 1280: decoding boxes in that type quantises every coordinate
21
+ * before NMS and the scale-back to original-image pixels ever run. {@link
22
+ * asFloat32Array} widens a half-precision output before the decoders touch it.
23
+ *
24
+ * `Float16Array` is what ORT requires for a half tensor — a `Uint16Array` of
25
+ * the same bits is rejected — and it is not in every browser yet, so
26
+ * {@link hasFloat16Array} exists to refuse at session creation instead of on
27
+ * the first frame.
28
+ */
29
+ /** ONNX `TensorProto.DataType` values this SDK can name. */
30
+ const ELEM_TYPE_TO_TENSOR_TYPE = {
31
+ 1: "float32",
32
+ 2: "uint8",
33
+ 3: "int8",
34
+ 4: "uint16",
35
+ 5: "int16",
36
+ 6: "int32",
37
+ 7: "int64",
38
+ 9: "bool",
39
+ 10: "float16",
40
+ 11: "float64",
41
+ 12: "uint32",
42
+ 13: "uint64",
43
+ };
44
+ /** The element type every task preprocesses to, and the fallback when unknown. */
45
+ export const DEFAULT_TENSOR_TYPE = "float32";
46
+ const FLOAT16_ARRAY = globalThis.Float16Array;
47
+ /**
48
+ * Whether this environment can build a half-precision tensor at all.
49
+ *
50
+ * @returns `true` when the runtime exposes `Float16Array`. ORT rejects any
51
+ * other typed array for a `float16` tensor, so a `false` here means half
52
+ * precision is unreachable in this browser no matter what the model declares.
53
+ */
54
+ export function hasFloat16Array() {
55
+ return FLOAT16_ARRAY !== undefined;
56
+ }
57
+ /**
58
+ * Name the tensor type an ONNX element type maps to.
59
+ *
60
+ * @param elemType A `TensorProto.DataType` value read off the graph.
61
+ * @returns The ORT tensor type name, or `"float32"` for anything unrecognised —
62
+ * which is what every task produces anyway, so an unknown type surfaces as
63
+ * ORT's own type error against the real graph rather than as a lookup miss.
64
+ */
65
+ export function tensorTypeFor(elemType) {
66
+ if (elemType === undefined)
67
+ return DEFAULT_TENSOR_TYPE;
68
+ return ELEM_TYPE_TO_TENSOR_TYPE[elemType] ?? DEFAULT_TENSOR_TYPE;
69
+ }
70
+ /**
71
+ * Convert a preprocessed float32 buffer to the type a feed must carry.
72
+ *
73
+ * @param data The preprocessed planar buffer.
74
+ * @param tensorType The tensor type the input declares, from
75
+ * {@link tensorTypeFor}.
76
+ * @returns `data` itself for a float32 input, or a `Float16Array` holding the
77
+ * same values for a half-precision one.
78
+ * @throws {RangeError} If half precision is asked for and the runtime has no
79
+ * `Float16Array`. Callers convert this into a `ModelLoadError` at session
80
+ * creation, so it never reaches a `predict()`.
81
+ */
82
+ export function toFeedData(data, tensorType) {
83
+ if (tensorType !== "float16")
84
+ return data;
85
+ if (FLOAT16_ARRAY === undefined) {
86
+ throw new RangeError("This model declares a float16 input, but this environment has no Float16Array.");
87
+ }
88
+ return new FLOAT16_ARRAY(data);
89
+ }
90
+ /**
91
+ * Widen a model output to `Float32Array`, without copying when it already is.
92
+ *
93
+ * @param data A tensor's `data`, as ORT returned it.
94
+ * @returns The same values as a `Float32Array`. A float32 output is passed
95
+ * through untouched; anything else is copied once.
96
+ */
97
+ export function asFloat32Array(data) {
98
+ if (data instanceof Float32Array)
99
+ return data;
100
+ return Float32Array.from(data);
101
+ }
102
+ //# sourceMappingURL=dtypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dtypes.js","sourceRoot":"","sources":["../../src/core/dtypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,4DAA4D;AAC5D,MAAM,wBAAwB,GAAqC;IACjE,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,MAAM;IACT,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;CACb,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAmB7C,MAAM,aAAa,GAAI,UAAyD,CAAC,YAAY,CAAC;AAE9F;;;;;;GAMG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,KAAK,SAAS,CAAC;AACrC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,QAA4B;IACxD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,mBAAmB,CAAC;IACvD,OAAO,wBAAwB,CAAC,QAAQ,CAAC,IAAI,mBAAmB,CAAC;AACnE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,IAAkB,EAAE,UAAkB;IAC/D,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,IAAI,UAAU,CAClB,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAa;IAC1C,IAAI,IAAI,YAAY,YAAY;QAAE,OAAO,IAAI,CAAC;IAC9C,OAAO,YAAY,CAAC,IAAI,CAAC,IAAyB,CAAC,CAAC;AACtD,CAAC"}
@@ -22,6 +22,21 @@
22
22
  * cannot be walked.
23
23
  */
24
24
  export declare function readModelMetadata(model: Uint8Array | ArrayBufferLike): Readonly<Record<string, string>>;
25
+ /**
26
+ * Read the element type each graph input declares.
27
+ *
28
+ * `onnxruntime-web` does not expose this. `session.inputMetadata` is
29
+ * `undefined` on 1.20.1 — the same version where `declaredShapesFrom` comes
30
+ * back empty — so the declared types have to come from the file, which the SDK
31
+ * already downloads and walks for {@link readModelMetadata}. Same bytes, one
32
+ * more pass, no extra request.
33
+ *
34
+ * @param model The `.onnx` file contents.
35
+ * @returns Input name → `TensorProto.DataType` value. An empty object when the
36
+ * file carries no readable graph, which every caller treats as "assume
37
+ * float32" — the behaviour before any of this existed.
38
+ */
39
+ export declare function readModelInputTypes(model: Uint8Array | ArrayBufferLike): Readonly<Record<string, number>>;
25
40
  /**
26
41
  * Read the class names an export baked into the model metadata.
27
42
  *
@@ -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,CAE1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,CA6BhF"}
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/core/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoKH;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,GAAG,eAAe,GAClC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAqBlC;AA2FD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,GAAG,eAAe,GAClC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkClC;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"}
@@ -15,6 +15,17 @@
15
15
  */
16
16
  /** Field number of `metadata_props` in `ModelProto` (repeated StringStringEntryProto). */
17
17
  const MODEL_METADATA_PROPS_FIELD = 14;
18
+ /** Field number of `graph` in `ModelProto` (GraphProto). */
19
+ const MODEL_GRAPH_FIELD = 7;
20
+ /** Field number of `input` in `GraphProto` (repeated ValueInfoProto). */
21
+ const GRAPH_INPUT_FIELD = 11;
22
+ /** Field numbers of `name` and `type` in `ValueInfoProto`. */
23
+ const VALUE_INFO_NAME_FIELD = 1;
24
+ const VALUE_INFO_TYPE_FIELD = 2;
25
+ /** Field number of `tensor_type` in `TypeProto` (TypeProto.Tensor). */
26
+ const TYPE_TENSOR_FIELD = 1;
27
+ /** Field number of `elem_type` in `TypeProto.Tensor` (a `TensorProto.DataType`). */
28
+ const TENSOR_ELEM_TYPE_FIELD = 1;
18
29
  /** Field numbers of `key` and `value` in `StringStringEntryProto`. */
19
30
  const ENTRY_KEY_FIELD = 1;
20
31
  const ENTRY_VALUE_FIELD = 2;
@@ -27,6 +38,11 @@ const WIRE_FIXED32 = 5;
27
38
  * Hard ceiling on a single length-delimited field, as a guard against a corrupt
28
39
  * length turning into a huge slice. Model metadata values are strings — a class
29
40
  * name map for thousands of classes still fits well inside this.
41
+ *
42
+ * It applies to leaf fields being read *out* of the file, not to the messages
43
+ * walked *through* to reach them. The `graph` of a real export is the file: 21.79
44
+ * MB on a reported YOLO detector. Applying this ceiling there made the reader
45
+ * give up on every model anyone would actually load, and give up silently.
30
46
  */
31
47
  const MAX_FIELD_BYTES = 1 << 20;
32
48
  /**
@@ -84,12 +100,15 @@ function skipField(cursor, wireType) {
84
100
  * Read a length-delimited payload as a byte range.
85
101
  *
86
102
  * @param cursor Cursor to advance past the payload.
103
+ * @param maxBytes Largest payload to accept, defaulting to
104
+ * {@link MAX_FIELD_BYTES}. Pass the buffer length when descending into a
105
+ * message whose size is the file's size rather than a leaf value's.
87
106
  * @returns Start and end offsets of the payload, or `null` when the length is
88
- * truncated, overruns the buffer, or exceeds {@link MAX_FIELD_BYTES}.
107
+ * truncated, overruns the buffer, or exceeds `maxBytes`.
89
108
  */
90
- function readLengthDelimited(cursor) {
109
+ function readLengthDelimited(cursor, maxBytes = MAX_FIELD_BYTES) {
91
110
  const length = readVarint(cursor);
92
- if (length === null || length > MAX_FIELD_BYTES)
111
+ if (length === null || length > maxBytes)
93
112
  return null;
94
113
  const start = cursor.pos;
95
114
  const end = start + length;
@@ -168,6 +187,150 @@ export function readModelMetadata(model) {
168
187
  }
169
188
  return metadata;
170
189
  }
190
+ /**
191
+ * Read the element type of a `TypeProto.Tensor` message.
192
+ *
193
+ * @param bytes The whole model buffer.
194
+ * @param start Offset of the message's first byte.
195
+ * @param end Offset one past its last byte.
196
+ * @returns The `TensorProto.DataType` value, or `null` when the message
197
+ * carries none or cannot be walked.
198
+ */
199
+ function readTensorElemType(bytes, start, end) {
200
+ const cursor = { bytes, end, pos: start };
201
+ while (cursor.pos < cursor.end) {
202
+ const tag = readVarint(cursor);
203
+ if (tag === null)
204
+ return null;
205
+ const field = tag >>> 3;
206
+ const wireType = tag & 0x07;
207
+ if (field === TENSOR_ELEM_TYPE_FIELD && wireType === WIRE_VARINT) {
208
+ return readVarint(cursor);
209
+ }
210
+ if (!skipField(cursor, wireType))
211
+ return null;
212
+ }
213
+ return null;
214
+ }
215
+ /**
216
+ * Read the element type out of a `TypeProto`, which wraps the tensor type.
217
+ *
218
+ * @param bytes The whole model buffer.
219
+ * @param start Offset of the message's first byte.
220
+ * @param end Offset one past its last byte.
221
+ * @returns The `TensorProto.DataType` value, or `null` for a non-tensor type
222
+ * (sequence, map, optional) or an unreadable message.
223
+ */
224
+ function readTypeElemType(bytes, start, end) {
225
+ const cursor = { bytes, end, pos: start };
226
+ while (cursor.pos < cursor.end) {
227
+ const tag = readVarint(cursor);
228
+ if (tag === null)
229
+ return null;
230
+ const field = tag >>> 3;
231
+ const wireType = tag & 0x07;
232
+ if (field === TYPE_TENSOR_FIELD && wireType === WIRE_LENGTH_DELIMITED) {
233
+ const range = readLengthDelimited(cursor);
234
+ if (range === null)
235
+ return null;
236
+ return readTensorElemType(bytes, range.start, range.end);
237
+ }
238
+ if (!skipField(cursor, wireType))
239
+ return null;
240
+ }
241
+ return null;
242
+ }
243
+ /**
244
+ * Read one `ValueInfoProto` into a name/element-type pair.
245
+ *
246
+ * @param bytes The whole model buffer.
247
+ * @param start Offset of the message's first byte.
248
+ * @param end Offset one past its last byte.
249
+ * @returns The pair, or `null` when either half is missing or unreadable.
250
+ */
251
+ function readValueInfo(bytes, start, end) {
252
+ const cursor = { bytes, end, pos: start };
253
+ let name = null;
254
+ let elemType = null;
255
+ while (cursor.pos < cursor.end) {
256
+ const tag = readVarint(cursor);
257
+ if (tag === null)
258
+ return null;
259
+ const field = tag >>> 3;
260
+ const wireType = tag & 0x07;
261
+ if (wireType === WIRE_LENGTH_DELIMITED) {
262
+ const range = readLengthDelimited(cursor);
263
+ if (range === null)
264
+ return null;
265
+ if (field === VALUE_INFO_NAME_FIELD) {
266
+ name = new TextDecoder("utf-8", { fatal: false }).decode(bytes.subarray(range.start, range.end));
267
+ }
268
+ else if (field === VALUE_INFO_TYPE_FIELD) {
269
+ elemType = readTypeElemType(bytes, range.start, range.end);
270
+ }
271
+ continue;
272
+ }
273
+ if (!skipField(cursor, wireType))
274
+ return null;
275
+ }
276
+ if (name === null || elemType === null)
277
+ return null;
278
+ return [name, elemType];
279
+ }
280
+ /**
281
+ * Read the element type each graph input declares.
282
+ *
283
+ * `onnxruntime-web` does not expose this. `session.inputMetadata` is
284
+ * `undefined` on 1.20.1 — the same version where `declaredShapesFrom` comes
285
+ * back empty — so the declared types have to come from the file, which the SDK
286
+ * already downloads and walks for {@link readModelMetadata}. Same bytes, one
287
+ * more pass, no extra request.
288
+ *
289
+ * @param model The `.onnx` file contents.
290
+ * @returns Input name → `TensorProto.DataType` value. An empty object when the
291
+ * file carries no readable graph, which every caller treats as "assume
292
+ * float32" — the behaviour before any of this existed.
293
+ */
294
+ export function readModelInputTypes(model) {
295
+ const bytes = model instanceof Uint8Array ? model : new Uint8Array(model);
296
+ const cursor = { bytes, end: bytes.length, pos: 0 };
297
+ const types = {};
298
+ while (cursor.pos < cursor.end) {
299
+ const tag = readVarint(cursor);
300
+ if (tag === null)
301
+ break;
302
+ const field = tag >>> 3;
303
+ const wireType = tag & 0x07;
304
+ if (field === MODEL_GRAPH_FIELD && wireType === WIRE_LENGTH_DELIMITED) {
305
+ const graph = readLengthDelimited(cursor, bytes.length);
306
+ if (graph === null)
307
+ break;
308
+ const inner = { bytes, end: graph.end, pos: graph.start };
309
+ while (inner.pos < inner.end) {
310
+ const innerTag = readVarint(inner);
311
+ if (innerTag === null)
312
+ break;
313
+ const innerField = innerTag >>> 3;
314
+ const innerWire = innerTag & 0x07;
315
+ if (innerField === GRAPH_INPUT_FIELD && innerWire === WIRE_LENGTH_DELIMITED) {
316
+ const range = readLengthDelimited(inner);
317
+ if (range === null)
318
+ break;
319
+ const info = readValueInfo(bytes, range.start, range.end);
320
+ if (info)
321
+ types[info[0]] = info[1];
322
+ continue;
323
+ }
324
+ if (!skipField(inner, innerWire))
325
+ break;
326
+ }
327
+ continue;
328
+ }
329
+ if (!skipField(cursor, wireType))
330
+ break;
331
+ }
332
+ return types;
333
+ }
171
334
  /**
172
335
  * Read the class names an export baked into the model metadata.
173
336
  *
@@ -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,sEAA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,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9B,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAElC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;IAC1C,IAAI,UAAU,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAE7C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,KAAK,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"}
@@ -69,6 +69,15 @@ export declare class OrtSession {
69
69
  * `webgpu` on a device without it runs on WASM and is told nothing.
70
70
  */
71
71
  readonly requestedProviders: readonly string[];
72
+ /**
73
+ * Tensor type each input declares, keyed by input name.
74
+ *
75
+ * Read from the model file, not from the session: `inputMetadata` is
76
+ * `undefined` on `onnxruntime-web` 1.20.1. Empty when the bytes were never
77
+ * in hand — a URL loaded with `readMetadata: false` — in which case every
78
+ * feed is built as float32, the behaviour before this existed.
79
+ */
80
+ private readonly _inputTypes;
72
81
  private constructor();
73
82
  /**
74
83
  * Load an ONNX model into an ORT inference session.
@@ -89,6 +98,16 @@ export declare class OrtSession {
89
98
  * @throws {@link ModelLoadError} if the model cannot be loaded.
90
99
  */
91
100
  static create(model: ModelSource, options?: OrtSessionOptions): Promise<OrtSession>;
101
+ /**
102
+ * Tensor type each input declares, in declaration order.
103
+ *
104
+ * `"float32"` for a normal export, `"float16"` for one exported with
105
+ * `half=True`. ORT matches a feed's type against this exactly, so the tasks
106
+ * read it and convert at the feed boundary.
107
+ */
108
+ get inputDtypes(): readonly string[];
109
+ /** Tensor type the first input declares. */
110
+ get inputDtype(): string;
92
111
  /** Names of the model's inputs, in declaration order. */
93
112
  get inputNames(): readonly string[];
94
113
  /** Name of the first (and usually only) input. */
@@ -149,5 +168,20 @@ export declare class OrtSession {
149
168
  * @throws {@link InferenceError} if ORT raises any error during execution.
150
169
  */
151
170
  run(feeds: Record<string, ort.Tensor>): Promise<Record<string, ort.Tensor>>;
171
+ /**
172
+ * Rebuild any feed whose type does not match what its input declares.
173
+ *
174
+ * ORT matches feed types against the graph exactly: a float32 tensor against
175
+ * a `half=True` export fails the run with `Unexpected input data type`. Every
176
+ * preprocessing path in this SDK produces `Float32Array`, on purpose — the
177
+ * normalization arithmetic belongs in single precision — so the conversion
178
+ * happens here, once, at the only boundary all of them pass through. A feed
179
+ * that already carries the declared type is handed on untouched, so a caller
180
+ * building its own half tensor pays nothing.
181
+ *
182
+ * @param feeds The tensors to run with.
183
+ * @returns The same mapping, with mismatched float32 feeds converted.
184
+ */
185
+ private _asDeclaredTypes;
152
186
  }
153
187
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA;;GAEG;A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