@camstack/addon-pipeline 1.2.4 → 1.2.6

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 (34) hide show
  1. package/dist/audio-analyzer/index.js +1 -1
  2. package/dist/audio-analyzer/index.mjs +1 -1
  3. package/dist/detection-pipeline/index.js +499 -30
  4. package/dist/detection-pipeline/index.mjs +493 -24
  5. package/dist/{dist-D7-LF079.js → dist-Bh0H8jM6.js} +61 -4
  6. package/dist/{dist-DVjpngiC.mjs → dist-Bw_V5L0r.mjs} +61 -4
  7. package/dist/motion-wasm/index.js +1 -1
  8. package/dist/motion-wasm/index.mjs +1 -1
  9. package/dist/pipeline-runner/index.js +19 -9
  10. package/dist/pipeline-runner/index.mjs +19 -9
  11. package/dist/recorder/index.js +1 -1
  12. package/dist/recorder/index.mjs +1 -1
  13. package/dist/{step-definitions-BPwND8Zg.mjs → step-definitions-aY4D9Loy.mjs} +241 -116
  14. package/dist/{step-definitions-BfXdDokR.js → step-definitions-xxdpJX9-.js} +241 -116
  15. package/dist/stream-broker/_stub.js +2 -2
  16. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DHZ9LbMC.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DX-Ef8CP.mjs} +2 -2
  17. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-gchR4WlX.mjs +26 -0
  18. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BdxY9zld.mjs +26 -0
  19. package/dist/stream-broker/{hostInit-CpoOj-Zh.mjs → hostInit-DUL71Vjq.mjs} +2 -2
  20. package/dist/stream-broker/index.js +1 -1
  21. package/dist/stream-broker/index.mjs +1 -1
  22. package/dist/stream-broker/remoteEntry.js +1 -1
  23. package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-L6rscpzL.js → MaskShapeCanvas-DI4BY7W2-CGWEeRkz.js} +1 -1
  24. package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-CK9BVkOT.js → MotionZonesSettings-NcxxQN8r-4YbTa3Wp.js} +1 -1
  25. package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-CNcYwFLg.js → PrivacyMaskSettings-APgPLF7p-DL_tAs9-.js} +1 -1
  26. package/embed-dist/assets/{index-CBhJRpiC.js → index-CvBwcYl_.js} +13 -13
  27. package/embed-dist/index.html +1 -1
  28. package/package.json +1 -1
  29. package/python/postprocessors/ctc.py +228 -4
  30. package/python/postprocessors/test_ctc.py +312 -0
  31. package/python/postprocessors/testdata/ctc_degenerate_lowres_logits.npy.gz.b64 +1 -0
  32. package/python/postprocessors/testdata/ctc_dwro309_logits.npy.gz.b64 +1 -0
  33. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CQC_f4Yv.mjs +0 -26
  34. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-5Zc9wj-A.mjs +0 -26
@@ -1,4 +1,4 @@
1
- import { E as hfModelUrl, a as COCO_TO_MACRO, i as COCO_80_LABELS, r as AUDIO_MACRO_LABELS } from "./dist-DVjpngiC.mjs";
1
+ import { E as hfModelUrl, a as COCO_TO_MACRO, i as COCO_80_LABELS, r as AUDIO_MACRO_LABELS } from "./dist-Bw_V5L0r.mjs";
2
2
  //#region src/detection-pipeline/registry/model-catalogs.ts
3
3
  var HF_REPO = "camstack/camstack-models";
4
4
  var HF_SCRYPTED = "scrypted/plugin-models";
@@ -469,61 +469,86 @@ var OBJECT_DETECTION_MODELS = [
469
469
  ovPrecisionVariant("yolo26x", "objectDetection/yolo26/openvino", "YOLO26 XLarge", "fp16", 112, true),
470
470
  ovPrecisionVariant("yolo26x", "objectDetection/yolo26/openvino", "YOLO26 XLarge", "int8", 56, true)
471
471
  ];
