matrice 1.0.99117__py3-none-any.whl → 1.0.99120__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.
@@ -1476,20 +1476,6 @@ class AdvancedCustomerServiceUseCase(BaseProcessor):
1476
1476
 
1477
1477
  return insights
1478
1478
 
1479
- def _get_current_timestamp_str(self, stream_info: Optional[dict]) -> str:
1480
- """Get formatted current timestamp based on stream type (video or stream)."""
1481
- if not stream_info:
1482
- return "00:00:00.00"
1483
- input_settings = stream_info.get("input_settings", {})
1484
- stream_type = input_settings.get("stream_type", "video_file")
1485
- if stream_type == "video_file":
1486
- # For video files, use video_timestamp
1487
- video_timestamp = stream_info.get("video_timestamp", "")
1488
- return video_timestamp[:8] if video_timestamp else "00:00:00.00"
1489
- else:
1490
- # For streams, use stream_time
1491
- stream_time_str = stream_info.get("stream_time", "")
1492
- return stream_time_str[:8] if stream_time_str else "00:00:00.00"
1493
1479
 
1494
1480
  def _get_start_timestamp_str(self, stream_info: Optional[dict]) -> str:
1495
1481
  """Get formatted start timestamp for 'TOTAL SINCE' based on stream type."""
@@ -522,9 +522,45 @@ class PeopleCountingUseCase(BaseProcessor):
522
522
  getattr(config.alert_config, 'alert_value', ['JSON']) if hasattr(config.alert_config, 'alert_value') else ['JSON'])
523
523
  }
524
524
  })
525
-
526
-
527
- human_text = self._generate_human_text_for_tracking(total_people, total_unique_count, config, frame_id, alerts, stream_info)
525
+ if zone_analysis:
526
+ human_text_lines=[]
527
+ current_timestamp = self._get_current_timestamp_str(stream_info, frame_id=frame_id)
528
+ start_timestamp = self._get_start_timestamp_str(stream_info)
529
+ human_text_lines.append(f"CURRENT FRAME @ {current_timestamp}:")
530
+ def robust_zone_total(zone_count):
531
+ if isinstance(zone_count, dict):
532
+ total = 0
533
+ for v in zone_count.values():
534
+ if isinstance(v, int):
535
+ total += v
536
+ elif isinstance(v, list) and total==0:
537
+ total += len(v)
538
+ return total
539
+ elif isinstance(zone_count, list):
540
+ return len(zone_count)
541
+ elif isinstance(zone_count, int):
542
+ return zone_count
543
+ else:
544
+ return 0
545
+ human_text_lines.append(f"\t- People Detected: {total_people}")
546
+ human_text_lines.append("")
547
+ human_text_lines.append(f"TOTAL SINCE @ {start_timestamp}:")
548
+
549
+ for zone_name, zone_count in zone_analysis.items():
550
+ zone_total = robust_zone_total(zone_count)
551
+ human_text_lines.append(f"\t- Zone name: {zone_name}")
552
+ human_text_lines.append(f"\t\t- Total count in zone: {zone_total-1}")
553
+
554
+
555
+ human_text_lines.append(f"\t- Total unique people in the scene: {total_unique_count}")
556
+ if alerts:
557
+ for alert in alerts:
558
+ human_text_lines.append(f"Alerts: {alert.get('settings', {})} sent @ {current_timestamp}")
559
+ else:
560
+ human_text_lines.append("Alerts: None")
561
+ human_text = "\n".join(human_text_lines)
562
+ else:
563
+ human_text = self._generate_human_text_for_tracking(total_people, total_unique_count, config, frame_id, alerts, stream_info)
528
564
 
529
565
  # Create high precision timestamps for input_timestamp and reset_timestamp
