matrice 1.0.99132__py3-none-any.whl → 1.0.99133__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.
@@ -582,34 +582,40 @@ class ChildMonitoringUseCase(BaseProcessor):
582
582
  """Format timestamp for video chunks (HH:MM:SS.ms format)."""
583
583
  hours = int(timestamp // 3600)
584
584
  minutes = int((timestamp % 3600) // 60)
585
- seconds = timestamp % 60
586
- return f"{hours:02d}:{minutes:02d}:{seconds:06.2f}"
585
+ seconds = round(float(timestamp % 60),2)
586
+ return f"{hours:02d}:{minutes:02d}:{seconds:.1f}"
587
587
 
588
588
  def _format_timestamp_for_stream(self, timestamp: float) -> str:
589
589
  """Format timestamp for streams (YYYY:MM:DD HH:MM:SS format)."""
590
590
  dt = datetime.fromtimestamp(timestamp, tz=timezone.utc)
591
591
  return dt.strftime('%Y:%m:%d %H:%M:%S')
592
592
 
593
- def _get_current_timestamp_str(self, stream_info: Optional[Dict[str, Any]], precision=False) -> str:
593
+ def _get_current_timestamp_str(self, stream_info: Optional[Dict[str, Any]], precision=False, frame_id: Optional[str]=None) -> str:
594
594
  """Get formatted current timestamp based on stream type."""
595
595
  if not stream_info:
596
596
  return "00:00:00.00"
597
-
598
597
  # is_video_chunk = stream_info.get("input_settings", {}).get("is_video_chunk", False)
599
598
  if precision:
600
- if stream_info.get("input_settings", {}).get("stream_type", "video_file") == "video_file":
601
- stream_time_str = stream_info.get("video_timestamp", "")
602
- return stream_time_str[:8]
599
+ if stream_info.get("input_settings", {}).get("start_frame", "na") != "na":
600
+ if frame_id:
601
+ start_time = int(frame_id)/stream_info.get("input_settings", {}).get("original_fps", 30)
602
+ else:
603
+ start_time = stream_info.get("input_settings", {}).get("start_frame", 30)/stream_info.get("input_settings", {}).get("original_fps", 30)
604
+ stream_time_str = self._format_timestamp_for_video(start_time)
605
+ return stream_time_str
603
606
  else:
604
607
  return datetime.now(timezone.utc).strftime("%Y-%m-%d-%H:%M:%S.%f UTC")
605
608
 
606
- if stream_info.get("input_settings", {}).get("stream_type", "video_file") == "video_file":
607
- # If video format, return video timestamp
608
- stream_time_str = stream_info.get("video_timestamp", "")
609
- return stream_time_str[:8]
609
+ if stream_info.get("input_settings", {}).get("start_frame", "na") != "na":
610
+ if frame_id:
611
+ start_time = int(frame_id)/stream_info.get("input_settings", {}).get("original_fps", 30)
612
+ else:
613
+ start_time = stream_info.get("input_settings", {}).get("start_frame", 30)/stream_info.get("input_settings", {}).get("original_fps", 30)
614
+ stream_time_str = self._format_timestamp_for_video(start_time)
615
+ return stream_time_str
610
616
  else:
611
617
  # For streams, use stream_time from stream_info
612
- stream_time_str = stream_info.get("stream_time", "")
618
+ stream_time_str = stream_info.get("input_settings", {}).get("stream_info", {}).get("stream_time", "")
613
619
  if stream_time_str:
614
620
  # Parse the high precision timestamp string to get timestamp
615
621
  try:
@@ -628,23 +634,20 @@ class ChildMonitoringUseCase(BaseProcessor):
628
634
  """Get formatted start timestamp for 'TOTAL SINCE' based on stream type."""
629
635
  if not stream_info:
630
636
  return "00:00:00"
631
-
632
- is_video_chunk = stream_info.get("input_settings", {}).get("is_video_chunk", False)
633
637
  if precision:
634
- if stream_info.get("input_settings", {}).get("stream_type", "video_file") == "video_file":
638
+ if stream_info.get("input_settings", {}).get("start_frame", "na") != "na":
635
639
  return "00:00:00"
636
640
  else:
637
641
  return datetime.now(timezone.utc).strftime("%Y-%m-%d-%H:%M:%S.%f UTC")
638
642
 
639
-
640
- if stream_info.get("input_settings", {}).get("stream_type", "video_file") == "video_file":
643
+ if stream_info.get("input_settings", {}).get("start_frame", "na") != "na":
641
644
  # If video format, start from 00:00:00
642
645
  return "00:00:00"
643
646
  else:
644
647
  # For streams, use tracking start time or current time with minutes/seconds reset
645
648
  if self._tracking_start_time is None:
646
649
  # Try to extract timestamp from stream_time string
647
- stream_time_str = stream_info.get("stream_time", "")
650
+ stream_time_str = stream_info.get("input_settings", {}).get("stream_info", {}).get("stream_time", "")
648
651
  if stream_time_str:
649
652
  try:
650
653
  # Remove " UTC" suffix and parse
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice
3
- Version: 1.0.99132
3
+ Version: 1.0.99133
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
@@ -163,7 +163,7 @@ matrice/deploy/utils/post_processing/usecases/blood_cancer_detection_img.py,sha2
163
163
  matrice/deploy/utils/post_processing/usecases/car_damage_detection.py,sha256=WvD7M90DrJ9serjp4mOkZiCDwSXUyJNv6OX1AjlXs6s,34505
164
164
  matrice/deploy/utils/post_processing/usecases/car_part_segmentation.py,sha256=JbLcl1VvsQ2heuJYOn6QN44odQZ5WwLYWJXpM6iXpVk,46240
165
165
  matrice/deploy/utils/post_processing/usecases/chicken_pose_detection.py,sha256=-e8di7Am-E-FCQFrSY8qJTO1aWtdRAVJoE-VKBgcyyI,29291
166
- matrice/deploy/utils/post_processing/usecases/child_monitoring.py,sha256=cWYDTXca0hci8k7rHNYfwzoByeGIeJ-d4tESwTnRXa0,38807
166
+ matrice/deploy/utils/post_processing/usecases/child_monitoring.py,sha256=z3oymoqq4hDGwA8MkdEONZW_Vx5CAZmvzZaNLsqmCfw,39380
167
167
  matrice/deploy/utils/post_processing/usecases/color_detection.py,sha256=Z8-akjy8a7f8YyiOzXu_Zi1Km30v-TRrymDqQOPpJ_8,43277
168
168
  matrice/deploy/utils/post_processing/usecases/color_map_utils.py,sha256=SP-AEVcjLmL8rxblu-ixqUJC2fqlcr7ab4hWo4Fcr_k,2677
169
169
  matrice/deploy/utils/post_processing/usecases/concrete_crack_detection.py,sha256=gz6uNgxwyJiB26zMUW-QBWMrP848co_SKwR__16cZcc,39359
@@ -225,8 +225,8 @@ matrice/deployment/camera_manager.py,sha256=ReBZqm1CNXRImKcbcZ4uWAT3TUWkof1D28oB
225
225
  matrice/deployment/deployment.py,sha256=PLIUD-PxTaC2Zxb3Y12wUddsryV-OJetjCjLoSUh7S4,48103
226
226
  matrice/deployment/inference_pipeline.py,sha256=bXLgd29ViA7o0c7YWLFJl1otBUQfTPb61jS6VawQB0Y,37918
227
227
  matrice/deployment/streaming_gateway_manager.py,sha256=w5swGsuFVfZIdOm2ZuBHRHlRdYYJMLopLsf2gb91lQ8,20946
228
- matrice-1.0.99132.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
229
- matrice-1.0.99132.dist-info/METADATA,sha256=dz62whFxWy17DDaMQBQrFJMg_zsLCJ3F1mI467xLxlQ,14624
230
- matrice-1.0.99132.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
231
- matrice-1.0.99132.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
232
- matrice-1.0.99132.dist-info/RECORD,,
228
+ matrice-1.0.99133.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
229
+ matrice-1.0.99133.dist-info/METADATA,sha256=U2B3c3Syax_INlbB91OK6xGPNyge3P2ubrOI4ehIeX0,14624
230
+ matrice-1.0.99133.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
231
+ matrice-1.0.99133.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
232
+ matrice-1.0.99133.dist-info/RECORD,,