matrice 1.0.99272__py3-none-any.whl → 1.0.99274__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.
@@ -319,7 +319,7 @@ class OutputConfig:
319
319
  class _RealTimeJsonEventPicker:
320
320
  """Stateful helper that replicates the original logic but works one frame at a time."""
321
321
 
322
- def __init__(self, consecutive_threshold: int = 7, end_threshold: int = 120):
322
+ def __init__(self, consecutive_threshold: int = 7, end_threshold: int = 130):
323
323
  # Required sequence of severities
324
324
  self._base_sequence: List[str] = ["low", "medium", "significant", "critical", "low"]
325
325
  self._sequence: deque[str] = deque(self._base_sequence)
@@ -232,10 +232,16 @@ class FireSmokeUseCase(BaseProcessor):
232
232
  tracking_stats = tracking_stats_list[0] if tracking_stats_list else {}
233
233
  #EVENT ENDED SIGNAL
234
234
 
235
- if len(tracking_stats_list)==3:
235
+ if len(tracking_stats_list)>1:
236
236
  alerts = tracking_stats_list[1]
237
237
  incidents = tracking_stats_list[2]
238
238
  tracking_stats = tracking_stats_list[0]
239
+ print("-----------------------------------------------------########-------------")
240
+ print('alerts',alerts)
241
+ print('incidents',incidents)
242
+ print('tracking_stats',tracking_stats)
243
+ print('FRAME_NUMBER',str(frame_number))
244
+ print("-----------------------------------------------------########-------------")
239
245
 
240
246
  business_analytics = business_analytics_list[0] if business_analytics_list else {}
241
247
  summary = summary_list[0] if summary_list else {}
@@ -307,6 +313,8 @@ class FireSmokeUseCase(BaseProcessor):
307
313
  # Safely fetch the last recorded severity level as a **string** (empty if no history yet)
308
314
  last_level = self._ascending_alert_list[-1] if self._ascending_alert_list else "low"
309
315
  alert_id = self._get_alert_incident_ids(last_level)
316
+ if alert_id not in [1,2,3,4,5]:
317
+ alert_id = 4
310
318
 
311
319
  count_thresholds = {}
312
320
  if config.alert_config and hasattr(config.alert_config, "count_thresholds"):
@@ -437,6 +445,7 @@ class FireSmokeUseCase(BaseProcessor):
437
445
  elif intensity_pct >= 13:
438
446
  level = "significant"
439
447
  self._ascending_alert_list.append(level)
448
+ self.current_incident_end_timestamp='Incident still active'
440
449
  elif intensity_pct >= 3:
441
450
  level = "medium"
442
451
  self._ascending_alert_list.append(level)
@@ -451,6 +460,7 @@ class FireSmokeUseCase(BaseProcessor):
451
460
  elif intensity_pct > 12:
452
461
  level = "significant"
453
462
  intensity = 9.0
463
+ self.current_incident_end_timestamp='Incident still active'
454
464
  self._ascending_alert_list.append(level)
455
465
  elif intensity_pct > 2:
456
466
  level = "medium"
@@ -469,6 +479,8 @@ class FireSmokeUseCase(BaseProcessor):
469
479
  # Pass the last severity level **value** instead of a single-element list
470
480
  last_level = level if level else self._ascending_alert_list[-1]
471
481
  incident_id = self._get_alert_incident_ids(last_level)
482
+ if incident_id not in [1,2,3,4,5]:
483
+ incident_id = 4
472
484
 
473
485
  alert_settings=[]
474
486
  if config.alert_config and hasattr(config.alert_config, 'alert_type'):
@@ -626,16 +638,17 @@ class FireSmokeUseCase(BaseProcessor):
626
638
  last_ending_id = self._get_alert_incident_ids("")
627
639
  print('last_ending_id',last_ending_id)
628
640
  if last_ending_id==5:
