microsoft / microsoft/onnxruntime
[Web] Missing API for fetching model metadata
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 184
Description
### Describe the issue
In Java, I can do
```java
OrtSession session = env.createSession(res.getContentAsByteArray());
OnnxModelMetadata meta = session.getMetadata();
Map customMeta = meta.getCustomMetadata();
String imgzz = customMeta.get("imgsz");
```
To get the `imgsz` metadata from a model.
In TypeScript, I expected to be able to do the same with roughly the same API, however I cannot find any API for this. Am I missing something, has nobody just gotten around to implementing the API yet (is this what
https://github.com/microsoft/onnxruntime/blob/a5dab850b8dfa64d8818eefa01e0df40cf3e4400/js/common/lib/inference-session.ts#L321-L324 is about?) or is there another reason the API does not exist?
### To reproduce
-
### Urgency
_No response_
### ONNX Runtime Installation
Released Package
### ONNX Runtime Version or Commit ID
1.15.0
### Execution Provider
'wasm'/'cpu' (WebAssembly CPU)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with js/common/lib/inference-session.ts around the referenced lines and compare the existing TypeScript web session surface with the Java metadata API shown in the issue. Trace how the WebAssembly CPU session is exposed, then verify that model metadata, including custom metadata such as "imgsz", can be fetched through the web API and add coverage where the existing tests for this surface are located.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, wasm
- Domain
- ai, api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100