matrice-analytics 0.1.97__py3-none-any.whl → 0.1.106__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.
@@ -929,6 +929,7 @@ class ALERT_INSTANCE:
929
929
  ) -> Dict[str, Any]:
930
930
  """Build trigger message in exact format specified in documentation."""
931
931
  detection_type_raw = detection.get("detectionType", "").lower()
932
+ triggered_at = datetime.now(timezone.utc).isoformat()
932
933
 
933
934
  context_data = {
934
935
  "detectionType": detection_type_raw,
@@ -964,12 +965,46 @@ class ALERT_INSTANCE:
964
965
  "personCount": detection.get("personCount", 1)
965
966
  })
966
967
 
968
+ # Build contextData with bbox, conf, timestamp, type for enhanced alert info
969
+ # Extract bbox from coordinates or detection's bounding_box
970
+ bbox = []
971
+ coordinates = detection.get("coordinates", {})
972
+ if isinstance(coordinates, dict) and coordinates:
973
+ # Convert from x,y,width,height format to [x1,y1,x2,y2] format
974
+ x = coordinates.get("x", 0)
975
+ y = coordinates.get("y", 0)
976
+ width = coordinates.get("width", 0)
977
+ height = coordinates.get("height", 0)
978
+ bbox = [x, y, x + width, y + height]
979
+ elif detection.get("bounding_box"):
980
+ bb = detection.get("bounding_box", {})
981
+ if isinstance(bb, dict):
982
+ if "xmin" in bb:
983
+ bbox = [bb.get("xmin", 0), bb.get("ymin", 0), bb.get("xmax", 0), bb.get("ymax", 0)]
984
+ elif "x" in bb:
985
+ x, y = bb.get("x", 0), bb.get("y", 0)
986
+ w, h = bb.get("width", 0), bb.get("height", 0)
987
+ bbox = [x, y, x + w, y + h]
988
+ elif isinstance(bb, list) and len(bb) >= 4:
989
+ bbox = list(bb[:4])
990
+
991
+ context_data_enhanced = {
992
+ "bbox": bbox,
993
+ "conf": float(detection.get("confidence", 0.0)),
994
+ "timestamp": detection.get("timestamp", triggered_at),
995
+ "type": detection_type_raw,
996
+ "plateNumber": detection.get("plateNumber", "") if detection_type_raw == "license_plate" else "",
997
+ "cameraName": detection.get("cameraName", ""),
998
+ "locationName": detection.get("locationName", ""),
999
+ }
1000
+
967
1001
  trigger_message = {
968
1002
  "instant_alert_id": alert.instant_alert_id,
969
1003
  "camera_id": alert.camera_id,
970
1004
  "frame_id": detection.get("frame_id", ""),
971
- "triggered_at": datetime.now(timezone.utc).isoformat(),
972
- "context_data": context_data
1005
+ "triggered_at": triggered_at,
1006
+ "context_data": context_data,
1007
+ "contextData": context_data_enhanced, # Enhanced contextData with bbox, conf, timestamp, type
973
1008
  }
974
1009
 
975
1010
  return trigger_message
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_analytics
3
- Version: 0.1.97
3
+ Version: 0.1.106
4
4
  Summary: Common server utilities for Matrice.ai services
5
5
  Author-email: "Matrice.ai" <dipendra@matrice.ai>
6
6
  License-Expression: MIT
@@ -12,16 +12,17 @@ matrice_analytics/boundary_drawing_internal/usage/boundary_drawer_launcher.py,sh
12
12
  matrice_analytics/boundary_drawing_internal/usage/simple_boundary_launcher.py,sha256=jHPriRLorLuiC8km0MFNS96w121tKxd7t5GQl7I5kKE,3494
13
13
  matrice_analytics/post_processing/README.md,sha256=bDszazvqV5xbGhMM6hDaMctIyk5gox9bADo2IZZ9Goo,13368
14
14
  matrice_analytics/post_processing/__init__.py,sha256=lwnLNF-wTlYWtddc2im5H2HqqKbPyc1DsKgUygh2K8c,30663
