matrice-analytics 0.1.70__py3-none-any.whl → 0.1.96__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.
Files changed (26) hide show
  1. matrice_analytics/post_processing/__init__.py +8 -2
  2. matrice_analytics/post_processing/config.py +4 -2
  3. matrice_analytics/post_processing/core/base.py +1 -1
  4. matrice_analytics/post_processing/core/config.py +40 -3
  5. matrice_analytics/post_processing/face_reg/face_recognition.py +1014 -201
  6. matrice_analytics/post_processing/face_reg/face_recognition_client.py +171 -29
  7. matrice_analytics/post_processing/face_reg/people_activity_logging.py +19 -0
  8. matrice_analytics/post_processing/post_processor.py +4 -0
  9. matrice_analytics/post_processing/usecases/__init__.py +4 -1
  10. matrice_analytics/post_processing/usecases/advanced_customer_service.py +913 -500
  11. matrice_analytics/post_processing/usecases/color_detection.py +19 -18
  12. matrice_analytics/post_processing/usecases/customer_service.py +356 -9
  13. matrice_analytics/post_processing/usecases/fire_detection.py +241 -23
  14. matrice_analytics/post_processing/usecases/footfall.py +750 -0
  15. matrice_analytics/post_processing/usecases/license_plate_monitoring.py +638 -40
  16. matrice_analytics/post_processing/usecases/people_counting.py +66 -33
  17. matrice_analytics/post_processing/usecases/vehicle_monitoring.py +35 -34
  18. matrice_analytics/post_processing/usecases/weapon_detection.py +2 -1
  19. matrice_analytics/post_processing/utils/alert_instance_utils.py +1018 -0
  20. matrice_analytics/post_processing/utils/business_metrics_manager_utils.py +1338 -0
  21. matrice_analytics/post_processing/utils/incident_manager_utils.py +1754 -0
  22. {matrice_analytics-0.1.70.dist-info → matrice_analytics-0.1.96.dist-info}/METADATA +1 -1
  23. {matrice_analytics-0.1.70.dist-info → matrice_analytics-0.1.96.dist-info}/RECORD +26 -22
  24. {matrice_analytics-0.1.70.dist-info → matrice_analytics-0.1.96.dist-info}/WHEEL +0 -0
  25. {matrice_analytics-0.1.70.dist-info → matrice_analytics-0.1.96.dist-info}/licenses/LICENSE.txt +0 -0
  26. {matrice_analytics-0.1.70.dist-info → matrice_analytics-0.1.96.dist-info}/top_level.txt +0 -0
@@ -84,6 +84,7 @@ from .usecases.field_mapping import FieldMappingConfig, FieldMappingUseCase
84
84
  from .usecases.leaf_disease import LeafDiseaseDetectionConfig, LeafDiseaseDetectionUseCase
85
85
  from .usecases.parking import ParkingConfig
86
86
  from .usecases.abandoned_object_detection import AbandonedObjectConfig
87
+ from .usecases.footfall import FootFallConfig
87
88
 
88
89
 
89
90
  from .usecases.weld_defect_detection import WeldDefectConfig
@@ -128,6 +129,7 @@ from .usecases.pcb_defect_detection import PCBDefectConfig, PCBDefectUseCase
128
129
  from .usecases.underground_pipeline_defect_detection import UndergroundPipelineDefectConfig,UndergroundPipelineDefectUseCase
129
130
  from .usecases.suspicious_activity_detection import SusActivityConfig, SusActivityUseCase
130
131
  from .usecases.natural_disaster import NaturalDisasterConfig, NaturalDisasterUseCase
132
+ from .usecases.footfall import FootFallUseCase
131
133
 
132
134
  #Put all IMAGE based usecases here
133
135
  from .usecases.blood_cancer_detection_img import BloodCancerDetectionConfig, BloodCancerDetectionUseCase
