@camstack/types 0.1.0 → 0.1.2

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/index.js CHANGED
@@ -20,25 +20,438 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
- ANIMAL_TYPE_MODELS: () => ANIMAL_TYPE_MODELS,
24
- AUDIO_CLASSIFICATION_MODELS: () => AUDIO_CLASSIFICATION_MODELS,
25
- BIRD_NABIRDS_MODELS: () => BIRD_NABIRDS_MODELS,
26
- BIRD_SPECIES_MODELS: () => BIRD_SPECIES_MODELS,
23
+ BINARY_FRAME_HEADER_SIZE: () => BINARY_FRAME_HEADER_SIZE,
24
+ BINARY_FRAME_TYPE: () => BINARY_FRAME_TYPE,
27
25
  COCO_80_LABELS: () => COCO_80_LABELS,
28
26
  COCO_TO_MACRO: () => COCO_TO_MACRO,
29
- FACE_DETECTION_MODELS: () => FACE_DETECTION_MODELS,
30
- FACE_RECOGNITION_MODELS: () => FACE_RECOGNITION_MODELS,
27
+ DEFAULT_FEATURES: () => DEFAULT_FEATURES,
28
+ DEFAULT_LOCATION_SUBPATHS: () => DEFAULT_LOCATION_SUBPATHS,
29
+ DEFAULT_RETENTION: () => DEFAULT_RETENTION,
30
+ DETECTION_TYPES: () => DETECTION_TYPES,
31
+ DEVICE_TYPE_INFO: () => DEVICE_TYPE_INFO,
32
+ DeviceType: () => DeviceType,
31
33
  HF_BASE_URL: () => HF_BASE_URL,
32
34
  HF_REPO: () => HF_REPO,
33
35
  MACRO_LABELS: () => MACRO_LABELS,
34
- OBJECT_DETECTION_MODELS: () => OBJECT_DETECTION_MODELS,
35
- PLATE_DETECTION_MODELS: () => PLATE_DETECTION_MODELS,
36
- PLATE_RECOGNITION_MODELS: () => PLATE_RECOGNITION_MODELS,
37
- SEGMENTATION_MODELS: () => SEGMENTATION_MODELS,
38
- hfModelUrl: () => hfModelUrl
36
+ READ_ONLY_SECTIONS: () => READ_ONLY_SECTIONS,
37
+ RECOGNITION_TYPES: () => RECOGNITION_TYPES,
38
+ SETTINGS_TABS: () => SETTINGS_TABS,
39
+ SUB_DETECTION_TYPES: () => SUB_DETECTION_TYPES,
40
+ SYSTEM_SETTINGS_SCHEMAS: () => SYSTEM_SETTINGS_SCHEMAS,
41
+ cosineSimilarity: () => cosineSimilarity,
42
+ createAnalysisContext: () => createAnalysisContext,
43
+ enrichContext: () => enrichContext,
44
+ getSystemSettingsSchema: () => getSystemSettingsSchema,
45
+ hfModelUrl: () => hfModelUrl,
46
+ resolveTranslation: () => resolveTranslation
39
47
  });
40
48
  module.exports = __toCommonJS(src_exports);
41
49
 
