@camstack/types 1.2.6 → 1.2.8

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.
@@ -8,7 +8,7 @@ import type { FrameResult } from '../types/detection.js';
8
8
  import type { ConfigUISchema } from './config-ui.js';
9
9
  import type { InferenceCapabilities } from './inference-capabilities.js';
10
10
  import type { IAddonResolver } from './pipeline-runner.js';
11
- import type { EngineProvisioning, PipelineValidationResult } from '../capabilities/pipeline-executor.cap.js';
11
+ import type { EngineProvisioning, NativeCropRef, PipelineValidationResult } from '../capabilities/pipeline-executor.cap.js';
12
12
  /**
13
13
  * Step configuration for pipeline execution — no runtime/backend (comes
14
14
  * from engine). Phase 7 (settings redesign) removed the generic
@@ -81,6 +81,15 @@ export interface PipelineRunInput {
81
81
  * pipelineRunner.runDetailSubtree (two-plane design).
82
82
  */
83
83
  readonly plane?: PipelineExecutionPlane;
84
+ /**
85
+ * Two-plane NATIVE child-crop reference (detail plane). Set by
86
+ * `runDetailSubtree` ONLY when the parent crop was resolved from the frame's
87
+ * retained native surface — lets the executor re-cut a leaf crop child's ROI
88
+ * (plate-ocr, face-embedding, leaf classifiers) at native resolution instead
89
+ * of the downscaled parent tile. Auxiliary to the image source, not one of the
90
+ * mutually-exclusive image inputs. Absent ⇒ tile-crop children.
91
+ */
92
+ readonly nativeCropRef?: NativeCropRef;
84
93
  }
85
94
  /**
86
95
  * Singleton capability provided by the pipeline-executor addon.
@@ -2394,7 +2394,6 @@ function expandCapMethods(def) {
2394
2394
  };
2395
2395
  return out;
2396
2396
  }
2397
- /** Shorthand to define a method schema */
2398
2397
  function method(input, output, options) {
2399
2398
  return {
2400
2399
  input,
@@ -2402,6 +2401,7 @@ function method(input, output, options) {
2402
2401
  kind: options?.kind ?? "query",
2403
2402
  auth: options?.auth ?? "protected",
2404
2403
  ...options?.access !== void 0 ? { access: options.access } : {},
2404
+ ...options?.caller !== void 0 ? { caller: options.caller } : {},
2405
2405
  timeoutMs: options?.timeoutMs
2406
2406
  };
2407
2407
  }
@@ -2394,7 +2394,6 @@ function expandCapMethods(def) {
2394
2394
  };
2395
2395
  return out;
2396
2396
  }
