@camstack/addon-pipeline 1.2.333 → 1.2.334

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 (35) hide show
  1. package/THIRD_PARTY_MODELS.md +3 -8
  2. package/dist/audio-analyzer/index.js +2 -2
  3. package/dist/audio-analyzer/index.mjs +2 -2
  4. package/dist/{default-detection-model-Biwf5-ML.js → custom-model-catalog-CVeosmYm.js} +236 -165
  5. package/dist/{default-detection-model-CDffuH2m.mjs → custom-model-catalog-DoOVE7kz.mjs} +225 -166
  6. package/dist/detection-pipeline/index.js +70 -104
  7. package/dist/detection-pipeline/index.mjs +18 -52
  8. package/dist/{dist-DJV7Z6Bb.js → dist-C7v30DMP.js} +69 -22
  9. package/dist/{dist-BsT15i7i.mjs → dist-Dn3knu_K.mjs} +69 -22
  10. package/dist/motion-wasm/index.js +1 -1
  11. package/dist/motion-wasm/index.mjs +1 -1
  12. package/dist/{node-CkmucLYG.js → node-DWdekhW3.js} +1 -1
  13. package/dist/{node-Crsi_8ea.mjs → node-_BruMF4L.mjs} +1 -1
  14. package/dist/pipeline-runner/index.js +228 -42
  15. package/dist/pipeline-runner/index.mjs +206 -20
  16. package/dist/{process-memory-BJb7Ihdp.js → process-memory-CaDpfUdM.js} +1 -1
  17. package/dist/{process-memory-1mAUV8S1.mjs → process-memory-Dp-4bFOp.mjs} +1 -1
  18. package/dist/recorder/index.js +2 -2
  19. package/dist/recorder/index.mjs +2 -2
  20. package/dist/{segment-demux-js-B_tboBcJ.mjs → segment-demux-js-B_-zBECg.mjs} +1 -1
  21. package/dist/{segment-demux-js-mK9IBGLf.js → segment-demux-js-BqPTLFZG.js} +1 -1
  22. package/dist/stream-broker/_stub.js +1 -1
  23. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-a3HMFtd5.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BP8FFU2i.mjs} +2 -2
  24. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CpjKK9II.mjs +26 -0
  25. package/dist/stream-broker/demux-worker-child.js +1 -1
  26. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  27. package/dist/stream-broker/{hostInit-DChPnZ5C.mjs → hostInit-BEh-hm1x.mjs} +2 -2
  28. package/dist/stream-broker/index.js +3 -3
  29. package/dist/stream-broker/index.mjs +3 -3
  30. package/dist/stream-broker/remoteEntry.js +1 -1
  31. package/package.json +1 -1
  32. package/python/postprocessors/test_yolo_seg_root.py +109 -0
  33. package/python/postprocessors/yolo.py +52 -13
  34. package/python/postprocessors/yolo_seg.py +79 -156
  35. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DPbj3ML4.mjs +0 -26
@@ -3,11 +3,11 @@ 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-DJV7Z6Bb.js");
7
- const require_node = require("../node-CkmucLYG.js");
8
- const require_default_detection_model = require("../default-detection-model-Biwf5-ML.js");
6
+ const require_dist = require("../dist-C7v30DMP.js");
7
+ const require_node = require("../node-DWdekhW3.js");
8
+ const require_custom_model_catalog = require("../custom-model-catalog-CVeosmYm.js");
9
9
  const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
10
- const require_process_memory = require("../process-memory-BJb7Ihdp.js");
10
+ const require_process_memory = require("../process-memory-CaDpfUdM.js");
11
11
  let node_os = require("node:os");
12
12
  node_os = require_chunk.__toESM(node_os);
13
13
  let node_fs = require("node:fs");
@@ -3001,38 +3001,6 @@ var PipelineModelManager = class {
3001
3001
  }
3002
3002
  };
3003
3003
  //#endregion
3004
- //#region src/detection-pipeline/engine/resolve-device-engine.ts
3005
- /**
3006
- * Resolve a Phase-1 device key (`<backend>:<device>`, or bare `cpu`) into the
3007
- * {@link PipelineEngineChoice} used to build that device's inference pool.
3008
- * Throws on an unknown backend token so a bad `deviceKey` fails loud rather
3009
- * than silently building a wrong pool. Format comes from the shared
3010
- * {@link DEVICE_BACKEND_TO_FORMAT} SSOT (`@camstack/types`) — no local copy.
3011
- */
3012
- function resolveDeviceEngine(deviceKey) {
3013
- const colon = deviceKey.indexOf(":");
3014
- const backend = colon >= 0 ? deviceKey.slice(0, colon) : deviceKey;
3015
- const device = colon >= 0 ? deviceKey.slice(colon + 1) : deviceKey;
3016
- const format = require_dist.DEVICE_BACKEND_TO_FORMAT[backend];
3017
- if (format === void 0) throw new Error(`resolveDeviceEngine: unknown backend "${backend}" in deviceKey "${deviceKey}"`);
3018
- return {
3019
- runtime: "python",
3020
- backend,
3021
- format,
3022
- device
3023
- };
3024
- }
3025
- /**
3026
- * The inverse of {@link resolveDeviceEngine}: the `<backend>:<device>` key that
3027
- * names the pool an engine belongs to. Every pool-level log line carries this —
3028
- * without it a default pool logs anonymously and six hours of logs cannot tell
3029
- * "the NPU is unused" from "the NPU IS the anonymous default pool".
3030
- * Falls back to the bare backend when the engine carries no device.
3031
- */
3032
- function deviceKeyOf(engine) {
3033
- return engine.device ? `${engine.backend}:${engine.device}` : engine.backend;
3034
- }
3035
- //#endregion
3036
3004
  //#region src/detection-pipeline/engine/coral-cocompiled-set.ts
3037
3005
  var ROOT_DETECTOR_STEP_ID = "object-detection";
3038
3006
  /** The models a dispatch places on the pool that runs it: every enabled video step. */