50
+ // src/interfaces/storage-backend.ts
51
+ var DEFAULT_LOCATION_SUBPATHS = {
52
+ "recordings-high": "recordings-high",
53
+ "recordings-low": "recordings-low",
54
+ "recordings-clips": "recordings-clips",
55
+ "event-images": "event-images",
56
+ "models": "models",
57
+ "addons-data": "addons-data",
58
+ "cache": "/tmp/camstack-cache",
59
+ "logs": "logs"
60
+ };
61
+
62
+ // src/interfaces/addon-i18n.ts
63
+ function resolveTranslation(provider, locale, key) {
64
+ if (provider.getTranslations) {
65
+ const map = provider.getTranslations(locale);
66
+ if (map && key in map) return map[key];
67
+ if (locale !== "en") {
68
+ const fallback = provider.getTranslations("en");
69
+ if (fallback && key in fallback) return fallback[key];
70
+ }
71
+ }
72
+ if (provider.getTranslationBundle) {
73
+ const bundle = provider.getTranslationBundle();
74
+ const map = bundle[locale];
75
+ if (map && key in map) return map[key];
76
+ if (locale !== "en") {
77
+ const fallback = bundle["en"];
78
+ if (fallback && key in fallback) return fallback[key];
79
+ }
80
+ }
81
+ return key;
82
+ }
83
+
84
+ // src/interfaces/feature-flags.ts
85
+ var DEFAULT_FEATURES = {
86
+ streaming: true,
87
+ notifications: true,
88
+ objectDetection: false,
89
+ remoteAccess: true,
90
+ agentCluster: false,
91
+ smartHome: true,
92
+ recordings: true,
93
+ backup: true,
94
+ repl: true
95
+ };
96
+
97
+ // src/interfaces/agent-protocol.ts
98
+ var BINARY_FRAME_HEADER_SIZE = 29;
99
+ var BINARY_FRAME_TYPE = 1;
100
+
101
+ // src/interfaces/server-analysis.ts
102
+ var DETECTION_TYPES = ["person", "vehicle", "animal", "package"];
103
+ var SUB_DETECTION_TYPES = ["face", "plate"];
104
+ var RECOGNITION_TYPES = ["face", "plate", "clip", "custom"];
105
+ function createAnalysisContext(deviceId, frame, rawDetections) {
106
+ return {
107
+ deviceId,
108
+ frame,
109
+ timestamp: frame.timestamp,
110
+ rawDetections,
111
+ trackedDetections: [],
112
+ events: [],
113
+ metadata: {}
114
+ };
115
+ }
116
+ function enrichContext(ctx, updates) {
117
+ return {
118
+ ...ctx,
119
+ trackedDetections: updates.trackedDetections ?? ctx.trackedDetections,
120
+ events: updates.events ?? ctx.events,
121
+ metadata: updates.metadata ? { ...ctx.metadata, ...updates.metadata } : ctx.metadata
122
+ };
123
+ }
124
+
125
+ // src/interfaces/analysis-persistence.ts
126
+ var DEFAULT_RETENTION = {
127
+ cleanupIntervalMs: 60 * 60 * 1e3,
128
+ detectionEventsDays: 30,
129
+ audioLevelsDays: 7,
130
+ snapshotsDays: 14
131
+ };
132
+
133
+ // src/schemas/system-settings-schemas.ts
134
+ var READ_ONLY_SECTIONS = /* @__PURE__ */ new Set([
135
+ "server"
136
+ ]);
137
+ var SETTINGS_TABS = [
138
+ { id: "server", label: "Server" },
139
+ { id: "logging", label: "Logs" },
140
+ { id: "recording", label: "Recording" },
141
+ { id: "ffmpeg", label: "FFmpeg" },
142
+ { id: "detection", label: "Detection" },
143
+ { id: "auth", label: "Auth" },
144
+ { id: "retention", label: "Retention" }
145
+ ];
146
+ var SERVER_SCHEMA = {
147
+ sections: [
148
+ {
149
+ id: "server-info",
150
+ title: "Server",
151
+ description: "Core server connection settings (read-only)",
152
+ columns: 2,
153
+ fields: [
154
+ {
155
+ type: "info",
156
+ key: "server-restart-note",
157
+ label: "Restart required",
158
+ content: "Server settings are read-only. Change them in config.yaml and restart.",
159
+ variant: "warning"
160
+ },
161
+ {
162
+ type: "text",
163
+ key: "port",
164
+ label: "Port",
165
+ disabled: true,
166
+ description: "Listening port"
167
+ },
168
+ {
169
+ type: "text",
170
+ key: "host",
171
+ label: "Host",
172
+ disabled: true,
173
+ description: "Bind address"
174
+ },
175
+ {
176
+ type: "text",
177
+ key: "dataPath",
178
+ label: "Data Path",
179
+ disabled: true,
180
+ description: "Root data directory",
181
+ span: 2
182
+ }
183
+ ]
184
+ }
185
+ ]
186
+ };
187
+ var STORAGE_SCHEMA = {
188
+ sections: []
189
+ };
190
+ var LOGGING_SCHEMA = {
191
+ sections: [
192
+ {
193
+ id: "logging-settings",
194
+ title: "Logging",
195
+ description: "Global log verbosity. Retention is managed per log-destination addon.",
196
+ columns: 1,
197
+ fields: [
198
+ {
199
+ type: "select",
200
+ key: "level",
201
+ label: "Log Level",
202
+ options: [
203
+ { value: "debug", label: "Debug" },
204
+ { value: "info", label: "Info" },
205
+ { value: "warn", label: "Warn" },
206
+ { value: "error", label: "Error" }
207
+ ]
208
+ }
209
+ ]
210
+ }
211
+ ]
212
+ };
213
+ var RECORDING_SCHEMA = {
214
+ sections: [
215
+ {
216
+ id: "recording-settings",
217
+ title: "Recording",
218
+ description: "Video recording segment and retention defaults",
219
+ columns: 2,
220
+ fields: [
221
+ {
222
+ type: "number",
223
+ key: "segmentDurationSeconds",
224
+ label: "Segment Duration",
225
+ description: "Length of each recording segment",
226
+ min: 1,
227
+ max: 60,
228
+ step: 1,
229
+ unit: "seconds"
230
+ },
231
+ {
232
+ type: "number",
233
+ key: "defaultRetentionDays",
234
+ label: "Default Retention",
235
+ description: "Days to keep recordings before auto-delete",
236
+ min: 1,
237
+ max: 365,
238
+ step: 1,
239
+ unit: "days"
240
+ }
241
+ ]
242
+ }
243
+ ]
244
+ };
245
+ var FFMPEG_SCHEMA = {
246
+ sections: [
247
+ {
248
+ id: "ffmpeg-settings",
249
+ title: "FFmpeg",
250
+ description: "FFmpeg binary and hardware acceleration settings",
251
+ columns: 2,
252
+ fields: [
253
+ {
254
+ type: "text",
255
+ key: "binaryPath",
256
+ label: "Binary Path",
257
+ description: "Path to ffmpeg executable",
258
+ placeholder: "ffmpeg",
259
+ span: 2
260
+ },
261
+ {
262
+ type: "select",
263
+ key: "hwAccel",
264
+ label: "Hardware Acceleration",
265
+ description: "GPU decoding/encoding backend",
266
+ options: [
267
+ { value: "auto", label: "Auto-detect" },
268
+ { value: "none", label: "None (CPU only)" },
269
+ { value: "videotoolbox", label: "VideoToolbox (macOS)" },
270
+ { value: "vaapi", label: "VA-API (Linux Intel/AMD)" },
271
+ { value: "qsv", label: "QSV (Intel Quick Sync)" },
272
+ { value: "cuda", label: "CUDA (NVIDIA)" }
273
+ ]
274
+ },
275
+ {
276
+ type: "number",
277
+ key: "threadCount",
278
+ label: "Thread Count",
279
+ description: "0 = auto (let FFmpeg decide)",
280
+ min: 0,
281
+ max: 16,
282
+ step: 1
283
+ }
284
+ ]
285
+ }
286
+ ]
287
+ };
288
+ var DETECTION_SCHEMA = {
289
+ sections: [
290
+ {
291
+ id: "detection-fps",
292
+ title: "Frame Rates",
293
+ description: "Default analysis frame rates for new cameras",
294
+ columns: 2,
295
+ fields: [
296
+ {
297
+ type: "number",
298
+ key: "defaultMotionFps",
299
+ label: "Motion FPS",
300
+ description: "Frames per second for motion detection",
301
+ min: 1,
302
+ max: 30,
303
+ step: 1,
304
+ unit: "fps"
305
+ },
306
+ {
307
+ type: "number",
308
+ key: "defaultDetectionFps",
309
+ label: "Detection FPS",
310
+ description: "Frames per second for object detection",
311
+ min: 1,
312
+ max: 30,
313
+ step: 1,
314
+ unit: "fps"
315
+ }
316
+ ]
317
+ },
318
+ {
319
+ id: "detection-thresholds",
320
+ title: "Thresholds",
321
+ description: "Default confidence and cooldown for detections",
322
+ columns: 2,
323
+ fields: [
324
+ {
325
+ type: "slider",
326
+ key: "defaultConfidenceThreshold",
327
+ label: "Confidence Threshold",
328
+ description: "Minimum confidence to trigger a detection event",
329
+ min: 0.1,
330
+ max: 1,
331
+ step: 0.05,
332
+ showValue: true
333
+ },
334
+ {
335
+ type: "number",
336
+ key: "defaultCooldownSeconds",
337
+ label: "Cooldown",
338
+ description: "Seconds between duplicate events",
339
+ min: 0,
340
+ max: 300,
341
+ step: 1,
342
+ unit: "seconds"
343
+ }
344
+ ]
345
+ },
346
+ {
347
+ id: "detection-tracker",
348
+ title: "Tracker",
349
+ description: "SORT/IoU tracker parameters",
350
+ columns: 3,
351
+ fields: [
352
+ {
353
+ type: "number",
354
+ key: "trackerMaxAgeFrames",
355
+ label: "Max Age",
356
+ description: "Frames before a lost track is removed",
357
+ min: 1,
358
+ max: 120,
359
+ step: 1,
360
+ unit: "frames"
361
+ },
362
+ {
363
+ type: "number",
364
+ key: "trackerMinHits",
365
+ label: "Min Hits",
366
+ description: "Consecutive detections to confirm a track",
367
+ min: 1,
368
+ max: 20,
369
+ step: 1
370
+ },
371
+ {
372
+ type: "slider",
373
+ key: "trackerIouThreshold",
374
+ label: "IoU Threshold",
375
+ description: "Minimum IoU to associate detection with track",
376
+ min: 0.1,
377
+ max: 0.9,
378
+ step: 0.05,
379
+ showValue: true
380
+ }
381
+ ]
382
+ }
383
+ ]
384
+ };
385
+ var AUTH_SCHEMA = {
386
+ sections: [
387
+ {
388
+ id: "auth-settings",
389
+ title: "Authentication",
390
+ description: "Token and session settings",
391
+ columns: 1,
392
+ fields: [
393
+ {
394
+ type: "text",
395
+ key: "tokenExpiry",
396
+ label: "Token Expiry",
397
+ description: "JWT token lifetime (e.g. 24h, 7d, 1h)",
398
+ placeholder: "24h"
399
+ }
400
+ ]
401
+ }
402
+ ]
403
+ };
404
+ var RETENTION_SCHEMA = {
405
+ sections: [
406
+ {
407
+ id: "retention-settings",
408
+ title: "Retention",
409
+ description: "Data retention periods for analytics data",
410
+ columns: 1,
411
+ fields: [
412
+ {
413
+ type: "slider",
414
+ key: "detectionEventsDays",
415
+ label: "Detection Events Retention",
416
+ min: 1,
417
+ max: 365,
418
+ unit: "days",
419
+ showValue: true,
420
+ span: 1
421
+ },
422
+ {
423
+ type: "slider",
424
+ key: "audioLevelsDays",
425
+ label: "Audio Levels Retention",
426
+ min: 1,
427
+ max: 90,
428
+ unit: "days",
429
+ showValue: true,
430
+ span: 1
431
+ }
432
+ ]
433
+ }
434
+ ]
435
+ };
436
+ var SYSTEM_SETTINGS_SCHEMAS = {
437
+ server: SERVER_SCHEMA,
438
+ storage: STORAGE_SCHEMA,
439
+ logging: LOGGING_SCHEMA,
440
+ recording: RECORDING_SCHEMA,
441
+ ffmpeg: FFMPEG_SCHEMA,
442
+ detection: DETECTION_SCHEMA,
443
+ auth: AUTH_SCHEMA,
444
+ retention: RETENTION_SCHEMA,
445
+ // These sections have no UI form — managed programmatically or addon-specific
446
+ streaming: { sections: [] },
447
+ backup: { sections: [] },
448
+ features: { sections: [] },
449
+ addons: { sections: [] }
450
+ };
451
+ function getSystemSettingsSchema(section) {
452
+ return SYSTEM_SETTINGS_SCHEMAS[section];
453
+ }
454
+
42
455
  // src/constants.ts
