@camstack/addon-pipeline 1.2.294 → 1.2.296

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/THIRD_PARTY_MODELS.md +241 -0
  2. package/dist/audio-analyzer/index.js +2 -2
  3. package/dist/audio-analyzer/index.mjs +2 -2
  4. package/dist/{default-detection-model-0dPKRKUD.mjs → default-detection-model-Co578D8C.mjs} +181 -99
  5. package/dist/{default-detection-model-D24AJOTn.js → default-detection-model-D1daTtqT.js} +181 -99
  6. package/dist/detection-pipeline/index.js +1301 -531
  7. package/dist/detection-pipeline/index.mjs +1301 -531
  8. package/dist/{dist-CJR259Xf.js → dist-8up-f2TX.js} +3688 -2698
  9. package/dist/{dist-RXbmRAwP.mjs → dist-CCd0Q3nr.mjs} +3676 -2698
  10. package/dist/motion-wasm/index.js +1 -1
  11. package/dist/motion-wasm/index.mjs +1 -1
  12. package/dist/{node-atmRSHPk.mjs → node-DgMSXSWP.mjs} +1 -1
  13. package/dist/{node-DWg9zbY1.js → node-lpQgHes9.js} +1 -1
  14. package/dist/pipeline-runner/index.js +975 -270
  15. package/dist/pipeline-runner/index.mjs +975 -270
  16. package/dist/{process-memory-BJUXvTjd.js → process-memory-CX_92V_r.js} +1 -1
  17. package/dist/{process-memory-BgFOHFnx.mjs → process-memory-DFC_O5zE.mjs} +1 -1
  18. package/dist/recorder/index.js +14 -6
  19. package/dist/recorder/index.mjs +14 -6
  20. package/dist/{segment-demux-js-C_fPJub3.js → segment-demux-js-DzBx6NN2.js} +1 -1
  21. package/dist/{segment-demux-js-G7wFpHzn.mjs → segment-demux-js-FZbBuk3F.mjs} +1 -1
  22. package/dist/session-decode/{decode-worker-child.js → decode-worker-main.js} +481 -72
  23. package/dist/session-decode/{decode-worker-child.mjs → decode-worker-main.mjs} +482 -71
  24. package/dist/stream-broker/_stub.js +2 -2
  25. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-6IyM-BIn.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-C_i7oFBl.mjs} +2 -2
  26. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DUGQKsKL.mjs +26 -0
  27. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CkbplMHA.mjs +26 -0
  28. package/dist/stream-broker/demux-worker-child.js +1 -1
  29. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  30. package/dist/stream-broker/{hostInit-BBYHWS3M.mjs → hostInit-BPtppL3W.mjs} +2 -2
  31. package/dist/stream-broker/index.js +4 -4
  32. package/dist/stream-broker/index.mjs +4 -4
  33. package/dist/stream-broker/remoteEntry.js +1 -1
  34. package/dist/{worker-protocol-B2MfQLlu.js → worker-protocol-C-G8qmye.js} +3 -1
  35. package/dist/{worker-protocol-C_W-P_g-.mjs → worker-protocol-D_NzPcnh.mjs} +3 -1
  36. package/package.json +3 -2
  37. package/python/inference_pool.py +422 -64
  38. package/python/postprocessors/__init__.py +2 -0
  39. package/python/postprocessors/ssd.py +73 -17
  40. package/python/postprocessors/test_ssd.py +205 -0
  41. package/python/postprocessors/test_yunet.py +292 -0
  42. package/python/postprocessors/testdata/ssdlite_mobiledet_outputs.json +1 -0
  43. package/python/postprocessors/yunet.py +275 -0
  44. package/python/test_inference_pool_compile_off_loop.py +414 -0
  45. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-6IHzlLJ_.mjs +0 -26
  46. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DoyA71_q.mjs +0 -26
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CJR259Xf.js");
1
+ const require_dist = require("./dist-8up-f2TX.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  //#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
4
4
  /**
@@ -384,6 +384,24 @@ var OBJECT_DETECTION_MODELS = [
384
384
  runtimes: ["python"]
385
385
  } }
386
386
  },
387
+ {
388
+ id: "ssdlite-mobiledet-coco-edgetpu",
389
+ name: "SSDLite MobileDet (Coral)",
390
+ description: "SSDLite MobileDet COCO (QAT) — EdgeTPU-compiled full-integer TFLite, 320×320; runs on the Coral USB Edge TPU. More accurate than SSD MobileNet V2 (32.9 vs 25.6 % COCO mAP, Coral-published). Scores top out near 0.77.",
391
+ inputSize: {
392
+ width: 320,
393
+ height: 320
394
+ },
395
+ labels: [],
396
+ preprocessMode: "letterbox",
397
+ postprocessor: "ssd",
398
+ license: "Apache-2.0",
399
+ formats: { tflite: {
400
+ url: hf("objectDetection/ssdlite-mobiledet/edgetpu/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite"),
401
+ sizeMB: 5.1,
402
+ runtimes: ["python"]
403
+ } }
404
+ },
387
405
  ovPrecisionVariant("yolo26n", "objectDetection/yolo26/openvino", "YOLO26 Nano", "fp16", 5, true),
388
406
  ovPrecisionVariant("yolo26n", "objectDetection/yolo26/openvino", "YOLO26 Nano", "int8", 3),
389
407
  ovPrecisionVariant("yolo26s", "objectDetection/yolo26/openvino", "YOLO26 Small", "fp16", 19, true),
@@ -502,57 +520,90 @@ var OBJECT_DETECTION_MODELS = [
502
520
  * A retired id resolves to the step's format default instead.
503
521
  */
504
522
  var RETIRED_MODEL_IDS = { "face-detection": ["scrypted-yolov9t-face"] };
505
- var FACE_DETECTION_MODELS = [{
506
- id: "scrfd-2.5g",
507
- name: "SCRFD 2.5G",
508
- description: "SCRFD 2.5G bnkps — balanced face detection with 5 keypoints (WIDER FACE 93.80/92.02/77.13). InsightFace pretrained weights.",
509
- inputSize: {
510
- width: 640,
511
- height: 640
523
+ var FACE_DETECTION_MODELS = [
524
+ {
525
+ id: "scrfd-2.5g",
526
+ name: "SCRFD 2.5G",
527
+ description: "SCRFD 2.5G bnkps — balanced face detection with 5 keypoints (WIDER FACE 93.80/92.02/77.13). InsightFace pretrained weights.",
528
+ inputSize: {
529
+ width: 640,
530
+ height: 640
531
+ },
532
+ labels: [{
533
+ id: "face",
534
+ name: "Face"
535
+ }],
536
+ preprocessMode: "letterbox",
537
+ inputNormalization: "scrfd",
538
+ license: "InsightFace-NonCommercial-Research",
539
+ formats: {
540
+ onnx: {
541
+ url: hf("faceDetection/scrfd/onnx/camstack-scrfd-2.5g.onnx"),
542
+ sizeMB: 3.1
543
+ },
544
+ coreml: {
545
+ url: hf("faceDetection/scrfd/coreml/camstack-scrfd-2.5g.mlpackage"),
546
+ sizeMB: 1.7,
547
+ isDirectory: true,
548
+ files: [...MLPACKAGE_FILES],
549
+ runtimes: ["python"]
550
+ },
551
+ openvino: ovFormat(hf("faceDetection/scrfd/openvino/camstack-scrfd-2.5g.xml"), 1.8)
552
+ }
512
553
  },
513
- labels: [{
514
- id: "face",
515
- name: "Face"
516
- }],
517
- preprocessMode: "letterbox",
518
- inputNormalization: "scrfd",
519
- license: "InsightFace-NonCommercial-Research",
520
- formats: {
521
- onnx: {
522
- url: hf("faceDetection/scrfd/onnx/camstack-scrfd-2.5g.onnx"),
523
- sizeMB: 3.1
554
+ {
555
+ id: "yunet-2023mar",
556
+ name: "YuNet 2023mar",
557
+ description: "YuNet (OpenCV Zoo, 2023mar) — tiny face detector with 5 keypoints, MIT weights (WIDER FACE AP 0.884/0.866/0.750). ~0.2 MB. Trained on WIDER FACE (CC BY-NC-ND images).",
558
+ inputSize: {
559
+ width: 640,
560
+ height: 640
524
561
  },
525
- coreml: {
526
- url: hf("faceDetection/scrfd/coreml/camstack-scrfd-2.5g.mlpackage"),
527
- sizeMB: 1.7,
528
- isDirectory: true,
529
- files: [...MLPACKAGE_FILES],
530
- runtimes: ["python"]
562
+ labels: [{
563
+ id: "face",
564
+ name: "Face"
565
+ }],
566
+ preprocessMode: "letterbox",
567
+ postprocessor: "yunet",
568
+ license: "MIT",
569
+ formats: {
570
+ onnx: {
571
+ url: hf("faceDetection/yunet/onnx/camstack-yunet-2023mar.onnx"),
572
+ sizeMB: .23
573
+ },
574
+ coreml: {
575
+ url: hf("faceDetection/yunet/coreml/camstack-yunet-2023mar.mlpackage"),
576
+ sizeMB: .2,
577
+ isDirectory: true,
578
+ files: [...MLPACKAGE_FILES],
579
+ runtimes: ["python"]
580
+ },
581
+ openvino: ovFormat(hf("faceDetection/yunet/openvino/camstack-yunet-2023mar.xml"), .36)
582
+ }
583
+ },
584
+ {
585
+ id: "ssd-mobilenet-v2-face-edgetpu",
586
+ legacy: true,
587
+ name: "SSD MobileNet V2 Face (Coral)",
588
+ description: "SSD MobileNet V2 face detector — EdgeTPU-compiled full-integer TFLite, 320×320; runs on the Coral USB Edge TPU. Requires an ssd-face postprocessor (not yet available).",
589
+ inputSize: {
590
+ width: 320,
591
+ height: 320
531
592
  },
532
- openvino: ovFormat(hf("faceDetection/scrfd/openvino/camstack-scrfd-2.5g.xml"), 1.8)
593
+ labels: [{
594
+ id: "face",
595
+ name: "Face"
596
+ }],
597
+ preprocessMode: "letterbox",
598
+ postprocessor: "ssd",
599
+ license: "Apache-2.0",
600
+ formats: { tflite: {
601
+ url: "https://github.com/google-coral/test_data/raw/master/ssd_mobilenet_v2_face_quant_postprocess_edgetpu.tflite",
602
+ sizeMB: 6.7,
603
+ runtimes: ["python"]
604
+ } }
533
605
  }
534
- }, {
535
- id: "ssd-mobilenet-v2-face-edgetpu",
536
- legacy: true,
537
- name: "SSD MobileNet V2 Face (Coral)",
538
- description: "SSD MobileNet V2 face detector — EdgeTPU-compiled full-integer TFLite, 320×320; runs on the Coral USB Edge TPU. Requires an ssd-face postprocessor (not yet available).",
539
- inputSize: {
540
- width: 320,
541
- height: 320
542
- },
543
- labels: [{
544
- id: "face",
545
- name: "Face"
546
- }],
547
- preprocessMode: "letterbox",
548
- postprocessor: "ssd",
549
- license: "Apache-2.0",
550
- formats: { tflite: {
551
- url: "https://github.com/google-coral/test_data/raw/master/ssd_mobilenet_v2_face_quant_postprocess_edgetpu.tflite",
552
- sizeMB: 6.7,
553
- runtimes: ["python"]
554
- } }
555
- }];
606
+ ];
556
607
  var FACE_EMBEDDING_MODELS = [
557
608
  {
558
609
  id: "arcface-r100",
@@ -1133,55 +1184,84 @@ var INSTANCE_SEGMENTATION_MODELS = [
1133
1184
  }
1134
1185
  }
1135
1186
  ];
1136
- var CLIP_EMBEDDING_MODELS = [{
1137
- id: "mobileclip-s1",
1138
- name: "MobileCLIP S1",
1139
- description: "MobileCLIP S1 — Apple balanced CLIP vision encoder, 512-dim, 256×256 (fp16 OpenVINO/CoreML)",
1140
- inputSize: {
1141
- width: 256,
1142
- height: 256
1187
+ var CLIP_EMBEDDING_MODELS = [
1188
+ {
1189
+ id: "mobileclip-s1",
1190
+ name: "MobileCLIP S1",
1191
+ description: "MobileCLIP S1 — Apple balanced CLIP vision encoder, 512-dim, 256×256 (fp16 OpenVINO/CoreML)",
1192
+ inputSize: {
1193
+ width: 256,
1194
+ height: 256
1195
+ },
1196
+ labels: [{
1197
+ id: "embedding",
1198
+ name: "CLIP Embedding"
1199
+ }],
1200
+ preprocessMode: "resize",
1201
+ inputNormalization: "none",
1202
+ formats: {
1203
+ openvino: ovFormat(hf("clip/mobileclip-s1/openvino/camstack-mobileclip-s1-vision.xml"), 55),
1204
+ coreml: {
1205
+ url: hf("clip/mobileclip-s1/coreml/camstack-mobileclip-s1-vision.mlpackage"),
1206
+ sizeMB: 65,
1207
+ isDirectory: true,
1208
+ files: [...MLPACKAGE_FILES],
1209
+ runtimes: ["python"]
1210
+ }
1211
+ }
1143
1212
  },
1144
- labels: [{
1145
- id: "embedding",
1146
- name: "CLIP Embedding"
1147
- }],
1148
- preprocessMode: "resize",
1149
- inputNormalization: "none",
1150
- formats: {
1151
- openvino: ovFormat(hf("clip/mobileclip-s1/openvino/camstack-mobileclip-s1-vision.xml"), 55),
1152
- coreml: {
1153
- url: hf("clip/mobileclip-s1/coreml/camstack-mobileclip-s1-vision.mlpackage"),
1154
- sizeMB: 65,
1155
- isDirectory: true,
1156
- files: [...MLPACKAGE_FILES],
1157
- runtimes: ["python"]
1213
+ {
1214
+ id: "mobileclip-s2",
1215
+ name: "MobileCLIP S2",
1216
+ description: "MobileCLIP S2 — Apple high-accuracy CLIP vision encoder, 512-dim, 256×256 (fp16 OpenVINO/CoreML)",
1217
+ inputSize: {
1218
+ width: 256,
1219
+ height: 256
1220
+ },
1221
+ labels: [{
1222
+ id: "embedding",
1223
+ name: "CLIP Embedding"
1224
+ }],
1225
+ preprocessMode: "resize",
1226
+ inputNormalization: "none",
1227
+ formats: {
1228
+ openvino: ovFormat(hf("clip/mobileclip-s2/openvino/camstack-mobileclip-s2-vision.xml"), 90),
1229
+ coreml: {
1230
+ url: hf("clip/mobileclip-s2/coreml/camstack-mobileclip-s2-vision.mlpackage"),
1231
+ sizeMB: 110,
1232
+ isDirectory: true,
1233
+ files: [...MLPACKAGE_FILES],
1234
+ runtimes: ["python"]
1235
+ }
1158
1236
  }
1159
- }
1160
- }, {
1161
- id: "mobileclip-s2",
1162
- name: "MobileCLIP S2",
1163
- description: "MobileCLIP S2 — Apple high-accuracy CLIP vision encoder, 512-dim, 256×256 (fp16 OpenVINO/CoreML)",
1164
- inputSize: {
1165
- width: 256,
1166
- height: 256
1167
1237
  },
1168
- labels: [{
1169
- id: "embedding",
1170
- name: "CLIP Embedding"
1171
- }],
1172
- preprocessMode: "resize",
1173
- inputNormalization: "none",
1174
- formats: {
1175
- openvino: ovFormat(hf("clip/mobileclip-s2/openvino/camstack-mobileclip-s2-vision.xml"), 90),
1176
- coreml: {
1177
- url: hf("clip/mobileclip-s2/coreml/camstack-mobileclip-s2-vision.mlpackage"),
1178
- sizeMB: 110,
1179
- isDirectory: true,
1180
- files: [...MLPACKAGE_FILES],
1181
- runtimes: ["python"]
1238
+ {
1239
+ id: "siglip2-b16-224",
1240
+ name: "SigLIP2 B/16",
1241
+ description: "Google SigLIP2 base, patch 16, 224×224 — Apache-2.0 CLIP vision encoder, 768-dim (fp16 OpenVINO/CoreML)",
1242
+ inputSize: {
1243
+ width: 224,
1244
+ height: 224
1245
+ },
1246
+ labels: [{
1247
+ id: "embedding",
1248
+ name: "CLIP Embedding"
1249
+ }],
1250
+ preprocessMode: "resize",
1251
+ inputNormalization: "none",
1252
+ license: "Apache-2.0",
1253
+ formats: {
1254
+ openvino: ovFormat(hf("clip/siglip2/openvino/camstack-siglip2-b16-224-vision.xml"), 186),
1255
+ coreml: {
1256
+ url: hf("clip/siglip2/coreml/camstack-siglip2-b16-224-vision.mlpackage"),
1257
+ sizeMB: 185,
1258
+ isDirectory: true,
1259
+ files: [...MLPACKAGE_FILES],
1260
+ runtimes: ["python"]
1261
+ }
1182
1262
  }
1183
1263
  }
1184
- }];
1264
+ ];
1185
1265
  var AUDIO_CLASSIFIER_MODELS = [{
1186
1266
  id: "yamnet-onnx",
1187
1267
  name: "YAMNet",
@@ -1574,7 +1654,8 @@ var STEP_FACE_DETECTION = new PipelineStepBase({
1574
1654
  inputClasses: ["person"],
1575
1655
  outputClasses: ["face"],
1576
1656
  models: [...FACE_DETECTION_MODELS],
1577
- defaultModelId: "scrfd-2.5g",
1657
+ defaultModelId: "yunet-2023mar",
1658
+ defaultModelIdByFormat: { tflite: "scrfd-2.5g" },
1578
1659
  defaultConfidence: .5,
1579
1660
  defaultMinParentScore: .7,
1580
1661
  cadence: {
@@ -1619,7 +1700,7 @@ var STEP_FACE_EMBEDDING = new FaceEmbeddingStep({
1619
1700
  outputClasses: ["identity"],
1620
1701
  labelTier: 2,
1621
1702
  models: [...FACE_EMBEDDING_MODELS],
1622
- defaultModelId: "arcface-r100",
1703
+ defaultModelId: "auraface-r100",
1623
1704
  modelScope: "cluster",
1624
1705
  defaultConfidence: 0,
1625
1706
  cadence: {
@@ -1819,11 +1900,12 @@ function getStepDefinition(stepId) {
1819
1900
  * has a build for `format`.
1820
1901
  * 2. `def.defaultModelId` — the step's plain declared default — if it
1821
1902
  * exists in `def.models` AND has a build for `format`.
1822
- * 3. The smallest-by-size model among those with a `format` build
1823
- * (legacy fallback, preserved for steps/formats with no declared
1903
+ * 3. The smallest-by-size NON-legacy model among those with a `format`
1904
+ * build (fallback, preserved for steps/formats with no declared
1824
1905
  * preference reachable).
1825
- * 4. `def.defaultModelId` unchanged, when ZERO models have a `format`
1826
- * build — an unloadable case flagged elsewhere, not resolved here.
1906
+ * 4. When NO non-legacy model has a `format` build — an unloadable case
1907
+ * flagged elsewhere, not resolved here — the declared per-format id if
1908
+ * there is one, else `def.defaultModelId`, unchanged.
1827
1909
  */
1828
1910
  function getDefaultModelForFormat(stepId, format) {
1829
1911
  return getDefaultModelForFormatFromDef(getStepDefinition(stepId), format);
@@ -1841,7 +1923,7 @@ function getDefaultModelForFormatFromDef(def, format) {
1841
1923
  if (declaredForFormat !== void 0 && hasFormatBuild(declaredForFormat)) return declaredForFormat;
1842
1924
  if (hasFormatBuild(def.defaultModelId)) return def.defaultModelId;
1843
1925
  const available = def.models.filter((m) => m.formats[format] && m.legacy !== true);
1844
- if (available.length === 0) return def.defaultModelId;
1926
+ if (available.length === 0) return declaredForFormat ?? def.defaultModelId;
1845
1927
  return [...available].toSorted((a, b) => {
1846
1928
  return (a.formats[format]?.sizeMB ?? Infinity) - (b.formats[format]?.sizeMB ?? Infinity);
1847
1929
  })[0].id;