@@ -205,7 +207,7 @@ from .usecases import (
205
207
 
206
208
  SusActivityUseCase,
207
209
  NaturalDisasterUseCase,
208
-
210
+ FootFallUseCase,
209
211
  #Put all IMAGE based usecases here
210
212
  BloodCancerDetectionUseCase,
211
213
  SkinCancerClassificationUseCase,
@@ -286,6 +288,7 @@ _pcb_defect_detection = PCBDefectUseCase()
286
288
  _underground_pipeline_defect = UndergroundPipelineDefectUseCase()
287
289
  _suspicious_activity_detection = SusActivityUseCase()
288
290
  _natural_disaster = NaturalDisasterUseCase()
291
+ _footfall = FootFallUseCase()
289
292
 
290
293
  # Face recognition with embeddings
291
294
  _face_recognition = FaceRecognitionEmbeddingUseCase()
@@ -370,6 +373,7 @@ registry.register_use_case(_pcb_defect_detection.category, _pcb_defect_detection
370
373
  registry.register_use_case(_underground_pipeline_defect.category, _underground_pipeline_defect.name, UndergroundPipelineDefectUseCase)
371
374
  registry.register_use_case(_suspicious_activity_detection.category, _suspicious_activity_detection.name, SusActivityUseCase)
372
375
  registry.register_use_case(_natural_disaster.category, _natural_disaster.name, NaturalDisasterUseCase)
376
+ registry.register_use_case(_footfall.category, _footfall.name, FaceEmotionUseCase)
373
377
 
374
378
  #Put all IMAGE based usecases here
375
379
  registry.register_use_case(_blood_cancer_detection.category, _blood_cancer_detection.name, BloodCancerDetectionUseCase)
@@ -574,7 +578,8 @@ __all__ = [
574
578
  'UndergroundPipelineDefectConfig',
575
579
  'SusActivityConfig',
576
580
  'NaturalDisasterConfig',
577
- 'VehiclePeopleDroneMonitoringConfig'
581
+ 'VehiclePeopleDroneMonitoringConfig',
582
+ 'FootFallConfig',
578
583
  #Put all IMAGE based usecase CONFIGS here
579
584
  'BloodCancerDetectionConfig',
580
585
  'SkinCancerClassificationConfig',
@@ -648,6 +653,7 @@ __all__ = [
648
653
  'UndergroundPipelineDefectUseCase',
649
654
  'SusActivityUseCase',
650
655
  'NaturalDisasterUseCase',
656
+ 'FootFallUseCase',
651
657
 
652
658
  #Put all IMAGE based usecases here
653
659
  'BloodCancerDetectionUseCase',
@@ -11,7 +11,7 @@ APP_NAME_TO_USECASE = {
11
11
  "traffic_sign_monitoring": "traffic_sign_monitoring",
12
12
  "flare_analysis": "flare_analysis",
13
13
  "ppe_compliance": "ppe_compliance",
14
- "advanced_customer_service": "advanced_customer_service",
14
+ "Customer Activity Analysis": "advanced_customer_service",
15
15
  "assembly_line_detection": "assembly_line_detection",
16
16
  "crop_weed_detection" : "crop_weed_detection",
17
17
  "emergency_vehicle_detection": "emergency_vehicle_detection",
@@ -65,6 +65,7 @@ APP_NAME_TO_USECASE = {
65
65
  "underground_pipeline_defect" : "underground_pipeline_defect",
66
66
  "suspicious_activity_detection": "suspicious_activity_detection",
67
67
  "natural_disaster_detection": "natural_disaster_detection",
68
+ "Foot Fall": "footfall"
68
69
  }
69
70
 
70
71
  APP_NAME_TO_CATEGORY = {
@@ -80,7 +81,7 @@ APP_NAME_TO_CATEGORY = {
80
81
  "traffic_sign_monitoring": "traffic",
81
82
  "flare_analysis": "flare_detection",
82
83
  "ppe_compliance": "security",
83
- "advanced_customer_service": "sales",
84
+ "Customer Activity Analysis": "sales",
84
85
  "assembly_line_detection": "manufacturing",
85
86
  "crop_weed_detection": "agriculture",
86
87
  "emergency_vehicle_detection": "traffic",
@@ -135,6 +136,7 @@ APP_NAME_TO_CATEGORY = {
135
136
  "underground_pipeline_defect" : "general",
136
137
  "suspicious_activity_detection": "security",
137
138
  "natural_disaster_detection": "environmental",
139
+ "Foot Fall": "retail"
138
140
  }
139
141
 
140
142
  def get_usecase_from_app_name(app_name: str) -> str:
@@ -286,7 +286,7 @@ class BaseProcessor(ABC):
286
286
  "incident_id": incident_id,
287
287
  "incident_type": incident_type,
288
288
  "severity_level": severity_level,
289
- "human_text": human_text or f"{incident_type} detected @ {timestamp} [Severity Level: {severity_level}]",
289
+ "human_text": human_text or f"{incident_type} detected. [Severity Level: {severity_level}]",
290
290
  "start_time": timestamp,
291
291
  "end_time": end_time or timestamp,
292
292
  "camera_info": camera_info or self.get_default_camera_info(),
@@ -352,14 +352,19 @@ class AlertConfig:
352
352
  @dataclass
353
353
  class PeopleCountingConfig(BaseConfig):
354
354
  """Configuration for people counting use case."""
355
-
355
+
356
356
  # Smoothing configuration
357
357
  enable_smoothing: bool = True
358
358
  smoothing_algorithm: str = "observability" # "window" or "observability"
359
359
  smoothing_window_size: int = 20
360
360
  smoothing_cooldown_frames: int = 5
361
361
  smoothing_confidence_range_factor: float = 0.5
362
-
362
+
363
+ # ====== PERFORMANCE: Tracker selection (both disabled by default for max throughput) ======
364
+ enable_advanced_tracker: bool = False # Heavy O(n³) tracker - enable only when tracking quality is critical
365
+ enable_simple_tracker: bool = False # Lightweight O(n) tracker - fast but no cross-frame persistence
366
+ # ====== END PERFORMANCE CONFIG ======
367
+
363
368
  # Zone configuration
364
369
  zone_config: Optional[ZoneConfig] = None
365
370
 
@@ -901,6 +906,7 @@ class ConfigManager:
901
906
  'underground_pipeline_defect' : None,
902
907
  'suspicious_activity_detection': None,
903
908
  'natural_disaster_detection': None,
909
+ 'footfall': None,
904
910
 
905
911
  #Put all image based usecases here::
906
912
  'blood_cancer_detection_img': None,
@@ -1405,7 +1411,15 @@ class ConfigManager:
1405
1411
  return NaturalDisasterConfig
1406
1412
  except ImportError:
1407
1413
  return None
1408
-
1414
+
1415
+ def footfall_detection_config_class(self):
1416
+ """Register a configuration class for a use case."""
1417
+ try:
1418
+ from ..usecases.footfall import FootFallConfig
1419
+ return FootFallConfig
1420
+ except ImportError:
1421
+ return None
1422
+
1409
1423
  #put all image based usecases here::
1410
1424
  def blood_cancer_detection_config_class(self):
1411
1425
  """Register a configuration class for a use case."""
@@ -2684,6 +2698,22 @@ class ConfigManager:
2684
2698
  **kwargs
2685
2699
  )
2686
2700
 
2701
+ elif usecase == "footfall":
2702
+ # Import here to avoid circular import
2703
+ from ..usecases.footfall import FootFallConfig
2704
+
2705
+ # Handle nested configurations
2706
+ alert_config = kwargs.pop("alert_config", None)
2707
+ if alert_config and isinstance(alert_config, dict):
2708
+ alert_config = AlertConfig(**alert_config)
2709
+
2710
+ config = FootFallConfig(
2711
+ category=category or "retail",
2712
+ usecase=usecase,
2713
+ alert_config=alert_config,
2714
+ **kwargs
2715
+ )
2716
+
2687
2717
  #Add IMAGE based usecases here::
2688
2718
  elif usecase == "blood_cancer_detection_img":
2689
2719
  # Import here to avoid circular import
@@ -3234,6 +3264,13 @@ class ConfigManager:
3234
3264
  from ..usecases.natural_disaster import NaturalDisasterConfig
3235
3265
  default_config = NaturalDisasterConfig()
3236
3266
  return default_config.to_dict()
3267
+
3268
+ elif usecase == "footfall":
3269
+ # Import here to avoid circular import
3270
+ from ..usecases.footfall import FootFallConfig
3271
+ default_config = FootFallConfig()
3272
+ return default_config.to_dict()
3273
+
3237
3274
 
3238
3275
  elif usecase == "underground_pipeline_defect":
3239
3276
  # Import here to avoid circular import