@camstack/addon-pipeline 1.2.193 → 1.2.194

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.
@@ -2107,4 +2107,86 @@ var localFrameRegistry = new LocalFrameRegistry({
2107
2107
  maxBytes: envPositiveInt("CAMSTACK_LOCAL_FRAME_BUDGET_MB", DEFAULT_MAX_BYTES / 1048576) * 1048576
2108
2108
  });
2109
2109
  //#endregion
2110
- export { getDefaultModelForFormat as a, getStepDefinition as c, ALL_STEPS as i, resolveModelForFormat as l, resolveFrameViewGeometry as n, getDefaultModelForFormatFromDef as o, ALL_PIPELINE_STEPS as r, getStep as s, localFrameRegistry as t, landmarkPrecisionVerdict as u };
2110
+ //#region src/detection-pipeline/default-detection-model.ts
2111
+ /** The object-detection step id — the only slot this resolver applies to. */
2112
+ var OBJECT_DETECTION_STEP_ID = "object-detection";
2113
+ /**
2114
+ * Balanced default object-detection model per accelerator class. `'cpu'` maps to
2115
+ * `null` → the caller substitutes the step's own `defaultModelId` (`yolo26n`).
2116
+ * INTEL NPU + iGPU default to OUR YOLOv9 (int8 @320): yolo26 does NOT compile on
2117
+ * the Intel NPU (arch incompat → 0 frames), while yolov9 runs on it (~298 fps
2118
+ * measured). Apple ANE uses the CoreML yolov9 @320 build.
2119
+ *
2120
+ * Do **not** promote these ids to `yolov9m-640` / `*-640`. The controlled
2121
+ * evaluation recovered 0/3 misses at the current 0.50 threshold and failed the
2122
+ * false-positive and capacity gates — see
2123
+ * `docs/benchmarks/pipeline-frame-model-eval.md`. 640 remains an explicit
2124
+ * operator pick, not a hardware-aware default.
2125
+ */
2126
+ var MODEL_BY_CLASS = {
2127
+ "apple-ane": "yolov9m-320",
2128
+ "intel-npu": "yolov9m-320-int8",
2129
+ "intel-gpu": "yolov9m-320-int8",
2130
+ cpu: null
2131
+ };
2132
+ /**
2133
+ * Classify a node's engine into an {@link AcceleratorClass} from its resolved
2134
+ * `backend` + `device`. Pure, total, never throws.
2135
+ *
2136
+ * OpenVINO's default device is `'auto'` (the python pool resolves NPU > GPU >
2137
+ * CPU at load). Because OpenVINO is only ever OFFERED when an Intel iGPU is
2138
+ * present, the GPU is the guaranteed accelerator while the NPU is an explicit
2139
+ * opt-in — so `'auto'` (and any non-cpu/non-npu device) is treated as
2140
+ * GPU-class conservatively. An operator who explicitly pins `device: 'npu'`
2141
+ * gets the NPU-tuned m-320.
2142
+ *
2143
+ * Also accepts the accelerator carried in the `backend` slot (e.g. `'ane'`,
2144
+ * `'mps'`, `'npu'`, `'intel-gpu'`) so a caller passing a device-style backend
2145
+ * still classifies correctly — real callers pass onnx/openvino/coreml.
2146
+ */
2147
+ function classifyAccelerator(backend, device) {
2148
+ const b = backend.toLowerCase();
2149
+ const d = device?.toLowerCase() ?? null;
2150
+ if (b === "coreml" || b === "ane" || b === "mps") return "apple-ane";
2151
+ if (b === "openvino") {
2152
+ if (d === "npu") return "intel-npu";
2153
+ if (d === "cpu") return "cpu";
2154
+ return "intel-gpu";
2155
+ }
2156
+ if (b === "npu" || b === "intel-npu") return "intel-npu";
2157
+ if (b === "gpu" || b === "intel-gpu" || b === "gpu-openvino") return "intel-gpu";
2158
+ return "cpu";
2159
+ }
2160
+ /**
2161
+ * Resolve the hardware-aware default object-detection model id for a node's
2162
+ * engine `(backend, device, format)`.
2163
+ *
2164
+ * Guarantees:
2165
+ * - never throws (hot default-tree path);
2166
+ * - never returns a model id without a build for `format` (unless the step
2167
+ * has ZERO builds for `format`, which is unloadable regardless of pick and
2168
+ * flagged by `collectZeroBuildIssues`) — an unmapped backend, a `'cpu'`
2169
+ * class, a mapped id missing from the catalog, or a mapped id without a
2170
+ * `format` build all fall back to the step's PER-FORMAT default
2171
+ * (`getDefaultModelForFormatFromDef`), NOT the bare `defaultModelId`.
2172
+ *
2173
+ * `getStepDef` is injectable (defaults to the real catalog lookup) so the
2174
+ * missing-build fallback branch is unit-testable without a live catalog —
2175
+ * mirrors `collectZeroBuildIssues`' injection seam.
2176
+ */
2177
+ function resolveDefaultDetectionModel(backend, device, format, getStepDef = getStepDefinition) {
2178
+ let def;
2179
+ try {
2180
+ def = getStepDef(OBJECT_DETECTION_STEP_ID);
2181
+ } catch {
2182
+ return "yolo26n";
2183
+ }
2184
+ const candidate = MODEL_BY_CLASS[classifyAccelerator(backend, device)];
2185
+ if (candidate !== null) {
2186
+ const entry = def.models.find((m) => m.id === candidate);
2187
+ if (entry && entry.formats[format] !== void 0) return candidate;
2188
+ }
2189
+ return getDefaultModelForFormatFromDef(def, format);
2190
+ }
2191
+ //#endregion
2192
+ export { ALL_PIPELINE_STEPS as a, getStep as c, landmarkPrecisionVerdict as d, resolveFrameViewGeometry as i, getStepDefinition as l, resolveDefaultDetectionModel as n, ALL_STEPS as o, localFrameRegistry as r, getDefaultModelForFormat as s, OBJECT_DETECTION_STEP_ID as t, resolveModelForFormat as u };
@@ -2107,6 +2107,88 @@ var localFrameRegistry = new LocalFrameRegistry({
2107
2107
  maxBytes: envPositiveInt("CAMSTACK_LOCAL_FRAME_BUDGET_MB", DEFAULT_MAX_BYTES / 1048576) * 1048576
2108
2108
  });
