@webex/ladon-ts 5.4.6 → 5.5.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/module/index.d.ts +3 -2
  3. package/build/module/index.js +35 -34
  4. package/build/module/index.js.map +1 -1
  5. package/build/module/lib/config-builder.d.ts +1 -1
  6. package/build/module/lib/config-builder.js +59 -58
  7. package/build/module/lib/config-builder.js.map +1 -1
  8. package/build/module/lib/config-types.d.ts +1 -1
  9. package/build/module/lib/config-types.js.map +1 -1
  10. package/build/module/lib/generator-types.d.ts +25 -0
  11. package/build/module/lib/generator.d.ts +2 -74
  12. package/build/module/lib/pipeline.js +17 -26
  13. package/build/module/lib/pipeline.js.map +1 -1
  14. package/build/module/lib/preload.js +4 -4
  15. package/build/module/lib/preload.js.map +1 -1
  16. package/build/module/lib/resource-loader.d.ts +22 -0
  17. package/build/module/lib/resource-loader.js +33 -0
  18. package/build/module/lib/resource-loader.js.map +1 -0
  19. package/build/module/lib/util.d.ts +1 -2
  20. package/build/module/lib/util.js +63 -82
  21. package/build/module/lib/util.js.map +1 -1
  22. package/build/module/lib/version.d.ts +1 -1
  23. package/build/module/lib/version.js +1 -1
  24. package/build/module/lib/version.js.map +1 -1
  25. package/build/module/lib/worker-generator.d.ts +15 -0
  26. package/build/module/lib/worker-generator.js +93 -0
  27. package/build/module/lib/worker-generator.js.map +1 -0
  28. package/build/module/lib/worker-manager.d.ts +41 -0
  29. package/build/module/lib/worker-manager.js +63 -0
  30. package/build/module/lib/worker-manager.js.map +1 -0
  31. package/build/worker/segmentation.js +791 -791
  32. package/build/worker/segmentation.js.map +1 -1
  33. package/package.json +1 -4
  34. package/build/module/lib/generator.js +0 -224
  35. package/build/module/lib/generator.js.map +0 -1
  36. package/build/module/lib/shared-resource-manager.d.ts +0 -93
  37. package/build/module/lib/shared-resource-manager.js +0 -166
  38. package/build/module/lib/shared-resource-manager.js.map +0 -1