15
- matrice_analytics/post_processing/config.py,sha256=ms_YbdMRrN953fXR3RXjSldXeDincsoRmoQOyACRNAA,7067
15
+ matrice_analytics/post_processing/config.py,sha256=TvpJPwA_AF3_n9IwvnGvRGqoDNEeFhVbW8KiQy0GzBg,7067
16
16
  matrice_analytics/post_processing/post_processor.py,sha256=S2ekNFKtGlJrNmy94m0lGy2iFtdnZTw2yj_pJeBXYdM,44854
17
17
  matrice_analytics/post_processing/advanced_tracker/README.md,sha256=RM8dynVoUWKn_hTbw9c6jHAbnQj-8hEAXnmuRZr2w1M,22485
18
18
  matrice_analytics/post_processing/advanced_tracker/__init__.py,sha256=tAPFzI_Yep5TLX60FDwKqBqppc-EbxSr0wNsQ9DGI1o,423
19
19
  matrice_analytics/post_processing/advanced_tracker/base.py,sha256=VqWy4dd5th5LK-JfueTt2_GSEoOi5QQfQxjTNhmQoLc,3580
20
- matrice_analytics/post_processing/advanced_tracker/config.py,sha256=hEVJVbh4uUrbIynmoq4OhuxF2IZA5AMCBLpixScp5FI,2865
20
+ matrice_analytics/post_processing/advanced_tracker/config.py,sha256=bWr_KZUf_gc3koKdQ9Rml5j3cKjo6zvW53GN_x13HU0,3114
21
21
  matrice_analytics/post_processing/advanced_tracker/kalman_filter.py,sha256=KBUKLVULnMoJoaRXCtVzPnfj0qobSXmc5PItzPo5Nmo,16017
22
22
  matrice_analytics/post_processing/advanced_tracker/matching.py,sha256=q2xBf8m0DJVUvBN0YHCoSfN7l8MMY9UxyqocqOHYDls,7666
23
23
  matrice_analytics/post_processing/advanced_tracker/strack.py,sha256=OSai-SSpC9_uFNWD83B4JYchI4YMdPJvKs2qYFb1UAU,9375
24
- matrice_analytics/post_processing/advanced_tracker/tracker.py,sha256=yN_tUzDZ-8M4NSoZrKf0OW0JA0JxOvz2oYKgbm-os88,15687
24
+ matrice_analytics/post_processing/advanced_tracker/track_class_aggregator.py,sha256=LpgtR4qpmHIUu9evRtP9rFtQXOqsxsB1hxolhFkToyQ,4573
25
+ matrice_analytics/post_processing/advanced_tracker/tracker.py,sha256=cq8jofJKr1GkTbgFjZyTUMGwjSDUzVNK_0x8UPcPkPo,16726
25
26
  matrice_analytics/post_processing/core/__init__.py,sha256=QlgoJwjTU-3UYTEmFRN6wFWpOr7zNSnrohoqLBF5bNY,1434
26
27
  matrice_analytics/post_processing/core/base.py,sha256=7cz1tYhMNphfe46bF5sgc5_z7ULof413axZWHKcdIIQ,29099
27
28
  matrice_analytics/post_processing/core/config.py,sha256=YwGQZ27FQF9n2UXHaptd2h_gcz8g-ldVsk79ULU4Ppw,135773
@@ -29,9 +30,9 @@ matrice_analytics/post_processing/core/config_utils.py,sha256=QuAS-_JKSoNOtfUWgr
29
30
  matrice_analytics/post_processing/face_reg/__init__.py,sha256=yntaiGlW9vdjBpPZQXNuovALihJPzRlFyUE88l3MhBA,1364
30
31
  matrice_analytics/post_processing/face_reg/compare_similarity.py,sha256=NlFc8b2a74k0PqSFAbuM_fUbA1BT3pr3VUgvSqRpJzQ,23396
31
32
  matrice_analytics/post_processing/face_reg/embedding_manager.py,sha256=3Rba94EcYWFK0D4el9JZ7fwqQ9kOyadrwK30lFmTP-k,44964