2109
2109
  //#endregion
2110
+ //#region src/detection-pipeline/default-detection-model.ts
2111
+ /** The object-detection step id — the only slot this resolver applies to. */
2112
+ var OBJECT_DETECTION_STEP_ID = "object-detection";
2113
+ /**
2114
+ * Balanced default object-detection model per accelerator class. `'cpu'` maps to
2115
+ * `null` → the caller substitutes the step's own `defaultModelId` (`yolo26n`).
2116
+ * INTEL NPU + iGPU default to OUR YOLOv9 (int8 @320): yolo26 does NOT compile on
2117
+ * the Intel NPU (arch incompat → 0 frames), while yolov9 runs on it (~298 fps
2118
+ * measured). Apple ANE uses the CoreML yolov9 @320 build.
2119
+ *
2120
+ * Do **not** promote these ids to `yolov9m-640` / `*-640`. The controlled
2121
+ * evaluation recovered 0/3 misses at the current 0.50 threshold and failed the
2122
+ * false-positive and capacity gates — see
2123
+ * `docs/benchmarks/pipeline-frame-model-eval.md`. 640 remains an explicit
2124
+ * operator pick, not a hardware-aware default.
2125
+ */
2126
+ var MODEL_BY_CLASS = {
2127
+ "apple-ane": "yolov9m-320",
2128
+ "intel-npu": "yolov9m-320-int8",
2129
+ "intel-gpu": "yolov9m-320-int8",
2130
+ cpu: null
2131
+ };
2132
+ /**
2133
+ * Classify a node's engine into an {@link AcceleratorClass} from its resolved
2134
+ * `backend` + `device`. Pure, total, never throws.
2135
+ *
2136
+ * OpenVINO's default device is `'auto'` (the python pool resolves NPU > GPU >
2137
+ * CPU at load). Because OpenVINO is only ever OFFERED when an Intel iGPU is
2138
+ * present, the GPU is the guaranteed accelerator while the NPU is an explicit
2139
+ * opt-in — so `'auto'` (and any non-cpu/non-npu device) is treated as
2140
+ * GPU-class conservatively. An operator who explicitly pins `device: 'npu'`
2141
+ * gets the NPU-tuned m-320.
2142
+ *
2143
+ * Also accepts the accelerator carried in the `backend` slot (e.g. `'ane'`,
2144
+ * `'mps'`, `'npu'`, `'intel-gpu'`) so a caller passing a device-style backend
2145
+ * still classifies correctly — real callers pass onnx/openvino/coreml.
2146
+ */
2147
+ function classifyAccelerator(backend, device) {
2148
+ const b = backend.toLowerCase();
2149
+ const d = device?.toLowerCase() ?? null;
2150
+ if (b === "coreml" || b === "ane" || b === "mps") return "apple-ane";
2151
+ if (b === "openvino") {
2152
+ if (d === "npu") return "intel-npu";
2153
+ if (d === "cpu") return "cpu";
2154
+ return "intel-gpu";
2155
+ }
2156
+ if (b === "npu" || b === "intel-npu") return "intel-npu";
2157
+ if (b === "gpu" || b === "intel-gpu" || b === "gpu-openvino") return "intel-gpu";
2158
+ return "cpu";
2159
+ }
2160
+ /**
2161
+ * Resolve the hardware-aware default object-detection model id for a node's
2162
+ * engine `(backend, device, format)`.
2163
+ *
2164
+ * Guarantees:
2165
+ * - never throws (hot default-tree path);
2166
+ * - never returns a model id without a build for `format` (unless the step
2167
+ * has ZERO builds for `format`, which is unloadable regardless of pick and
2168
+ * flagged by `collectZeroBuildIssues`) — an unmapped backend, a `'cpu'`
2169
+ * class, a mapped id missing from the catalog, or a mapped id without a
2170
+ * `format` build all fall back to the step's PER-FORMAT default
2171
+ * (`getDefaultModelForFormatFromDef`), NOT the bare `defaultModelId`.
2172
+ *
2173
+ * `getStepDef` is injectable (defaults to the real catalog lookup) so the
2174
+ * missing-build fallback branch is unit-testable without a live catalog —
2175
+ * mirrors `collectZeroBuildIssues`' injection seam.
2176
+ */
2177
+ function resolveDefaultDetectionModel(backend, device, format, getStepDef = getStepDefinition) {
2178
+ let def;
2179
+ try {
2180
+ def = getStepDef(OBJECT_DETECTION_STEP_ID);
2181
+ } catch {
2182
+ return "yolo26n";
2183
+ }
2184
+ const candidate = MODEL_BY_CLASS[classifyAccelerator(backend, device)];
2185
+ if (candidate !== null) {
2186
+ const entry = def.models.find((m) => m.id === candidate);
2187
+ if (entry && entry.formats[format] !== void 0) return candidate;
2188
+ }
2189
+ return getDefaultModelForFormatFromDef(def, format);
2190
+ }
2191
+ //#endregion
2110
2192
  Object.defineProperty(exports, "ALL_PIPELINE_STEPS", {
2111
2193
  enumerable: true,
2112
2194
  get: function() {
@@ -2119,16 +2201,16 @@ Object.defineProperty(exports, "ALL_STEPS", {
2119
2201
  return ALL_STEPS;
2120
2202
  }
2121
2203
  });
2122
- Object.defineProperty(exports, "getDefaultModelForFormat", {
2204
+ Object.defineProperty(exports, "OBJECT_DETECTION_STEP_ID", {
2123
2205
  enumerable: true,
2124
2206
  get: function() {
2125
- return getDefaultModelForFormat;
2207
+ return OBJECT_DETECTION_STEP_ID;
2126
2208
  }
2127
2209
  });
2128
- Object.defineProperty(exports, "getDefaultModelForFormatFromDef", {
2210
+ Object.defineProperty(exports, "getDefaultModelForFormat", {
2129
2211
  enumerable: true,
2130
2212
  get: function() {
2131
- return getDefaultModelForFormatFromDef;
2213
+ return getDefaultModelForFormat;
2132
2214
  }
2133
2215
  });
2134
2216
  Object.defineProperty(exports, "getStep", {
@@ -2155,6 +2237,12 @@ Object.defineProperty(exports, "localFrameRegistry", {
2155
2237
  return localFrameRegistry;
2156
2238
  }
2157
2239
  });
2240
+ Object.defineProperty(exports, "resolveDefaultDetectionModel", {
2241
+ enumerable: true,
2242
+ get: function() {
2243
+ return resolveDefaultDetectionModel;
2244
+ }
2245
+ });
2158
2246
  Object.defineProperty(exports, "resolveFrameViewGeometry", {
2159
2247
  enumerable: true,
2160
2248
  get: function() {
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
4
4
  });
5
5
  const require_dist = require("../dist-HG5geL9t.js");
6
6
  const require_node = require("../node--my8JTOW.js");
7
- const require_local_frame_registry = require("../local-frame-registry-x3m6SNqf.js");
7
+ const require_default_detection_model = require("../default-detection-model-CJdc8j83.js");
8
8
  const require_lazy_sharp = require("../lazy-sharp-DmAwZ0s9.js");
9
9
  const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DaUBcb13.js");
10
10
  const require_process_memory = require("../process-memory-CoCSce63.js");
@@ -453,88 +453,6 @@ var ClusterModelSource = class {
453
453
  }
454
454
  };
455
455
  //#endregion
456
- //#region src/detection-pipeline/default-detection-model.ts
457
- /** The object-detection step id — the only slot this resolver applies to. */
458
- var OBJECT_DETECTION_STEP_ID = "object-detection";
459
- /**
460
- * Balanced default object-detection model per accelerator class. `'cpu'` maps to
461
- * `null` → the caller substitutes the step's own `defaultModelId` (`yolo26n`).
462
- * INTEL NPU + iGPU default to OUR YOLOv9 (int8 @320): yolo26 does NOT compile on
463
- * the Intel NPU (arch incompat → 0 frames), while yolov9 runs on it (~298 fps
464
- * measured). Apple ANE uses the CoreML yolov9 @320 build.
465
- *
466
- * Do **not** promote these ids to `yolov9m-640` / `*-640`. The controlled
467
- * evaluation recovered 0/3 misses at the current 0.50 threshold and failed the
468
- * false-positive and capacity gates — see
469
- * `docs/benchmarks/pipeline-frame-model-eval.md`. 640 remains an explicit
470
- * operator pick, not a hardware-aware default.
471
- */
472
- var MODEL_BY_CLASS = {
473
- "apple-ane": "yolov9m-320",
474
- "intel-npu": "yolov9m-320-int8",
475
- "intel-gpu": "yolov9m-320-int8",
476
- cpu: null
477
- };
478
- /**
479
- * Classify a node's engine into an {@link AcceleratorClass} from its resolved
480
- * `backend` + `device`. Pure, total, never throws.
481
- *
482
- * OpenVINO's default device is `'auto'` (the python pool resolves NPU > GPU >
483
- * CPU at load). Because OpenVINO is only ever OFFERED when an Intel iGPU is
484
- * present, the GPU is the guaranteed accelerator while the NPU is an explicit
485
- * opt-in — so `'auto'` (and any non-cpu/non-npu device) is treated as
486
- * GPU-class conservatively. An operator who explicitly pins `device: 'npu'`
487
- * gets the NPU-tuned m-320.
488
- *
489
- * Also accepts the accelerator carried in the `backend` slot (e.g. `'ane'`,
490
- * `'mps'`, `'npu'`, `'intel-gpu'`) so a caller passing a device-style backend
491
- * still classifies correctly — real callers pass onnx/openvino/coreml.
492
- */
493
- function classifyAccelerator(backend, device) {
494
- const b = backend.toLowerCase();
495
- const d = device?.toLowerCase() ?? null;
496
- if (b === "coreml" || b === "ane" || b === "mps") return "apple-ane";
497
- if (b === "openvino") {
498
- if (d === "npu") return "intel-npu";
499
- if (d === "cpu") return "cpu";
500
- return "intel-gpu";
501
- }
502
- if (b === "npu" || b === "intel-npu") return "intel-npu";
503
- if (b === "gpu" || b === "intel-gpu" || b === "gpu-openvino") return "intel-gpu";
504
- return "cpu";
505
- }
506
- /**
507
- * Resolve the hardware-aware default object-detection model id for a node's
508
- * engine `(backend, device, format)`.
509
- *
510
- * Guarantees:
511
- * - never throws (hot default-tree path);
512
- * - never returns a model id without a build for `format` (unless the step
513
- * has ZERO builds for `format`, which is unloadable regardless of pick and
514
- * flagged by `collectZeroBuildIssues`) — an unmapped backend, a `'cpu'`
515
- * class, a mapped id missing from the catalog, or a mapped id without a
516
- * `format` build all fall back to the step's PER-FORMAT default
517
- * (`getDefaultModelForFormatFromDef`), NOT the bare `defaultModelId`.
518
- *
519
- * `getStepDef` is injectable (defaults to the real catalog lookup) so the
520
- * missing-build fallback branch is unit-testable without a live catalog —
521
- * mirrors `collectZeroBuildIssues`' injection seam.
522
- */
523
- function resolveDefaultDetectionModel(backend, device, format, getStepDef = require_local_frame_registry.getStepDefinition) {
524
- let def;
525
- try {
526
- def = getStepDef(OBJECT_DETECTION_STEP_ID);
527
- } catch {
528
- return "yolo26n";
529
- }
530
- const candidate = MODEL_BY_CLASS[classifyAccelerator(backend, device)];
531
- if (candidate !== null) {
532
- const entry = def.models.find((m) => m.id === candidate);
533
- if (entry && entry.formats[format] !== void 0) return candidate;
534
- }
535
- return require_local_frame_registry.getDefaultModelForFormatFromDef(def, format);
536
- }
537
- //#endregion
538
456
  //#region src/detection-pipeline/device-override-mirror.ts
539
457
  /**
540
458
  * The per-device detection overrides, kept fresh OFF the frame path.
@@ -2649,7 +2567,7 @@ var EngineFactory = class {
2649
2567
  * to `buildConfig`, which throws the message naming the step and the model.
2650
2568
  */
2651
2569
  resolveDecode(stepId, modelId, settings) {
2652
- const def = require_local_frame_registry.getStepDefinition(stepId);
2570
+ const def = require_default_detection_model.getStepDefinition(stepId);
2653
2571
  const modelEntry = def.models.find((m) => m.id === modelId) ?? this.opts.resolveCustomModel?.(stepId, modelId);
2654
2572
  if (!modelEntry) return null;
2655
2573
  return resolvePoolDecodeSettings({
@@ -2693,7 +2611,7 @@ var EngineFactory = class {
2693
2611
  */
2694
2612
  function buildPoolModelConfigForStep(inputs) {
2695
2613
  const { stepId, modelId, poolRuntime, modelsDir } = inputs;
2696
- const def = require_local_frame_registry.getStepDefinition(stepId);
2614
+ const def = require_default_detection_model.getStepDefinition(stepId);
2697
2615
  const modelEntry = def.models.find((m) => m.id === modelId) ?? inputs.resolveCustomModel?.(stepId, modelId);
2698
2616
  if (!modelEntry) throw new Error(`Model "${modelId}" not found in step "${stepId}" catalog (static or custom registry)`);
2699
2617
  const format = RUNTIME_TO_FORMAT[poolRuntime];
@@ -5782,7 +5700,7 @@ var PipelineExecutor = class {
5782
5700
  this.warnFaceTooSmall(child, detShortSide, minFaceSize, void 0, deviceId);
5783
5701
  continue;
5784
5702
  }
5785
- const precision = require_local_frame_registry.landmarkPrecisionVerdict({
5703
+ const precision = require_default_detection_model.landmarkPrecisionVerdict({
5786
5704
  detectionShortSidePx: detShortSide,
5787
5705
  floorPx: numericSetting(child.settings, "minLandmarkFaceSize", 24)
5788
5706
  });
@@ -6045,7 +5963,7 @@ function buildExecutableTree(steps, getEngine, resolveModel) {
6045
5963
  return { roots: steps.filter((s) => s.enabled).filter((s) => s.slot !== "audio-classifier").map((s) => buildNode(s, getEngine, resolveModel)) };
6046
5964
  }
6047
5965
  function buildNode(step, getEngine, resolveModel) {
6048
- const definition = require_local_frame_registry.getStepDefinition(step.addonId);
5966
+ const definition = require_default_detection_model.getStepDefinition(step.addonId);
6049
5967
  const engine = getEngine(step.addonId);
6050
5968
  const children = (step.children ?? []).filter((c) => c.enabled).map((c) => buildNode(c, getEngine, resolveModel));
6051
5969
  const mergedSettings = {
@@ -6072,7 +5990,7 @@ function buildNode(step, getEngine, resolveModel) {
6072
5990
  * entered recursively. Fields without a declared default are skipped.
6073
5991
  */
6074
5992
  function collectSchemaDefaults(stepId) {
6075
- const schema = require_local_frame_registry.getStep(stepId).getConfigSchema();
5993
+ const schema = require_default_detection_model.getStep(stepId).getConfigSchema();
6076
5994
  const out = {};
6077
5995
  walkFieldsForDefaults(schema, out);
6078
5996
  return out;
@@ -6166,7 +6084,7 @@ function mergeCustomModels(staticModels, customModels) {
6166
6084
  */
6167
6085
  var defaultLookup = (stepId) => {
6168
6086
  try {
6169
- return require_local_frame_registry.getStepDefinition(stepId);
6087
+ return require_default_detection_model.getStepDefinition(stepId);
6170
6088
  } catch {
6171
6089
  return null;
6172
6090
  }
@@ -6215,7 +6133,7 @@ function collectSubstitutions(steps, format) {
6215
6133
  for (const step of steps) {
6216
6134
  const chosen = step.modelId;
6217
6135
  if (chosen != null) {
6218
- const running = require_local_frame_registry.resolveModelForFormat(step.addonId, chosen, format);
6136
+ const running = require_default_detection_model.resolveModelForFormat(step.addonId, chosen, format);
6219
6137
  if (running !== chosen) result.push({
6220
6138
  addonId: step.addonId,
6221
6139
  chosen,
@@ -6241,7 +6159,7 @@ function collectSubstitutions(steps, format) {
6241
6159
  * black-box test. Unknown/custom addonIds (no registered `StepDefinition`)
6242
6160
  * are skipped, never thrown.
6243
6161
  */
6244
- function collectZeroBuildIssues(steps, format, getStepDef = require_local_frame_registry.getStepDefinition) {
6162
+ function collectZeroBuildIssues(steps, format, getStepDef = require_default_detection_model.getStepDefinition) {
6245
6163
  const result = [];
6246
6164
  for (const step of steps) {
6247
6165
  let def;
@@ -6267,7 +6185,7 @@ function collectZeroBuildIssues(steps, format, getStepDef = require_local_frame_
6267
6185
  * tests can exercise the unknown-addon branch with a fabricated resolver
6268
6186
  * without `vi.mock`.
6269
6187
  */
6270
- function collectUnknownAddonIssues(steps, getStepDef = require_local_frame_registry.getStepDefinition) {
6188
+ function collectUnknownAddonIssues(steps, getStepDef = require_default_detection_model.getStepDefinition) {
6271
6189
  const result = [];
6272
6190
  for (const step of steps) {
6273
6191
  try {
@@ -6308,7 +6226,7 @@ function resolveInputSteps(steps, format, engine, clusterModels, clusterSettings
6308
6226
  for (const s of steps) {
6309
6227
  let def;
6310
6228
  try {
6311
- def = require_local_frame_registry.getStepDefinition(s.addonId);
6229
+ def = require_default_detection_model.getStepDefinition(s.addonId);
6312
6230
  } catch {
6313
6231
  unknownAddonIds.push(s.addonId);
6314
6232
  continue;
@@ -6344,7 +6262,7 @@ function resolveInputSteps(steps, format, engine, clusterModels, clusterSettings
6344
6262
  }
6345
6263
  }
6346
6264
  const chosenModelId = s.modelId ?? null;
6347
- const runningModelId = chosenModelId === null && engine !== void 0 && s.addonId === "object-detection" ? resolveDefaultDetectionModel(engine.backend, engine.device, format) : require_local_frame_registry.resolveModelForFormat(s.addonId, chosenModelId, format);
6265
+ 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);
6348
6266
  if (chosenModelId !== null && runningModelId !== chosenModelId) substitutions.push({
6349
6267
  addonId: s.addonId,
6350
6268
  chosen: chosenModelId,
@@ -7390,7 +7308,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7390
7308
  * first, then the custom registry. Returns undefined if neither has it.
7391
7309
  */
7392
7310
  async resolveModelEntry(addonId, modelId) {
7393
- const fromCatalog = require_local_frame_registry.getStepDefinition(addonId).models.find((m) => m.id === modelId);
7311
+ const fromCatalog = require_default_detection_model.getStepDefinition(addonId).models.find((m) => m.id === modelId);
7394
7312
  if (fromCatalog) return fromCatalog;
7395
7313
  return (await this.getCustomModels()).get(addonId)?.find((m) => m.id === modelId);
7396
7314
  }
@@ -7455,7 +7373,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7455
7373
  };
7456
7374
  }
7457
7375
  async getDefaultSteps(engine) {
7458
- const detectionModelId = resolveDefaultDetectionModel(engine.backend, engine.device ?? null, engine.format);
7376
+ const detectionModelId = require_default_detection_model.resolveDefaultDetectionModel(engine.backend, engine.device ?? null, engine.format);
7459
7377
  return buildDefaultStepTree(engine.format, detectionModelId);
7460
7378
  }
7461
7379
  /**
@@ -7486,7 +7404,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7486
7404
  /** Pure recursive resolver — builds the resolved step tree without touching `modelSubstitutions`. */
7487
7405
  resolveStepModelTree(steps, format) {
7488
7406
  return steps.map((step) => {
7489
- const resolved = require_local_frame_registry.resolveModelForFormat(step.addonId, step.modelId ?? null, format);
7407
+ const resolved = require_default_detection_model.resolveModelForFormat(step.addonId, step.modelId ?? null, format);
7490
7408
  const children = step.children?.length ? this.resolveStepModelTree([...step.children], format) : step.children;
7491
7409
  return resolved === step.modelId && children === step.children ? step : {
7492
7410
  ...step,
@@ -7513,7 +7431,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7513
7431
  */
7514
7432
  async getGlobalSteps() {
7515
7433
  if (this.currentSteps) return this.currentSteps;
7516
- const detectionModelId = resolveDefaultDetectionModel(this.currentEngine.backend, this.currentEngine.device ?? null, this.currentEngine.format);
7434
+ const detectionModelId = require_default_detection_model.resolveDefaultDetectionModel(this.currentEngine.backend, this.currentEngine.device ?? null, this.currentEngine.format);
7517
7435
  const defaults = buildDefaultStepTree(this.currentEngine.format, detectionModelId);
7518
7436
  if (defaults.length === 0) return null;
7519
7437
  this.currentSteps = this.resolveStepModels(defaults);
@@ -7634,7 +7552,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7634
7552
  for (const step of nodes) {
7635
7553
  if (!step.enabled) continue;
7636
7554
  try {
7637
- if (require_local_frame_registry.getStepDefinition(step.addonId).slot === "audio-classifier") continue;
7555
+ if (require_default_detection_model.getStepDefinition(step.addonId).slot === "audio-classifier") continue;
7638
7556
  } catch {
7639
7557
  continue;
7640
7558
  }
@@ -7654,7 +7572,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
7654
7572
  async getCapabilities(_forceRefresh) {
7655
7573
  const agentId = (this.addonCtx?.kernel?.cluster?.broker)?.nodeID ?? node_os.hostname();
7656
7574
  const agentName = agentId;
7657
- const addons = require_local_frame_registry.ALL_PIPELINE_STEPS.map((s) => ({
7575
+ const addons = require_default_detection_model.ALL_PIPELINE_STEPS.map((s) => ({
7658
7576
  id: s.definition.id,
7659
7577
  name: s.definition.name,
7660
7578
  models: s.definition.models.filter((m) => m.legacy !== true).map((m) => {
@@ -8154,7 +8072,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
8154
8072
  let frameViewResolver;
8155
8073
  let rootInputViewProvider;
8156
8074
  if (runtimeFrameRef) {
8157
- frameViewResolver = createRootFrameViewResolver(require_local_frame_registry.localFrameRegistry, runtimeFrameRef);
8075
+ frameViewResolver = createRootFrameViewResolver(require_default_detection_model.localFrameRegistry, runtimeFrameRef);
8158
8076
  rootInputViewProvider = async (root, crop) => {
8159
8077
  const view = await frameViewResolver(root, crop ? {
8160
8078
  left: crop[0],
@@ -9603,7 +9521,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
9603
9521
  function buildSchemaSlots(formats, modelsDir, customByStep) {
9604
9522
  const slotMap = /* @__PURE__ */ new Map();
9605
9523
  const formatList = [...formats];
9606
- for (const pipelineStep of require_local_frame_registry.ALL_PIPELINE_STEPS) {
9524
+ for (const pipelineStep of require_default_detection_model.ALL_PIPELINE_STEPS) {
9607
9525
  const step = pipelineStep.definition;
9608
9526
  const availableModels = mergeCustomModels(step.models, customByStep?.get(step.id) ?? []).filter((m) => m.legacy !== true && formatList.some((f) => m.formats[f]));
9609
9527
  if (availableModels.length === 0) continue;
@@ -9697,7 +9615,7 @@ function resolveChildSlots(slot) {
9697
9615
  */
9698
9616
  function buildDefaultStepTree(format, objectDetectionModelId) {
9699
9617
  const makeStep = (stepId, children, opts) => {
9700
- const def = require_local_frame_registry.getStepDefinition(stepId);
9618
+ const def = require_default_detection_model.getStepDefinition(stepId);
9701
9619
  if (!def.models.some((m) => m.formats[format])) return null;
9702
9620
  return {
9703
9621
  addonId: def.id,
@@ -9706,7 +9624,7 @@ function buildDefaultStepTree(format, objectDetectionModelId) {
9706
9624
  inputClasses: def.inputClasses ?? [],
9707
9625
  outputClasses: def.outputClasses,
9708
9626
  enabled: opts?.enabled ?? true,
9709
- modelId: opts?.modelId ?? require_local_frame_registry.getDefaultModelForFormat(stepId, format),
9627
+ modelId: opts?.modelId ?? require_default_detection_model.getDefaultModelForFormat(stepId, format),
9710
9628
  children,
9711
9629
  ...def.group ? { group: def.group } : {}
9712
9630
  };
@@ -9763,7 +9681,7 @@ function flattenSteps(steps) {
9763
9681
  */
9764
9682
  function isDetailPlaneStep(addonId) {
9765
9683
  try {
9766
- return require_local_frame_registry.getStepDefinition(addonId).inputClasses !== null;
9684
+ return require_default_detection_model.getStepDefinition(addonId).inputClasses !== null;
9767
9685
  } catch {
9768
9686
  return false;
9769
9687
  }
@@ -9784,7 +9702,7 @@ function stepHasZeroBuildsFor(addonId, format) {
9784
9702
  */
9785
9703
  function availableFormatsForStep(addonId) {
9786
9704
  try {
9787
- const def = require_local_frame_registry.getStepDefinition(addonId);
9705
+ const def = require_default_detection_model.getStepDefinition(addonId);
9788
9706
  const formats = /* @__PURE__ */ new Set();
9789
9707
  for (const model of def.models) for (const format of Object.keys(model.formats)) formats.add(format);
9790
9708
  return Array.from(formats).toSorted();
@@ -10353,7 +10271,7 @@ var DetectionPipelineAddon = class extends require_dist.BaseAddon {
10353
10271
  }).catch(() => {});
10354
10272
  }
10355
10273
  getModelCatalog() {
10356
- return require_local_frame_registry.ALL_STEPS.flatMap((s) => s.models.filter((m) => m.legacy !== true));
10274
+ return require_default_detection_model.ALL_STEPS.flatMap((s) => s.models.filter((m) => m.legacy !== true));
10357
10275
  }
10358
10276
  /**
10359
10277
  * Proactively install the OpenVINO Python package when Intel hardware
@@ -10439,9 +10357,9 @@ var DetectionPipelineAddon = class extends require_dist.BaseAddon {
10439
10357
  }
10440
10358
  };
10441
10359
  //#endregion
10442
- exports.ALL_STEPS = require_local_frame_registry.ALL_STEPS;
10360
+ exports.ALL_STEPS = require_default_detection_model.ALL_STEPS;
10443
10361
  exports.DetectionPipelineProvider = DetectionPipelineProvider;
10444
10362
  exports.default = DetectionPipelineAddon;
10445
- exports.getDefaultModelForFormat = require_local_frame_registry.getDefaultModelForFormat;
10446
- exports.getStepDefinition = require_local_frame_registry.getStepDefinition;
10363
+ exports.getDefaultModelForFormat = require_default_detection_model.getDefaultModelForFormat;
10364
+ exports.getStepDefinition = require_default_detection_model.getStepDefinition;
10447
10365
  exports.shouldInstallOpenvino = shouldInstallOpenvino;
@@ -1,7 +1,7 @@
1
1
  import { n as __require } from "../chunk-DnnnRqeS.mjs";
2
2
  import { $ as inferModelProvider, B as defaultDeviceFor$1, Et as errMsg, G as detectionPipelineCapability, Ht as nodePin, J as enumerateInferenceDevices, Jt as array, Kt as sleep, Lt as createEvent, Nt as BaseAddon, Rt as hydrateSchema, S as PoolMemoryWatchdog, Ut as parseJsonUnknown, X as evaluateZoneRules, _t as resolveClusterStepModelId, c as DEFAULT_CLUSTER_STEP_MODELS, ct as pickClusterStepModels, en as object, ft as pipelineExecutorCapability, in as EventCategory, k as YAMNET_TO_MACRO, l as DEFAULT_CLUSTER_STEP_SETTINGS, lt as pickClusterStepSettings, m as DEVICE_BACKEND_TO_FORMAT, nn as string, ot as overlayClusterStepSettings, rn as union, t as APPLE_SA_TO_MACRO, tt as loadContributionCapability, wt as supportedRuntimes$1, xt as runtimeDevices$1, yt as resolvePoolMemoryPolicy } from "../dist-mYDK58Jp.mjs";
3
3
  import { a as readProcessCost } from "../node-xRsaPwBa.mjs";
4
- import { a as getDefaultModelForFormat, c as getStepDefinition, i as ALL_STEPS, l as resolveModelForFormat, o as getDefaultModelForFormatFromDef, r as ALL_PIPELINE_STEPS, s as getStep, t as localFrameRegistry, u as landmarkPrecisionVerdict } from "../local-frame-registry-av9ObDG0.mjs";
4
+ import { a as ALL_PIPELINE_STEPS, c as getStep, d as landmarkPrecisionVerdict, l as getStepDefinition, n as resolveDefaultDetectionModel, o as ALL_STEPS, r as localFrameRegistry, s as getDefaultModelForFormat, u as resolveModelForFormat } from "../default-detection-model-BGBAmtEp.mjs";
5
5
  import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
6
6
  import { n as startEventLoopStallMonitor } from "../event-loop-stall-monitor-DXLNBMkY.mjs";
7
7
  import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-BDHR3lxe.mjs";
@@ -447,88 +447,6 @@ var ClusterModelSource = class {
447
447
  }
448
448
  };
449
449
  //#endregion
450
- //#region src/detection-pipeline/default-detection-model.ts
451
- /** The object-detection step id — the only slot this resolver applies to. */
452
- var OBJECT_DETECTION_STEP_ID = "object-detection";
453
- /**
454
- * Balanced default object-detection model per accelerator class. `'cpu'` maps to
455
- * `null` → the caller substitutes the step's own `defaultModelId` (`yolo26n`).
456
- * INTEL NPU + iGPU default to OUR YOLOv9 (int8 @320): yolo26 does NOT compile on
457
- * the Intel NPU (arch incompat → 0 frames), while yolov9 runs on it (~298 fps
458
- * measured). Apple ANE uses the CoreML yolov9 @320 build.
459
- *
460
- * Do **not** promote these ids to `yolov9m-640` / `*-640`. The controlled
461
- * evaluation recovered 0/3 misses at the current 0.50 threshold and failed the
462
- * false-positive and capacity gates — see
463
- * `docs/benchmarks/pipeline-frame-model-eval.md`. 640 remains an explicit
464
- * operator pick, not a hardware-aware default.
465
- */
466
- var MODEL_BY_CLASS = {
467
- "apple-ane": "yolov9m-320",
468
- "intel-npu": "yolov9m-320-int8",
469
- "intel-gpu": "yolov9m-320-int8",
470
- cpu: null
471
- };
472
- /**
473
- * Classify a node's engine into an {@link AcceleratorClass} from its resolved
474
- * `backend` + `device`. Pure, total, never throws.
475
- *
476
- * OpenVINO's default device is `'auto'` (the python pool resolves NPU > GPU >
477
- * CPU at load). Because OpenVINO is only ever OFFERED when an Intel iGPU is
478
- * present, the GPU is the guaranteed accelerator while the NPU is an explicit
479
- * opt-in — so `'auto'` (and any non-cpu/non-npu device) is treated as
480
- * GPU-class conservatively. An operator who explicitly pins `device: 'npu'`
481
- * gets the NPU-tuned m-320.
482
- *
483
- * Also accepts the accelerator carried in the `backend` slot (e.g. `'ane'`,
484
- * `'mps'`, `'npu'`, `'intel-gpu'`) so a caller passing a device-style backend
485
- * still classifies correctly — real callers pass onnx/openvino/coreml.
486
- */
487
- function classifyAccelerator(backend, device) {
488
- const b = backend.toLowerCase();
489
- const d = device?.toLowerCase() ?? null;
490
- if (b === "coreml" || b === "ane" || b === "mps") return "apple-ane";
491
- if (b === "openvino") {
492
- if (d === "npu") return "intel-npu";
493
- if (d === "cpu") return "cpu";
494
- return "intel-gpu";
495
- }
496
- if (b === "npu" || b === "intel-npu") return "intel-npu";
497
- if (b === "gpu" || b === "intel-gpu" || b === "gpu-openvino") return "intel-gpu";
498
- return "cpu";
499
- }
500
- /**
501
- * Resolve the hardware-aware default object-detection model id for a node's
502
- * engine `(backend, device, format)`.
503
- *
504
- * Guarantees:
505
- * - never throws (hot default-tree path);
506
- * - never returns a model id without a build for `format` (unless the step
507
- * has ZERO builds for `format`, which is unloadable regardless of pick and
508
- * flagged by `collectZeroBuildIssues`) — an unmapped backend, a `'cpu'`
509
- * class, a mapped id missing from the catalog, or a mapped id without a
510
- * `format` build all fall back to the step's PER-FORMAT default
511
- * (`getDefaultModelForFormatFromDef`), NOT the bare `defaultModelId`.
512
- *
513
- * `getStepDef` is injectable (defaults to the real catalog lookup) so the
514
- * missing-build fallback branch is unit-testable without a live catalog —
515
- * mirrors `collectZeroBuildIssues`' injection seam.
516
- */
517
- function resolveDefaultDetectionModel(backend, device, format, getStepDef = getStepDefinition) {
518
- let def;
519
- try {
520
- def = getStepDef(OBJECT_DETECTION_STEP_ID);
521
- } catch {
522
- return "yolo26n";
523
- }
524
- const candidate = MODEL_BY_CLASS[classifyAccelerator(backend, device)];
525
- if (candidate !== null) {
526
- const entry = def.models.find((m) => m.id === candidate);
527
- if (entry && entry.formats[format] !== void 0) return candidate;
528
- }
529
- return getDefaultModelForFormatFromDef(def, format);
530
- }
531
- //#endregion
532
450
  //#region src/detection-pipeline/device-override-mirror.ts
533
451
  /**
534
452
  * The per-device detection overrides, kept fresh OFF the frame path.