matrice 1.0.99249__py3-none-any.whl → 1.0.99251__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.
@@ -562,7 +562,7 @@ class ProximityUseCase(BaseProcessor):
562
562
  human_text_lines.append("Alerts: None")
563
563
  human_text = "\n".join(human_text_lines)
564
564
  else:
565
- human_text = self._generate_human_text_for_tracking(total_people, total_unique_count, config, frame_id, alerts, stream_info)
565
+ human_text = self._generate_human_text_for_tracking(total_people, detections, total_unique_count, config, frame_id, alerts, stream_info)
566
566
 
567
567
  # Create high precision timestamps for input_timestamp and reset_timestamp
568
568
  high_precision_start_timestamp = self._get_current_timestamp_str(stream_info, precision=True, frame_id=frame_id)
@@ -571,12 +571,12 @@ class ProximityUseCase(BaseProcessor):
571
571
  tracking_stat = self.create_tracking_stats(
572
572
  total_counts, current_counts, detections, human_text, camera_info, alerts, alert_settings, start_time=high_precision_start_timestamp, reset_time=high_precision_reset_timestamp
573
573
  )
574
-
574
+ print(tracking_stat)
575
575
  return [tracking_stat]
576
576
 
577
577
  def _check_proximity(self, detections):
578
578
  """Check if any two detections are within proximity threshold."""
579
- proximity_threshold = 0.5
579
+ proximity_threshold = 400
580
580
  for i in range(len(detections)):
581
581
  for j in range(i + 1, len(detections)):
582
582
  bbox1 = detections[i].get("bounding_box", {})
@@ -589,11 +589,12 @@ class ProximityUseCase(BaseProcessor):
589
589
  center2 = get_bbox_center(bbox2)
590
590
 
591
591
  if center1 and center2:
592
- distance = ((center1[0] - center2[0]) ** 2 + (center1[1] - center2[1]) ** 2) ** 0.5
592
+ distance = abs((center1[0] - center2[0]) + (center1[1] - center2[1]))
593
593
  if distance < proximity_threshold:
594
594
  return True
595
+ return False
595
596
 
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:
597
+ def _generate_human_text_for_tracking(self, total_people: int, detections, total_unique_count: int, config: ProximityConfig, frame_id: str, alerts:Any=[], stream_info: Optional[Dict[str, Any]] = None) -> str:
597
598
  """Generate human-readable text for tracking stats in old format."""
598
599
  from datetime import datetime, timezone
599
600
 
@@ -602,7 +603,9 @@ class ProximityUseCase(BaseProcessor):
602
603
  start_timestamp = self._get_start_timestamp_str(stream_info, precision=True)
603
604
 
604
605
  human_text_lines.append(f"CURRENT FRAME @ {current_timestamp}:")
605
- human_text_lines.append(f"\t- People Detected: {total_people}")
606
+ if self._check_proximity(detections):
607
+ human_text_lines.append("\t- Proximity Alert: People are within proximity threshold!")
608
+ # human_text_lines.append(f"\t- People Detected: {total_people}")
606
609
 
607
610
  human_text_lines.append("")
608
611
  if total_unique_count > 0:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice
3
- Version: 1.0.99249
3
+ Version: 1.0.99251
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=eLs_C2-XeNH-XwTOKeXxDZHafvwmYQqSkf8pyTO3Jl0,77438
207
+ matrice/deploy/utils/post_processing/usecases/proximity_detection.py,sha256=yOIDAP8B484cvHIiLUNqwDBDsu3eZIV_61FAMD2opAo,77640
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.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,,
246
+ matrice-1.0.99251.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
247
+ matrice-1.0.99251.dist-info/METADATA,sha256=mbdD3q-rhD4szxy27qDXJXTZx6gMUzqHWIxXHfKB6S4,14624
248
+ matrice-1.0.99251.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
249
+ matrice-1.0.99251.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
250
+ matrice-1.0.99251.dist-info/RECORD,,