@camstack/addon-pipeline 1.2.338 → 1.2.340
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/dist/audio-analyzer/index.js +22 -30
- package/dist/audio-analyzer/index.mjs +23 -31
- package/dist/{custom-model-catalog-CN6WPGB8.mjs → custom-model-catalog-BOnN63HU.mjs} +5 -1448
- package/dist/{custom-model-catalog-BYJyfhgj.js → custom-model-catalog-Cjbll1Sf.js} +18 -1461
- package/dist/detection-pipeline/index.js +208 -17
- package/dist/detection-pipeline/index.mjs +232 -41
- package/dist/{dist-WIL4yeyi.js → dist-BWigCRRN.js} +324 -51
- package/dist/{dist-CdmlJu1J.mjs → dist-CsA6fY6I.mjs} +311 -50
- package/dist/model-catalogs-BFBf8sHb.js +1522 -0
- package/dist/model-catalogs-D7JXV0_i.mjs +1445 -0
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-CEtew1DU.mjs → node-BZ29vHq2.mjs} +1 -1
- package/dist/{node-DCFClFJ1.js → node-D52HHrVZ.js} +1 -1
- package/dist/pipeline-runner/index.js +3 -3
- package/dist/pipeline-runner/index.mjs +3 -3
- package/dist/{process-memory-Bsj_b---.js → process-memory-C9U6dKxS.js} +1 -1
- package/dist/{process-memory-maZfOnev.mjs → process-memory-DOEeg2pL.mjs} +1 -1
- package/dist/recorder/index.js +6 -2
- package/dist/recorder/index.mjs +6 -2
- package/dist/{segment-demux-js-CXmBf_nf.js → segment-demux-js-CMZSmwMp.js} +1 -1
- package/dist/{segment-demux-js-DnPcYYbc.mjs → segment-demux-js-DDgwrz-e.mjs} +1 -1
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BdsJXZcP.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-6JIjr_ur.mjs} +2 -2
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js--yC-aoPc.mjs +26 -0
- package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Bt8aa0wk.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-B-hhg2sP.mjs} +1 -1
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-BU5SBy0i.mjs → hostInit-Ck1wQfKk.mjs} +2 -2
- package/dist/stream-broker/index.js +3 -3
- package/dist/stream-broker/index.mjs +3 -3
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-1Y-WK-Zy.mjs +0 -26
|
@@ -3,8 +3,9 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../chunk-emK7D4bc.js");
|
|
6
|
-
const require_dist = require("../dist-
|
|
7
|
-
const
|
|
6
|
+
const require_dist = require("../dist-BWigCRRN.js");
|
|
7
|
+
const require_model_catalogs = require("../model-catalogs-BFBf8sHb.js");
|
|
8
|
+
const require_process_memory = require("../process-memory-C9U6dKxS.js");
|
|
8
9
|
let node_fs = require("node:fs");
|
|
9
10
|
node_fs = require_chunk.__toESM(node_fs);
|
|
10
11
|
let node_path = require("node:path");
|
|
@@ -178,19 +179,22 @@ async function createAudioPipeline(modelsDir, logger, options) {
|
|
|
178
179
|
if (!options?.pythonPath) throw new Error("YAMNet audio backend requires the embedded Python interpreter — pass options.pythonPath (ctx.deps.ensurePython()).");
|
|
179
180
|
return new YamnetPythonPipeline(modelsDir, logger, options.pythonPath, options.installPythonRequirements);
|
|
180
181
|
}
|
|
182
|
+
var YAMNET_MODEL_ID = "yamnet-onnx";
|
|
181
183
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
* `downloadFile` from `@camstack/system`, the SAME helper detection-
|
|
186
|
-
* pipeline uses to materialise its YOLO/face/plate models.
|
|
187
|
-
*
|
|
188
|
-
* {domain}/{family}/{format}/{filename}
|
|
189
|
-
* For YAMNet that's `audioClassification/yamnet/onnx/camstack-yamnet.onnx`,
|
|
190
|
-
* with the labels JSON one level up (`audioClassification/yamnet/`).
|
|
184
|
+
* Materialise the YAMNet ONNX model and its labels from the catalog entry,
|
|
185
|
+
* through `ensureModel` — the one download path every hosted artefact takes,
|
|
186
|
+
* so a copy the mirror replaced in place is fetched again (D743, D744).
|
|
191
187
|
*/
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
async function ensureYamnetFiles(modelsDir) {
|
|
189
|
+
const entry = require_model_catalogs.AUDIO_CLASSIFIER_MODELS.find((m) => m.id === YAMNET_MODEL_ID);
|
|
190
|
+
if (entry === void 0) throw new Error(`audio catalog has no ${YAMNET_MODEL_ID} entry`);
|
|
191
|
+
const labels = entry.extraFiles?.[0];
|
|
192
|
+
if (labels === void 0) throw new Error(`${YAMNET_MODEL_ID} declares no labels file`);
|
|
193
|
+
return {
|
|
194
|
+
modelPath: await (0, _camstack_system_addon_utils.ensureModel)(modelsDir, entry, "onnx"),
|
|
195
|
+
labelsPath: node_path.join(modelsDir, labels.filename)
|
|
196
|
+
};
|
|
197
|
+
}
|
|
194
198
|
/**
|
|
195
199
|
* Locate the addon's bundled `python/` dir (holds `yamnet_audio.py` +
|
|
196
200
|
* `requirements-audio.txt`). Mirrors detection-pipeline's resolver: the
|
|
@@ -230,23 +234,11 @@ var YamnetPythonPipeline = class {
|
|
|
230
234
|
this.channel = new AudioSubprocessChannel("YAMNet Python", logger);
|
|
231
235
|
}
|
|
232
236
|
async initialize() {
|
|
233
|
-
const modelPath =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
dest: modelPath
|
|
239
|
-
} });
|
|
240
|
-
await (0, _camstack_system_addon_utils.downloadFile)(YAMNET_MODEL_URL, modelPath);
|
|
241
|
-
this.log.info("YAMNet ONNX model downloaded", { meta: { sizeBytes: node_fs.statSync(modelPath).size } });
|
|
242
|
-
}
|
|
243
|
-
if (!node_fs.existsSync(labelsPath)) {
|
|
244
|
-
this.log.info("YAMNet labels not found locally — downloading from HuggingFace", { meta: {
|
|
245
|
-
url: YAMNET_LABELS_URL,
|
|
246
|
-
dest: labelsPath
|
|
247
|
-
} });
|
|
248
|
-
await (0, _camstack_system_addon_utils.downloadFile)(YAMNET_LABELS_URL, labelsPath);
|
|
249
|
-
}
|
|
237
|
+
const { modelPath, labelsPath } = await ensureYamnetFiles(this.modelsDir);
|
|
238
|
+
this.log.info("YAMNet model ready", { meta: {
|
|
239
|
+
modelPath,
|
|
240
|
+
sizeBytes: node_fs.statSync(modelPath).size
|
|
241
|
+
} });
|
|
250
242
|
const pythonDir = resolveAudioPythonDir();
|
|
251
243
|
if (this.installPythonRequirements) await this.installPythonRequirements(node_path.join(pythonDir, "requirements-audio.txt"));
|
|
252
244
|
const scriptPath = node_path.join(pythonDir, "yamnet_audio.py");
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { n as __require } from "../chunk-DnnnRqeS.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
2
|
+
import { Dn as errMsg, In as expandAudioChunkToF32le, Ln as hydrateSchema, Mn as audioChunkBytesPerSample, N as PoolMemoryWatchdog, Nt as mapAudioLabelToMacro, Vn as nodePin, X as audioAnalyzerCapability, Y as audioAnalysisCapability, an as resolvePoolMemoryPolicy, h as DEFAULT_AUDIO_ANALYZER_CONFIG, ir as EventCategory, kn as BaseAddon, r as AUDIO_BACKEND_CHOICES } from "../dist-CsA6fY6I.mjs";
|
|
3
|
+
import { n as AUDIO_CLASSIFIER_MODELS } from "../model-catalogs-D7JXV0_i.mjs";
|
|
4
|
+
import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-DOEeg2pL.mjs";
|
|
4
5
|
import * as fs from "node:fs";
|
|
5
6
|
import * as path$1 from "node:path";
|
|
6
|
-
import {
|
|
7
|
+
import { ensureModel } from "@camstack/system/addon-utils";
|
|
7
8
|
//#region src/audio-analyzer/audio-subprocess-channel.ts
|
|
8
9
|
/** The backend process ended (or was disposed) while — or before — a request waited on it. */
|
|
9
10
|
var AudioBackendExitedError = class extends Error {
|
|
@@ -172,19 +173,22 @@ async function createAudioPipeline(modelsDir, logger, options) {
|
|
|
172
173
|
if (!options?.pythonPath) throw new Error("YAMNet audio backend requires the embedded Python interpreter — pass options.pythonPath (ctx.deps.ensurePython()).");
|
|
173
174
|
return new YamnetPythonPipeline(modelsDir, logger, options.pythonPath, options.installPythonRequirements);
|
|
174
175
|
}
|
|
176
|
+
var YAMNET_MODEL_ID = "yamnet-onnx";
|
|
175
177
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* `downloadFile` from `@camstack/system`, the SAME helper detection-
|
|
180
|
-
* pipeline uses to materialise its YOLO/face/plate models.
|
|
181
|
-
*
|
|
182
|
-
* {domain}/{family}/{format}/{filename}
|
|
183
|
-
* For YAMNet that's `audioClassification/yamnet/onnx/camstack-yamnet.onnx`,
|
|
184
|
-
* with the labels JSON one level up (`audioClassification/yamnet/`).
|
|
178
|
+
* Materialise the YAMNet ONNX model and its labels from the catalog entry,
|
|
179
|
+
* through `ensureModel` — the one download path every hosted artefact takes,
|
|
180
|
+
* so a copy the mirror replaced in place is fetched again (D743, D744).
|
|
185
181
|
*/
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
async function ensureYamnetFiles(modelsDir) {
|
|
183
|
+
const entry = AUDIO_CLASSIFIER_MODELS.find((m) => m.id === YAMNET_MODEL_ID);
|
|
184
|
+
if (entry === void 0) throw new Error(`audio catalog has no ${YAMNET_MODEL_ID} entry`);
|
|
185
|
+
const labels = entry.extraFiles?.[0];
|
|
186
|
+
if (labels === void 0) throw new Error(`${YAMNET_MODEL_ID} declares no labels file`);
|
|
187
|
+
return {
|
|
188
|
+
modelPath: await ensureModel(modelsDir, entry, "onnx"),
|
|
189
|
+
labelsPath: path$1.join(modelsDir, labels.filename)
|
|
190
|
+
};
|
|
191
|
+
}
|
|
188
192
|
/**
|
|
189
193
|
* Locate the addon's bundled `python/` dir (holds `yamnet_audio.py` +
|
|
190
194
|
* `requirements-audio.txt`). Mirrors detection-pipeline's resolver: the
|
|
@@ -224,23 +228,11 @@ var YamnetPythonPipeline = class {
|
|
|
224
228
|
this.channel = new AudioSubprocessChannel("YAMNet Python", logger);
|
|
225
229
|
}
|
|
226
230
|
async initialize() {
|
|
227
|
-
const modelPath =
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
dest: modelPath
|
|
233
|
-
} });
|
|
234
|
-
await downloadFile(YAMNET_MODEL_URL, modelPath);
|
|
235
|
-
this.log.info("YAMNet ONNX model downloaded", { meta: { sizeBytes: fs.statSync(modelPath).size } });
|
|
236
|
-
}
|
|
237
|
-
if (!fs.existsSync(labelsPath)) {
|
|
238
|
-
this.log.info("YAMNet labels not found locally — downloading from HuggingFace", { meta: {
|
|
239
|
-
url: YAMNET_LABELS_URL,
|
|
240
|
-
dest: labelsPath
|
|
241
|
-
} });
|
|
242
|
-
await downloadFile(YAMNET_LABELS_URL, labelsPath);
|
|
243
|
-
}
|
|
231
|
+
const { modelPath, labelsPath } = await ensureYamnetFiles(this.modelsDir);
|
|
232
|
+
this.log.info("YAMNet model ready", { meta: {
|
|
233
|
+
modelPath,
|
|
234
|
+
sizeBytes: fs.statSync(modelPath).size
|
|
235
|
+
} });
|
|
244
236
|
const pythonDir = resolveAudioPythonDir();
|
|
245
237
|
if (this.installPythonRequirements) await this.installPythonRequirements(path$1.join(pythonDir, "requirements-audio.txt"));
|
|
246
238
|
const scriptPath = path$1.join(pythonDir, "yamnet_audio.py");
|