32
- matrice_analytics/post_processing/face_reg/face_recognition.py,sha256=jtIdOLQEwDkdZ5lG8s4_8ZomQc4JinZoFddbTaTgrXI,142663
33
+ matrice_analytics/post_processing/face_reg/face_recognition.py,sha256=3tQLOv0aBVKA-HWcAzNWkK10SJ_vmFBO0rkfDe5CkWQ,170644
33
34
  matrice_analytics/post_processing/face_reg/face_recognition_client.py,sha256=ZGQyMnV7t4w3YBx9ywh-MQF10XtRHN4DAqs-h1N-Wp0,37268
34
- matrice_analytics/post_processing/face_reg/people_activity_logging.py,sha256=qOggxp8UoLnbKqy-kASAfwQ9FGczIQxgNbpfgV5A35U,14619
35
+ matrice_analytics/post_processing/face_reg/people_activity_logging.py,sha256=Z86ZoqCf-Eu8kCWrVEbrWjepT4ph5XS0zdyE3aew6xY,15122
35
36
  matrice_analytics/post_processing/ocr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
37
  matrice_analytics/post_processing/ocr/easyocr_extractor.py,sha256=RMrRoGb2gMcJEGouQn8U9cCgCLXPT7qRa8liI4LNxFM,11555
37
38
  matrice_analytics/post_processing/ocr/postprocessing.py,sha256=RILArp8I9WRH7bALVZ9wPGc-aR7YMdqV1ndOOIcOnGQ,12309
@@ -119,7 +120,7 @@ matrice_analytics/post_processing/usecases/field_mapping.py,sha256=JDwYX8pd2W-wa
119
120
  matrice_analytics/post_processing/usecases/fire_detection.py,sha256=r9nkviYNVNqEQsdmlM8m_V4DoeZBWKU4s1mDOo_Swmw,65801
120
121
  matrice_analytics/post_processing/usecases/flare_analysis.py,sha256=3nf4fUeUwlP_UII0h5fQkUGPXbr32ZnJjaM-dukNSP8,42680
121
122
  matrice_analytics/post_processing/usecases/flower_segmentation.py,sha256=4I7qMx9Ztxg_hy9KTVX-3qBhAN-QwDt_Yigf9fFjLus,52017
122
- matrice_analytics/post_processing/usecases/footfall.py,sha256=eVH0LT9p86Zzt9W7oREPLmFzZH8uLx4UxZ8-GXSel44,36633
123
+ matrice_analytics/post_processing/usecases/footfall.py,sha256=9_Hd0LPvmGgF5kWzNXdVHsFoTCKjj58kna00CORO_-w,40942
123
124
  matrice_analytics/post_processing/usecases/gas_leak_detection.py,sha256=KL2ft7fXvjTas-65-QgcJm3W8KBsrwF44qibSXjfaLc,40557
124
125
  matrice_analytics/post_processing/usecases/gender_detection.py,sha256=DEnCTRew6B7DtPcBQVCTtpd_IQMvMusBcu6nadUg2oM,40107
125
126
  matrice_analytics/post_processing/usecases/human_activity_recognition.py,sha256=SLyvbw1y_nEQ0AlT-ErpeSydjA8U5yfRPrjMx1t3Yz0,42226
@@ -128,7 +129,7 @@ matrice_analytics/post_processing/usecases/leaf.py,sha256=cwgB1ZNxkQFtkk-thSJrkX
128
129
  matrice_analytics/post_processing/usecases/leaf_disease.py,sha256=bkiLccTdf4KUq3he4eCpBlKXb5exr-WBhQ_oWQ7os68,36225
129
130
  matrice_analytics/post_processing/usecases/leak_detection.py,sha256=oOCLLVMuXVeXPHyN8FUrD3U9JYJJwIz-5fcEMgvLdls,40531
130
131
  matrice_analytics/post_processing/usecases/license_plate_detection.py,sha256=dsavd92-wnyXCNrCzaRj24zH7BVvLSa09HkYsrOXYDM,50806