629
- tracking_stats.append({
641
+ alerts={
630
642
  "alert_type": getattr(config.alert_config, 'alert_type', ['Default']) if hasattr(config.alert_config, 'alert_type') else ['Default'],
631
- "alert_id": "alert_"+category+'_'+str(last_ending_id),
643
+ "alert_id": "alert_"+'Event_Ended'+'_'+str(last_ending_id),
632
644
  "incident_category": self.CASE_TYPE,
633
645
  "threshold_level": 0,
634
646
  "ascending": False,
635
647
  "settings": {t: v for t, v in zip(getattr(config.alert_config, 'alert_type', ['Default']) if hasattr(config.alert_config, 'alert_type') else ['Default'],
636
648
  getattr(config.alert_config, 'alert_value', ['JSON']) if hasattr(config.alert_config, 'alert_value') else ['JSON'])
637
649
  }
638
- })
650
+ }
651
+ tracking_stats.append(alerts)
639
652
  tracking_stats.append(self.create_incident(incident_id=self.CASE_TYPE+'_'+str(last_ending_id), incident_type=self.CASE_TYPE,
640
653
  severity_level='info', human_text='Event Over', camera_info=camera_info, alerts=alerts, alert_settings=alert_settings,
641
654
  start_time=start_timestamp, end_time='Incident still active',
@@ -1010,7 +1023,7 @@ class FireSmokeUseCase(BaseProcessor):
1010
1023
  else:
1011
1024
  if len(self.id_hit_list)==1:
1012
1025
  self.id_hit_counter+=1
1013
- if self.id_hit_counter>120:
1026
+ if self.id_hit_counter>130:
1014
1027
  self.id_hit_list = ["low","medium","significant","critical","low"]
1015
1028
  self.id_hit_counter = 0
1016
1029
  self.latest_stack = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice
3
- Version: 1.0.99272
3
+ Version: 1.0.99274
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
@@ -108,7 +108,7 @@ matrice/deploy/client/auto_streaming/auto_streaming.py,sha256=VRfy_EBFvhspN-hoN3
108
108
  matrice/deploy/client/auto_streaming/auto_streaming_utils.py,sha256=BuRUokLp3t43yzRF8YSX9p_RHQD94RoBwNEoldXFDQo,14995
109
109
  matrice/deploy/client/streaming_gateway/__init__.py,sha256=hkYC0qszaXZThquMuuI20Qkt_AHCB3pdy7jlJVeqPN4,1203
110
110
  matrice/deploy/client/streaming_gateway/streaming_gateway.py,sha256=r8Z5AXBom89n-8W5RTlB-nOeUaprxK-QBDsAb-E9gl8,19605
111
- matrice/deploy/client/streaming_gateway/streaming_gateway_utils.py,sha256=znNZkzG9W7VeZPKUxzgxHiW1GqvD-oA-McZSnMiBm1E,42144
111
+ matrice/deploy/client/streaming_gateway/streaming_gateway_utils.py,sha256=_fJl0ry2O8UkEwHpufNdJ68EAkWAAN7moGbBLJtPQeE,42144
112
112
  matrice/deploy/client/streaming_gateway/streaming_results_handler.py,sha256=OpHkdbnuqVN28tQm9CYwrfgAth3Qz40Uaq5Tg4bbxyo,15813
113
113
  matrice/deploy/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
114
  matrice/deploy/server/server.py,sha256=duki4KUU1tvW3Y7wkrlMRVvt7bAP2QqSIsrSogLxC4o,36799
@@ -182,7 +182,7 @@ matrice/deploy/utils/post_processing/usecases/face_emotion.py,sha256=eRfqBdryB0u
182
182
  matrice/deploy/utils/post_processing/usecases/face_recognition.py,sha256=T5xAuv6b9OrkmTmoXgZs4LZ5XUsbvp9xCpeLBwdu7eI,40231
183
183
  matrice/deploy/utils/post_processing/usecases/fashion_detection.py,sha256=f9gpzMDhIW-gyn46k9jgf8nY7YeoqAnTxGOzksabFbE,40457
184
184
  matrice/deploy/utils/post_processing/usecases/field_mapping.py,sha256=JDwYX8pd2W-waDvBh98Y_o_uchJu7wEYbFxOliA4Iq4,39822
185
- matrice/deploy/utils/post_processing/usecases/fire_detection.py,sha256=hVKWtP8xdJA_dKohc0-Sz5HZhLQVf8sxcEzheDdq-vI,48155
185
+ matrice/deploy/utils/post_processing/usecases/fire_detection.py,sha256=8GMabLpVFWCSHULdjO8V_fCPqz9hf9pyAu2n-vuLg7A,48936
186
186
  matrice/deploy/utils/post_processing/usecases/flare_analysis.py,sha256=-egmS3Hs_iGOLeCMfapbkfQ04EWtZx97QRuUcDa-jMU,45340
187
187
  matrice/deploy/utils/post_processing/usecases/flower_segmentation.py,sha256=4I7qMx9Ztxg_hy9KTVX-3qBhAN-QwDt_Yigf9fFjLus,52017
188
188
  matrice/deploy/utils/post_processing/usecases/gas_leak_detection.py,sha256=KL2ft7fXvjTas-65-QgcJm3W8KBsrwF44qibSXjfaLc,40557
@@ -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.99272.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
247
- matrice-1.0.99272.dist-info/METADATA,sha256=2oWp1a_wo-Q8GdzRwrqRboA95IiizC3ybOMbUxqr3P4,14624
248
- matrice-1.0.99272.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
249
- matrice-1.0.99272.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
250
- matrice-1.0.99272.dist-info/RECORD,,
246
+ matrice-1.0.99274.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
247
+ matrice-1.0.99274.dist-info/METADATA,sha256=8l_cz4_KBhm5bJ3K9MQQBUyeQ-NuVS3UQU2A0I5oHTI,14624
248
+ matrice-1.0.99274.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
249
+ matrice-1.0.99274.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
250
+ matrice-1.0.99274.dist-info/RECORD,,