@@ -3380,7 +3348,7 @@ var EngineFactory = class {
3380
3348
  constructor(opts) {
3381
3349
  this.opts = opts;
3382
3350
  this.log = opts.logger;
3383
- this.deviceKey = deviceKeyOf(opts.engine);
3351
+ this.deviceKey = require_custom_model_catalog.deviceKeyOf(opts.engine);
3384
3352
  this.resolvedProvisioning = resolvePoolProvisioning(opts.engine, opts.provisioning);
3385
3353
  this.coralSets = BACKEND_TO_POOL_RUNTIME[opts.engine.backend] === "edgetpu" ? new CoralSetPlanner(opts.coCompiledSets ?? EDGETPU_COCOMPILED_SETS) : null;
3386
3354
  }
@@ -3651,7 +3619,7 @@ var EngineFactory = class {
3651
3619
  * to `buildConfig`, which throws the message naming the step and the model.
3652
3620
  */
3653
3621
  resolveDecode(stepId, modelId, settings) {
3654
- const def = require_default_detection_model.getStepDefinition(stepId);
3622
+ const def = require_custom_model_catalog.getStepDefinition(stepId);
3655
3623
  const modelEntry = def.models.find((m) => m.id === modelId) ?? this.opts.resolveCustomModel?.(stepId, modelId);
3656
3624
  if (!modelEntry) return null;
3657
3625
  return resolvePoolDecodeSettings({
@@ -3696,7 +3664,7 @@ var EngineFactory = class {
3696
3664
  */
3697
3665
  function buildPoolModelConfigForStep(inputs) {
3698
3666
  const { stepId, modelId, poolRuntime, modelsDir } = inputs;
3699
- const def = require_default_detection_model.getStepDefinition(stepId);
3667
+ const def = require_custom_model_catalog.getStepDefinition(stepId);
3700
3668
  const resolvedEntry = def.models.find((m) => m.id === modelId) ?? inputs.resolveCustomModel?.(stepId, modelId);
3701
3669
  if (!resolvedEntry) throw new Error(`Model "${modelId}" not found in step "${stepId}" catalog (static or custom registry)`);
3702
3670
  const modelEntry = inputs.entryForPool?.(stepId, resolvedEntry) ?? resolvedEntry;
@@ -3728,7 +3696,7 @@ function buildPoolModelConfigForStep(inputs) {
3728
3696
  inputNormalization: modelEntry.inputNormalization,
3729
3697
  outputProbabilities: modelEntry.outputProbabilities,
3730
3698
  postprocessor: resolveEffectivePostprocessorForEntry(def, modelEntry),
3731
- confidence: resolvePoolConfidenceFloor(stepId, require_default_detection_model.resolveModelDefaultConfidence(def, modelEntry)),
3699
+ confidence: resolvePoolConfidenceFloor(stepId, require_custom_model_catalog.resolveModelDefaultConfidence(def, modelEntry)),
3732
3700
  nmsIouThreshold: resolvePoolDecodeSettings({
3733
3701
  def,
3734
3702
  modelEntry,
@@ -6586,7 +6554,7 @@ function linkedLabelsFor(supplies, rawClass, macroClass, modelId) {
6586
6554
  if (require_dist.LABEL_SUPPLY_MACRO[supply.stepId] !== macroClass) continue;
6587
6555
  const effect = supply.labelToEffect[rawClass];
6588
6556
  if (effect === void 0 || effect === macroClass) continue;
6589
- const tier = require_default_detection_model.getStepDefinition(supply.stepId).labelTier;
6557
+ const tier = require_custom_model_catalog.getStepDefinition(supply.stepId).labelTier;
6590
6558
  out.push({
6591
6559
  label: effect,
6592
6560
  score: 0,
@@ -7198,7 +7166,7 @@ var PipelineExecutor = class {
7198
7166
  this.warnFaceTooSmall(child, detShortSide, minFaceSize, void 0, deviceId);
7199
7167
  continue;
7200
7168
  }
7201
- const precision = require_default_detection_model.landmarkPrecisionVerdict({
7169
+ const precision = require_custom_model_catalog.landmarkPrecisionVerdict({
7202
7170
  detectionShortSidePx: detShortSide,
7203
7171
  floorPx: numericSetting(child.settings, "minLandmarkFaceSize", 24)
7204
7172
  });
@@ -7391,7 +7359,7 @@ var PipelineExecutor = class {
7391
7359
  * - `minConfidence<Macro>`: number (e.g. `minConfidencePerson: 0.5`)
7392
7360
  */
7393
7361
  macroFilterVerdict(macroClass, score, settings) {
7394
- return require_default_detection_model.macroGateVerdict(macroClass, score, settings);
7362
+ return require_custom_model_catalog.macroGateVerdict(macroClass, score, settings);
7395
7363
  }
7396
7364
  };
7397
7365
  //#endregion
@@ -7469,7 +7437,7 @@ function buildChild(child, parentStepId, getEngine, resolveModel, onMissingVaria
7469
7437
  return buildNode(child, getEngine, resolveModel, onMissingVariant, variant);
7470
7438
  }
7471
7439
  function buildNode(step, getEngine, resolveModel, onMissingVariant, resolved) {
7472
- const definition = require_default_detection_model.getStepDefinition(step.addonId);
7440
+ const definition = require_custom_model_catalog.getStepDefinition(step.addonId);
7473
7441
  const variant = resolved ?? getEngine(step.addonId, step.modelId);
7474
7442
  const children = (step.children ?? []).filter((c) => c.enabled).map((c) => buildChild(c, step.addonId, getEngine, resolveModel, onMissingVariant)).filter((c) => c !== null);
7475
7443
  const modelEntry = resolveModelEntry(definition, variant.modelId, resolveModel);
@@ -7507,7 +7475,7 @@ function rootSuppliesField(definition, modelEntry) {
7507
7475
  * entered recursively. Fields without a declared default are skipped.
7508
7476
  */
7509
7477
  function collectSchemaDefaults(stepId, model) {
7510
- const schema = require_default_detection_model.getStep(stepId).getConfigSchema(model);
7478
+ const schema = require_custom_model_catalog.getStep(stepId).getConfigSchema(model);
7511
7479
  const out = {};
7512
7480
  walkFieldsForDefaults(schema, out);
7513
7481
  return out;
@@ -7564,7 +7532,7 @@ function walkFieldsForDefaults(fields, out) {
7564
7532
  */
7565
7533
  var defaultLookup = (stepId) => {
7566
7534
  try {
7567
- return require_default_detection_model.getStepDefinition(stepId);
7535
+ return require_custom_model_catalog.getStepDefinition(stepId);
7568
7536
  } catch {
7569
7537
  return null;
7570
7538
  }
@@ -7613,7 +7581,7 @@ function collectSubstitutions(steps, format) {
7613
7581
  for (const step of steps) {
7614
7582
  const chosen = step.modelId;
7615
7583
  if (chosen != null) {
7616
- const running = require_default_detection_model.resolveModelForFormat(step.addonId, chosen, format);
7584
+ const running = require_custom_model_catalog.resolveModelForFormat(step.addonId, chosen, format);
7617
7585
  if (running !== chosen) result.push({
7618
7586
  addonId: step.addonId,
7619
7587
  chosen,
@@ -7641,7 +7609,7 @@ function collectSubstitutions(steps, format) {
7641
7609
  * black-box test. Unknown/custom addonIds (no registered `StepDefinition`)
7642
7610
  * are skipped, never thrown.
7643
7611
  */
7644
- function collectZeroBuildIssues(steps, format, getStepDef = require_default_detection_model.getStepDefinition) {
7612
+ function collectZeroBuildIssues(steps, format, getStepDef = require_custom_model_catalog.getStepDefinition) {
7645
7613
  const result = [];
7646
7614
  for (const step of steps) {
7647
7615
  let def;
@@ -7667,7 +7635,7 @@ function collectZeroBuildIssues(steps, format, getStepDef = require_default_dete
7667
7635
  * tests can exercise the unknown-addon branch with a fabricated resolver
7668
7636
  * without `vi.mock`.
7669
7637
  */
7670
- function collectUnknownAddonIssues(steps, getStepDef = require_default_detection_model.getStepDefinition) {
7638
+ function collectUnknownAddonIssues(steps, getStepDef = require_custom_model_catalog.getStepDefinition) {
7671
7639
  const result = [];
7672
7640
  for (const step of steps) {
7673
7641
  try {
@@ -7717,7 +7685,7 @@ function resolveInputSteps(steps, format, engine, clusterModels, clusterSettings
7717
7685
  for (const s of steps) {
7718
7686
  let def;
7719
7687
  try {
7720
- def = require_default_detection_model.getStepDefinition(s.addonId);
7688
+ def = require_custom_model_catalog.getStepDefinition(s.addonId);
7721
7689
  } catch {
7722
7690
  unknownAddonIds.push(s.addonId);
7723
7691
  continue;
@@ -7752,7 +7720,7 @@ function resolveInputSteps(steps, format, engine, clusterModels, clusterSettings
7752
7720
  }
7753
7721
  }
7754
7722
  const chosenModelId = s.modelId ?? null;
7755
- const runningModelId = chosenModelId === null && engine !== void 0 && s.addonId === "object-detection" ? require_default_detection_model.resolveDefaultDetectionModel(engine.backend, engine.device, format) : require_default_detection_model.resolveModelForFormat(s.addonId, chosenModelId, format);
7723
+ const runningModelId = chosenModelId === null && engine !== void 0 && s.addonId === "object-detection" ? require_custom_model_catalog.resolveDefaultDetectionModel(engine.backend, engine.device, format) : require_custom_model_catalog.resolveModelForFormat(s.addonId, chosenModelId, format);
7756
7724
  if (chosenModelId !== null && runningModelId !== chosenModelId) substitutions.push({
7757
7725
  addonId: s.addonId,
7758
7726
  chosen: chosenModelId,
@@ -8185,7 +8153,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
8185
8153
  * paths don't issue a cap round-trip on every call. Empty map = no provider
8186
8154
  * (or a query failure) → behaviour identical to the static-catalog-only path.
8187
8155
  */
8188
- customModels = new require_default_detection_model.CustomModelCatalog({ warn: (message, extras) => this.log.warn(message, extras) });
8156
+ customModels = new require_custom_model_catalog.CustomModelCatalog({ warn: (message, extras) => this.log.warn(message, extras) });
8189
8157
  /**
8190
8158
  * SYNC custom-model lookup handed to every live {@link EngineFactory} so
8191
8159
  * `buildPoolModelConfigForStep` can resolve an operator-registered model at
@@ -8323,7 +8291,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
8323
8291
  listGuardedPools() {
8324
8292
  const pools = [];
8325
8293
  if (this.engineFactory) pools.push({
8326
- key: `default:${deviceKeyOf(this.currentEngine)}`,
8294
+ key: `default:${require_custom_model_catalog.deviceKeyOf(this.currentEngine)}`,
8327
8295
  factory: this.engineFactory
8328
8296
  });
8329
8297
  for (const [deviceKey, factory] of this.factoriesByDevice) pools.push({
@@ -8585,7 +8553,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
8585
8553
  } catch {}
8586
8554
  const devices = require_dist.enumerateInferenceDevices(envToHardwareInfo(runtimeEnvFromProcess(hardware ? toProbedHardware(hardware) : null)));
8587
8555
  const top = devices.find((d) => d.available) ?? devices[0];
8588
- this.currentEngine = top ? resolveDeviceEngine(top.key) : ONNX_FLOOR;
8556
+ this.currentEngine = top ? require_custom_model_catalog.resolveDeviceEngine(top.key) : ONNX_FLOOR;
8589
8557
  this.log.info("Derived node-default engine (local kernel)", { meta: {
8590
8558
  deviceKey: top?.key ?? "onnx:cpu(floor)",
8591
8559
  backend: this.currentEngine.backend,
@@ -8844,7 +8812,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
8844
8812
  * first, then the custom registry. Returns undefined if neither has it.
8845
8813
  */
8846
8814
  async resolveModelEntry(addonId, modelId) {
8847
- const fromCatalog = require_default_detection_model.getStepDefinition(addonId).models.find((m) => m.id === modelId);
8815
+ const fromCatalog = require_custom_model_catalog.getStepDefinition(addonId).models.find((m) => m.id === modelId);
8848
8816
  if (fromCatalog) return fromCatalog;
8849
8817
  return (await this.getCustomModels()).get(addonId)?.find((m) => m.id === modelId);
8850
8818
  }
@@ -8909,7 +8877,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
8909
8877
  };
8910
8878
  }
8911
8879
  async getDefaultSteps(engine) {
8912
- const detectionModelId = require_default_detection_model.resolveDefaultDetectionModel(engine.backend, engine.device ?? null, engine.format);
8880
+ const detectionModelId = require_custom_model_catalog.resolveDefaultDetectionModel(engine.backend, engine.device ?? null, engine.format);
8913
8881
  return buildDefaultStepTree(engine.format, detectionModelId);
8914
8882
  }
8915
8883
  /**
@@ -8940,7 +8908,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
8940
8908
  /** Pure recursive resolver — builds the resolved step tree without touching `modelSubstitutions`. */
8941
8909
  resolveStepModelTree(steps, format) {
8942
8910
  return steps.map((step) => {
8943
- const resolved = require_default_detection_model.resolveModelForFormat(step.addonId, step.modelId ?? null, format);
8911
+ const resolved = require_custom_model_catalog.resolveModelForFormat(step.addonId, step.modelId ?? null, format);
8944
8912
  const children = step.children?.length ? this.resolveStepModelTree([...step.children], format) : step.children;
8945
8913
  return resolved === step.modelId && children === step.children ? step : {
8946
8914
  ...step,
@@ -8967,7 +8935,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
8967
8935
  */
8968
8936
  async getGlobalSteps() {
8969
8937
  if (this.currentSteps) return this.currentSteps;
8970
- const detectionModelId = require_default_detection_model.resolveDefaultDetectionModel(this.currentEngine.backend, this.currentEngine.device ?? null, this.currentEngine.format);
8938
+ const detectionModelId = require_custom_model_catalog.resolveDefaultDetectionModel(this.currentEngine.backend, this.currentEngine.device ?? null, this.currentEngine.format);
8971
8939
  const defaults = buildDefaultStepTree(this.currentEngine.format, detectionModelId);
8972
8940
  if (defaults.length === 0) return null;
8973
8941
  this.currentSteps = this.resolveStepModels(defaults);
@@ -9013,7 +8981,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9013
8981
  let format = this.currentEngine.format;
9014
8982
  try {
9015
8983
  if (input.deviceKey !== void 0) try {
9016
- format = resolveDeviceEngine(input.deviceKey).format;
8984
+ format = require_custom_model_catalog.resolveDeviceEngine(input.deviceKey).format;
9017
8985
  } catch (err) {
9018
8986
  return {
9019
8987
  ok: false,
@@ -9102,7 +9070,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9102
9070
  for (const step of nodes) {
9103
9071
  if (!step.enabled) continue;
9104
9072
  try {
9105
- if (require_default_detection_model.getStepDefinition(step.addonId).slot === "audio-classifier") continue;
9073
+ if (require_custom_model_catalog.getStepDefinition(step.addonId).slot === "audio-classifier") continue;
9106
9074
  } catch {
9107
9075
  continue;
9108
9076
  }
@@ -9122,7 +9090,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9122
9090
  async getCapabilities(_forceRefresh) {
9123
9091
  const agentId = (this.addonCtx?.kernel?.cluster?.broker)?.nodeID ?? node_os.hostname();
9124
9092
  const agentName = agentId;
9125
- const addons = require_default_detection_model.ALL_PIPELINE_STEPS.map((s) => ({
9093
+ const addons = require_custom_model_catalog.ALL_PIPELINE_STEPS.map((s) => ({
9126
9094
  id: s.definition.id,
9127
9095
  name: s.definition.name,
9128
9096
  models: s.definition.models.filter((m) => m.legacy !== true).map((m) => {
@@ -9524,7 +9492,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9524
9492
  executing: input.plane === "frame" ? collectFramePlaneSteps(benchmarkSteps, isDetailPlaneStep) : enabledSteps,
9525
9493
  requestedDeviceKey: input.deviceKey,
9526
9494
  dispatchDeviceKey,
9527
- format: dispatchDeviceKey ? resolveDeviceEngine(dispatchDeviceKey).format : this.currentEngine.format
9495
+ format: dispatchDeviceKey ? require_custom_model_catalog.resolveDeviceEngine(dispatchDeviceKey).format : this.currentEngine.format
9528
9496
  });
9529
9497
  if (verdict.kind === "refused") {
9530
9498
  this.log.warn("replay refused — the node cannot run exactly what was pinned", {
@@ -9556,13 +9524,13 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9556
9524
  logger: this.log
9557
9525
  });
9558
9526
  this.executor = executor;
9559
- const dispatchEngine = dispatchDeviceKey ? resolveDeviceEngine(dispatchDeviceKey) : runEngine;
9527
+ const dispatchEngine = dispatchDeviceKey ? require_custom_model_catalog.resolveDeviceEngine(dispatchDeviceKey) : runEngine;
9560
9528
  const dispatchFactory = dispatchDeviceKey ? await this.resolveDeviceFactory(dispatchDeviceKey) : this.engineFactory;
9561
9529
  const needed = enabledSteps.filter((s) => dispatchFactory.needsPoolUpdate(s));
9562
9530
  let runSteps = benchmarkSteps;
9563
9531
  const loadPolicy = dispatchLoadPolicyOf(input);
9564
9532
  if (needed.length > 0) {
9565
- const dispatchDeviceKeyLabel = deviceKeyOf(dispatchEngine);
9533
+ const dispatchDeviceKeyLabel = require_custom_model_catalog.deviceKeyOf(dispatchEngine);
9566
9534
  const toIssue = needed.filter((s) => this.loadGovernor.check(dispatchFactory, dispatchDeviceKeyLabel, [stepModelKey(s)]).kind === "go");
9567
9535
  if (toIssue.length > 0) this.log.info("Benchmark: models to load", { meta: {
9568
9536
  count: toIssue.length,
@@ -9588,7 +9556,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9588
9556
  }));
9589
9557
  if (notWarm.length > 0) {
9590
9558
  if (loadPolicy === "all-or-nothing") throw new DispatchStepsNotLoadedError(notWarm);
9591
- const dispatchDeviceKeyLabel = deviceKeyOf(dispatchEngine);
9559
+ const dispatchDeviceKeyLabel = require_custom_model_catalog.deviceKeyOf(dispatchEngine);
9592
9560
  for (const failure of notWarm) {
9593
9561
  const model = stepModelKey(failure.step);
9594
9562
  this.reportDispatchLoadLoss({
@@ -9618,7 +9586,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9618
9586
  let frameViewResolver;
9619
9587
  let rootInputViewProvider;
9620
9588
  if (runtimeFrameRef) {
9621
- frameViewResolver = createRootFrameViewResolver(require_default_detection_model.localFrameRegistry, runtimeFrameRef);
9589
+ frameViewResolver = createRootFrameViewResolver(require_custom_model_catalog.localFrameRegistry, runtimeFrameRef);
9622
9590
  rootInputViewProvider = async (root, crop) => {
9623
9591
  const view = await frameViewResolver(root, crop ? {
9624
9592
  left: crop[0],
@@ -9804,7 +9772,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9804
9772
  device: this.currentEngine.device ?? null
9805
9773
  };
9806
9774
  const nodeEngineLabel = `${nodeEngine.backend}/${nodeEngine.device ?? "default"} (${nodeFormat})`;
9807
- const deviceEngine = deviceKey ? resolveDeviceEngine(deviceKey) : void 0;
9775
+ const deviceEngine = deviceKey ? require_custom_model_catalog.resolveDeviceEngine(deviceKey) : void 0;
9808
9776
  if (deviceKey === void 0 || deviceEngine === void 0) {
9809
9777
  const refusals = [];
9810
9778
  const steps = this.inputStepsToPipelineSteps(args.steps, nodeFormat, nodeEngine, refusals);
@@ -9832,7 +9800,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9832
9800
  steps
9833
9801
  };
9834
9802
  }
9835
- const pruneResult = pruneUnrunnableDetailSteps(steps, isDetailPlaneStep, (subtree) => !require_default_detection_model.buildSubtreeCanRun(subtree, this.mergedStepDef)(deviceFormat));
9803
+ const pruneResult = pruneUnrunnableDetailSteps(steps, isDetailPlaneStep, (subtree) => !require_custom_model_catalog.buildSubtreeCanRun(subtree, this.mergedStepDef)(deviceFormat));
9836
9804
  if (pruneResult.prunedAddonIds.length > 0) {
9837
9805
  const prunedList = pruneResult.prunedAddonIds.join(",");
9838
9806
  this.logLiveDispatchIssueOnce(`detail-defer:${deviceKey}:${deviceFormat}:${prunedList}`, () => this.log.info("Detail steps have no model build for the dispatch device format — deferred to the detail-plane device jump", {
@@ -9957,7 +9925,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9957
9925
  async noteCoralPlacement(steps, factory, format, context) {
9958
9926
  const change = factory.notePlacement(placedModelsOf(steps));
9959
9927
  if (change.kind === "unchanged") return;
9960
- const deviceKey = context.deviceKey ?? deviceKeyOf(this.currentEngine);
9928
+ const deviceKey = context.deviceKey ?? require_custom_model_catalog.deviceKeyOf(this.currentEngine);
9961
9929
  const tags = context.deviceId !== void 0 ? { tags: { deviceId: context.deviceId } } : {};
9962
9930
  const placed = change.placed.map((p) => `${p.stepId}/${p.modelId}`);
9963
9931
  if (change.to.kind === "set") this.log.info("Coral pool loads a co-compiled set — the models placed on it share the parameter cache", {
@@ -10018,7 +9986,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10018
9986
  const needed = this.stepsNeedingLoad(steps, factory);
10019
9987
  if (needed.length === 0) return;
10020
9988
  const pool = factory ?? this.nullPoolKey;
10021
- const deviceKey = context.deviceKey ?? deviceKeyOf(this.currentEngine);
9989
+ const deviceKey = context.deviceKey ?? require_custom_model_catalog.deviceKeyOf(this.currentEngine);
10022
9990
  const models = needed.map(stepModelKey);
10023
9991
  const refusal = this.loadRefusal(pool, deviceKey, models);
10024
9992
  if (refusal !== null) {
@@ -10300,7 +10268,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10300
10268
  plane: void 0
10301
10269
  });
10302
10270
  const dispatchDeviceKey = dispatchResolution.deviceKey;
10303
- const resolveFormat = dispatchDeviceKey ? resolveDeviceEngine(dispatchDeviceKey).format : this.currentEngine.format;
10271
+ const resolveFormat = dispatchDeviceKey ? require_custom_model_catalog.resolveDeviceEngine(dispatchDeviceKey).format : this.currentEngine.format;
10304
10272
  const benchmarkSteps = dispatchResolution.steps;
10305
10273
  const enabledSteps = flattenEnabledVideoSteps(benchmarkSteps);
10306
10274
  if (enabledSteps.length === 0) throw new Error("runPipelineBatch: no enabled steps");
@@ -10323,7 +10291,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10323
10291
  await this.ensureEngineFactory();
10324
10292
  const factory = dispatchDeviceKey ? await this.resolveDeviceFactory(dispatchDeviceKey) : this.engineFactory;
10325
10293
  if (!factory) throw new Error("runPipelineBatch: factory not initialised");
10326
- if (enabledSteps.filter((s) => factory.needsPoolUpdate(s)).length > 0) await this.ensureModelsForSteps(benchmarkSteps, factory, resolveFormat, { deviceKey: dispatchDeviceKey ?? deviceKeyOf(this.currentEngine) });
10294
+ if (enabledSteps.filter((s) => factory.needsPoolUpdate(s)).length > 0) await this.ensureModelsForSteps(benchmarkSteps, factory, resolveFormat, { deviceKey: dispatchDeviceKey ?? require_custom_model_catalog.deviceKeyOf(this.currentEngine) });
10327
10295
  const canFastPath = singleRoot && allRaw && uniformDims && factory.supportsBatch();
10328
10296
  this.log.info("runPipelineBatch path decision", { meta: {
10329
10297
  phase: "batch",
@@ -10556,7 +10524,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10556
10524
  * pool that ran the work (D646).
10557
10525
  */
10558
10526
  async getEffectiveTuning(input = {}) {
10559
- const p = resolvePoolProvisioning(input.deviceKey !== void 0 ? resolveDeviceEngine(input.deviceKey) : this.currentEngine, this.executorOptions.provisioning);
10527
+ const p = resolvePoolProvisioning(input.deviceKey !== void 0 ? require_custom_model_catalog.resolveDeviceEngine(input.deviceKey) : this.currentEngine, this.executorOptions.provisioning);
10560
10528
  return {
10561
10529
  deviceKey: input.deviceKey ?? null,
10562
10530
  runtime: p.runtime,
@@ -10573,7 +10541,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10573
10541
  * If global steps exist, initializes with them. Otherwise, creates an empty pool.
10574
10542
  */
10575
10543
  async ensureEngineFactory() {
10576
- const defaultDeviceKey = deviceKeyOf(this.currentEngine);
10544
+ const defaultDeviceKey = require_custom_model_catalog.deviceKeyOf(this.currentEngine);
10577
10545
  this.refuseIfDeviceUnusable(defaultDeviceKey);
10578
10546
  if (this.engineFactory) {
10579
10547
  if (this.engineFactory.isReady()) return;
@@ -10773,7 +10741,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10773
10741
  async getInferenceDeviceHealth() {
10774
10742
  const byKey = /* @__PURE__ */ new Map();
10775
10743
  for (const entry of this.deviceLiveness.unhealthy()) byKey.set(entry.deviceKey, entry);
10776
- const live = [...this.factoriesByDevice, ...this.engineFactory ? [[deviceKeyOf(this.currentEngine), this.engineFactory]] : []];
10744
+ const live = [...this.factoriesByDevice, ...this.engineFactory ? [[require_custom_model_catalog.deviceKeyOf(this.currentEngine), this.engineFactory]] : []];
10777
10745
  for (const [deviceKey, factory] of live) {
10778
10746
  if (factory.isReady() || byKey.has(deviceKey)) continue;
10779
10747
  byKey.set(deviceKey, {
@@ -10809,7 +10777,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10809
10777
  return { rearmed };
10810
10778
  }
10811
10779
  async resolveDeviceFactory(deviceKey) {
10812
- const engine = resolveDeviceEngine(deviceKey);
10780
+ const engine = require_custom_model_catalog.resolveDeviceEngine(deviceKey);
10813
10781
  if (enginesEqual(engine, this.currentEngine)) {
10814
10782
  await this.ensureEngineFactory();
10815
10783
  return this.engineFactory;
@@ -10993,7 +10961,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
10993
10961
  });
10994
10962
  }
10995
10963
  for (const [deviceKey, factory] of this.factoriesByDevice) {
10996
- const eng = resolveDeviceEngine(deviceKey);
10964
+ const eng = require_custom_model_catalog.resolveDeviceEngine(deviceKey);
10997
10965
  const loaded = factory.listLoaded();
10998
10966
  out.push({
10999
10967
  engineKey: `${eng.runtime}/${eng.backend}/${eng.device ?? "default"} [${deviceKey}]`,
@@ -11176,9 +11144,9 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
11176
11144
  function buildSchemaSlots(formats, modelsDir, customByStep) {
11177
11145
  const slotMap = /* @__PURE__ */ new Map();
11178
11146
  const formatList = [...formats];
11179
- for (const pipelineStep of require_default_detection_model.ALL_PIPELINE_STEPS) {
11147
+ for (const pipelineStep of require_custom_model_catalog.ALL_PIPELINE_STEPS) {
11180
11148
  const step = pipelineStep.definition;
11181
- const availableModels = require_default_detection_model.mergeCustomModels(step.models, customByStep?.get(step.id) ?? []).filter((m) => m.legacy !== true && formatList.some((f) => m.formats[f]));
11149
+ const availableModels = require_custom_model_catalog.mergeCustomModels(step.models, customByStep?.get(step.id) ?? []).filter((m) => m.legacy !== true && formatList.some((f) => m.formats[f]));
11182
11150
  if (availableModels.length === 0) continue;
11183
11151
  const slot = step.slot;
11184
11152
  if (!slotMap.has(slot)) slotMap.set(slot, []);
@@ -11206,7 +11174,7 @@ function buildSchemaSlots(formats, modelsDir, customByStep) {
11206
11174
  ...m.group ? { group: m.group } : {},
11207
11175
  ...m.legacy !== void 0 ? { legacy: m.legacy } : {},
11208
11176
  provider: m.provider ?? "camstack",
11209
- defaultConfidence: require_default_detection_model.resolveModelDefaultConfidence(step, m),
11177
+ defaultConfidence: require_custom_model_catalog.resolveModelDefaultConfidence(step, m),
11210
11178
  ...modelSuppliesField(step, m)
11211
11179
  })),
11212
11180
  defaultModelId: step.defaultModelId,
@@ -11259,20 +11227,15 @@ function resolveChildSlots(slot) {
11259
11227
  }
11260
11228
  }
11261
11229
  /**
11262
- * V2 default: lightweight pipeline with minimal enabled steps.
11263
- *
11264
- * Only object detection (yolov9t, 4-8 MB) + face detection (scrfd, 1.7 MB) enabled.
11265
- * All other steps are present in the tree but DISABLED — user enables via UI.
11266
- * Total model footprint: ~10 MB (CoreML), ~11 MB (ONNX)
11267
- *
11268
- * Why:
11269
- * - Fast startup (seconds, not minutes of model downloads)
11270
- * - Covers 90% of NVR use cases (person/vehicle/animal detection + face detection)
11271
- * - Users opt-in to heavy classifiers (vehicle type, plate OCR, bird species) when needed
11230
+ * V2 default: the node-default step tree (never persisted — see
11231
+ * `getGlobalSteps`). The core detection + recognition steps are enabled; every
11232
+ * optional step is present with its catalog `enabledByDefault` (the animal and
11233
+ * vehicle classifiers on — their answer comes from the root model when it
11234
+ * declares them, D736 — the bird classifier and segmentation off).
11272
11235
  */
11273
11236
  function buildDefaultStepTree(format, objectDetectionModelId) {
11274
11237
  const makeStep = (stepId, children, opts) => {
11275
- const def = require_default_detection_model.getStepDefinition(stepId);
11238
+ const def = require_custom_model_catalog.getStepDefinition(stepId);
11276
11239
  if (!def.models.some((m) => m.formats[format])) return null;
11277
11240
  return {
11278
11241
  addonId: def.id,
@@ -11281,7 +11244,7 @@ function buildDefaultStepTree(format, objectDetectionModelId) {
11281
11244
  inputClasses: def.inputClasses ?? [],
11282
11245
  outputClasses: def.outputClasses,
11283
11246
  enabled: opts?.enabled ?? true,
11284
- modelId: opts?.modelId ?? require_default_detection_model.getDefaultModelForFormat(stepId, format),
11247
+ modelId: opts?.modelId ?? require_custom_model_catalog.getDefaultModelForFormat(stepId, format),
11285
11248
  children,
11286
11249
  ...def.group ? { group: def.group } : {}
11287
11250
  };
@@ -11289,14 +11252,17 @@ function buildDefaultStepTree(format, objectDetectionModelId) {
11289
11252
  const faceEmbedding = makeStep("face-embedding", []);
11290
11253
  const faceDetection = makeStep("face-detection", faceEmbedding ? [faceEmbedding] : []);
11291
11254
  const plateOcr = makeStep("plate-ocr", []);
11255
+ const plateDetection = makeStep("plate-detection", plateOcr ? [plateOcr] : []);
11256
+ const clipEmbedding = makeStep("clip-embedding", []);
11257
+ const byCatalogDefault = (stepId) => ({ enabled: require_custom_model_catalog.getStepDefinition(stepId).enabledByDefault ?? true });
11292
11258
  const root = makeStep("object-detection", [
11293
11259
  faceDetection,
11294
- makeStep("plate-detection", plateOcr ? [plateOcr] : []),
11295
- makeStep("clip-embedding", []),
11296
- makeStep("animal-classifier", [], { enabled: false }),
11297
- makeStep("bird-classifier", [], { enabled: false }),
11298
- makeStep("vehicle-classifier", [], { enabled: false }),
11299
- makeStep("segmentation", [], { enabled: false })
11260
+ plateDetection,
11261
+ clipEmbedding,
11262
+ makeStep("animal-classifier", [], byCatalogDefault("animal-classifier")),
11263
+ makeStep("bird-classifier", [], byCatalogDefault("bird-classifier")),
11264
+ makeStep("vehicle-classifier", [], byCatalogDefault("vehicle-classifier")),
11265
+ makeStep("segmentation", [], byCatalogDefault("segmentation"))
11300
11266
  ].filter((s) => s !== null), objectDetectionModelId !== void 0 ? { modelId: objectDetectionModelId } : void 0);
11301
11267
  const audioStep = makeStep("audio-classifier", []);
11302
11268
  const steps = [];
@@ -11338,7 +11304,7 @@ function flattenSteps(steps) {
11338
11304
  */
11339
11305
  function isDetailPlaneStep(addonId) {
11340
11306
  try {
11341
- return require_default_detection_model.getStepDefinition(addonId).inputClasses !== null;
11307
+ return require_custom_model_catalog.getStepDefinition(addonId).inputClasses !== null;
11342
11308
  } catch {
11343
11309
  return false;
11344
11310
  }
@@ -11377,7 +11343,7 @@ function stepsSurvivingLoad(steps, failures, policy) {
11377
11343
  */
11378
11344
  function availableFormatsForStep(addonId) {
11379
11345
  try {
11380
- const def = require_default_detection_model.getStepDefinition(addonId);
11346
+ const def = require_custom_model_catalog.getStepDefinition(addonId);
11381
11347
  const formats = /* @__PURE__ */ new Set();
11382
11348
  for (const model of def.models) for (const format of Object.keys(model.formats)) formats.add(format);
11383
11349
  return Array.from(formats).toSorted();
@@ -11946,7 +11912,7 @@ var DetectionPipelineAddon = class extends require_dist.BaseAddon {
11946
11912
  }).catch(() => {});
11947
11913
  }
11948
11914
  getModelCatalog() {
11949
- return require_default_detection_model.ALL_STEPS.flatMap((s) => s.models.filter((m) => m.legacy !== true));
11915
+ return require_custom_model_catalog.ALL_STEPS.flatMap((s) => s.models.filter((m) => m.legacy !== true));
11950
11916
  }
11951
11917
  /**
11952
11918
  * Proactively install the OpenVINO Python package when Intel hardware
@@ -12032,9 +11998,9 @@ var DetectionPipelineAddon = class extends require_dist.BaseAddon {
12032
11998
  }
12033
11999
  };
12034
12000
  //#endregion
12035
- exports.ALL_STEPS = require_default_detection_model.ALL_STEPS;
12001
+ exports.ALL_STEPS = require_custom_model_catalog.ALL_STEPS;
12036
12002
  exports.DetectionPipelineProvider = DetectionPipelineProvider;
12037
12003
  exports.default = DetectionPipelineAddon;
12038
- exports.getDefaultModelForFormat = require_default_detection_model.getDefaultModelForFormat;
12039
- exports.getStepDefinition = require_default_detection_model.getStepDefinition;
12004
+ exports.getDefaultModelForFormat = require_custom_model_catalog.getDefaultModelForFormat;
12005
+ exports.getStepDefinition = require_custom_model_catalog.getStepDefinition;
12040
12006
  exports.shouldInstallOpenvino = shouldInstallOpenvino;
@@ -1,9 +1,9 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
- import { $n as union, Cn as errMsg, Dt as linkedLabelStepId, G as YAMNET_TO_MACRO, Ln as nodePin, N as PoolMemoryWatchdog, Nn as hydrateSchema, O as LABEL_SUPPLY_MACRO, Qn as string, Rn as parseJsonUnknown, Tn as BaseAddon, Un as array, Vn as sleep, Vt as pickClusterStepSettings, Wt as pipelineExecutorCapability, Yn as object, Zt as resolveClusterStepModelId, an as runtimeDevices$1, b as DEVICE_BACKEND_TO_FORMAT, d as CLUSTER_MODEL_SCOPED_STEPS, dn as supportedRuntimes$1, dt as detectionPipelineCapability, er as EventCategory, g as DEFAULT_CLUSTER_STEP_SETTINGS, ht as evaluateZoneRules, in as rootSuppliesOf, kn as createEvent, kt as loadContributionCapability, mt as enumerateInferenceDevices, n as APPLE_SA_TO_MACRO, nt as containingParentIndex, on as stepModelRunsOnFormat, ot as defaultDeviceFor$1, tn as resolvePoolMemoryPolicy, wt as hfModelUrl, zt as overlayClusterStepSettings } from "../dist-BsT15i7i.mjs";
3
- import { s as readProcessCost } from "../node-Crsi_8ea.mjs";
4
- import { _ as getStep, a as buildSubtreeCanRun, b as landmarkPrecisionVerdict, c as macroGateVerdict, g as getDefaultModelForFormat, h as ALL_STEPS, i as mergeCustomModels, m as ALL_PIPELINE_STEPS, n as resolveDefaultDetectionModel, r as CustomModelCatalog, u as localFrameRegistry, v as getStepDefinition, x as resolveModelDefaultConfidence, y as resolveModelForFormat } from "../default-detection-model-CDffuH2m.mjs";
2
+ import { $n as union, Cn as errMsg, Dt as linkedLabelStepId, G as YAMNET_TO_MACRO, Ln as nodePin, N as PoolMemoryWatchdog, Nn as hydrateSchema, O as LABEL_SUPPLY_MACRO, Qn as string, Rn as parseJsonUnknown, Tn as BaseAddon, Un as array, Vn as sleep, Vt as pickClusterStepSettings, Wt as pipelineExecutorCapability, Yn as object, Zt as resolveClusterStepModelId, an as runtimeDevices$1, d as CLUSTER_MODEL_SCOPED_STEPS, dn as supportedRuntimes$1, dt as detectionPipelineCapability, er as EventCategory, g as DEFAULT_CLUSTER_STEP_SETTINGS, ht as evaluateZoneRules, in as rootSuppliesOf, kn as createEvent, kt as loadContributionCapability, mt as enumerateInferenceDevices, n as APPLE_SA_TO_MACRO, nt as containingParentIndex, on as stepModelRunsOnFormat, ot as defaultDeviceFor$1, tn as resolvePoolMemoryPolicy, wt as hfModelUrl, zt as overlayClusterStepSettings } from "../dist-Dn3knu_K.mjs";
3
+ import { s as readProcessCost } from "../node-_BruMF4L.mjs";
4
+ import { C as resolveModelDefaultConfidence, S as landmarkPrecisionVerdict, _ as ALL_STEPS, b as getStepDefinition, f as localFrameRegistry, g as ALL_PIPELINE_STEPS, l as resolveDefaultDetectionModel, n as mergeCustomModels, o as deviceKeyOf, r as buildSubtreeCanRun, s as resolveDeviceEngine, t as CustomModelCatalog, u as macroGateVerdict, v as getDefaultModelForFormat, x as resolveModelForFormat, y as getStep } from "../custom-model-catalog-DoOVE7kz.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
- import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-1mAUV8S1.mjs";
6
+ import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-Dp-4bFOp.mjs";
7
7
  import * as os from "node:os";
8
8
  import * as fs from "node:fs";
9
9
  import * as path$1 from "node:path";
@@ -2994,38 +2994,6 @@ var PipelineModelManager = class {
2994
2994
  }
2995
2995
  };
2996
2996
  //#endregion
2997
- //#region src/detection-pipeline/engine/resolve-device-engine.ts
2998
- /**
2999
- * Resolve a Phase-1 device key (`<backend>:<device>`, or bare `cpu`) into the
3000
- * {@link PipelineEngineChoice} used to build that device's inference pool.
3001
- * Throws on an unknown backend token so a bad `deviceKey` fails loud rather
3002
- * than silently building a wrong pool. Format comes from the shared
3003
- * {@link DEVICE_BACKEND_TO_FORMAT} SSOT (`@camstack/types`) — no local copy.
3004
- */
3005
- function resolveDeviceEngine(deviceKey) {
3006
- const colon = deviceKey.indexOf(":");
3007
- const backend = colon >= 0 ? deviceKey.slice(0, colon) : deviceKey;
3008
- const device = colon >= 0 ? deviceKey.slice(colon + 1) : deviceKey;
3009
- const format = DEVICE_BACKEND_TO_FORMAT[backend];
3010
- if (format === void 0) throw new Error(`resolveDeviceEngine: unknown backend "${backend}" in deviceKey "${deviceKey}"`);
3011
- return {
3012
- runtime: "python",
3013
- backend,
3014
- format,
3015
- device
3016
- };
3017
- }
3018
- /**
3019
- * The inverse of {@link resolveDeviceEngine}: the `<backend>:<device>` key that
3020
- * names the pool an engine belongs to. Every pool-level log line carries this —
3021
- * without it a default pool logs anonymously and six hours of logs cannot tell
3022
- * "the NPU is unused" from "the NPU IS the anonymous default pool".
3023
- * Falls back to the bare backend when the engine carries no device.
3024
- */
3025
- function deviceKeyOf(engine) {
3026
- return engine.device ? `${engine.backend}:${engine.device}` : engine.backend;
3027
- }
3028
- //#endregion
3029
2997
  //#region src/detection-pipeline/engine/coral-cocompiled-set.ts
3030
2998
  var ROOT_DETECTOR_STEP_ID = "object-detection";
3031
2999
  /** The models a dispatch places on the pool that runs it: every enabled video step. */
@@ -11252,16 +11220,11 @@ function resolveChildSlots(slot) {
11252
11220
  }
11253
11221
  }
11254
11222
  /**
11255
- * V2 default: lightweight pipeline with minimal enabled steps.
11256
- *
11257
- * Only object detection (yolov9t, 4-8 MB) + face detection (scrfd, 1.7 MB) enabled.
11258
- * All other steps are present in the tree but DISABLED — user enables via UI.
11259
- * Total model footprint: ~10 MB (CoreML), ~11 MB (ONNX)
11260
- *
11261
- * Why:
11262
- * - Fast startup (seconds, not minutes of model downloads)
11263
- * - Covers 90% of NVR use cases (person/vehicle/animal detection + face detection)
11264
- * - Users opt-in to heavy classifiers (vehicle type, plate OCR, bird species) when needed
11223
+ * V2 default: the node-default step tree (never persisted — see
11224
+ * `getGlobalSteps`). The core detection + recognition steps are enabled; every
11225
+ * optional step is present with its catalog `enabledByDefault` (the animal and
11226
+ * vehicle classifiers on — their answer comes from the root model when it
11227
+ * declares them, D736 — the bird classifier and segmentation off).
11265
11228
  */
11266
11229
  function buildDefaultStepTree(format, objectDetectionModelId) {
11267
11230
  const makeStep = (stepId, children, opts) => {
@@ -11282,14 +11245,17 @@ function buildDefaultStepTree(format, objectDetectionModelId) {
11282
11245
  const faceEmbedding = makeStep("face-embedding", []);
11283
11246
  const faceDetection = makeStep("face-detection", faceEmbedding ? [faceEmbedding] : []);
11284
11247
  const plateOcr = makeStep("plate-ocr", []);
11248
+ const plateDetection = makeStep("plate-detection", plateOcr ? [plateOcr] : []);
11249
+ const clipEmbedding = makeStep("clip-embedding", []);
11250
+ const byCatalogDefault = (stepId) => ({ enabled: getStepDefinition(stepId).enabledByDefault ?? true });
11285
11251
  const root = makeStep("object-detection", [
11286
11252
  faceDetection,
11287
- makeStep("plate-detection", plateOcr ? [plateOcr] : []),
11288
- makeStep("clip-embedding", []),
11289
- makeStep("animal-classifier", [], { enabled: false }),
11290
- makeStep("bird-classifier", [], { enabled: false }),
11291
- makeStep("vehicle-classifier", [], { enabled: false }),
11292
- makeStep("segmentation", [], { enabled: false })
11253
+ plateDetection,
11254
+ clipEmbedding,
11255
+ makeStep("animal-classifier", [], byCatalogDefault("animal-classifier")),
11256
+ makeStep("bird-classifier", [], byCatalogDefault("bird-classifier")),
11257
+ makeStep("vehicle-classifier", [], byCatalogDefault("vehicle-classifier")),
11258
+ makeStep("segmentation", [], byCatalogDefault("segmentation"))
11293
11259
  ].filter((s) => s !== null), objectDetectionModelId !== void 0 ? { modelId: objectDetectionModelId } : void 0);
11294
11260
  const audioStep = makeStep("audio-classifier", []);
11295
11261
  const steps = [];