@camstack/addon-pipeline 1.2.294 → 1.2.295

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 (39) hide show
  1. package/THIRD_PARTY_MODELS.md +233 -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-CAUBVbgK.mjs} +107 -54
  5. package/dist/{default-detection-model-D24AJOTn.js → default-detection-model-wNEISVA9.js} +107 -54
  6. package/dist/detection-pipeline/index.js +284 -457
  7. package/dist/detection-pipeline/index.mjs +284 -457
  8. package/dist/{dist-CJR259Xf.js → dist-BsVcf5wO.js} +1310 -832
  9. package/dist/{dist-RXbmRAwP.mjs → dist-CuxSNLKW.mjs} +1305 -833
  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-Cqb1QiXk.mjs} +1 -1
  13. package/dist/{node-DWg9zbY1.js → node-UFk6I2f6.js} +1 -1
  14. package/dist/pipeline-runner/index.js +189 -70
  15. package/dist/pipeline-runner/index.mjs +189 -70
  16. package/dist/{process-memory-BJUXvTjd.js → process-memory-CJV29sPf.js} +1 -1
  17. package/dist/{process-memory-BgFOHFnx.mjs → process-memory-D0Nvs9rr.mjs} +1 -1
  18. package/dist/recorder/index.js +12 -2
  19. package/dist/recorder/index.mjs +12 -2
  20. package/dist/{segment-demux-js-C_fPJub3.js → segment-demux-js-DGwmf5hu.js} +1 -1
  21. package/dist/{segment-demux-js-G7wFpHzn.mjs → segment-demux-js-DIDWw1iE.mjs} +1 -1
  22. package/dist/stream-broker/_stub.js +2 -2
  23. 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-B7nBFqva.mjs} +2 -2
  24. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CCIyBvRa.mjs +26 -0
  25. 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 → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DeD_UFdb.mjs} +1 -1
  26. package/dist/stream-broker/demux-worker-child.js +1 -1
  27. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  28. package/dist/stream-broker/{hostInit-BBYHWS3M.mjs → hostInit-BKlb3qac.mjs} +2 -2
  29. package/dist/stream-broker/index.js +3 -3
  30. package/dist/stream-broker/index.mjs +3 -3
  31. package/dist/stream-broker/remoteEntry.js +1 -1
  32. package/package.json +3 -2
  33. package/python/postprocessors/__init__.py +2 -0
  34. package/python/postprocessors/ssd.py +73 -17
  35. package/python/postprocessors/test_ssd.py +205 -0
  36. package/python/postprocessors/test_yunet.py +292 -0
  37. package/python/postprocessors/testdata/ssdlite_mobiledet_outputs.json +1 -0
  38. package/python/postprocessors/yunet.py +275 -0
  39. 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
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CJR259Xf.js");
1
+ const require_dist = require("./dist-BsVcf5wO.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",
@@ -1574,7 +1625,8 @@ var STEP_FACE_DETECTION = new PipelineStepBase({
1574
1625
  inputClasses: ["person"],
1575
1626
  outputClasses: ["face"],
1576
1627
  models: [...FACE_DETECTION_MODELS],
1577
- defaultModelId: "scrfd-2.5g",
1628
+ defaultModelId: "yunet-2023mar",
1629
+ defaultModelIdByFormat: { tflite: "scrfd-2.5g" },
1578
1630
  defaultConfidence: .5,
1579
1631
  defaultMinParentScore: .7,
1580
1632
  cadence: {
@@ -1819,11 +1871,12 @@ function getStepDefinition(stepId) {
1819
1871
  * has a build for `format`.
1820
1872
  * 2. `def.defaultModelId` — the step's plain declared default — if it
1821
1873
  * 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
1874
+ * 3. The smallest-by-size NON-legacy model among those with a `format`
1875
+ * build (fallback, preserved for steps/formats with no declared
1824
1876
  * preference reachable).
1825
- * 4. `def.defaultModelId` unchanged, when ZERO models have a `format`
1826
- * build — an unloadable case flagged elsewhere, not resolved here.
1877
+ * 4. When NO non-legacy model has a `format` build — an unloadable case
1878
+ * flagged elsewhere, not resolved here — the declared per-format id if
1879
+ * there is one, else `def.defaultModelId`, unchanged.
1827
1880
  */
1828
1881
  function getDefaultModelForFormat(stepId, format) {
1829
1882
  return getDefaultModelForFormatFromDef(getStepDefinition(stepId), format);
@@ -1841,7 +1894,7 @@ function getDefaultModelForFormatFromDef(def, format) {
1841
1894
  if (declaredForFormat !== void 0 && hasFormatBuild(declaredForFormat)) return declaredForFormat;
1842
1895
  if (hasFormatBuild(def.defaultModelId)) return def.defaultModelId;
1843
1896
  const available = def.models.filter((m) => m.formats[format] && m.legacy !== true);
1844
- if (available.length === 0) return def.defaultModelId;
1897
+ if (available.length === 0) return declaredForFormat ?? def.defaultModelId;
1845
1898
  return [...available].toSorted((a, b) => {
1846
1899
  return (a.formats[format]?.sizeMB ?? Infinity) - (b.formats[format]?.sizeMB ?? Infinity);
1847
1900
  })[0].id;