43
456
  var HF_REPO = "camstack/camstack-models";
44
457
  var HF_BASE_URL = `https://huggingface.co/${HF_REPO}/resolve/main`;
@@ -48,6 +461,21 @@ function hfModelUrl(repo, path) {
48
461
  return `https://huggingface.co/${repo}/resolve/main/${path}`;
49
462
  }
50
463
 
464
+ // src/utils/cosine-similarity.ts
465
+ function cosineSimilarity(a, b) {
466
+ if (a.length !== b.length) return 0;
467
+ let dotProduct = 0;
468
+ let normA = 0;
469
+ let normB = 0;
470
+ for (let i = 0; i < a.length; i++) {
471
+ dotProduct += a[i] * b[i];
472
+ normA += a[i] * a[i];
473
+ normB += b[i] * b[i];
474
+ }
475
+ const denom = Math.sqrt(normA) * Math.sqrt(normB);
476
+ return denom === 0 ? 0 : dotProduct / denom;
477
+ }
478
+
51
479
  // src/catalogs/coco-classmap.ts
52
480
  var COCO_80_LABELS = [
53
481
  { id: "person", name: "Person" },
@@ -161,651 +589,39 @@ var COCO_TO_MACRO = {
161
589
  preserveOriginal: true
162
590
  };
163
591
 
164
- // src/catalogs/object-detection-models.ts
165
- var HF_REPO2 = "camstack/camstack-models";
166
- var OBJECT_DETECTION_MODELS = [
167
- {
168
- id: "yolov8n",
169
- name: "YOLOv8 Nano",
170
- description: "YOLOv8 Nano \u2014 fastest, smallest object detection model",
171
- inputSize: { width: 640, height: 640 },
172
- labels: COCO_80_LABELS,
173
- formats: {
174
- onnx: {
175
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/onnx/camstack-yolov8n.onnx"),
176
- sizeMB: 12
177
- },
178
- coreml: {
179
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/coreml/camstack-yolov8n.mlpackage"),
180
- sizeMB: 6
181
- },
182
- openvino: {
183
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/openvino/camstack-yolov8n.xml"),
184
- sizeMB: 7
185
- },
186
- tflite: {
187
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/tflite/camstack-yolov8n_float32.tflite"),
188
- sizeMB: 12
189
- }
190
- }
191
- },
192
- {
193
- id: "yolov8s",
194
- name: "YOLOv8 Small",
195
- description: "YOLOv8 Small \u2014 balanced speed and accuracy",
196
- inputSize: { width: 640, height: 640 },
197
- labels: COCO_80_LABELS,
198
- formats: {
199
- onnx: {
200
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/onnx/camstack-yolov8s.onnx"),
201
- sizeMB: 43
202
- },
203
- coreml: {
204
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/coreml/camstack-yolov8s.mlpackage"),
205
- sizeMB: 21
206
- },
207
- openvino: {
208
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/openvino/camstack-yolov8s.xml"),
209
- sizeMB: 22
210
- },
211
- tflite: {
212
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/tflite/camstack-yolov8s_float32.tflite"),
213
- sizeMB: 43
214
- }
215
- }
216
- },
217
- {
218
- id: "yolov8m",
219
- name: "YOLOv8 Medium",
220
- description: "YOLOv8 Medium \u2014 higher accuracy, moderate size",
221
- inputSize: { width: 640, height: 640 },
222
- labels: COCO_80_LABELS,
223
- formats: {
224
- onnx: {
225
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/onnx/camstack-yolov8m.onnx"),
226
- sizeMB: 99
227
- },
228
- coreml: {
229
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/coreml/camstack-yolov8m.mlpackage"),
230
- sizeMB: 49
231
- },
232
- openvino: {
233
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/openvino/camstack-yolov8m.xml"),
234
- sizeMB: 50
235
- },
236
- tflite: {
237
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov8/tflite/camstack-yolov8m_float32.tflite"),
238
- sizeMB: 99
239
- }
240
- }
241
- },
242
- {
243
- id: "yolov9t",
244
- name: "YOLOv9 Tiny",
245
- description: "YOLOv9 Tiny \u2014 ultra-lightweight next-gen detector",
246
- inputSize: { width: 640, height: 640 },
247
- labels: COCO_80_LABELS,
248
- formats: {
249
- onnx: {
250
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/onnx/camstack-yolov9t.onnx"),
251
- sizeMB: 8
252
- },
253
- coreml: {
254
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/coreml/camstack-yolov9t.mlpackage"),
255
- sizeMB: 4
256
- },
257
- openvino: {
258
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/openvino/camstack-yolov9t.xml"),
259
- sizeMB: 6
260
- },
261
- tflite: {
262
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/tflite/camstack-yolov9t_float32.tflite"),
263
- sizeMB: 8
264
- }
265
- }
266
- },
267
- {
268
- id: "yolov9s",
269
- name: "YOLOv9 Small",
270
- description: "YOLOv9 Small \u2014 improved efficiency over YOLOv8s",
271
- inputSize: { width: 640, height: 640 },
272
- labels: COCO_80_LABELS,
273
- formats: {
274
- onnx: {
275
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/onnx/camstack-yolov9s.onnx"),
276
- sizeMB: 28
277
- },
278
- coreml: {
279
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/coreml/camstack-yolov9s.mlpackage"),
280
- sizeMB: 14
281
- },
282
- openvino: {
283
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/openvino/camstack-yolov9s.xml"),
284
- sizeMB: 16
285
- },
286
- tflite: {
287
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/tflite/camstack-yolov9s_float32.tflite"),
288
- sizeMB: 28
289
- }
290
- }
291
- },
292
- {
293
- id: "yolov9c",
294
- name: "YOLOv9 C",
295
- description: "YOLOv9 C \u2014 high-accuracy compact model",
296
- inputSize: { width: 640, height: 640 },
297
- labels: COCO_80_LABELS,
298
- formats: {
299
- onnx: {
300
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/onnx/camstack-yolov9c.onnx"),
301
- sizeMB: 97
302
- },
303
- coreml: {
304
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/coreml/camstack-yolov9c.mlpackage"),
305
- sizeMB: 48
306
- },
307
- openvino: {
308
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/openvino/camstack-yolov9c.xml"),
309
- sizeMB: 49
310
- },
311
- tflite: {
312
- url: hfModelUrl(HF_REPO2, "objectDetection/yolov9/tflite/camstack-yolov9c_float32.tflite"),
313
- sizeMB: 97
314
- }
315
- }
316
- },
317
- // YOLO11 — no CoreML (coremltools incompatible)
318
- {
319
- id: "yolo11n",
320
- name: "YOLO11 Nano",
321
- description: "YOLO11 Nano \u2014 fastest, smallest YOLO11 detection model",
322
- inputSize: { width: 640, height: 640 },
323
- labels: COCO_80_LABELS,
324
- formats: {
325
- onnx: {
326
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/onnx/camstack-yolo11n.onnx"),
327
- sizeMB: 10
328
- },
329
- openvino: {
330
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/openvino/camstack-yolo11n.xml"),
331
- sizeMB: 5.4
332
- },
333
- tflite: {
334
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/tflite/camstack-yolo11n_float32.tflite"),
335
- sizeMB: 10
336
- }
337
- }
338
- },
339
- {
340
- id: "yolo11s",
341
- name: "YOLO11 Small",
342
- description: "YOLO11 Small \u2014 balanced speed and accuracy",
343
- inputSize: { width: 640, height: 640 },
344
- labels: COCO_80_LABELS,
345
- formats: {
346
- onnx: {
347
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/onnx/camstack-yolo11s.onnx"),
348
- sizeMB: 36
349
- },
350
- openvino: {
351
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/openvino/camstack-yolo11s.xml"),
352
- sizeMB: 18
353
- },
354
- tflite: {
355
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/tflite/camstack-yolo11s_float32.tflite"),
356
- sizeMB: 36
357
- }
358
- }
359
- },
360
- {
361
- id: "yolo11m",
362
- name: "YOLO11 Medium",
363
- description: "YOLO11 Medium \u2014 higher accuracy, moderate size",
364
- inputSize: { width: 640, height: 640 },
365
- labels: COCO_80_LABELS,
366
- formats: {
367
- onnx: {
368
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/onnx/camstack-yolo11m.onnx"),
369
- sizeMB: 77
370
- },
371
- openvino: {
372
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/openvino/camstack-yolo11m.xml"),
373
- sizeMB: 39
374
- },
375
- tflite: {
376
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/tflite/camstack-yolo11m_float32.tflite"),
377
- sizeMB: 77
378
- }
379
- }
380
- },
381
- {
382
- id: "yolo11l",
383
- name: "YOLO11 Large",
384
- description: "YOLO11 Large \u2014 high-accuracy large model",
385
- inputSize: { width: 640, height: 640 },
386
- labels: COCO_80_LABELS,
387
- formats: {
388
- onnx: {
389
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/onnx/camstack-yolo11l.onnx"),
390
- sizeMB: 97
391
- },
392
- openvino: {
393
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/openvino/camstack-yolo11l.xml"),
394
- sizeMB: 49
395
- },
396
- tflite: {
397
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/tflite/camstack-yolo11l_float32.tflite"),
398
- sizeMB: 97
399
- }
400
- }
401
- },
402
- {
403
- id: "yolo11x",
404
- name: "YOLO11 Extra-Large",
405
- description: "YOLO11 Extra-Large \u2014 maximum accuracy",
406
- inputSize: { width: 640, height: 640 },
407
- labels: COCO_80_LABELS,
408
- formats: {
409
- onnx: {
410
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/onnx/camstack-yolo11x.onnx"),
411
- sizeMB: 218
412
- },
413
- openvino: {
414
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/openvino/camstack-yolo11x.xml"),
415
- sizeMB: 109
416
- },
417
- tflite: {
418
- url: hfModelUrl(HF_REPO2, "objectDetection/yolo11/tflite/camstack-yolo11x_float32.tflite"),
419
- sizeMB: 218
420
- }
421
- }
422
- }
423
- ];
424
-
425
- // src/catalogs/face-detection-models.ts
426
- var HF_REPO3 = "camstack/camstack-models";
427
- var FACE_LABELS = [
428
- { id: "face", name: "Face" }
429
- ];
430
- var FACE_DETECTION_MODELS = [
431
- {
432
- id: "scrfd-500m",
433
- name: "SCRFD 500M",
434
- description: "SCRFD 500M \u2014 ultra-lightweight face detector",
435
- inputSize: { width: 640, height: 640 },
436
- labels: FACE_LABELS,
437
- formats: {
438
- onnx: {
439
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/onnx/camstack-scrfd-500m.onnx"),
440
- sizeMB: 2.2
441
- },
442
- coreml: {
443
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/coreml/camstack-scrfd-500m.mlpackage"),
444
- sizeMB: 1.2
445
- },
446
- openvino: {
447
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/openvino/camstack-scrfd-500m.xml"),
448
- sizeMB: 1.3
449
- }
450
- }
451
- },
452
- {
453
- id: "scrfd-2.5g",
454
- name: "SCRFD 2.5G",
455
- description: "SCRFD 2.5G \u2014 balanced face detection model",
456
- inputSize: { width: 640, height: 640 },
457
- labels: FACE_LABELS,
458
- formats: {
459
- onnx: {
460
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/onnx/camstack-scrfd-2.5g.onnx"),
461
- sizeMB: 3.1
462
- },
463
- coreml: {
464
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/coreml/camstack-scrfd-2.5g.mlpackage"),
465
- sizeMB: 1.7
466
- },
467
- openvino: {
468
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/openvino/camstack-scrfd-2.5g.xml"),
469
- sizeMB: 1.8
470
- }
471
- }
472
- },
473
- {
474
- id: "scrfd-10g",
475
- name: "SCRFD 10G",
476
- description: "SCRFD 10G \u2014 high-accuracy face detector",
477
- inputSize: { width: 640, height: 640 },
478
- labels: FACE_LABELS,
479
- formats: {
480
- onnx: {
481
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/onnx/camstack-scrfd-10g.onnx"),
482
- sizeMB: 16
483
- },
484
- coreml: {
485
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/coreml/camstack-scrfd-10g.mlpackage"),
486
- sizeMB: 8.2
487
- },
488
- openvino: {
489
- url: hfModelUrl(HF_REPO3, "faceDetection/scrfd/openvino/camstack-scrfd-10g.xml"),
490
- sizeMB: 8.3
491
- }
492
- }
493
- }
494
- ];
495
-
496
- // src/catalogs/face-recognition-models.ts
497
- var HF_REPO4 = "camstack/camstack-models";
498
- var FACE_EMBEDDING_LABELS = [
499
- { id: "embedding", name: "Face Embedding" }
500
- ];
501
- var FACE_RECOGNITION_MODELS = [
502
- {
503
- id: "arcface-r100",
504
- name: "ArcFace R100",
505
- description: "ArcFace ResNet-100 \u2014 high-accuracy face recognition embeddings",
506
- inputSize: { width: 112, height: 112 },
507
- inputLayout: "nhwc",
508
- labels: FACE_EMBEDDING_LABELS,
509
- formats: {
510
- onnx: {
511
- url: hfModelUrl(HF_REPO4, "faceRecognition/arcface/onnx/camstack-arcface-arcface.onnx"),
512
- sizeMB: 130
513
- },
514
- coreml: {
515
- url: hfModelUrl(HF_REPO4, "faceRecognition/arcface/coreml/camstack-arcface-r100.mlpackage"),
516
- sizeMB: 65
517
- },
518
- openvino: {
519
- url: hfModelUrl(HF_REPO4, "faceRecognition/arcface/openvino/camstack-arcface-r100.xml"),
520
- sizeMB: 65
521
- }
522
- }
523
- }
524
- ];
525
-
526
- // src/catalogs/plate-detection-models.ts
527
- var HF_REPO5 = "camstack/camstack-models";
528
- var PLATE_LABELS = [
529
- { id: "plate", name: "License Plate" }
530
- ];
531
- var PLATE_DETECTION_MODELS = [
532
- {
533
- id: "yolov8n-plate",
534
- name: "YOLOv8 Nano \u2014 License Plate",
535
- description: "YOLOv8 Nano fine-tuned for license plate detection",
536
- inputSize: { width: 640, height: 640 },
537
- labels: PLATE_LABELS,
538
- formats: {
539
- onnx: {
540
- url: hfModelUrl(HF_REPO5, "plateDetection/yolov8-plate/onnx/camstack-yolov8n-plate.onnx"),
541
- sizeMB: 12
542
- },
543
- coreml: {
544
- url: hfModelUrl(HF_REPO5, "plateDetection/yolov8-plate/coreml/camstack-yolov8n-plate.mlpackage"),
545
- sizeMB: 5.9
546
- },
547
- openvino: {
548
- url: hfModelUrl(HF_REPO5, "plateDetection/yolov8-plate/openvino/camstack-yolov8n-plate.xml"),
549
- sizeMB: 6.1
550
- },
551
- tflite: {
552
- url: hfModelUrl(HF_REPO5, "plateDetection/yolov8-plate/tflite/camstack-yolov8n-plate_float32.tflite"),
553
- sizeMB: 12
554
- }
555
- }
556
- }
557
- ];
558
-
559
- // src/catalogs/plate-recognition-models.ts
560
- var HF_REPO6 = "camstack/camstack-models";
561
- var PLATE_TEXT_LABELS = [
562
- { id: "text", name: "Plate Text" }
563
- ];
564
- var PLATE_RECOGNITION_MODELS = [
565
- {
566
- id: "paddleocr-latin",
567
- name: "PaddleOCR Latin",
568
- description: "PaddleOCR recognition model for Latin-script license plates",
569
- inputSize: { width: 320, height: 48 },
570
- labels: PLATE_TEXT_LABELS,
571
- formats: {
572
- onnx: {
573
- url: hfModelUrl(HF_REPO6, "plateRecognition/paddleocr/onnx/camstack-paddleocr-latin-rec.onnx"),
574
- sizeMB: 7.5
575
- },
576
- openvino: {
577
- url: hfModelUrl(HF_REPO6, "plateRecognition/paddleocr/openvino/camstack-paddleocr-latin.xml"),
578
- sizeMB: 4
579
- }
580
- }
581
- },
582
- {
583
- id: "paddleocr-en",
584
- name: "PaddleOCR English",
585
- description: "PaddleOCR recognition model optimized for English license plates",
586
- inputSize: { width: 320, height: 48 },
587
- labels: PLATE_TEXT_LABELS,
588
- formats: {
589
- onnx: {
590
- url: hfModelUrl(HF_REPO6, "plateRecognition/paddleocr/onnx/camstack-paddleocr-en-rec.onnx"),
591
- sizeMB: 7.5
592
- },
593
- openvino: {
594
- url: hfModelUrl(HF_REPO6, "plateRecognition/paddleocr/openvino/camstack-paddleocr-en.xml"),
595
- sizeMB: 4
596
- }
597
- }
598
- }
599
- ];
600
-
601
- // src/catalogs/audio-classification-models.ts
602
- var HF_REPO7 = "camstack/camstack-models";
603
- var AUDIO_LABELS = [
604
- { id: "audio", name: "Audio Event" }
605
- ];
606
- var AUDIO_CLASSIFICATION_MODELS = [
607
- {
608
- id: "yamnet",
609
- name: "YAMNet",
610
- description: "YAMNet \u2014 audio event classification from raw waveform",
611
- inputSize: { width: 1, height: 16e3 },
612
- labels: AUDIO_LABELS,
613
- formats: {
614
- onnx: {
615
- url: hfModelUrl(HF_REPO7, "audioClassification/yamnet/onnx/camstack-yamnet.onnx"),
616
- sizeMB: 15
617
- },
618
- openvino: {
619
- url: hfModelUrl(HF_REPO7, "audioClassification/yamnet/openvino/camstack-yamnet.xml"),
620
- sizeMB: 8
621
- }
622
- }
623
- }
624
- ];
625
-
626
- // src/catalogs/segmentation-models.ts
627
- var HF_REPO8 = "camstack/camstack-models";
628
- var SEGMENTATION_MODELS = [
629
- // YOLO11-seg — no CoreML (coremltools incompatible)
630
- {
631
- id: "yolo11n-seg",
632
- name: "YOLO11 Nano Segmentation",
633
- description: "YOLO11 Nano \u2014 fastest, smallest YOLO11 instance segmentation model",
634
- inputSize: { width: 640, height: 640 },
635
- labels: COCO_80_LABELS,
636
- formats: {
637
- onnx: {
638
- url: hfModelUrl(HF_REPO8, "segmentation/yolo11-seg/onnx/camstack-yolo11n-seg.onnx"),
639
- sizeMB: 11
640
- },
641
- openvino: {
642
- url: hfModelUrl(HF_REPO8, "segmentation/yolo11-seg/openvino/camstack-yolo11n-seg.xml"),
643
- sizeMB: 6
644
- }
645
- }
646
- },
647
- {
648
- id: "yolo11s-seg",
649
- name: "YOLO11 Small Segmentation",
650
- description: "YOLO11 Small \u2014 balanced speed and accuracy for instance segmentation",
651
- inputSize: { width: 640, height: 640 },
652
- labels: COCO_80_LABELS,
653
- formats: {
654
- onnx: {
655
- url: hfModelUrl(HF_REPO8, "segmentation/yolo11-seg/onnx/camstack-yolo11s-seg.onnx"),
656
- sizeMB: 39
657
- },
658
- openvino: {
659
- url: hfModelUrl(HF_REPO8, "segmentation/yolo11-seg/openvino/camstack-yolo11s-seg.xml"),
660
- sizeMB: 20
661
- }
662
- }
663
- },
664
- {
665
- id: "yolo11m-seg",
666
- name: "YOLO11 Medium Segmentation",
667
- description: "YOLO11 Medium \u2014 higher accuracy instance segmentation",
668
- inputSize: { width: 640, height: 640 },
669
- labels: COCO_80_LABELS,
670
- formats: {
671
- onnx: {
672
- url: hfModelUrl(HF_REPO8, "segmentation/yolo11-seg/onnx/camstack-yolo11m-seg.onnx"),
673
- sizeMB: 86
674
- },
675
- openvino: {
676
- url: hfModelUrl(HF_REPO8, "segmentation/yolo11-seg/openvino/camstack-yolo11m-seg.xml"),
677
- sizeMB: 43
678
- }
679
- }
680
- },
681
- // YOLOv8-seg — CoreML available
682
- {
683
- id: "yolov8n-seg",
684
- name: "YOLOv8 Nano Segmentation",
685
- description: "YOLOv8 Nano \u2014 fastest, smallest YOLOv8 instance segmentation model",
686
- inputSize: { width: 640, height: 640 },
687
- labels: COCO_80_LABELS,
688
- formats: {
689
- onnx: {
690
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/onnx/camstack-yolov8n-seg.onnx"),
691
- sizeMB: 13
692
- },
693
- coreml: {
694
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/coreml/camstack-yolov8n-seg.mlpackage"),
695
- sizeMB: 7
696
- },
697
- openvino: {
698
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/openvino/camstack-yolov8n-seg.xml"),
699
- sizeMB: 7
700
- }
701
- }
702
- },
703
- {
704
- id: "yolov8s-seg",
705
- name: "YOLOv8 Small Segmentation",
706
- description: "YOLOv8 Small \u2014 balanced speed and accuracy for instance segmentation",
707
- inputSize: { width: 640, height: 640 },
708
- labels: COCO_80_LABELS,
709
- formats: {
710
- onnx: {
711
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/onnx/camstack-yolov8s-seg.onnx"),
712
- sizeMB: 45
713
- },
714
- coreml: {
715
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/coreml/camstack-yolov8s-seg.mlpackage"),
716
- sizeMB: 23
717
- },
718
- openvino: {
719
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/openvino/camstack-yolov8s-seg.xml"),
720
- sizeMB: 23
721
- }
722
- }
723
- },
724
- {
725
- id: "yolov8m-seg",
726
- name: "YOLOv8 Medium Segmentation",
727
- description: "YOLOv8 Medium \u2014 higher accuracy instance segmentation",
728
- inputSize: { width: 640, height: 640 },
729
- labels: COCO_80_LABELS,
730
- formats: {
731
- onnx: {
732
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/onnx/camstack-yolov8m-seg.onnx"),
733
- sizeMB: 104
734
- },
735
- coreml: {
736
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/coreml/camstack-yolov8m-seg.mlpackage"),
737
- sizeMB: 52
738
- },
739
- openvino: {
740
- url: hfModelUrl(HF_REPO8, "segmentation/yolov8-seg/openvino/camstack-yolov8m-seg.xml"),
741
- sizeMB: 53
742
- }
743
- }
744
- }
745
- ];
746
-
747
- // src/catalogs/animal-classification-models.ts
748
- var hf = (path) => hfModelUrl(HF_REPO, path);
749
- var BIRD_LABEL = { id: "species", name: "Bird Species" };
750
- var ANIMAL_TYPE_LABEL = { id: "animal-type", name: "Animal Type" };
751
- var BIRD_SPECIES_MODELS = [
752
- {
753
- id: "bird-species-525",
754
- name: "Bird Species (525)",
755
- description: "EfficientNet bird species classifier \u2014 525 species, MIT license",
756
- inputSize: { width: 224, height: 224 },
757
- inputNormalization: "imagenet",
758
- labels: [BIRD_LABEL],
759
- formats: {
760
- onnx: { url: hf("animalClassification/bird-species/onnx/camstack-bird-species-525.onnx"), sizeMB: 32 }
761
- }
762
- }
763
- ];
764
- var BIRD_NABIRDS_MODELS = [
765
- {
766
- id: "bird-nabirds-404",
767
- name: "NABirds (404 species)",
768
- description: "ResNet50 trained on NABirds \u2014 404 North American species with ONNX, CoreML, OpenVINO",
769
- inputSize: { width: 224, height: 224 },
770
- inputNormalization: "imagenet",
771
- labels: [{ id: "species", name: "Bird Species" }],
772
- formats: {
773
- onnx: { url: hf("animalClassification/bird-nabirds/onnx/camstack-bird-nabirds-404.onnx"), sizeMB: 93 },
774
- coreml: { url: hf("animalClassification/bird-nabirds/coreml/camstack-bird-nabirds-404.mlpackage"), sizeMB: 47 },
775
- openvino: { url: hf("animalClassification/bird-nabirds/openvino/camstack-bird-nabirds-404.xml"), sizeMB: 47 }
776
- }
777
- }
778
- ];
779
- var ANIMAL_TYPE_MODELS = [
780
- {
781
- id: "animals-10",
782
- name: "Animal Classifier (10)",
783
- description: "ViT-based animal type classifier \u2014 cat, cow, dog, dolphin, eagle, panda, horse, monkey, sheep, spider",
784
- inputSize: { width: 224, height: 224 },
785
- inputNormalization: "imagenet",
786
- labels: [ANIMAL_TYPE_LABEL],
787
- formats: {
788
- onnx: { url: hf("animalClassification/animals-10/onnx/camstack-animals-10.onnx"), sizeMB: 328 }
789
- }
790
- }
791
- ];
592
+ // src/types/device-type.ts
593
+ var DeviceType = /* @__PURE__ */ ((DeviceType2) => {
594
+ DeviceType2["Camera"] = "camera";
595
+ return DeviceType2;
596
+ })(DeviceType || {});
597
+ var DEVICE_TYPE_INFO = {
598
+ ["camera" /* Camera */]: { type: "camera" /* Camera */, label: "Camera", icon: "camera" }
599
+ };
792
600
  // Annotate the CommonJS export names for ESM import in node:
793
601
  0 && (module.exports = {
794
- ANIMAL_TYPE_MODELS,
795
- AUDIO_CLASSIFICATION_MODELS,
796
- BIRD_NABIRDS_MODELS,
797
- BIRD_SPECIES_MODELS,
602
+ BINARY_FRAME_HEADER_SIZE,
603
+ BINARY_FRAME_TYPE,
798
604
  COCO_80_LABELS,
799
605
  COCO_TO_MACRO,
800
- FACE_DETECTION_MODELS,
801
- FACE_RECOGNITION_MODELS,
606
+ DEFAULT_FEATURES,
607
+ DEFAULT_LOCATION_SUBPATHS,
608
+ DEFAULT_RETENTION,
609
+ DETECTION_TYPES,
610
+ DEVICE_TYPE_INFO,
611
+ DeviceType,
802
612
  HF_BASE_URL,
803
613
  HF_REPO,
804
614
  MACRO_LABELS,
805
- OBJECT_DETECTION_MODELS,
806
- PLATE_DETECTION_MODELS,
807
- PLATE_RECOGNITION_MODELS,
808
- SEGMENTATION_MODELS,
809
- hfModelUrl
615
+ READ_ONLY_SECTIONS,
616
+ RECOGNITION_TYPES,
617
+ SETTINGS_TABS,
618
+ SUB_DETECTION_TYPES,
619
+ SYSTEM_SETTINGS_SCHEMAS,
620
+ cosineSimilarity,
621
+ createAnalysisContext,
622
+ enrichContext,
623
+ getSystemSettingsSchema,
624
+ hfModelUrl,
625
+ resolveTranslation
810
626
  });
811
627
  //# sourceMappingURL=index.js.map