2397
- /** Shorthand to define a method schema */
2398
2397
  function method(input, output, options) {
2399
2398
  return {
2400
2399
  input,
@@ -2402,6 +2401,7 @@ function method(input, output, options) {
2402
2401
  kind: options?.kind ?? "query",
2403
2402
  auth: options?.auth ?? "protected",
2404
2403
  ...options?.access !== void 0 ? { access: options.access } : {},
2404
+ ...options?.caller !== void 0 ? { caller: options.caller } : {},
2405
2405
  timeoutMs: options?.timeoutMs
2406
2406
  };
2407
2407
  }
@@ -218,6 +218,19 @@ export interface ObjectDetection extends DetectionBase {
218
218
  * the parent person (the person box is not the ArcFace input).
219
219
  */
220
220
  readonly faceAlignedCrop?: string;
221
+ /**
222
+ * Short side (px) of the face measured on the NATIVE surface the aligned
223
+ * crop was cut from — the executor's own native-aware size measure
224
+ * (`aligned.nativeFaceShortSidePx`). The detail's `bbox` travels in the
225
+ * DOWNSCALED detection-frame space (≈640-wide), where a face that is
226
+ * 90–200px at native reads as 15–33px — so any consumer gating on
227
+ * `min(bbox.w, bbox.h)` against a pixel threshold silently discards every
228
+ * distant-camera face (2026-07-22: zero faces from the 4K outdoor cameras).
229
+ * Consumers MUST prefer this measure when present and fall back to the
230
+ * detection-space bbox only when absent (older runners / no native surface).
231
+ * Present iff the face path cut its aligned crop from a native surface.
232
+ */
233
+ readonly nativeFaceShortSidePx?: number;
221
234
  }
222
235
  /** Audio detection — flat, time-localised within the window. */
223
236
  export interface AudioDetection extends DetectionBase {
@@ -94,6 +94,26 @@ export interface StepDefinition {
94
94
  readonly rejectClasses?: readonly string[];
95
95
  /** Character set for CTC decode (index 0 = blank token) */
96
96
  readonly charset?: readonly string[];
97
+ /**
98
+ * Region plate grammar for format-aware plate-OCR rescoring (CTC steps).
99
+ * ISO-3166 alpha-2 code (`'DE'`, future `'IT'`/`'FR'`) selecting the grammar
100
+ * the greedy read is validated against; `'off'` disables rescoring. Forwarded
101
+ * to the Python CTC postprocessor exactly like {@link charset}. Absent ⇒ the
102
+ * postprocessor's backward-compatible 'off' fallback (no rescoring).
103
+ */
104
+ readonly plateRegion?: string;
105
+ /**
106
+ * Minimum non-space character count below which a CTC read is suppressed as
107
+ * degenerate near-all-blank noise (plate-OCR plausibility gate). Forwarded to
108
+ * the Python postprocessor; absent ⇒ its `DEFAULT_MIN_TEXT_LENGTH` (3).
109
+ */
110
+ readonly minTextLength?: number;
111
+ /**
112
+ * Confidence floor below which a CTC read is suppressed (plate-OCR
113
+ * plausibility gate). Forwarded to the Python postprocessor; absent ⇒ its
114
+ * `DEFAULT_MIN_TEXT_CONFIDENCE` (0, disabled).
115
+ */
116
+ readonly minTextConfidence?: number;
97
117
  /** COCO-to-macro class mapping (e.g., 'car' → 'vehicle') */
98
118
  readonly classMap?: ClassMapDefinition;
99
119
  /** UI grouping label — steps with the same group are displayed together (e.g., 'Segmentation') */
@@ -183,6 +203,16 @@ export interface PoolModelConfig {
183
203
  readonly labels?: readonly string[];
184
204
  /** Character set for CTC-based recognizers */
185
205
  readonly charset?: readonly string[];
206
+ /**
207
+ * Region plate grammar for format-aware CTC plate-OCR rescoring (ISO-3166
208
+ * alpha-2, e.g. `'DE'`; `'off'` disables). Read by the Python CTC
209
+ * postprocessor. See {@link StepDefinition.plateRegion}.
210
+ */
211
+ readonly plateRegion?: string;
212
+ /** Plate-OCR plausibility gate: minimum non-space character count. */
213
+ readonly minTextLength?: number;
214
+ /** Plate-OCR plausibility gate: confidence floor. */
215
+ readonly minTextConfidence?: number;
186
216
  /** Number of classes (for YOLO: 80 COCO or 1 for plate) */
187
217
  readonly numClasses?: number;
188
218
  /** Anchor strides for SCRFD (default [8, 16, 32]) */
@@ -231,6 +261,16 @@ export interface TextOutput {
231
261
  readonly kind: 'text';
232
262
  readonly text: string;
233
263
  readonly confidence: number;
264
+ /**
265
+ * Format-aware plate-OCR annotation (CTC steps with an active
266
+ * `plateRegion`). `true` when the returned `text` matches the region plate
267
+ * grammar (either the greedy read already conformed, or confusable rescoring
268
+ * repaired it to a conforming candidate); `false` when no grammar-conforming
269
+ * read was found and the original greedy read was kept verbatim. Absent when
270
+ * rescoring is disabled (`plateRegion: 'off'` / unset) or the read was
271
+ * suppressed by the plausibility gate.
272
+ */
273
+ readonly formatValid?: boolean;
234
274
  }
235
275
  export interface MaskOutput {
236
276
  readonly kind: 'mask';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",