@camstack/addon-post-analysis 1.2.253 → 1.2.254

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.
@@ -36683,6 +36683,21 @@ var TripwireTracker = class {
36683
36683
  return this.tracks.size;
36684
36684
  }
36685
36685
  };
36686
+ //#endregion
36687
+ //#region src/pipeline-analytics/pipeline/face-parent-containment.ts
36688
+ /**
36689
+ * `true` when the face belongs to this parent by geometry.
36690
+ *
36691
+ * A degenerate box (zero or negative extent) is NOT contained: an empty
36692
+ * rectangle has no centre worth believing, and treating it as a match would
36693
+ * bind a face to whichever parent happened to be asked first.
36694
+ */
36695
+ function faceIsInsideParent(face, parent) {
36696
+ if (face.w <= 0 || face.h <= 0 || parent.w <= 0 || parent.h <= 0) return false;
36697
+ const cx = face.x + face.w / 2;
36698
+ const cy = face.y + face.h / 2;
36699
+ return cx >= parent.x && cx <= parent.x + parent.w && cy >= parent.y && cy <= parent.y + parent.h;
36700
+ }
36686
36701
  var DEFAULT_ZONE_TRANSITION_CONFIG = {
36687
36702
  enterFrames: 2,
36688
36703
  exitFrames: 4
@@ -38659,6 +38674,10 @@ var FrameProcessor = class {
38659
38674
  refusalsThisFrame = [];
38660
38675
  /** Running count of refusals-in-zone SEEN — never the throttled number. */
38661
38676
  zoneRefusalEventCount = 0;
38677
+ /** Faces refused because their centre was not in the body they were found
38678
+ * for — the padding reaching into a neighbour. See
38679
+ * `face-parent-containment.ts`. */
38680
+ faceOutsideParentCount = 0;
38662
38681
  zoneRefusalObserver = null;
38663
38682
  /** Track ids whose BIRTH zone history has already been folded in — the fold
38664
38683
  * happens once, on the frame a track first becomes visible. */
@@ -38887,6 +38906,13 @@ var FrameProcessor = class {
38887
38906
  zoneRefusalEventsEmitted() {
38888
38907
  return this.zoneRefusalEventCount;
38889
38908
  }
38909
+ /** How many faces this processor refused for belonging to somebody else.
38910
+ * Zero is the expected reading; a rising one means two people stand close
38911
+ * together on this camera, which is worth knowing per-camera rather than
38912
+ * per-fleet. */
38913
+ facesRefusedOutsideParent() {
38914
+ return this.faceOutsideParentCount;
38915
+ }
38890
38916
  reportZoneFiltered(excluded) {
38891
38917
  const observer = this.spawnRefusalObserver;
38892
38918
  if (!observer || excluded.length === 0) return;
@@ -38959,6 +38985,15 @@ var FrameProcessor = class {
38959
38985
  if (det.kind !== "detail" || det.macroClass !== "face" || !det.parentId) continue;
38960
38986
  const parentBbox = firstLevelBboxById.get(det.parentId);
38961
38987
  if (parentBbox === void 0 || faceBboxByBbox.has(parentBbox)) continue;
38988
+ if (!faceIsInsideParent({
38989
+ x: det.bbox.x,
38990
+ y: det.bbox.y,
38991
+ w: det.bbox.width,
38992
+ h: det.bbox.height
38993
+ }, parentBbox)) {
38994
+ this.faceOutsideParentCount += 1;
38995
+ continue;
38996
+ }
38962
38997
  faceBboxByBbox.set(parentBbox, {
38963
38998
  x: det.bbox.x,
38964
38999
  y: det.bbox.y,
@@ -36658,6 +36658,21 @@ var TripwireTracker = class {
36658
36658
  return this.tracks.size;
36659
36659
  }
36660
36660
  };
36661
+ //#endregion
36662
+ //#region src/pipeline-analytics/pipeline/face-parent-containment.ts
36663
+ /**
36664
+ * `true` when the face belongs to this parent by geometry.
36665
+ *
36666
+ * A degenerate box (zero or negative extent) is NOT contained: an empty
36667
+ * rectangle has no centre worth believing, and treating it as a match would
36668
+ * bind a face to whichever parent happened to be asked first.
36669
+ */
36670
+ function faceIsInsideParent(face, parent) {
36671
+ if (face.w <= 0 || face.h <= 0 || parent.w <= 0 || parent.h <= 0) return false;
36672
+ const cx = face.x + face.w / 2;
36673
+ const cy = face.y + face.h / 2;
36674
+ return cx >= parent.x && cx <= parent.x + parent.w && cy >= parent.y && cy <= parent.y + parent.h;
36675
+ }
36661
36676
  var DEFAULT_ZONE_TRANSITION_CONFIG = {
36662
36677
  enterFrames: 2,
36663
36678
  exitFrames: 4
@@ -38634,6 +38649,10 @@ var FrameProcessor = class {
38634
38649
  refusalsThisFrame = [];
38635
38650
  /** Running count of refusals-in-zone SEEN — never the throttled number. */
38636
38651
  zoneRefusalEventCount = 0;
38652
+ /** Faces refused because their centre was not in the body they were found
38653
+ * for — the padding reaching into a neighbour. See
38654
+ * `face-parent-containment.ts`. */
38655
+ faceOutsideParentCount = 0;
38637
38656
  zoneRefusalObserver = null;
38638
38657
  /** Track ids whose BIRTH zone history has already been folded in — the fold
38639
38658
  * happens once, on the frame a track first becomes visible. */
@@ -38862,6 +38881,13 @@ var FrameProcessor = class {
38862
38881
  zoneRefusalEventsEmitted() {
38863
38882
  return this.zoneRefusalEventCount;
38864
38883
  }
38884
+ /** How many faces this processor refused for belonging to somebody else.
38885
+ * Zero is the expected reading; a rising one means two people stand close
38886
+ * together on this camera, which is worth knowing per-camera rather than
38887
+ * per-fleet. */
38888
+ facesRefusedOutsideParent() {
38889
+ return this.faceOutsideParentCount;
38890
+ }
38865
38891
  reportZoneFiltered(excluded) {
38866
38892
  const observer = this.spawnRefusalObserver;
38867
38893
  if (!observer || excluded.length === 0) return;
@@ -38934,6 +38960,15 @@ var FrameProcessor = class {
38934
38960
  if (det.kind !== "detail" || det.macroClass !== "face" || !det.parentId) continue;
38935
38961
  const parentBbox = firstLevelBboxById.get(det.parentId);
38936
38962
  if (parentBbox === void 0 || faceBboxByBbox.has(parentBbox)) continue;
38963
+ if (!faceIsInsideParent({
38964
+ x: det.bbox.x,
38965
+ y: det.bbox.y,
38966
+ w: det.bbox.width,
38967
+ h: det.bbox.height
38968
+ }, parentBbox)) {
38969
+ this.faceOutsideParentCount += 1;
38970
+ continue;
38971
+ }
38937
38972
  faceBboxByBbox.set(parentBbox, {
38938
38973
  x: det.bbox.x,
38939
38974
  y: det.bbox.y,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-post-analysis",
3
- "version": "1.2.253",
3
+ "version": "1.2.254",
4
4
  "description": "Post-Analysis bundle — enrichment, embedding-encoder, pipeline-analytics. Multi-entry npm package shipping addons that consume pipeline output.",
5
5
  "keywords": [
6
6
  "camstack",