@camstack/types 0.1.1 → 0.1.3
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/__tests__/addon-capability-provider.test.d.ts +2 -0
- package/dist/__tests__/addon-capability-provider.test.d.ts.map +1 -0
- package/dist/__tests__/addon-declaration.test.d.ts +2 -0
- package/dist/__tests__/addon-declaration.test.d.ts.map +1 -0
- package/dist/__tests__/capability.test.d.ts +2 -0
- package/dist/__tests__/capability.test.d.ts.map +1 -0
- package/dist/catalogs/coco-classmap.d.ts +5 -0
- package/dist/catalogs/coco-classmap.d.ts.map +1 -0
- package/dist/catalogs/index.d.ts +2 -0
- package/dist/catalogs/index.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/generated/addon-api.d.ts +4870 -0
- package/dist/generated/addon-api.d.ts.map +1 -0
- package/dist/index.d.ts +82 -3053
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +377 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +369 -7
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/addon-i18n.d.ts +41 -0
- package/dist/interfaces/addon-i18n.d.ts.map +1 -0
- package/dist/interfaces/addon-routes.d.ts +50 -0
- package/dist/interfaces/addon-routes.d.ts.map +1 -0
- package/dist/interfaces/addon.d.ts +294 -0
- package/dist/interfaces/addon.d.ts.map +1 -0
- package/dist/interfaces/advanced-notifier.d.ts +59 -0
- package/dist/interfaces/advanced-notifier.d.ts.map +1 -0
- package/dist/interfaces/agent-protocol.d.ts +189 -0
- package/dist/interfaces/agent-protocol.d.ts.map +1 -0
- package/dist/interfaces/agent.d.ts +87 -0
- package/dist/interfaces/agent.d.ts.map +1 -0
- package/dist/interfaces/analysis-persistence.d.ts +278 -0
- package/dist/interfaces/analysis-persistence.d.ts.map +1 -0
- package/dist/interfaces/analysis.d.ts +27 -0
- package/dist/interfaces/analysis.d.ts.map +1 -0
- package/dist/interfaces/api-shared.d.ts +168 -0
- package/dist/interfaces/api-shared.d.ts.map +1 -0
- package/dist/interfaces/auth-provider.d.ts +39 -0
- package/dist/interfaces/auth-provider.d.ts.map +1 -0
- package/dist/interfaces/auth.d.ts +47 -0
- package/dist/interfaces/auth.d.ts.map +1 -0
- package/dist/interfaces/camera-pipeline.d.ts +121 -0
- package/dist/interfaces/camera-pipeline.d.ts.map +1 -0
- package/dist/interfaces/capability.d.ts +84 -0
- package/dist/interfaces/capability.d.ts.map +1 -0
- package/dist/interfaces/classifier.d.ts +8 -0
- package/dist/interfaces/classifier.d.ts.map +1 -0
- package/dist/interfaces/config-ui.d.ts +152 -0
- package/dist/interfaces/config-ui.d.ts.map +1 -0
- package/dist/interfaces/context.d.ts +44 -0
- package/dist/interfaces/context.d.ts.map +1 -0
- package/dist/interfaces/cropper.d.ts +8 -0
- package/dist/interfaces/cropper.d.ts.map +1 -0
- package/dist/interfaces/decoder.d.ts +27 -0
- package/dist/interfaces/decoder.d.ts.map +1 -0
- package/dist/interfaces/detection-addon.d.ts +15 -0
- package/dist/interfaces/detection-addon.d.ts.map +1 -0
- package/dist/interfaces/detector.d.ts +8 -0
- package/dist/interfaces/detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/accessory.d.ts +14 -0
- package/dist/interfaces/device-capabilities/accessory.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/audio-detector.d.ts +12 -0
- package/dist/interfaces/device-capabilities/audio-detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/camera.d.ts +22 -0
- package/dist/interfaces/device-capabilities/camera.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/doorbell.d.ts +10 -0
- package/dist/interfaces/device-capabilities/doorbell.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/events.d.ts +47 -0
- package/dist/interfaces/device-capabilities/events.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/index.d.ts +15 -0
- package/dist/interfaces/device-capabilities/index.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/motion-sensor.d.ts +7 -0
- package/dist/interfaces/device-capabilities/motion-sensor.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/native-detection.d.ts +14 -0
- package/dist/interfaces/device-capabilities/native-detection.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/object-detector.d.ts +59 -0
- package/dist/interfaces/device-capabilities/object-detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/pan-tilt-zoom.d.ts +29 -0
- package/dist/interfaces/device-capabilities/pan-tilt-zoom.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/recording.d.ts +18 -0
- package/dist/interfaces/device-capabilities/recording.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/siren.d.ts +8 -0
- package/dist/interfaces/device-capabilities/siren.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/status-light.d.ts +7 -0
- package/dist/interfaces/device-capabilities/status-light.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/switch.d.ts +8 -0
- package/dist/interfaces/device-capabilities/switch.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/two-way-audio.d.ts +8 -0
- package/dist/interfaces/device-capabilities/two-way-audio.d.ts.map +1 -0
- package/dist/interfaces/device-capability.d.ts +14 -0
- package/dist/interfaces/device-capability.d.ts.map +1 -0
- package/dist/interfaces/device-provider.d.ts +43 -0
- package/dist/interfaces/device-provider.d.ts.map +1 -0
- package/dist/interfaces/device.d.ts +40 -0
- package/dist/interfaces/device.d.ts.map +1 -0
- package/dist/interfaces/event-bus.d.ts +22 -0
- package/dist/interfaces/event-bus.d.ts.map +1 -0
- package/dist/interfaces/feature-flags.d.ts +14 -0
- package/dist/interfaces/feature-flags.d.ts.map +1 -0
- package/dist/interfaces/ffmpeg.d.ts +10 -0
- package/dist/interfaces/ffmpeg.d.ts.map +1 -0
- package/dist/interfaces/inference-capabilities.d.ts +101 -0
- package/dist/interfaces/inference-capabilities.d.ts.map +1 -0
- package/dist/interfaces/inference-engine.d.ts +17 -0
- package/dist/interfaces/inference-engine.d.ts.map +1 -0
- package/dist/interfaces/lifecycle.d.ts +19 -0
- package/dist/interfaces/lifecycle.d.ts.map +1 -0
- package/dist/interfaces/logging.d.ts +33 -0
- package/dist/interfaces/logging.d.ts.map +1 -0
- package/dist/interfaces/model-catalog.d.ts +25 -0
- package/dist/interfaces/model-catalog.d.ts.map +1 -0
- package/dist/interfaces/network-quality.d.ts +25 -0
- package/dist/interfaces/network-quality.d.ts.map +1 -0
- package/dist/interfaces/network.d.ts +43 -0
- package/dist/interfaces/network.d.ts.map +1 -0
- package/dist/interfaces/notification.d.ts +53 -0
- package/dist/interfaces/notification.d.ts.map +1 -0
- package/dist/interfaces/pipeline-runner.d.ts +23 -0
- package/dist/interfaces/pipeline-runner.d.ts.map +1 -0
- package/dist/interfaces/pipeline-slot.d.ts +10 -0
- package/dist/interfaces/pipeline-slot.d.ts.map +1 -0
- package/dist/interfaces/platform.d.ts +55 -0
- package/dist/interfaces/platform.d.ts.map +1 -0
- package/dist/interfaces/process.d.ts +41 -0
- package/dist/interfaces/process.d.ts.map +1 -0
- package/dist/interfaces/python-env.d.ts +20 -0
- package/dist/interfaces/python-env.d.ts.map +1 -0
- package/dist/interfaces/refiner.d.ts +8 -0
- package/dist/interfaces/refiner.d.ts.map +1 -0
- package/dist/interfaces/repl.d.ts +26 -0
- package/dist/interfaces/repl.d.ts.map +1 -0
- package/dist/interfaces/repositories.d.ts +20 -0
- package/dist/interfaces/repositories.d.ts.map +1 -0
- package/dist/interfaces/restreamer.d.ts +24 -0
- package/dist/interfaces/restreamer.d.ts.map +1 -0
- package/dist/interfaces/router.d.ts +30 -0
- package/dist/interfaces/router.d.ts.map +1 -0
- package/dist/interfaces/scene-intelligence.d.ts +21 -0
- package/dist/interfaces/scene-intelligence.d.ts.map +1 -0
- package/dist/interfaces/scoped-token.d.ts +22 -0
- package/dist/interfaces/scoped-token.d.ts.map +1 -0
- package/dist/interfaces/server-analysis.d.ts +146 -0
- package/dist/interfaces/server-analysis.d.ts.map +1 -0
- package/dist/interfaces/server-network.d.ts +78 -0
- package/dist/interfaces/server-network.d.ts.map +1 -0
- package/dist/interfaces/storage-backend.d.ts +27 -0
- package/dist/interfaces/storage-backend.d.ts.map +1 -0
- package/dist/interfaces/storage.d.ts +174 -0
- package/dist/interfaces/storage.d.ts.map +1 -0
- package/dist/interfaces/stream-broker.d.ts +92 -0
- package/dist/interfaces/stream-broker.d.ts.map +1 -0
- package/dist/interfaces/streaming.d.ts +29 -0
- package/dist/interfaces/streaming.d.ts.map +1 -0
- package/dist/interfaces/task-handler.d.ts +46 -0
- package/dist/interfaces/task-handler.d.ts.map +1 -0
- package/dist/interfaces/webrtc-provider.d.ts +11 -0
- package/dist/interfaces/webrtc-provider.d.ts.map +1 -0
- package/dist/interfaces/worker-protocol.d.ts +110 -0
- package/dist/interfaces/worker-protocol.d.ts.map +1 -0
- package/dist/schemas/system-settings-schemas.d.ts +27 -0
- package/dist/schemas/system-settings-schemas.d.ts.map +1 -0
- package/dist/types/analytics.d.ts +75 -0
- package/dist/types/analytics.d.ts.map +1 -0
- package/dist/types/benchmark.d.ts +112 -0
- package/dist/types/benchmark.d.ts.map +1 -0
- package/dist/types/camera-detection.d.ts +34 -0
- package/dist/types/camera-detection.d.ts.map +1 -0
- package/dist/types/config.d.ts +37 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/detection.d.ts +93 -0
- package/dist/types/detection.d.ts.map +1 -0
- package/dist/types/device-type.d.ts +10 -0
- package/dist/types/device-type.d.ts.map +1 -0
- package/dist/types/entities.d.ts +35 -0
- package/dist/types/entities.d.ts.map +1 -0
- package/dist/types/events.d.ts +35 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/io.d.ts +25 -0
- package/dist/types/io.d.ts.map +1 -0
- package/dist/types/labels.d.ts +12 -0
- package/dist/types/labels.d.ts.map +1 -0
- package/dist/types/live-state.d.ts +47 -0
- package/dist/types/live-state.d.ts.map +1 -0
- package/dist/types/models.d.ts +79 -0
- package/dist/types/models.d.ts.map +1 -0
- package/dist/types/pipeline-schema.d.ts +78 -0
- package/dist/types/pipeline-schema.d.ts.map +1 -0
- package/dist/types/pipeline.d.ts +42 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/tracked.d.ts +21 -0
- package/dist/types/tracked.d.ts.map +1 -0
- package/dist/types/zones.d.ts +48 -0
- package/dist/types/zones.d.ts.map +1 -0
- package/dist/utils/cosine-similarity.d.ts +3 -0
- package/dist/utils/cosine-similarity.d.ts.map +1 -0
- package/dist/utils/hf-url.d.ts +2 -0
- package/dist/utils/hf-url.d.ts.map +1 -0
- package/package.json +16 -5
- package/dist/index.d.mts +0 -3053
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { BoundingBox } from './io.js';
|
|
2
|
+
export type BenchmarkMode = 'single-addon' | 'full-pipeline' | 'compare-runtimes' | 'compare-models';
|
|
3
|
+
export type BenchmarkSource = {
|
|
4
|
+
readonly type: 'reference';
|
|
5
|
+
readonly images: 'all' | readonly string[];
|
|
6
|
+
} | {
|
|
7
|
+
readonly type: 'camera';
|
|
8
|
+
readonly deviceId: string;
|
|
9
|
+
readonly durationSec: number;
|
|
10
|
+
};
|
|
11
|
+
export type BenchmarkExecution = {
|
|
12
|
+
readonly type: 'local';
|
|
13
|
+
} | {
|
|
14
|
+
readonly type: 'agent';
|
|
15
|
+
readonly agentId: string;
|
|
16
|
+
} | {
|
|
17
|
+
readonly type: 'multi-agent';
|
|
18
|
+
readonly agentIds: readonly string[];
|
|
19
|
+
} | {
|
|
20
|
+
readonly type: 'all-agents';
|
|
21
|
+
};
|
|
22
|
+
export interface BenchmarkTarget {
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly addonId: string;
|
|
25
|
+
readonly config: Readonly<Record<string, unknown>>;
|
|
26
|
+
}
|
|
27
|
+
export interface BenchmarkConfig {
|
|
28
|
+
readonly mode: BenchmarkMode;
|
|
29
|
+
readonly source: BenchmarkSource;
|
|
30
|
+
readonly execution: BenchmarkExecution;
|
|
31
|
+
readonly iterations?: number;
|
|
32
|
+
readonly warmup?: number;
|
|
33
|
+
readonly targets: readonly BenchmarkTarget[];
|
|
34
|
+
}
|
|
35
|
+
export interface LatencyStats {
|
|
36
|
+
readonly mean: number;
|
|
37
|
+
readonly median: number;
|
|
38
|
+
readonly p95: number;
|
|
39
|
+
readonly p99: number;
|
|
40
|
+
readonly min: number;
|
|
41
|
+
readonly max: number;
|
|
42
|
+
}
|
|
43
|
+
export interface ResourceStats {
|
|
44
|
+
readonly peakMemoryMB: number;
|
|
45
|
+
readonly avgCpuPercent: number;
|
|
46
|
+
readonly avgGpuPercent?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface AccuracyStats {
|
|
49
|
+
readonly mAP50?: number;
|
|
50
|
+
readonly precision?: number;
|
|
51
|
+
readonly recall?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface SystemInfo {
|
|
54
|
+
readonly os: string;
|
|
55
|
+
readonly arch: string;
|
|
56
|
+
readonly cpuModel: string;
|
|
57
|
+
readonly cpuCores: number;
|
|
58
|
+
readonly totalMemoryMB: number;
|
|
59
|
+
readonly gpuModel?: string;
|
|
60
|
+
readonly pythonVersion?: string;
|
|
61
|
+
readonly nodeVersion: string;
|
|
62
|
+
}
|
|
63
|
+
export interface BenchmarkTargetResult {
|
|
64
|
+
readonly label: string;
|
|
65
|
+
readonly addonId: string;
|
|
66
|
+
readonly config: Readonly<Record<string, unknown>>;
|
|
67
|
+
readonly latency: LatencyStats;
|
|
68
|
+
readonly fps: number;
|
|
69
|
+
readonly accuracy?: AccuracyStats;
|
|
70
|
+
readonly resources: ResourceStats;
|
|
71
|
+
readonly stepBreakdown?: Readonly<Record<string, {
|
|
72
|
+
readonly meanMs: number;
|
|
73
|
+
readonly percentOfTotal: number;
|
|
74
|
+
}>>;
|
|
75
|
+
}
|
|
76
|
+
export type AgentBenchmarkStatus = 'completed' | 'partial' | 'failed' | 'disconnected';
|
|
77
|
+
export interface MultiBenchmarkReport {
|
|
78
|
+
readonly timestamp: string;
|
|
79
|
+
readonly source: BenchmarkSource;
|
|
80
|
+
readonly agents: ReadonlyArray<{
|
|
81
|
+
readonly agentId: string;
|
|
82
|
+
readonly status: AgentBenchmarkStatus;
|
|
83
|
+
readonly systemInfo: SystemInfo;
|
|
84
|
+
readonly results: readonly BenchmarkTargetResult[];
|
|
85
|
+
readonly error?: string;
|
|
86
|
+
readonly completedIterations?: number;
|
|
87
|
+
}>;
|
|
88
|
+
readonly leaderboard: ReadonlyArray<{
|
|
89
|
+
readonly rank: number;
|
|
90
|
+
readonly agentId: string;
|
|
91
|
+
readonly label: string;
|
|
92
|
+
readonly meanMs: number;
|
|
93
|
+
readonly fps: number;
|
|
94
|
+
readonly peakMemoryMB: number;
|
|
95
|
+
readonly accuracy?: AccuracyStats;
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
export interface GroundTruthAnnotation {
|
|
99
|
+
readonly class: string;
|
|
100
|
+
readonly originalClass?: string;
|
|
101
|
+
readonly bbox: BoundingBox;
|
|
102
|
+
readonly children?: readonly GroundTruthAnnotation[];
|
|
103
|
+
readonly identity?: string;
|
|
104
|
+
readonly plateText?: string;
|
|
105
|
+
readonly species?: string;
|
|
106
|
+
readonly vehicleType?: string;
|
|
107
|
+
}
|
|
108
|
+
export interface GroundTruth {
|
|
109
|
+
readonly image: string;
|
|
110
|
+
readonly annotations: readonly GroundTruthAnnotation[];
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=benchmark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../src/types/benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,eAAe,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AAEpG,MAAM,MAAM,eAAe,GACvB;IA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,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,SAAS,qBAAqB,EAAE,CAAA;CACvD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion detection configuration per camera.
|
|
3
|
+
* Motion is a pipeline TRIGGER, not a pipeline step.
|
|
4
|
+
*/
|
|
5
|
+
export interface CameraMotionConfig {
|
|
6
|
+
/** 'stream' = frame-diff analysis on decoded frames (default)
|
|
7
|
+
* 'onboarded' = use camera's native motion signal via IMotionSensor capability
|
|
8
|
+
* 'smart' = AI-based motion detection */
|
|
9
|
+
readonly source: 'stream' | 'onboarded' | 'smart';
|
|
10
|
+
/** Frame-diff settings (only used when source='stream') */
|
|
11
|
+
readonly threshold?: number;
|
|
12
|
+
readonly minArea?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Camera native AI detection configuration.
|
|
16
|
+
* These events are emitted for recording/notifications, NOT for inference pipeline.
|
|
17
|
+
* Uses the IObjectDetector device capability to receive detection events.
|
|
18
|
+
*/
|
|
19
|
+
export interface CameraNativeDetectionConfig {
|
|
20
|
+
/** Whether to listen for the camera's native AI events */
|
|
21
|
+
readonly enabled: boolean;
|
|
22
|
+
/** Source identifier for attribution */
|
|
23
|
+
readonly source: string;
|
|
24
|
+
/** Classes the camera reports natively */
|
|
25
|
+
readonly classes: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Combined camera detection capabilities config.
|
|
29
|
+
*/
|
|
30
|
+
export interface CameraDetectionCapabilities {
|
|
31
|
+
readonly motion: CameraMotionConfig;
|
|
32
|
+
readonly nativeDetection?: CameraNativeDetectionConfig;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=camera-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-detection.d.ts","sourceRoot":"","sources":["../../src/types/camera-detection.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;8CAE0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAA;IACjD,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,2BAA2B,CAAA;CACvD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DetectionEventType } from './events.js';
|
|
2
|
+
export type DetectionRuntime = 'onnx' | 'coreml' | 'pytorch' | 'openvino' | 'tflite';
|
|
3
|
+
export type DetectionDevice = 'cpu' | 'gpu-cuda' | 'gpu-mps' | 'npu' | 'coral-edgetpu' | 'tensorrt';
|
|
4
|
+
export type ProbeCapability = 'fp32' | 'fp16' | 'int8' | 'batch-inference';
|
|
5
|
+
export interface ProbeResult {
|
|
6
|
+
readonly available: boolean;
|
|
7
|
+
readonly runtime: DetectionRuntime;
|
|
8
|
+
readonly device: DetectionDevice;
|
|
9
|
+
readonly capabilities: readonly ProbeCapability[];
|
|
10
|
+
readonly estimatedMemoryMB?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface CameraAnalysisConfig {
|
|
13
|
+
readonly tracker: {
|
|
14
|
+
readonly maxAge: number;
|
|
15
|
+
readonly minHits: number;
|
|
16
|
+
readonly iouThreshold: number;
|
|
17
|
+
};
|
|
18
|
+
readonly stateAnalyzer: {
|
|
19
|
+
readonly stationaryThresholdSec: number;
|
|
20
|
+
readonly loiteringThresholdSec: number;
|
|
21
|
+
readonly velocityThreshold: number;
|
|
22
|
+
};
|
|
23
|
+
readonly snapshots: {
|
|
24
|
+
readonly enabled: boolean;
|
|
25
|
+
readonly saveThumbnail: boolean;
|
|
26
|
+
readonly saveAnnotatedFrame: boolean;
|
|
27
|
+
readonly saveDebugThumbnails: boolean;
|
|
28
|
+
readonly clipPreSec: number;
|
|
29
|
+
readonly clipPostSec: number;
|
|
30
|
+
};
|
|
31
|
+
readonly events: {
|
|
32
|
+
readonly minTrackAge: number;
|
|
33
|
+
readonly cooldownSec: number;
|
|
34
|
+
readonly enabledTypes: readonly DetectionEventType[];
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GA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E,MAAM,CAAA;QAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;QAC5B,QAAQ,CAAC,YAAY,EAAE,SAAS,kBAAkB,EAAE,CAAA;KACrD,CAAA;CACF"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { BoundingBox, Landmark, FrameInput } from './io.js';
|
|
2
|
+
import type { DetectionZoneMembership } from './zones.js';
|
|
3
|
+
export interface SpatialDetection {
|
|
4
|
+
readonly class: string;
|
|
5
|
+
readonly originalClass: string;
|
|
6
|
+
readonly score: number;
|
|
7
|
+
readonly bbox: BoundingBox;
|
|
8
|
+
readonly landmarks?: readonly Landmark[];
|
|
9
|
+
readonly mask?: Uint8Array;
|
|
10
|
+
readonly maskWidth?: number;
|
|
11
|
+
readonly maskHeight?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CropInput {
|
|
14
|
+
readonly frame: FrameInput;
|
|
15
|
+
readonly roi: BoundingBox;
|
|
16
|
+
readonly parentDetection: SpatialDetection;
|
|
17
|
+
}
|
|
18
|
+
export interface Classification {
|
|
19
|
+
readonly class: string;
|
|
20
|
+
readonly score: number;
|
|
21
|
+
readonly text?: string;
|
|
22
|
+
readonly embedding?: Float32Array;
|
|
23
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
24
|
+
}
|
|
25
|
+
export interface DetectorOutput {
|
|
26
|
+
readonly detections: readonly SpatialDetection[];
|
|
27
|
+
readonly inferenceMs: number;
|
|
28
|
+
readonly modelId: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CropperOutput {
|
|
31
|
+
readonly crops: readonly SpatialDetection[];
|
|
32
|
+
readonly inferenceMs: number;
|
|
33
|
+
readonly modelId: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ClassifierOutput {
|
|
36
|
+
readonly classifications: readonly Classification[];
|
|
37
|
+
readonly inferenceMs: number;
|
|
38
|
+
readonly modelId: string;
|
|
39
|
+
}
|
|
40
|
+
export interface RefinerOutput {
|
|
41
|
+
/** Base64-encoded binary mask for the refined detection region */
|
|
42
|
+
readonly mask: string;
|
|
43
|
+
readonly maskWidth: number;
|
|
44
|
+
readonly maskHeight: number;
|
|
45
|
+
readonly inferenceMs: number;
|
|
46
|
+
readonly modelId: string;
|
|
47
|
+
}
|
|
48
|
+
/** Origin type of a label — what kind of pipeline step produced it */
|
|
49
|
+
export type LabelOrigin = 'classification' | 'face' | 'plate' | 'recognition' | 'unknown';
|
|
50
|
+
/** A label produced by any classifier/recognizer step in the pipeline */
|
|
51
|
+
export interface LabelData {
|
|
52
|
+
/** The classification/recognition result (e.g., "Sunbird", "EA0202AA", "Dodge Journey SUV 2012") */
|
|
53
|
+
readonly label: string;
|
|
54
|
+
/** Confidence of the classification */
|
|
55
|
+
readonly score: number;
|
|
56
|
+
/** Bounding box of the source region this label applies to [x1, y1, x2, y2] */
|
|
57
|
+
readonly box: readonly [number, number, number, number];
|
|
58
|
+
/** Source addon that produced this label */
|
|
59
|
+
readonly addonId: string;
|
|
60
|
+
/** Origin type — what kind of step produced this label */
|
|
61
|
+
readonly origin: LabelOrigin;
|
|
62
|
+
}
|
|
63
|
+
/** A detection produced by the pipeline executor with accumulated labels */
|
|
64
|
+
export interface PipelineDetection {
|
|
65
|
+
readonly className: string;
|
|
66
|
+
readonly originalClass?: string;
|
|
67
|
+
readonly confidence: number;
|
|
68
|
+
readonly bbox: readonly [number, number, number, number];
|
|
69
|
+
/** Accumulated labels from all classifier/recognizer steps in the pipeline */
|
|
70
|
+
readonly labelsData: readonly LabelData[];
|
|
71
|
+
/** Base64-encoded binary segmentation mask (when using -seg models or refiner) */
|
|
72
|
+
readonly mask?: string;
|
|
73
|
+
readonly maskWidth?: number;
|
|
74
|
+
readonly maskHeight?: number;
|
|
75
|
+
/** Sub-detections from cropper steps (face bbox, plate bbox) — for debug */
|
|
76
|
+
readonly children?: readonly PipelineDetection[];
|
|
77
|
+
readonly zones?: readonly DetectionZoneMembership[];
|
|
78
|
+
readonly embeddingId?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface PipelineStepTiming {
|
|
81
|
+
readonly addonId: string;
|
|
82
|
+
readonly modelId: string;
|
|
83
|
+
readonly ms: number;
|
|
84
|
+
readonly detections: number;
|
|
85
|
+
}
|
|
86
|
+
export interface PipelineRunResult {
|
|
87
|
+
readonly detections: readonly PipelineDetection[];
|
|
88
|
+
readonly stepTimings: readonly PipelineStepTiming[];
|
|
89
|
+
readonly totalMs: number;
|
|
90
|
+
readonly imageWidth: number;
|
|
91
|
+
readonly imageHeight: number;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/types/detection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;IACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;IACzB,QAAQ,CAAC,eAAe,EAAE,gBAAgB,CAAA;CAC3C;AAED,MAAM,WAAW,cAAc;IAC7B,QA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,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAA;IACjD,QAAQ,CAAC,WAAW,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum DeviceType {
|
|
2
|
+
Camera = "camera"
|
|
3
|
+
}
|
|
4
|
+
export interface DeviceTypeInfo {
|
|
5
|
+
readonly type: DeviceType;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly icon: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEVICE_TYPE_INFO: Record<DeviceType, DeviceTypeInfo>;
|
|
10
|
+
//# sourceMappingURL=device-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-type.d.ts","sourceRoot":"","sources":["../../src/types/device-type.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,cAAc,CAE/D,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface ZoneDefinition {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly cameraId: string;
|
|
5
|
+
readonly type: 'polygon' | 'tripwire';
|
|
6
|
+
readonly points: ReadonlyArray<{
|
|
7
|
+
readonly x: number;
|
|
8
|
+
readonly y: number;
|
|
9
|
+
}>;
|
|
10
|
+
readonly direction?: 'in' | 'out' | 'both';
|
|
11
|
+
readonly alertOnClasses?: readonly string[];
|
|
12
|
+
readonly color?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface KnownFace {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly label?: string;
|
|
18
|
+
readonly embeddings: readonly Float32Array[];
|
|
19
|
+
readonly thumbnailPath?: string;
|
|
20
|
+
readonly createdAt: number;
|
|
21
|
+
}
|
|
22
|
+
export interface KnownPlate {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly plateText: string;
|
|
25
|
+
readonly label?: string;
|
|
26
|
+
readonly vehicleDescription?: string;
|
|
27
|
+
readonly createdAt: number;
|
|
28
|
+
}
|
|
29
|
+
export interface KnownAudioEvent {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly className: string;
|
|
32
|
+
readonly label: string;
|
|
33
|
+
readonly notifyAlways: boolean;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/types/entities.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC1E,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAA;IAC1C,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,YAAY,EAAE,CAAA;IAC5C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;CAC/B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BoundingBox } from './io.js';
|
|
2
|
+
import type { Classification } from './detection.js';
|
|
3
|
+
import type { TrackedDetection, TrackedObjectState } from './tracked.js';
|
|
4
|
+
export type DetectionEventType = 'object.detected' | 'object.classified' | 'object.entering' | 'object.leaving' | 'object.stationary' | 'object.loitering' | 'zone.enter' | 'zone.exit' | 'tripwire.cross' | 'audio.detected';
|
|
5
|
+
export type TrackEventType = 'track.new' | 'track.update' | 'track.stationary' | 'track.moving' | 'track.zone-enter' | 'track.zone-exit' | 'track.zone-dwell' | 'track.ended';
|
|
6
|
+
export type AnalysisEventType = DetectionEventType | TrackEventType;
|
|
7
|
+
export interface ZoneEvent {
|
|
8
|
+
readonly type: 'zone-enter' | 'zone-exit' | 'zone-loiter' | 'tripwire-cross';
|
|
9
|
+
readonly zoneId: string;
|
|
10
|
+
readonly zoneName: string;
|
|
11
|
+
readonly trackId: string;
|
|
12
|
+
readonly detection: TrackedDetection;
|
|
13
|
+
readonly direction?: 'in' | 'out' | 'left' | 'right';
|
|
14
|
+
readonly timestamp: number;
|
|
15
|
+
}
|
|
16
|
+
export interface EventSnapshot {
|
|
17
|
+
readonly thumbnailPath: string;
|
|
18
|
+
readonly annotatedFramePath: string;
|
|
19
|
+
readonly debugThumbnails?: Readonly<Record<string, string>>;
|
|
20
|
+
readonly clipPath?: string;
|
|
21
|
+
readonly clipDurationSec?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface DetectionEvent {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly type: DetectionEventType;
|
|
26
|
+
readonly timestamp: number;
|
|
27
|
+
readonly deviceId: string;
|
|
28
|
+
readonly detection: TrackedDetection;
|
|
29
|
+
readonly classifications: readonly Classification[];
|
|
30
|
+
readonly objectState: TrackedObjectState;
|
|
31
|
+
readonly zoneEvents: readonly ZoneEvent[];
|
|
32
|
+
readonly snapshot?: EventSnapshot;
|
|
33
|
+
readonly trackPath: readonly BoundingBox[];
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAExE,MAAM,MAAM,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E,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;IACpC,QAAQ,CAAC,eAAe,EAAE,SAAS,cAAc,EAAE,CAAA;IACnD,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,WAAW,EAAE,CAAA;CAC3C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface BoundingBox {
|
|
2
|
+
readonly x: number;
|
|
3
|
+
readonly y: number;
|
|
4
|
+
readonly w: number;
|
|
5
|
+
readonly h: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Landmark {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
readonly y: number;
|
|
10
|
+
readonly label?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FrameInput {
|
|
13
|
+
readonly data: Buffer;
|
|
14
|
+
readonly format: 'jpeg' | 'rgb' | 'yuv420';
|
|
15
|
+
readonly width: number;
|
|
16
|
+
readonly height: number;
|
|
17
|
+
readonly timestamp: number;
|
|
18
|
+
}
|
|
19
|
+
export interface AudioChunkInput {
|
|
20
|
+
readonly data: Float32Array;
|
|
21
|
+
readonly sampleRate: number;
|
|
22
|
+
readonly channels: number;
|
|
23
|
+
readonly timestamp: number;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=io.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/types/io.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface LabelDefinition {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly category?: string;
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
readonly icon?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ClassMapDefinition {
|
|
9
|
+
readonly mapping: Readonly<Record<string, string>>;
|
|
10
|
+
readonly preserveOriginal: boolean;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/types/labels.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAClD,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;CACnC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { BoundingBox } from './io.js';
|
|
2
|
+
import type { ObjectState } from './tracked.js';
|
|
3
|
+
import type { DetectionEvent } from './events.js';
|
|
4
|
+
import type { PipelineStatus } from './pipeline.js';
|
|
5
|
+
export interface TrackedObjectSummary {
|
|
6
|
+
readonly trackId: string;
|
|
7
|
+
readonly class: string;
|
|
8
|
+
readonly originalClass: string;
|
|
9
|
+
readonly state: ObjectState;
|
|
10
|
+
readonly bbox: BoundingBox;
|
|
11
|
+
readonly velocity: {
|
|
12
|
+
readonly dx: number;
|
|
13
|
+
readonly dy: number;
|
|
14
|
+
};
|
|
15
|
+
readonly dwellTimeMs: number;
|
|
16
|
+
readonly inZones: readonly string[];
|
|
17
|
+
readonly identity?: string;
|
|
18
|
+
readonly plateText?: string;
|
|
19
|
+
readonly subClass?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ZoneLiveState {
|
|
22
|
+
readonly zoneId: string;
|
|
23
|
+
readonly zoneName: string;
|
|
24
|
+
readonly occupied: boolean;
|
|
25
|
+
readonly objectCount: number;
|
|
26
|
+
readonly objectsByClass: Readonly<Record<string, number>>;
|
|
27
|
+
readonly trackIds: readonly string[];
|
|
28
|
+
readonly avgDwellTimeMs: number;
|
|
29
|
+
readonly totalEntrancesToday: number;
|
|
30
|
+
readonly totalExitsToday: number;
|
|
31
|
+
readonly loiteringTracks: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
export interface CameraLiveState {
|
|
34
|
+
readonly deviceId: string;
|
|
35
|
+
readonly lastFrameTimestamp: number;
|
|
36
|
+
readonly activeObjects: number;
|
|
37
|
+
readonly movingObjects: number;
|
|
38
|
+
readonly stationaryObjects: number;
|
|
39
|
+
readonly objectCounts: Readonly<Record<string, number>>;
|
|
40
|
+
readonly tracks: readonly TrackedObjectSummary[];
|
|
41
|
+
readonly zones: readonly ZoneLiveState[];
|
|
42
|
+
readonly lastEvent?: DetectionEvent;
|
|
43
|
+
readonly pipelineStatus: readonly PipelineStatus[];
|
|
44
|
+
readonly avgPipelineMs: number;
|
|
45
|
+
readonly currentFps: number;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=live-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-state.d.ts","sourceRoot":"","sources":["../../src/types/live-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA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,CAAC,SAAS,CAAC,EAAE,cAAc,CAAA;IACnC,QAAQ,CAAC,cAAc,EAAE,SAAS,cAAc,EAAE,CAAA;IAClD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { LabelDefinition, ClassMapDefinition } from './labels.js';
|
|
2
|
+
export type ModelFormat = 'onnx' | 'coreml' | 'openvino' | 'tflite' | 'pt';
|
|
3
|
+
export type ModelOutputFormat = 'yolo' | 'ssd' | 'embedding' | 'classification' | 'ocr' | 'segmentation';
|
|
4
|
+
export interface ModelFormatEntry {
|
|
5
|
+
readonly url: string;
|
|
6
|
+
readonly sizeMB: number;
|
|
7
|
+
/** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
|
|
8
|
+
readonly isDirectory?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* For directory formats: list of files relative to the directory root.
|
|
11
|
+
* The downloader fetches each file from `{url}/{file}` and saves to `{modelDir}/{file}`.
|
|
12
|
+
* If omitted for a directory format, the downloader probes HuggingFace API (slower).
|
|
13
|
+
*/
|
|
14
|
+
readonly files?: readonly string[];
|
|
15
|
+
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
16
|
+
readonly runtimes?: readonly ('node' | 'python')[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
20
|
+
* The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
|
|
21
|
+
*/
|
|
22
|
+
export interface ModelExtraFile {
|
|
23
|
+
readonly url: string;
|
|
24
|
+
readonly filename: string;
|
|
25
|
+
readonly sizeMB: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ModelCatalogEntry {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly description: string;
|
|
31
|
+
readonly formats: Partial<Readonly<Record<ModelFormat, ModelFormatEntry>>>;
|
|
32
|
+
readonly inputSize: {
|
|
33
|
+
readonly width: number;
|
|
34
|
+
readonly height: number;
|
|
35
|
+
};
|
|
36
|
+
readonly labels: readonly LabelDefinition[];
|
|
37
|
+
readonly inputLayout?: 'nchw' | 'nhwc';
|
|
38
|
+
readonly inputNormalization?: 'zero-one' | 'imagenet' | 'none';
|
|
39
|
+
/**
|
|
40
|
+
* Auxiliary files required at runtime (labels JSON, charset dict, etc.).
|
|
41
|
+
* Downloaded into the same modelsDir alongside the model file.
|
|
42
|
+
*/
|
|
43
|
+
readonly extraFiles?: readonly ModelExtraFile[];
|
|
44
|
+
}
|
|
45
|
+
export interface DetectionModel {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly labels: readonly string[];
|
|
49
|
+
readonly inputSize: {
|
|
50
|
+
readonly width: number;
|
|
51
|
+
readonly height: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface ModelDownloadOptions {
|
|
55
|
+
readonly url: string;
|
|
56
|
+
readonly fallbackUrls?: readonly string[];
|
|
57
|
+
readonly destDir: string;
|
|
58
|
+
readonly filename?: string;
|
|
59
|
+
readonly expectedSha256?: string;
|
|
60
|
+
readonly onProgress?: (downloaded: number, total: number) => void;
|
|
61
|
+
}
|
|
62
|
+
export interface ModelDownloadResult {
|
|
63
|
+
readonly filePath: string;
|
|
64
|
+
readonly downloadedBytes: number;
|
|
65
|
+
readonly fromCache: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface CustomModelMetadata {
|
|
68
|
+
readonly name: string;
|
|
69
|
+
readonly inputSize: {
|
|
70
|
+
readonly width: number;
|
|
71
|
+
readonly height: number;
|
|
72
|
+
};
|
|
73
|
+
readonly labels: readonly LabelDefinition[];
|
|
74
|
+
readonly classMap?: ClassMapDefinition;
|
|
75
|
+
readonly inputLayout?: 'nchw' | 'nhwc';
|
|
76
|
+
readonly inputNormalization?: 'zero-one' | 'imagenet' | 'none';
|
|
77
|
+
readonly outputFormat: ModelOutputFormat;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/types/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEtE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,IAAI,CAAA;AAC1E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,gBAAgB,GAAG,KAAK,GAAG,cAAc,CAAA;AAExG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,6FAA6F;IAC7F,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAA;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,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