131
- matrice_analytics/post_processing/usecases/license_plate_monitoring.py,sha256=o_ga5aLd3s7EWBxBvP7aieS2yT9Y_3zecngQKBclV-g,121656
132
+ matrice_analytics/post_processing/usecases/license_plate_monitoring.py,sha256=Oa38sv-5byq7S6hUl1phzW4rUFl3Dx9WarSCLZtMeaw,123145
132
133
  matrice_analytics/post_processing/usecases/litter_monitoring.py,sha256=XaHAUGRBDJg_iVbu8hRMjTR-5TqrLj6ZNCRkInbzZTY,33255
133
134
  matrice_analytics/post_processing/usecases/mask_detection.py,sha256=L_s6ZiT5zeXG-BsFcskb3HEG98DhLgqeMSDmCuwOteU,41501
134
135
  matrice_analytics/post_processing/usecases/natural_disaster.py,sha256=ehxdPBoYcZWGVDOVn_mHFoz4lIE8LrveAkuXQj0n9XE,44253
@@ -161,8 +162,8 @@ matrice_analytics/post_processing/usecases/traffic_sign_monitoring.py,sha256=nDl
161
162
  matrice_analytics/post_processing/usecases/underground_pipeline_defect_detection.py,sha256=W_2joZStsP0jl2zn89-jtdtqqGv3vJ0amsalbE5WKwo,37647
162
163
  matrice_analytics/post_processing/usecases/underwater_pollution_detection.py,sha256=jqP1ZKfDZe2-56Lyvgb2DxnbqRfvxm6pPL0Ck3esfBk,40356
163
164
  matrice_analytics/post_processing/usecases/vehicle_monitoring.py,sha256=PBD-xGXvN3tzJzpcjiHAMtPs0ZrCVAuSeUDoeAWuWbc,50826
164
- matrice_analytics/post_processing/usecases/vehicle_monitoring_drone_view.py,sha256=MXqOLAeZfuU8uUGz8dwqzhjkTGt4GUr3pZ1vFx0_wQg,50694
165
- matrice_analytics/post_processing/usecases/vehicle_monitoring_parking_lot.py,sha256=WHA2BH8wV2Fyh5LK8PO5SmtKZoh8cG8BxQZDkTfC0mw,50925
165
+ matrice_analytics/post_processing/usecases/vehicle_monitoring_drone_view.py,sha256=ceQdDLLquTfn-l8aYRx-Z7Zy6fgL-q5a16bdDf6vpIU,60049
166
+ matrice_analytics/post_processing/usecases/vehicle_monitoring_parking_lot.py,sha256=ip7DB2kCkh3dq6JoCZJeXZsjXdC6XA0_xpPNCyNkXQ4,51747
166
167
  matrice_analytics/post_processing/usecases/warehouse_object_segmentation.py,sha256=5uZXTJL_A3tUEN08T-_ZQpUoJ9gqbuuMc4z2mT4sMnQ,43753
167
168
  matrice_analytics/post_processing/usecases/waterbody_segmentation.py,sha256=JsCxDEMB8s4WDcezfJDr2zrjM-TCjB9hxOztzSvWmpY,45268
168
169
  matrice_analytics/post_processing/usecases/weapon_detection.py,sha256=QZFNm3I216l_ZzE59U4LCSktVsZfkFs6FWj6t4d9SNY,40675
@@ -179,11 +180,12 @@ matrice_analytics/post_processing/usecases/color/clip_processor/special_tokens_m
179
180
  matrice_analytics/post_processing/usecases/color/clip_processor/tokenizer.json,sha256=bZEJzIOJd_PKlKN57sNq7MfIB-F4XNcpZgyi_AFx-zU,3642073
180
181
  matrice_analytics/post_processing/usecases/color/clip_processor/tokenizer_config.json,sha256=w9KmfEiln_qP2S3gYGCFJLEsrpOstP6D5esDFHoAH1o,774
181
182
  matrice_analytics/post_processing/usecases/color/clip_processor/vocab.json,sha256=UEe1Vs6GzK9qois__M_FLTkepKzNq5wvJAfaW3QtQ2M,862328
