matrice 1.0.99248__py3-none-any.whl → 1.0.99249__py3-none-any.whl

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.
@@ -511,6 +511,7 @@ class ProximityUseCase(BaseProcessor):
511
511
  detection_obj = self.create_detection_object(category, bbox)
512
512
  detections.append(detection_obj)
513
513
 
514
+ print(detections)
514
515
  # Build alerts and alert_settings arrays
515
516
  alert_settings = []
516
517
  if config.alert_config and hasattr(config.alert_config, 'alert_type'):
@@ -573,6 +574,25 @@ class ProximityUseCase(BaseProcessor):
573
574
 
574
575
  return [tracking_stat]
575
576
 
577
+ def _check_proximity(self, detections):
578
+ """Check if any two detections are within proximity threshold."""
579
+ proximity_threshold = 0.5
580
+ for i in range(len(detections)):
581
+ for j in range(i + 1, len(detections)):
582
+ bbox1 = detections[i].get("bounding_box", {})
583
+ bbox2 = detections[j].get("bounding_box", {})
584
+
585
+ if not bbox1 or not bbox2:
586
+ continue
587
+
588
+ center1 = get_bbox_center(bbox1)
589
+ center2 = get_bbox_center(bbox2)
590
+
591
+ if center1 and center2:
592
+ distance = ((center1[0] - center2[0]) ** 2 + (center1[1] - center2[1]) ** 2) ** 0.5
593
+ if distance < proximity_threshold:
594
+ return True
595
+
576
596
  def _generate_human_text_for_tracking(self, total_people: int, total_unique_count: int, config: ProximityConfig, frame_id: str, alerts:Any=[], stream_info: Optional[Dict[str, Any]] = None) -> str:
577
597
  """Generate human-readable text for tracking stats in old format."""
578
598
  from datetime import datetime, timezone
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice
3
- Version: 1.0.99248
3
+ Version: 1.0.99249
4
4
  Summary: SDK for connecting to matrice.ai services
5
5
  Home-page: https://github.com/matrice-ai/python-sdk
6
6
  Author: Matrice.ai
@@ -204,7 +204,7 @@ matrice/deploy/utils/post_processing/usecases/plaque_segmentation_img.py,sha256=
204
204
  matrice/deploy/utils/post_processing/usecases/pothole_segmentation.py,sha256=jXTb8ZqInp5xJ-O3Zp3zQBiryFVD0-WBbhW6Kux_NDo,44905
205
205
  matrice/deploy/utils/post_processing/usecases/ppe_compliance.py,sha256=G9P9j9E9nfNJInHJxmK1Lb4daFBlG5hq0aqotTLvFFE,30146
206
206
  matrice/deploy/utils/post_processing/usecases/price_tag_detection.py,sha256=09Tp6MGAHh95s-NSAp-4WC9iCc20sajWApuUBAvgXiQ,39880
207
- matrice/deploy/utils/post_processing/usecases/proximity_detection.py,sha256=MDCPQ7_AScJQUcTNzv5FOgf5tQssFN5c4X3WYEFW1FI,76582
207
+ matrice/deploy/utils/post_processing/usecases/proximity_detection.py,sha256=eLs_C2-XeNH-XwTOKeXxDZHafvwmYQqSkf8pyTO3Jl0,77438
208
208
  matrice/deploy/utils/post_processing/usecases/road_lane_detection.py,sha256=V_KxwBtAHSNkyoH8sXw-U-P3J8ToXtX3ncc69gn6Tds,31591
209
209
  matrice/deploy/utils/post_processing/usecases/road_traffic_density.py,sha256=YiHQ0kKhXglagHPvygywxMqZAw8s0WharrBQqLQj2q4,40311
210
210
  matrice/deploy/utils/post_processing/usecases/road_view_segmentation.py,sha256=BcBbOOg5622KuvzKrzs9cJW1wkRoIIcOab0N7BONQKQ,44986
@@ -243,8 +243,8 @@ matrice/deployment/camera_manager.py,sha256=e1Lc81RJP5wUWRdTgHO6tMWF9BkBdHOSVyx3
243
243
  matrice/deployment/deployment.py,sha256=HFt151eWq6iqIAMsQvurpV2WNxW6Cx_gIUVfnVy5SWE,48093
244
244
  matrice/deployment/inference_pipeline.py,sha256=6b4Mm3-qt-Zy0BeiJfFQdImOn3FzdNCY-7ET7Rp8PMk,37911
245
245
  matrice/deployment/streaming_gateway_manager.py,sha256=ifYGl3g25wyU39HwhPQyI2OgF3M6oIqKMWt8RXtMxY8,21401
246
- matrice-1.0.99248.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
247
- matrice-1.0.99248.dist-info/METADATA,sha256=BrFRs4fAg0E642TaG1F8T4BUezT01CbpJzWy9PrOvgA,14624
248
- matrice-1.0.99248.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
249
- matrice-1.0.99248.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
250
- matrice-1.0.99248.dist-info/RECORD,,
246
+ matrice-1.0.99249.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
247
+ matrice-1.0.99249.dist-info/METADATA,sha256=lqoVX_xeHrWV65FNXH7oHyADPM6oPg-IZyThL0y_Cgs,14624
248
+ matrice-1.0.99249.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
249
+ matrice-1.0.99249.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
250
+ matrice-1.0.99249.dist-info/RECORD,,