530
566
  high_precision_start_timestamp = self._get_current_timestamp_str(stream_info, precision=True, frame_id=frame_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice
3
- Version: 1.0.99117
3
+ Version: 1.0.99120
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
@@ -153,7 +153,7 @@ matrice/deploy/utils/post_processing/test_cases/test_processor.py,sha256=nwF2EIA
153
153
  matrice/deploy/utils/post_processing/test_cases/test_utilities.py,sha256=lmT5bp5_T5yYy1HQ4X01myfScAqnMgf4pd7hHBCjr6A,13414
154
154
  matrice/deploy/utils/post_processing/test_cases/test_utils.py,sha256=bfmOT1rr9asv3jpr-p_UrjnnSZ1qEWM2LEqNKkyvJZ8,29370
155
155
  matrice/deploy/utils/post_processing/usecases/__init__.py,sha256=Nb13P5IZSs7tl9j-RZWE0ryuVqu6fvGTAfJhWe3644k,7323
156
- matrice/deploy/utils/post_processing/usecases/advanced_customer_service.py,sha256=3KJLO-0Wrd5v1lWDPySX-lrNlOyq09E2ICc2wcmuyKk,76708
156
+ matrice/deploy/utils/post_processing/usecases/advanced_customer_service.py,sha256=ELt5euxr6P4X2s8-YGngmj27QscOHefjOsx3774sNFk,75914
157
157
  matrice/deploy/utils/post_processing/usecases/age_detection.py,sha256=cgOIx2zqPd_OWQMfTDV_4HSlvXlI8eKcZSEZ85SnZWA,35263
158
158
  matrice/deploy/utils/post_processing/usecases/anti_spoofing_detection.py,sha256=XdtDdXGzZMLQdWcoOoiE5t4LPYHhgOtJ7tZCNlq1A2E,31329
159
159
  matrice/deploy/utils/post_processing/usecases/assembly_line_detection.py,sha256=aWvdUesfVSDeuG5k5J0pmbg-xUp_tS_A6TyZGSsPeDI,39657
@@ -186,7 +186,7 @@ matrice/deploy/utils/post_processing/usecases/mask_detection.py,sha256=MNpCcuefO
186
186
  matrice/deploy/utils/post_processing/usecases/parking.py,sha256=lqTGqcjUZZPFw3tu11Ha8BSsZ311K5--wEZnlVsXakU,34534
187
187
  matrice/deploy/utils/post_processing/usecases/parking_space_detection.py,sha256=1bZaspmzvJAggyr4Lk_hPX79xm6NFpGakAxbuqDnHb8,34524
188
188
  matrice/deploy/utils/post_processing/usecases/pedestrian_detection.py,sha256=hPFtvpWXXEsbDavmuiXIhrosMNlOhGya--jukT-ZOHA,39288
189
- matrice/deploy/utils/post_processing/usecases/people_counting.py,sha256=FWVSRZCZ8_I2zg3oYVltvRfYUN1zOVcvEfyLldDybg8,74543
189
+ matrice/deploy/utils/post_processing/usecases/people_counting.py,sha256=mDJOwcrs9OO4jIbJVr_ItWvjjGP2mgGFYlrP3R-mH2E,76528
190
190
  matrice/deploy/utils/post_processing/usecases/plaque_segmentation_img.py,sha256=d__a0PkkObYVoC-Q5-2bFVfeyKnQHtB5xVAKVOCeFyk,41925
191
191
  matrice/deploy/utils/post_processing/usecases/pothole_segmentation.py,sha256=6Mv8SoEE5CGItY7S0g-SY5Lb3DV-WWVMlpEp04a86a8,43197
192
192
  matrice/deploy/utils/post_processing/usecases/ppe_compliance.py,sha256=koLwrPtLerXM9vV-Lk_nj3BWVzZXcGtenpFm79Rl7l0,30147
@@ -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.99117.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
229
- matrice-1.0.99117.dist-info/METADATA,sha256=wUAddEX81gS9jjJ-h5D1aFNCLOJpFMExwGeA3NAUqvI,14624
230
- matrice-1.0.99117.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
231
- matrice-1.0.99117.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
232
- matrice-1.0.99117.dist-info/RECORD,,
228
+ matrice-1.0.99120.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
229
+ matrice-1.0.99120.dist-info/METADATA,sha256=RpltS6SiXXIs8q5ZV0-XL-wiCQ1cGoQd2VdEO4FDOZs,14624
230
+ matrice-1.0.99120.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
231
+ matrice-1.0.99120.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
232
+ matrice-1.0.99120.dist-info/RECORD,,