472
- var FACE_DETECTION_MODELS = [{
473
- id: "scrfd-2.5g",
474
- name: "SCRFD 2.5G",
475
- description: "SCRFD 2.5G — balanced face detection model",
476
- inputSize: {
477
- width: 640,
478
- height: 640
479
- },
480
- labels: [{
481
- id: "face",
482
- name: "Face"
483
- }],
484
- preprocessMode: "letterbox",
485
- formats: {
486
- onnx: {
487
- url: hf("faceDetection/scrfd/onnx/camstack-scrfd-2.5g.onnx"),
488
- sizeMB: 3.1
472
+ var FACE_DETECTION_MODELS = [
473
+ {
474
+ id: "scrfd-2.5g",
475
+ name: "SCRFD 2.5G",
476
+ description: "SCRFD 2.5G — balanced face detection model",
477
+ inputSize: {
478
+ width: 640,
479
+ height: 640
489
480
  },
490
- coreml: {
491
- url: hf("faceDetection/scrfd/coreml/camstack-scrfd-2.5g.mlpackage"),
492
- sizeMB: 1.7,
493
- isDirectory: true,
494
- files: [...MLPACKAGE_FILES],
495
- runtimes: ["python"]
481
+ labels: [{
482
+ id: "face",
483
+ name: "Face"
484
+ }],
485
+ preprocessMode: "letterbox",
486
+ formats: {
487
+ onnx: {
488
+ url: hf("faceDetection/scrfd/onnx/camstack-scrfd-2.5g.onnx"),
489
+ sizeMB: 3.1
490
+ },
491
+ coreml: {
492
+ url: hf("faceDetection/scrfd/coreml/camstack-scrfd-2.5g.mlpackage"),
493
+ sizeMB: 1.7,
494
+ isDirectory: true,
495
+ files: [...MLPACKAGE_FILES],
496
+ runtimes: ["python"]
497
+ },
498
+ openvino: ovFormat(hf("faceDetection/scrfd/openvino/camstack-scrfd-2.5g.xml"), 1.8)
499
+ }
500
+ },
501
+ {
502
+ id: "scrypted-yolov9t-face",
503
+ name: "YOLOv9t Face ReLU",
504
+ description: "YOLOv9t face detection — YOLO-based, fast, 320x320 ReLU",
505
+ inputSize: {
506
+ width: 320,
507
+ height: 320
496
508
  },
497
- openvino: ovFormat(hf("faceDetection/scrfd/openvino/camstack-scrfd-2.5g.xml"), 1.8)
498
- }
499
- }, {
500
- id: "scrypted-yolov9t-face",
501
- name: "YOLOv9t Face ReLU",
502
- description: "YOLOv9t face detection — YOLO-based, fast, 320x320 ReLU",
503
- inputSize: {
504
- width: 320,
505
- height: 320
509
+ labels: [{
510
+ id: "face",
511
+ name: "Face"
512
+ }],
513
+ preprocessMode: "letterbox",
514
+ formats: {
515
+ onnx: {
516
+ url: hfScrypted("onnx/scrypted_yolov9t_relu_face/scrypted_yolov9t_relu_face.onnx"),
517
+ sizeMB: 8.1
518
+ },
519
+ coreml: {
520
+ url: hfScrypted("coreml/scrypted_yolov9t_relu_face/scrypted_yolov9t_relu_face.mlpackage"),
521
+ sizeMB: 4,
522
+ isDirectory: true,
523
+ files: [...MLPACKAGE_FILES],
524
+ runtimes: ["python"]
525
+ },
526
+ openvino: ovFormat(hf("faceDetection/scrypted-yolov9-face/openvino/scrypted_yolov9t_relu_face.xml"), 6)
527
+ }
506
528
  },
507
- labels: [{
508
- id: "face",
509
- name: "Face"
510
- }],
511
- preprocessMode: "letterbox",
512
- formats: {
513
- onnx: {
514
- url: hfScrypted("onnx/scrypted_yolov9t_relu_face/scrypted_yolov9t_relu_face.onnx"),
515
- sizeMB: 8.1
529
+ {
530
+ id: "ssd-mobilenet-v2-face-edgetpu",
531
+ legacy: true,
532
+ name: "SSD MobileNet V2 Face (Coral)",
533
+ 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).",
534
+ inputSize: {
535
+ width: 320,
536
+ height: 320
516
537
  },
517
- coreml: {
518
- url: hfScrypted("coreml/scrypted_yolov9t_relu_face/scrypted_yolov9t_relu_face.mlpackage"),
519
- sizeMB: 4,
520
- isDirectory: true,
521
- files: [...MLPACKAGE_FILES],
538
+ labels: [{
539
+ id: "face",
540
+ name: "Face"
541
+ }],
542
+ preprocessMode: "letterbox",
543
+ postprocessor: "ssd",
544
+ license: "Apache-2.0",
545
+ formats: { tflite: {
546
+ url: "https://github.com/google-coral/test_data/raw/master/ssd_mobilenet_v2_face_quant_postprocess_edgetpu.tflite",
547
+ sizeMB: 6.7,
522
548
  runtimes: ["python"]
523
- },
524
- openvino: ovFormat(hf("faceDetection/scrypted-yolov9-face/openvino/scrypted_yolov9t_relu_face.xml"), 6)
549
+ } }
525
550
  }
526
- }];
551
+ ];
527
552
  var FACE_EMBEDDING_MODELS = [{
528
553
  id: "arcface-r100",
529
554
  name: "ArcFace R100",
@@ -755,77 +780,109 @@ var ANIMAL_CLASSIFIER_MODELS = [{
755
780
  openvino: ovFormat(hf("animalClassification/animals-10/openvino/camstack-animals-10.xml"), 164)
756
781
  }
757
782
  }];
758
- var BIRD_CLASSIFIER_MODELS = [{
759
- id: "bird-classifier",
760
- name: "Bird Classifier (AIY 965)",
761
- description: "Google AIY Birds V1 (MobileNetV2) — 964 species + background; publicly distributable (Apache-2.0)",
762
- inputSize: {
763
- width: 224,
764
- height: 224
765
- },
766
- inputLayout: "nhwc",
767
- inputNormalization: "none",
768
- outputProbabilities: true,
769
- license: "Apache-2.0",
770
- labels: [{
771
- id: "species",
772
- name: "Bird Species"
773
- }],
774
- preprocessMode: "resize",
775
- formats: {
776
- onnx: {
777
- url: hf("animalClassification/bird-classifier/onnx/bird-classifier.onnx"),
778
- sizeMB: 14
783
+ var BIRD_CLASSIFIER_MODELS = [
784
+ {
785
+ id: "bird-classifier",
786
+ name: "Bird Classifier (AIY 965)",
787
+ description: "Google AIY Birds V1 (MobileNetV2) — 964 species + background; publicly distributable (Apache-2.0)",
788
+ inputSize: {
789
+ width: 224,
790
+ height: 224
779
791
  },
780
- coreml: {
781
- url: hf("animalClassification/bird-classifier/coreml/bird-classifier.mlpackage"),
782
- sizeMB: 6.8,
783
- isDirectory: true,
784
- files: [...MLPACKAGE_FILES],
785
- runtimes: ["python"]
792
+ inputLayout: "nhwc",
793
+ inputNormalization: "none",
794
+ outputProbabilities: true,
795
+ license: "Apache-2.0",
796
+ labels: [{
797
+ id: "species",
798
+ name: "Bird Species"
799
+ }],
800
+ preprocessMode: "resize",
801
+ formats: {
802
+ onnx: {
803
+ url: hf("animalClassification/bird-classifier/onnx/bird-classifier.onnx"),
804
+ sizeMB: 14
805
+ },
806
+ coreml: {
807
+ url: hf("animalClassification/bird-classifier/coreml/bird-classifier.mlpackage"),
808
+ sizeMB: 6.8,
809
+ isDirectory: true,
810
+ files: [...MLPACKAGE_FILES],
811
+ runtimes: ["python"]
812
+ },
813
+ openvino: ovFormat(hf("animalClassification/bird-classifier/openvino/bird-classifier.xml"), 14)
786
814
  },
787
- openvino: ovFormat(hf("animalClassification/bird-classifier/openvino/bird-classifier.xml"), 14)
788
- },
789
- extraFiles: [{
790
- url: hf("animalClassification/bird-classifier/onnx/bird-classifier-labels.json"),
791
- filename: "bird-classifier-labels.json",
792
- sizeMB: .03
793
- }]
794
- }, {
795
- id: "bird-nabirds-404",
796
- name: "NABirds (404 species)",
797
- description: "ResNet50 trained on NABirds — 404 North American species",
798
- legacy: true,
799
- inputSize: {
800
- width: 224,
801
- height: 224
815
+ extraFiles: [{
816
+ url: hf("animalClassification/bird-classifier/onnx/bird-classifier-labels.json"),
817
+ filename: "bird-classifier-labels.json",
818
+ sizeMB: .03
819
+ }]
802
820
  },
803
- inputNormalization: "imagenet",
804
- labels: [{
805
- id: "species",
806
- name: "Bird Species"
807
- }],
808
- preprocessMode: "resize",
809
- formats: {
810
- onnx: {
811
- url: hf("animalClassification/bird-nabirds/onnx/camstack-bird-nabirds-404.onnx"),
812
- sizeMB: 93
821
+ {
822
+ id: "bird-nabirds-404",
823
+ name: "NABirds (404 species)",
824
+ description: "ResNet50 trained on NABirds — 404 North American species",
825
+ legacy: true,
826
+ inputSize: {
827
+ width: 224,
828
+ height: 224
813
829
  },
814
- coreml: {
815
- url: hf("animalClassification/bird-nabirds/coreml/camstack-bird-nabirds-404.mlpackage"),
816
- sizeMB: 47,
817
- isDirectory: true,
818
- files: [...MLPACKAGE_FILES],
819
- runtimes: ["python"]
830
+ inputNormalization: "imagenet",
831
+ labels: [{
832
+ id: "species",
833
+ name: "Bird Species"
834
+ }],
835
+ preprocessMode: "resize",
836
+ formats: {
837
+ onnx: {
838
+ url: hf("animalClassification/bird-nabirds/onnx/camstack-bird-nabirds-404.onnx"),
839
+ sizeMB: 93
840
+ },
841
+ coreml: {
842
+ url: hf("animalClassification/bird-nabirds/coreml/camstack-bird-nabirds-404.mlpackage"),
843
+ sizeMB: 47,
844
+ isDirectory: true,
845
+ files: [...MLPACKAGE_FILES],
846
+ runtimes: ["python"]
847
+ },
848
+ openvino: ovFormat(hf("animalClassification/bird-nabirds/openvino/camstack-bird-nabirds-404.xml"), 47)
820
849
  },
821
- openvino: ovFormat(hf("animalClassification/bird-nabirds/openvino/camstack-bird-nabirds-404.xml"), 47)
850
+ extraFiles: [{
851
+ url: hf("animalClassification/bird-nabirds/onnx/camstack-bird-nabirds-404-labels.json"),
852
+ filename: "camstack-bird-nabirds-404-labels.json",
853
+ sizeMB: .02
854
+ }]
822
855
  },
823
- extraFiles: [{
824
- url: hf("animalClassification/bird-nabirds/onnx/camstack-bird-nabirds-404-labels.json"),
825
- filename: "camstack-bird-nabirds-404-labels.json",
826
- sizeMB: .02
827
- }]
828
- }];
856
+ {
857
+ id: "bird-classifier-aiy-edgetpu",
858
+ legacy: true,
859
+ name: "Bird Classifier AIY (Coral)",
860
+ description: "Google AIY Birds V1 (MobileNetV2) — EdgeTPU-compiled full-integer TFLite, 224×224, 964 species + background; runs on the Coral USB Edge TPU. Requires EdgeTPU classifier output dequantization (not yet available).",
861
+ inputSize: {
862
+ width: 224,
863
+ height: 224
864
+ },
865
+ inputLayout: "nhwc",
866
+ inputNormalization: "none",
867
+ outputProbabilities: true,
868
+ license: "Apache-2.0",
869
+ labels: [{
870
+ id: "species",
871
+ name: "Bird Species"
872
+ }],
873
+ preprocessMode: "resize",
874
+ formats: { tflite: {
875
+ url: "https://github.com/google-coral/test_data/raw/master/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite",
876
+ sizeMB: 4.3,
877
+ runtimes: ["python"]
878
+ } },
879
+ extraFiles: [{
880
+ url: hf("animalClassification/bird-classifier/onnx/bird-classifier-labels.json"),
881
+ filename: "bird-classifier-labels.json",
882
+ sizeMB: .03
883
+ }]
884
+ }
885
+ ];
829
886
  var VEHICLE_CLASSIFIER_MODELS = [{
830
887
  id: "vehicle-type-v1",
831
888
  name: "Vehicle Type (8)",
@@ -1401,6 +1458,71 @@ var ClassifierWithMinConfidence = class extends PipelineStepBase {
1401
1458
  }];
1402
1459
  }
1403
1460
  };
1461
+ var PLATE_OCR_DEFAULT_REGION = "DE";
1462
+ var PLATE_OCR_DEFAULT_MIN_TEXT_LENGTH = 3;
1463
+ var PLATE_OCR_DEFAULT_MIN_TEXT_CONFIDENCE = 0;
1464
+ var PLATE_OCR_REGION_OPTIONS = [{
1465
+ value: "off",
1466
+ label: "Off (no format correction)"
1467
+ }, {
1468
+ value: "DE",
1469
+ label: "Germany"
1470
+ }];
1471
+ /**
1472
+ * Plate OCR step — exposes a `rectify` toggle (default ON) that deskews the
1473
+ * plate crop (rotation rectification) before the CTC recognizer reads it.
1474
+ * Oblique cameras (steeply angled plates) skew the text baseline and collapse
1475
+ * CTC beyond ~10-15°; a frontal camera loses nothing at 0° because the executor
1476
+ * skips the warp when the estimated angle is ~0. Per-camera configurable.
1477
+ *
1478
+ * Also exposes the format-aware rescoring controls (`plateRegion` grammar +
1479
+ * plausibility-gate thresholds) forwarded to the Python CTC postprocessor.
1480
+ */
1481
+ var PlateOcrStep = class extends PipelineStepBase {
1482
+ getConfigSchema() {
1483
+ return [
1484
+ {
1485
+ type: "boolean",
1486
+ key: "rectify",
1487
+ label: "Deskew Plate Crop",
1488
+ description: "Rotate the plate crop to level the text baseline before OCR. Recommended for oblique/angled cameras; a frontal camera is unaffected (no rotation applied at ~0°).",
1489
+ default: true,
1490
+ style: "switch"
1491
+ },
1492
+ {
1493
+ type: "select",
1494
+ key: "plateRegion",
1495
+ label: "Plate Format",
1496
+ description: "Validate each read against a country plate grammar and repair OCR confusables (0↔O, 1↔I, 8↔B, …) to the highest-scoring conforming read. Never drops a plausible read — only fixes or annotates it. \"Off\" disables correction.",
1497
+ options: PLATE_OCR_REGION_OPTIONS,
1498
+ default: PLATE_OCR_DEFAULT_REGION,
1499
+ immediate: true
1500
+ },
1501
+ {
1502
+ type: "slider",
1503
+ key: "minTextLength",
1504
+ label: "Min Plate Length",
1505
+ description: "Suppress reads shorter than this many characters as low-resolution noise (never stored as a plate).",
1506
+ min: 1,
1507
+ max: 8,
1508
+ step: 1,
1509
+ default: PLATE_OCR_DEFAULT_MIN_TEXT_LENGTH,
1510
+ showValue: true
1511
+ },
1512
+ {
1513
+ type: "slider",
1514
+ key: "minTextConfidence",
1515
+ label: "Min OCR Confidence",
1516
+ description: "Suppress reads whose mean character confidence is below this floor. 0 disables the confidence gate (length is the primary discriminator).",
1517
+ min: 0,
1518
+ max: 1,
1519
+ step: .05,
1520
+ default: PLATE_OCR_DEFAULT_MIN_TEXT_CONFIDENCE,
1521
+ showValue: true
1522
+ }
1523
+ ];
1524
+ }
1525
+ };
1404
1526
  var STEP_FACE_DETECTION = new PipelineStepBase({
1405
1527
  id: "face-detection",
1406
1528
  name: "Face Detection",
@@ -1474,7 +1596,7 @@ var STEP_PLATE_DETECTION = new PipelineStepBase({
1474
1596
  maxPerTrack: 5
1475
1597
  }
1476
1598
  });
1477
- var STEP_PLATE_OCR = new PipelineStepBase({
1599
+ var STEP_PLATE_OCR = new PlateOcrStep({
1478
1600
  id: "plate-ocr",
1479
1601
  name: "Plate OCR",
1480
1602
  slot: "classifier",
@@ -1486,6 +1608,9 @@ var STEP_PLATE_OCR = new PipelineStepBase({
1486
1608
  defaultModelId: "vgg-english-g2",
1487
1609
  defaultConfidence: 0,
1488
1610
  charset: [...VGG_G2_CHARSET],
1611
+ plateRegion: PLATE_OCR_DEFAULT_REGION,
1612
+ minTextLength: PLATE_OCR_DEFAULT_MIN_TEXT_LENGTH,
1613
+ minTextConfidence: PLATE_OCR_DEFAULT_MIN_TEXT_CONFIDENCE,
1489
1614
  cadence: {
1490
1615
  trigger: "once",
1491
1616
  maxPerTrack: 5