matrice 1.0.99263__py3-none-any.whl → 1.0.99265__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.
- matrice/deploy/client/streaming_gateway/streaming_gateway_utils.py +2 -1
- matrice/deploy/client/streaming_gateway/streaming_results_handler.py +2 -1
- matrice/deploy/utils/post_processing/usecases/intrusion_detection.py +1 -1
- matrice/deploy/utils/post_processing/usecases/proximity_detection.py +44 -19
- {matrice-1.0.99263.dist-info → matrice-1.0.99265.dist-info}/METADATA +1 -1
- {matrice-1.0.99263.dist-info → matrice-1.0.99265.dist-info}/RECORD +9 -9
- {matrice-1.0.99263.dist-info → matrice-1.0.99265.dist-info}/WHEEL +0 -0
- {matrice-1.0.99263.dist-info → matrice-1.0.99265.dist-info}/licenses/LICENSE.txt +0 -0
- {matrice-1.0.99263.dist-info → matrice-1.0.99265.dist-info}/top_level.txt +0 -0
@@ -372,7 +372,8 @@ class _RealTimeJsonEventPicker:
|
|
372
372
|
A dictionary describing the detected event or ``None`` if no event
|
373
373
|
boundary was reached for the supplied frame.
|
374
374
|
"""
|
375
|
-
incidents = frame_json.get("result").get("value").get("agg_summary")[str(frame_id)].get("incidents") or []
|
375
|
+
#incidents = frame_json.get("result").get("value").get("agg_summary")[str(frame_id)].get("incidents") or []
|
376
|
+
incidents = frame_json.get("result").get("value").get("agg_apps")[0].get("agg_summary")[str(frame_id)].get("incidents") or []
|
376
377
|
has_alerts = bool(incidents and incidents.get("alerts")[0])
|
377
378
|
|
378
379
|
if has_alerts:
|
@@ -317,7 +317,8 @@ class StreamingResultsHandler:
|
|
317
317
|
raise
|
318
318
|
def _send_file_to_api_(self, frame_json):
|
319
319
|
"""Send file to API."""
|
320
|
-
frame_id = list(frame_json.get("result").get("value").get("agg_summary").keys())[0]
|
320
|
+
# frame_id = list(frame_json.get("result").get("value").get("agg_summary").keys())[0]
|
321
|
+
frame_id = list(frame_json.get("result").get("value").get("agg_apps")[0].get("agg_summary").keys())[0]
|
321
322
|
return self.json_event_picker.process(int(frame_id), frame_json)
|
322
323
|
def _cleanup_old_files(self):
|
323
324
|
"""Remove old result files if exceeding max_files limit."""
|
@@ -422,7 +422,7 @@ class IntrusionUseCase(BaseProcessor):
|
|
422
422
|
self._ascending_alert_list.append(0)
|
423
423
|
|
424
424
|
human_text_lines.append(f"\t\t- Zone name: {zone_name}")
|
425
|
-
human_text_lines.append(f"\t\t\t- Total count in Prohibited Boarding Gate: {zone_total
|
425
|
+
human_text_lines.append(f"\t\t\t- Total count in Prohibited Boarding Gate: {zone_total}")
|
426
426
|
# Main people counting incident
|
427
427
|
human_text = "\n".join(human_text_lines)
|
428
428
|
event = self.create_incident(incident_id=self.CASE_TYPE+'_'+'zone_'+zone_name+str(frame_id), incident_type=self.CASE_TYPE,
|
@@ -62,6 +62,10 @@ class ProximityUseCase(BaseProcessor):
|
|
62
62
|
|
63
63
|
# Track start time for "TOTAL SINCE" calculation
|
64
64
|
self._tracking_start_time = None
|
65
|
+
|
66
|
+
# Proximity counting
|
67
|
+
self._total_proximity_count = 0 # Total proximity events across all calls
|
68
|
+
|
65
69
|
|
66
70
|
# --------------------------------------------------------------------- #
|
67
71
|
# Tracking aliasing structures to merge fragmented IDs #
|
@@ -276,7 +280,12 @@ class ProximityUseCase(BaseProcessor):
|
|
276
280
|
# Count by category
|
277
281
|
for detection in frame_detections:
|
278
282
|
category = detection.get("category", "unknown")
|
279
|
-
|
283
|
+
current_count = counting_summary["categories"].get(category, 0)
|
284
|
+
counting_summary["categories"][category] = current_count + 1
|
285
|
+
|
286
|
+
proximity_count = self._count_proximity_events(frame_detections)
|
287
|
+
counting_summary["proximity_events"] = proximity_count
|
288
|
+
counting_summary["total_proximity_count"] = self._total_proximity_count + proximity_count
|
280
289
|
|
281
290
|
# Step 5: Zone analysis for this frame
|
282
291
|
zone_analysis = {}
|
@@ -574,43 +583,59 @@ class ProximityUseCase(BaseProcessor):
|
|
574
583
|
print(tracking_stat)
|
575
584
|
return [tracking_stat]
|
576
585
|
|
577
|
-
def
|
578
|
-
"""
|
579
|
-
proximity_threshold = 400
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
586
|
+
def _count_proximity_events(self, detections):
|
587
|
+
"""Count proximity events between detections."""
|
588
|
+
proximity_threshold = 400 # pixels
|
589
|
+
proximity_count = 0
|
590
|
+
|
591
|
+
for i, detection1 in enumerate(detections):
|
592
|
+
for j, detection2 in enumerate(detections[i+1:], i+1):
|
593
|
+
bbox1 = detection1.get("bounding_box", {})
|
594
|
+
bbox2 = detection2.get("bounding_box", {})
|
595
|
+
|
585
596
|
if not bbox1 or not bbox2:
|
586
597
|
continue
|
587
|
-
|
598
|
+
|
588
599
|
center1 = get_bbox_center(bbox1)
|
589
600
|
center2 = get_bbox_center(bbox2)
|
590
|
-
|
601
|
+
|
591
602
|
if center1 and center2:
|
592
603
|
distance = abs((center1[0] - center2[0]) + (center1[1] - center2[1]))
|
593
604
|
if distance < proximity_threshold:
|
594
|
-
|
595
|
-
|
605
|
+
proximity_count += 1
|
606
|
+
|
607
|
+
return proximity_count
|
596
608
|
|
597
|
-
def _generate_human_text_for_tracking(
|
609
|
+
def _generate_human_text_for_tracking(
|
610
|
+
self,
|
611
|
+
total_people: int,
|
612
|
+
detections,
|
613
|
+
total_unique_count: int,
|
614
|
+
config: ProximityConfig,
|
615
|
+
frame_id: str,
|
616
|
+
alerts:Any=[],
|
617
|
+
stream_info: Optional[Dict[str, Any]] = None) -> str:
|
598
618
|
"""Generate human-readable text for tracking stats in old format."""
|
599
619
|
from datetime import datetime, timezone
|
600
620
|
|
601
621
|
human_text_lines=[]
|
602
622
|
current_timestamp = self._get_current_timestamp_str(stream_info, precision=True, frame_id=frame_id)
|
603
623
|
start_timestamp = self._get_start_timestamp_str(stream_info, precision=True)
|
604
|
-
|
624
|
+
|
605
625
|
human_text_lines.append(f"CURRENT FRAME @ {current_timestamp}:")
|
606
|
-
|
607
|
-
|
626
|
+
|
627
|
+
# Add proximity count to human text
|
628
|
+
proximity_count = self._count_proximity_events(detections)
|
629
|
+
if proximity_count > 0:
|
630
|
+
human_text_lines.append(f"\t- Proximity Events Detected: {proximity_count}")
|
631
|
+
else:
|
632
|
+
human_text_lines.append("\t- No Proximity Events Detected")
|
608
633
|
# human_text_lines.append(f"\t- People Detected: {total_people}")
|
609
634
|
|
610
635
|
human_text_lines.append("")
|
611
|
-
if
|
636
|
+
if proximity_count > 0:
|
612
637
|
human_text_lines.append(f"TOTAL SINCE @ {start_timestamp}:")
|
613
|
-
human_text_lines.append(f"\t- Total
|
638
|
+
human_text_lines.append(f"\t- Total Proximity Count: {self._total_proximity_count + proximity_count}")
|
614
639
|
|
615
640
|
if alerts:
|
616
641
|
for alert in alerts:
|
@@ -108,8 +108,8 @@ 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=
|
112
|
-
matrice/deploy/client/streaming_gateway/streaming_results_handler.py,sha256=
|
111
|
+
matrice/deploy/client/streaming_gateway/streaming_gateway_utils.py,sha256=znNZkzG9W7VeZPKUxzgxHiW1GqvD-oA-McZSnMiBm1E,42144
|
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
|
115
115
|
matrice/deploy/server/stream_worker.py,sha256=KDNlYep4Bg1xhHwDrwY9kfxsJfFtATydiYbzVDt58vs,20481
|
@@ -188,7 +188,7 @@ matrice/deploy/utils/post_processing/usecases/flower_segmentation.py,sha256=4I7q
|
|
188
188
|
matrice/deploy/utils/post_processing/usecases/gas_leak_detection.py,sha256=KL2ft7fXvjTas-65-QgcJm3W8KBsrwF44qibSXjfaLc,40557
|
189
189
|
matrice/deploy/utils/post_processing/usecases/gender_detection.py,sha256=DEnCTRew6B7DtPcBQVCTtpd_IQMvMusBcu6nadUg2oM,40107
|
190
190
|
matrice/deploy/utils/post_processing/usecases/human_activity_recognition.py,sha256=SLyvbw1y_nEQ0AlT-ErpeSydjA8U5yfRPrjMx1t3Yz0,42226
|
191
|
-
matrice/deploy/utils/post_processing/usecases/intrusion_detection.py,sha256=
|
191
|
+
matrice/deploy/utils/post_processing/usecases/intrusion_detection.py,sha256=Aa2wX-rq_S5aC5JDh7O_hCFPyHGPxWRDG2LIvOKZeHY,77439
|
192
192
|
matrice/deploy/utils/post_processing/usecases/leaf.py,sha256=cwgB1ZNxkQFtkk-thSJrkXOGou1ghJr1kqtopb3sLD4,37036
|
193
193
|
matrice/deploy/utils/post_processing/usecases/leaf_disease.py,sha256=bkiLccTdf4KUq3he4eCpBlKXb5exr-WBhQ_oWQ7os68,36225
|
194
194
|
matrice/deploy/utils/post_processing/usecases/leak_detection.py,sha256=oOCLLVMuXVeXPHyN8FUrD3U9JYJJwIz-5fcEMgvLdls,40531
|
@@ -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=
|
207
|
+
matrice/deploy/utils/post_processing/usecases/proximity_detection.py,sha256=YySgDaIFY-CEqaRkPJoI8HXTNxwe-XGFYmemPoaenJ8,78430
|
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.
|
247
|
-
matrice-1.0.
|
248
|
-
matrice-1.0.
|
249
|
-
matrice-1.0.
|
250
|
-
matrice-1.0.
|
246
|
+
matrice-1.0.99265.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
|
247
|
+
matrice-1.0.99265.dist-info/METADATA,sha256=HfDECYWS5i_0EPFnpwUuQbCJkjtgFfmJkHrq-MMpo-M,14624
|
248
|
+
matrice-1.0.99265.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
249
|
+
matrice-1.0.99265.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
|
250
|
+
matrice-1.0.99265.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|