@@ -1,166 +0,0 @@
1
- import * as i from "onnxruntime-web";
2
- import { loadAndCacheFile as h, isResolvedUri as c, toAbsoluteURI as m } from "./util.js";
3
- const k = "ort-wasm-simd-threaded.wasm";
4
- class U {
5
- constructor() {
6
- this.modelSessions = {}, this.resolvedUriCache = /* @__PURE__ */ new Map();
7
- }
8
- /**
9
- * Initialize the worker using the provided configuration.
10
- *
11
- * @param config - The configuration object.
12
- * @returns A promise that resolves when the worker is initialized.
13
- */
14
- async initializeWorker(e) {
15
- if (typeof Worker > "u")
16
- throw new Error("[ladon-ts] web workers are not supported in this environment");
17
- const r = await this.resolveUri(e, e.mask.workerUri), s = await (await fetch(r, { cache: "force-cache" })).text();
18
- return this.workerUrl = URL.createObjectURL(new Blob([s], { type: "text/javascript" })), new Worker(this.workerUrl, { type: "module" });
19
- }
20
- /**
21
- * Terminate the worker.
22
- */
23
- terminateWorker() {
24
- this.worker && (this.worker.terminate(), this.worker = void 0);
25
- }
26
- /**
27
- * Load the model using the provided configuration. This gets called by the worker when using
28
- * the worker generator.
29
- *
30
- * @param config - The configuration object.
31
- * @returns A promise that resolves when the model is preloaded.
32
- */
33
- async loadModel(e) {
34
- const { mask: r, executionProviders: o } = e;
35
- i.env.wasm.numThreads = 1;
36
- const s = await this.resolveUri(e, e.wasmUri);
37
- if (s)
38
- try {
39
- i.env.wasm.wasmBinary = await h(s + k);
40
- } catch (w) {
41
- console.warn("Failed to load or cache WASM file. Using WASM paths.", w), i.env.wasm.wasmPaths = s;
42
- }
43
- const a = await this.resolveUri(e, r.modelUri);
44
- let t = this.modelSessions[a];
45
- if (!t) {
46
- const n = { executionProviders: o != null && o.length ? o : ["wasm"] };
47
- try {
48
- const l = await h(a);
49
- t = await i.InferenceSession.create(l, n);
50
- } catch (l) {
51
- console.warn("Failed to load or cache model file. Using model URL.", l), t = await i.InferenceSession.create(a, n);
52
- }
53
- }
54
- return this.modelSessions[a] = t, await this.warmupModel(t, r.inputSize, r.modelRank), t;
55
- }
56
- /**
57
- * Preload the worker using the provided configuration.
58
- *
59
- * @param config - The configuration object.
60
- * @returns A promise that resolves when the worker is preloaded.
61
- */
62
- async preloadWorker(e) {
63
- const r = await this.prepareWorkerConfig(e);
64
- this.worker = await this.initializeWorker(r), this.worker.postMessage({ type: "preload", config: r });
65
- }
66
- /**
67
- * Warmup the model session with a dummy input to avoid latency when running the model for the first time.
68
- *
69
- * @param {ort.InferenceSession} session The model session.
70
- * @param {ResolutionConfig} inputSize The input size of the model.
71
- * @param {number} inputChannels The number of input channels (e.g., RGB is 3).
72
- * @param {ort.Tensor.Type} inputType The input tensor type.
73
- * @returns {Promise<void>} A promise that resolves when the model is warmed up.
74
- * @example
75
- * await warmupModel(session, inputSize, inputChannels, inputType);
76
- */
77
- async warmupModel(e, r = { width: 1280, height: 720 }, o = 3, s = "float32") {
78
- const a = r.height * r.width, t = new Float32Array(o * a).fill(0), w = new i.Tensor(s, t, [
79
- 1,
80
- o,
81
- r.height,
82
- r.width
83
- ]), n = { [e.inputNames[0]]: w };
84
- if (o === 3) {
85
- const l = new Float32Array(a).fill(0), d = new i.Tensor(s, l, [
86
- 1,
87
- 1,
88
- r.height,
89
- r.width
90
- ]);
91
- n[e.inputNames[1]] = d;
92
- }
93
- await e.run(n);
94
- }
95
- /**
96
- * Get the model session for the provided model URL.
97
- *
98
- * @param {string} modelUrl The model URL.
99
- * @returns {ort.InferenceSession} The model session.
100
- * @example
101
- * const session = getModelSession(modelUrl);
102
- */
103
- getModelSession(e) {
104
- return this.modelSessions[e];
105
- }
106
- /**
107
- * Resolves the full URL for a given asset. Non-file URIs are treated as paths
108
- * and resolved using the `toAbsoluteURI` method.
109
- *
110
- * @param config - The preload configuration.
111
- * @param assetUri - The asset URI from the config.
112
- * @returns The resolved full URL.
113
- */
114
- /**
115
- * Resolves the full URL for a given asset. Non-file URIs are treated as paths and resolved
116
- * using the `toAbsoluteURI` method. If the assetUri is already resolved, or if it's found in
117
- * cache, it will be returned directly. If an assetUrlResolver function is provided in the
118
- * configuration, it will be used to resolve the URL if the assetUri is not fully qualified,
119
- * a blob URL, or in the cache.
120
- *
121
- * @param config - The preload configuration.
122
- * @param assetUri - The asset URI from the config.
123
- * @returns The resolved full URL.
124
- */
125
- async resolveUri(e, r) {
126
- if (!r)
127
- throw new Error("Asset URI is undefined.");
128
- if (this.resolvedUriCache.has(r))
129
- return this.resolvedUriCache.get(r);
130
- let o;
131
- if (c(r) ? o = r : r.match(/\.[a-z0-9]+$/i) ? typeof e.assetUrlResolver == "function" && (o = await e.assetUrlResolver(r, e)) : o = m(r, e.baseUrl), !o)
132
- throw new Error(`Failed to resolve asset URI: ${r}`);
133
- return this.resolvedUriCache.set(r, o), o;
134
- }
135
- getWorker() {
136
- return this.worker;
137
- }
138
- getWorkerUrl() {
139
- return this.workerUrl;
140
- }
141
- /**
142
- * Prepare the worker configuration by resolving the final URLs and paths to send to the
143
- * worker. This is necessary because we can't send functions to the worker. We also need to
144
- * remove the assetUrlResolver function from the configuration.
145
- *
146
- * @param config - The preload configuration.
147
- * @returns The worker configuration.
148
- */
149
- async prepareWorkerConfig(e) {
150
- const o = { ...{
151
- ...e,
152
- mask: {
153
- ...e.mask,
154
- modelUri: await this.resolveUri(e, e.mask.modelUri),
155
- workerUri: await this.resolveUri(e, e.mask.workerUri)
156
- },
157
- wasmUri: await this.resolveUri(e, e.wasmUri)
158
- }, assetUrlResolver: void 0 };
159
- return JSON.parse(JSON.stringify(o));
160
- }
161
- }
162
- const p = new U();
163
- export {
164
- p as sharedResourceManager
165
- };
166
- //# sourceMappingURL=shared-resource-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared-resource-manager.js","sources":["../../../src/lib/shared-resource-manager.ts"],"sourcesContent":["import * as ort from 'onnxruntime-web';\n\nimport { PreloadConfig, ResolutionConfig, WorkerConfig } from './config-types';\nimport { isResolvedUri, loadAndCacheFile, toAbsoluteURI } from './util';\n\n// There is only a single WASM file for all WebAssembly binaries now.\nconst ONNX_WASM_FILENAME = 'ort-wasm-simd-threaded.wasm';\n\n/**\n * Shared resource manager used to preload and share resources across different pipelines.\n * This is useful when multiple pipelines are using the same model or when the model needs\n * to be preloaded before the pipeline is created.\n */\nclass SharedResourceManager {\n private modelSessions: Record<string, ort.InferenceSession> = {};\n private worker?: Worker;\n private workerUrl?: string;\n\n // In-memory cache for resolved URLs\n private resolvedUriCache: Map<string, string> = new Map();\n\n /**\n * Initialize the worker using the provided configuration.\n *\n * @param config - The configuration object.\n * @returns A promise that resolves when the worker is initialized.\n */\n public async initializeWorker(config: WorkerConfig): Promise<Worker> {\n if (typeof Worker === 'undefined') {\n throw new Error('[ladon-ts] web workers are not supported in this environment');\n }\n\n const scriptUri = await this.resolveUri(config, config.mask.workerUri);\n const response = await fetch(scriptUri, { cache: 'force-cache' });\n const workerSource = await response.text();\n\n this.workerUrl = URL.createObjectURL(new Blob([workerSource], { type: 'text/javascript' }));\n\n return new Worker(this.workerUrl, { type: 'module' });\n }\n\n /**\n * Terminate the worker.\n */\n public terminateWorker() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = undefined;\n }\n }\n\n /**\n * Load the model using the provided configuration. This gets called by the worker when using\n * the worker generator.\n *\n * @param config - The configuration object.\n * @returns A promise that resolves when the model is preloaded.\n */\n public async loadModel(config: PreloadConfig) {\n const { mask, executionProviders: providers } = config;\n\n // Lock to a single thread to avoid performance issues.\n ort.env.wasm.numThreads = 1;\n\n // Get the resolved paths for the WASM binary.\n const wasmPaths = await this.resolveUri(config, config.wasmUri);\n\n if (wasmPaths) {\n try {\n ort.env.wasm.wasmBinary = await loadAndCacheFile(wasmPaths + ONNX_WASM_FILENAME);\n } catch (error) {\n console.warn('Failed to load or cache WASM file. Using WASM paths.', error);\n ort.env.wasm.wasmPaths = wasmPaths;\n }\n }\n\n // Resolve the model URL.\n const modelUrl = await this.resolveUri(config, mask.modelUri);\n let modelSession = this.modelSessions[modelUrl];\n\n // If the model session is not already cached, create a new session and cache.\n if (!modelSession) {\n // Allows the user to specify the execution providers to use. The default is the WASM provider.\n // TODO: Add and test support for other execution providers.\n const executionProviders = providers?.length ? providers : ['wasm'];\n const sessionOptions = { executionProviders };\n\n // First try to get the model binary either from cache or by fetching and cacheing it.\n try {\n const modelBinary = await loadAndCacheFile(modelUrl);\n modelSession = await ort.InferenceSession.create(modelBinary, sessionOptions);\n } catch (error) {\n console.warn('Failed to load or cache model file. Using model URL.', error);\n modelSession = await ort.InferenceSession.create(modelUrl, sessionOptions);\n }\n }\n\n // Cache the model session.\n this.modelSessions[modelUrl] = modelSession;\n\n // Warmup the model with a dummy input to avoid latency when running the model for the first time.\n await this.warmupModel(modelSession, mask.inputSize, mask.modelRank);\n\n return modelSession;\n }\n\n /**\n * Preload the worker using the provided configuration.\n *\n * @param config - The configuration object.\n * @returns A promise that resolves when the worker is preloaded.\n */\n public async preloadWorker(config: PreloadConfig) {\n const workerConfig = await this.prepareWorkerConfig(config);\n\n this.worker = await this.initializeWorker(workerConfig);\n this.worker.postMessage({ type: 'preload', config: workerConfig });\n }\n\n /**\n * Warmup the model session with a dummy input to avoid latency when running the model for the first time.\n *\n * @param {ort.InferenceSession} session The model session.\n * @param {ResolutionConfig} inputSize The input size of the model.\n * @param {number} inputChannels The number of input channels (e.g., RGB is 3).\n * @param {ort.Tensor.Type} inputType The input tensor type.\n * @returns {Promise<void>} A promise that resolves when the model is warmed up.\n * @example\n * await warmupModel(session, inputSize, inputChannels, inputType);\n */\n public async warmupModel(\n session: ort.InferenceSession,\n inputSize: ResolutionConfig = { width: 1280, height: 720 },\n inputChannels = 3,\n inputType: ort.Tensor.Type = 'float32'\n ): Promise<void> {\n const numPixels = inputSize.height * inputSize.width;\n const dummyInputData = new Float32Array(inputChannels * numPixels).fill(0);\n const dummyInput = new ort.Tensor(inputType, dummyInputData, [\n 1,\n inputChannels,\n inputSize.height,\n inputSize.width,\n ]);\n const feed = { [session.inputNames[0]]: dummyInput };\n\n // Use an additional dummy tensor if the model expects a previous mask.\n if (inputChannels === 3) {\n const dummyMaskData = new Float32Array(numPixels).fill(0);\n const prevMaskTensor = new ort.Tensor(inputType, dummyMaskData, [\n 1,\n 1,\n inputSize.height,\n inputSize.width,\n ]);\n feed[session.inputNames[1]] = prevMaskTensor;\n }\n\n // Run the model with the dummy input to warm it up.\n await session.run(feed);\n }\n\n /**\n * Get the model session for the provided model URL.\n *\n * @param {string} modelUrl The model URL.\n * @returns {ort.InferenceSession} The model session.\n * @example\n * const session = getModelSession(modelUrl);\n */\n public getModelSession(modelUrl: string) {\n return this.modelSessions[modelUrl];\n }\n\n /**\n * Resolves the full URL for a given asset. Non-file URIs are treated as paths\n * and resolved using the `toAbsoluteURI` method.\n *\n * @param config - The preload configuration.\n * @param assetUri - The asset URI from the config.\n * @returns The resolved full URL.\n */\n /**\n * Resolves the full URL for a given asset. Non-file URIs are treated as paths and resolved\n * using the `toAbsoluteURI` method. If the assetUri is already resolved, or if it's found in\n * cache, it will be returned directly. If an assetUrlResolver function is provided in the\n * configuration, it will be used to resolve the URL if the assetUri is not fully qualified,\n * a blob URL, or in the cache.\n *\n * @param config - The preload configuration.\n * @param assetUri - The asset URI from the config.\n * @returns The resolved full URL.\n */\n public async resolveUri(config: PreloadConfig, assetUri?: string): Promise<string> {\n if (!assetUri) {\n throw new Error('Asset URI is undefined.');\n }\n\n // Check if the URL is already cached\n if (this.resolvedUriCache.has(assetUri)) {\n return this.resolvedUriCache.get(assetUri) as string;\n }\n\n let resolvedUrl: string | undefined;\n\n if (isResolvedUri(assetUri)) {\n // If the assetUri is fully qualified or a blob URL, return it directly.\n // (Assets uris are resolved before being sent to the worker.)\n resolvedUrl = assetUri;\n } else if (!assetUri.match(/\\.[a-z0-9]+$/i)) {\n // Resolve as an absolute path to a non-file endpoint (e.g., wasmPaths).\n resolvedUrl = toAbsoluteURI(assetUri, config.baseUrl);\n } else if (typeof config.assetUrlResolver === 'function') {\n // Resolve via assetUrlResolver. This delegates the resolution logic to the caller.\n resolvedUrl = await config.assetUrlResolver(assetUri, config);\n }\n\n if (!resolvedUrl) {\n throw new Error(`Failed to resolve asset URI: ${assetUri}`);\n }\n\n // Cache the resolved URL\n this.resolvedUriCache.set(assetUri, resolvedUrl);\n\n return resolvedUrl;\n }\n\n public getWorker() {\n return this.worker;\n }\n\n public getWorkerUrl() {\n return this.workerUrl;\n }\n\n /**\n * Prepare the worker configuration by resolving the final URLs and paths to send to the\n * worker. This is necessary because we can't send functions to the worker. We also need to\n * remove the assetUrlResolver function from the configuration.\n *\n * @param config - The preload configuration.\n * @returns The worker configuration.\n */\n public async prepareWorkerConfig(config: PreloadConfig) {\n // Resolve and cache the URIs before sending the config to the worker. Future calls to the\n // resolveUri method will use the cache.\n const resolvedConfig: PreloadConfig = {\n ...config,\n mask: {\n ...config.mask,\n modelUri: await this.resolveUri(config, config.mask.modelUri),\n workerUri: await this.resolveUri(config, config.mask.workerUri),\n },\n wasmUri: await this.resolveUri(config, config.wasmUri),\n };\n\n // We can't send the assetUrlResolver function to the worker so we remove it from the config.\n const workerConfig = { ...resolvedConfig, assetUrlResolver: undefined };\n\n // This is a workaround to ensure the worker configuration can be sent to the worker.\n return JSON.parse(JSON.stringify(workerConfig));\n }\n}\n\n// Global instance of the shared resource manager.\nexport const sharedResourceManager = new SharedResourceManager();\n"],"names":["ONNX_WASM_FILENAME","SharedResourceManager","config","scriptUri","workerSource","mask","providers","ort","wasmPaths","loadAndCacheFile","error","modelUrl","modelSession","sessionOptions","modelBinary","workerConfig","session","inputSize","inputChannels","inputType","numPixels","dummyInputData","dummyInput","feed","dummyMaskData","prevMaskTensor","assetUri","resolvedUrl","isResolvedUri","toAbsoluteURI","sharedResourceManager"],"mappings":";;AAMA,MAAMA,IAAqB;AAO3B,MAAMC,EAAsB;AAAA,EAA5B,cAAA;AACI,SAAQ,gBAAsD,CAAC,GAKvD,KAAA,uCAA4C,IAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQxD,MAAa,iBAAiBC,GAAuC;AAC7D,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