182
- matrice_analytics/post_processing/utils/__init__.py,sha256=E4_V_Rq3aMRtdUyJuvXoiAY67V5xBlwLJeiL20RuDqo,3802
183
+ matrice_analytics/post_processing/utils/__init__.py,sha256=SFfUcTPhtMJIANSzP3in9BNpiJomNLZnxB3UOLFRo3U,3868
183
184
  matrice_analytics/post_processing/utils/advanced_counting_utils.py,sha256=D6jlZNRCfPtfG8COv3AMCbCfZf4_DK9rFhwzVJEYjpg,19152
184
185
  matrice_analytics/post_processing/utils/advanced_helper_utils.py,sha256=W8mDqJTpg98YJgWYBod0rZUNbR4bmvYMeWAGASs14_s,11624
185
186
  matrice_analytics/post_processing/utils/advanced_tracking_utils.py,sha256=tKEGjq-1bJ_AeXEWl_clr-7vAry0NLU_P_Q0cbSqLFI,16942
186
- matrice_analytics/post_processing/utils/alert_instance_utils.py,sha256=6i4ZTay3JeEXiGiEiRQYfOvFWUg68rKYAevzubqPr1U,49737
187
+ matrice_analytics/post_processing/utils/agnostic_nms.py,sha256=XndokhV1IEWwxb7uAevmRjy7_VJe_QmLnBYqctUke58,28224
188
+ matrice_analytics/post_processing/utils/alert_instance_utils.py,sha256=v3sNH1OLCU9TGkwv2F3DRuu5X_ua1_pzg84LSHiVdpI,51505
187
189
  matrice_analytics/post_processing/utils/alerting_utils.py,sha256=zDX66UiMBMC7FwQNCq-t6eUcP3Zj2JvCQX0K774zhaQ,8430
188
190
  matrice_analytics/post_processing/utils/business_metrics_manager_utils.py,sha256=9UNdzX9AmLUra1OMgIL2wtYy-GOMh1t2m-AigVcf0cA,59892
189
191
  matrice_analytics/post_processing/utils/category_mapping_utils.py,sha256=B31n8PIyGqT7QMFgYSfZPlkgSQQTpvHAHQ5B0glW48I,3459
@@ -195,8 +197,8 @@ matrice_analytics/post_processing/utils/geometry_utils.py,sha256=BWfdM6RsdJTTLR1
195
197
  matrice_analytics/post_processing/utils/incident_manager_utils.py,sha256=Yf-IWP6W7r5VrJspUupVMnj6b4Uy2ViAGyzmlzPn3Mo,79651
196
198
  matrice_analytics/post_processing/utils/smoothing_utils.py,sha256=78U-yucAcjUiZ0NIAc9NOUSIT0PWP1cqyIPA_Fdrjp0,14699
197
199
  matrice_analytics/post_processing/utils/tracking_utils.py,sha256=rWxuotnJ3VLMHIBOud2KLcu4yZfDp7hVPWUtNAq_2xw,8288
198
- matrice_analytics-0.1.97.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
199
- matrice_analytics-0.1.97.dist-info/METADATA,sha256=O2ZRvxWPh9TfopH3wJJUVs4pKdp9FG0VxB_gAliru1Q,14378
200
- matrice_analytics-0.1.97.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
201
- matrice_analytics-0.1.97.dist-info/top_level.txt,sha256=STAPEU-e-rWTerXaspdi76T_eVRSrEfFpURSP7_Dt8E,18
202
- matrice_analytics-0.1.97.dist-info/RECORD,,
200
+ matrice_analytics-0.1.106.dist-info/licenses/LICENSE.txt,sha256=_uQUZpgO0mRYL5-fPoEvLSbNnLPv6OmbeEDCHXhK6Qc,1066
201
+ matrice_analytics-0.1.106.dist-info/METADATA,sha256=vln9PY0hBu4PlnNprjL4TUVYUdCnecwufJ3x9_MG4PM,14379
202
+ matrice_analytics-0.1.106.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
203
+ matrice_analytics-0.1.106.dist-info/top_level.txt,sha256=STAPEU-e-rWTerXaspdi76T_eVRSrEfFpURSP7_Dt8E,18
204
+ matrice_analytics-0.1.106.dist-info/RECORD,,