matrice 1.0.99217__py3-none-any.whl → 1.0.99219__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.
@@ -44,9 +44,10 @@ APP_NAME_TO_USECASE = {
44
44
  "drowsy_driver_detection": "drowsy_driver_detection",
45
45
  "waterbody_segmentation": "waterbody_segmentation",
46
46
  "litter_detection" : "litter_detection",
47
- "human_activity_recognition": "human_activity_recognition",
48
47
  "leak_detection": "leak_detection",
49
48
  "fire_smoke_detection": "fire_smoke_detection",
49
+ "human_activity": "human_activity",
50
+ "gas_leak_detection": "gas_leak_detection",
50
51
  }
51
52
 
52
53
  APP_NAME_TO_CATEGORY = {
@@ -95,9 +96,10 @@ APP_NAME_TO_CATEGORY = {
95
96
  "drowsy_driver_detection": "automobile",
96
97
  "waterbody_segmentation": "agriculture",
97
98
  "litter_detection" : "litter_detection",
98
- "human_activity_recognition": "general",
99
99
  "leak_detection": "oil_gas",
100
100
  "fire_smoke_detection": "hazard",
101
+ "human_activity": "general",
102
+ "gas_leak_detection": "oil_gas",
101
103
  }
102
104
 
103
105
  def get_usecase_from_app_name(app_name: str) -> str:
@@ -327,63 +327,6 @@ class PeopleCountingConfig(BaseConfig):
327
327
 
328
328
  return errors
329
329
 
330
- @dataclass
331
- class HumanActivityConfig(BaseConfig):
332
- """Configuration for Human Activity use case."""
333
-
334
- # Smoothing configuration
335
- enable_smoothing: bool = True
336
- smoothing_algorithm: str = "observability" # "window" or "observability"
337
- smoothing_window_size: int = 20
338
- smoothing_cooldown_frames: int = 5
339
- smoothing_confidence_range_factor: float = 0.5
340
-
341
- # Zone configuration
342
- zone_config: Optional[ZoneConfig] = None
343
-
344
- # Counting parameters
345
- enable_unique_counting: bool = True
346
- time_window_minutes: int = 60
347
-
348
- # Category mapping
349
- activity_categories: List[str] = field(
350
- default_factory=lambda: ["barbequing", "bartending", "breading or flooring", "celebrating",
351
- "clapping", "cleaning floor", "cleaning gutters", "cleaning toilet",
352
- "cleaning windows", "climbing ladder", "cooking chicken", "cooking egg",
353
- "cooking sausages", "counting money", "cutting pineapple", "cutting watermelon",
354
- "dining", "drinking", "drinking beer", "drinking shots", "eating burger", "eating cake",
355
- "eating carrots", "eating chips", "eating doughnuts", "eating hotdog", "eating ice cream",
356
- "eating spaghetti", "eating watermelon", "flipping pancake", "frying vegetables", "garbage collecting",
357
- "making a cake", "making a sandwich", "making pizza making sushi", "making tea",
358
- "mopping floor", "moving furniture", "peeling apples", "peeling potatos", "picking fruit",
359
- "reading book", "reading newspaper", "setting table", "shaking hands", "smoking", "smoking hookah",
360
- "sweeping floor", "tasting beer", "tasting food", "tossing salad", "washing hands",
361
- "washing dishes", "texting", "using computer"]
362
- )
363
- index_to_category: Optional[Dict[int, str]] = None
364
-
365
- # Alert configuration
366
- alert_config: Optional[AlertConfig] = None
367
-
368
- def validate(self) -> List[str]:
369
- """Validate human activity configuration."""
370
- errors = super().validate()
371
-
372
- if self.time_window_minutes <= 0:
373
- errors.append("time_window_minutes must be positive")
374
-
375
- if not self.activity_categories:
376
- errors.append("activity_categories cannot be empty")
377
-
378
- # Validate nested configurations
379
- if self.zone_config:
380
- errors.extend(self.zone_config.validate())
381
-
382
- if self.alert_config:
383
- errors.extend(self.alert_config.validate())
384
-
385
- return errors
386
-
387
330
 
388
331
 
389
332
  @dataclass
@@ -463,7 +406,6 @@ class ConfigManager:
463
406
  "people_counting": PeopleCountingConfig,
464
407
  "customer_service": CustomerServiceConfig,
465
408
  "advanced_customer_service": CustomerServiceConfig,
466
- "human_activity_recognition": HumanActivityConfig,
467
409
  "basic_counting_tracking": None, # Will be set later to avoid circular import
468
410
  "license_plate_detection": None, # Will be set later to avoid circular import
469
411
  "ppe_compliance_detection": None,
@@ -514,6 +456,8 @@ class ConfigManager:
514
456
  'waterbody_segmentation': None,
515
457
  'litter_detection':None,
516
458
  'leak_detection': None,
459
+ 'human_activity': None,
460
+ 'gas_leak_detection': None,
517
461
 
518
462
  #Put all image based usecases here::
519
463
  'blood_cancer_detection_img': None,
@@ -926,6 +870,22 @@ class ConfigManager:
926
870
  except ImportError:
927
871
  return None
928
872
 
873
+ def human_activity_config_class(self):
874
+ """Register a configuration class for a use case."""
875
+ try:
876
+ from ..usecases.human_activity import HumanActivityRecognitionConfig
877
+ return HumanActivityRecognitionConfig
878
+ except ImportError:
879
+ return None
880
+
881
+ def gas_leak_detection_config_class(self):
882
+ """Register a configuration class for a use case."""
883
+ try:
884
+ from ..usecases.gas_leak_detection import GasLeakConfig
885
+ return GasLeakConfig
886
+ except ImportError:
887
+ return None
888
+
929
889
  #put all image based usecases here::
930
890
  def blood_cancer_detection_config_class(self):
931
891
  """Register a configuration class for a use case."""
@@ -1016,23 +976,6 @@ class ConfigManager:
1016
976
  alert_config=alert_config,
1017
977
  **kwargs
1018
978
  )
1019
- elif usecase == "human_activity_recognition":
1020
- # Handle nested configurations
1021
- zone_config = kwargs.pop("zone_config", None)
1022
- if zone_config and isinstance(zone_config, dict):
1023
- zone_config = ZoneConfig(**zone_config)
1024
-
1025
- alert_config = kwargs.pop("alert_config", None)
1026
- if alert_config and isinstance(alert_config, dict):
1027
- alert_config = AlertConfig(**alert_config)
1028
-
1029
- config = HumanActivityConfig(
1030
- category=category or "general",
1031
- usecase=usecase,
1032
- zone_config=zone_config,
1033
- alert_config=alert_config,
1034
- **kwargs
1035
- )
1036
979
  elif usecase == "basic_counting_tracking":
1037
980
  # Import here to avoid circular import
1038
981
  from ..usecases.basic_counting_tracking import BasicCountingTrackingConfig
@@ -1910,7 +1853,38 @@ class ConfigManager:
1910
1853
  alert_config=alert_config,
1911
1854
  **kwargs
1912
1855
  )
1856
+
1857
+ elif usecase == "human_activity":
1858
+ # Import here to avoid circular import
1859
+ from ..usecases.human_activity import HumanActivityRecognitionConfig
1860
+
1861
+ alert_config = kwargs.pop("alert_config", None)
1862
+ if alert_config and isinstance(alert_config, dict):
1863
+ alert_config = AlertConfig(**alert_config)
1864
+
1865
+ config = HumanActivityRecognitionConfig(
1866
+ category=category or "general",
1867
+ usecase=usecase,
1868
+ zone_config=zone_config,
1869
+ alert_config=alert_config,
1870
+ **kwargs
1871
+ )
1872
+
1873
+ elif usecase == "gas_leak_detection":
1874
+ # Import here to avoid circular import
1875
+ from ..usecases.gas_leak_detection import GasLeakConfig
1913
1876
 
1877
+ # Handle nested configurations
1878
+ alert_config = kwargs.pop("alert_config", None)
1879
+ if alert_config and isinstance(alert_config, dict):
1880
+ alert_config = AlertConfig(**alert_config)
1881
+
1882
+ config = GasLeakConfig(
1883
+ category=category or "oil_gas",
1884
+ usecase=usecase,
1885
+ alert_config=alert_config,
1886
+ **kwargs
1887
+ )
1914
1888
 
1915
1889
  #Add IMAGE based usecases here::
1916
1890
  elif usecase == "blood_cancer_detection_img":
@@ -2367,6 +2341,16 @@ class ConfigManager:
2367
2341
  from ..usecases.leak_detection import LeakDetectionConfig
2368
2342
  default_config = LeakDetectionConfig()
2369
2343
  return default_config.to_dict()
2344
+ elif usecase == "human_activity":
2345
+ # Import here to avoid circular import
2346
+ from ..usecases.human_activity import HumanActivityRecognitionConfig
2347
+ default_config = HumanActivityRecognitionConfig()
2348
+ return default_config.to_dict()
2349
+ elif usecase == "gas_leak_detection":
2350
+ # Import here to avoid circular import
2351
+ from ..usecases.gas_leak_detection import GasLeakConfig
2352
+ default_config = GasLeakConfig()
2353
+ return default_config.to_dict()
2370
2354
 
2371
2355
  #Add all image based usecases here
2372
2356
  elif usecase == "blood_cancer_detection_img":
@@ -31,7 +31,6 @@ from .usecases import (
31
31
  PeopleCountingUseCase,
32
32
  CustomerServiceUseCase,
33
33
  AdvancedCustomerServiceUseCase,
34
- HumanActivityUseCase,
35
34
  LicensePlateUseCase,
36
35
  ColorDetectionUseCase,
37
36
  PotholeSegmentationUseCase,
@@ -62,6 +61,8 @@ from .usecases import (
62
61
  LaneDetectionUseCase,
63
62
  LitterDetectionUseCase,
64
63
  LeakDetectionUseCase,
64
+ HumanActivityRecognitionUseCase,
65
+ GasLeakUseCase,
65
66
 
66
67
 
67
68
  AgeDetectionUseCase,
@@ -222,8 +223,9 @@ class PostProcessor:
222
223
  registry.register_use_case("automobile", "drowsy_driver_detection", DrowsyDriverUseCase)
223
224
  registry.register_use_case("agriculture", "waterbody_segmentation", WaterBodyUseCase)
224
225
  registry.register_use_case("litter_detection", "litter_detection", LitterDetectionUseCase)
225
- registry.register_use_case("general", "human_activity_recognition", HumanActivityUseCase)
226
226
  registry.register_use_case("oil_gas", "leak_detection", LeakDetectionUseCase)
227
+ registry.register_use_case("general", "human_activity", HumanActivityRecognitionUseCase)
228
+ registry.register_use_case("oil_gas", "gas_leak_detection", GasLeakUseCase)
227
229
 
228
230
  #Put all IMAGE based usecases here
229
231
  registry.register_use_case("healthcare", "bloodcancer_img_detection", BloodCancerDetectionUseCase)
@@ -398,6 +400,10 @@ class PostProcessor:
398
400
  result = use_case.process(data, parsed_config, context, stream_info)
399
401
  elif isinstance(use_case, LeakDetectionUseCase):
400
402
  result = use_case.process(data, parsed_config, context, stream_info)
403
+ elif isinstance(use_case, HumanActivityRecognitionUseCase):
404
+ result = use_case.process(data, parsed_config, context, stream_info)
405
+ elif isinstance(use_case, GasLeakUseCase):
406
+ result = use_case.process(data, parsed_config, context, stream_info)
401
407
 
402
408
  #Put all IMAGE based usecases here
403
409
  elif isinstance(use_case, BloodCancerDetectionUseCase):
@@ -8,7 +8,6 @@ post-processing scenarios.
8
8
  from .people_counting import PeopleCountingUseCase, PeopleCountingConfig
9
9
  from .customer_service import CustomerServiceUseCase, CustomerServiceConfig
10
10
  from .advanced_customer_service import AdvancedCustomerServiceUseCase
11
- from .human_activity_recognition import HumanActivityUseCase, HumanActivityConfig
12
11
  from .basic_counting_tracking import BasicCountingTrackingUseCase
13
12
  from .license_plate_detection import LicensePlateUseCase, LicensePlateConfig
14
13
  from .color_detection import ColorDetectionUseCase, ColorDetectionConfig
@@ -70,6 +69,8 @@ from .drowsy_driver_detection import DrowsyDriverUseCase, DrowsyDriverUseCase
70
69
  from .waterbody_segmentation import WaterBodyConfig, WaterBodyUseCase
71
70
  from .litter_monitoring import LitterDetectionConfig,LitterDetectionUseCase
72
71
  from .leak_detection import LeakDetectionConfig, LeakDetectionUseCase
72
+ from .human_activity import HumanActivityRecognitionConfig, HumanActivityRecognitionUseCase
73
+ from .gas_leak_detection import GasLeakConfig, GasLeakUseCase
73
74
 
74
75
  #Put all IMAGE based usecases here
75
76
  from .blood_cancer_detection_img import BloodCancerDetectionConfig, BloodCancerDetectionUseCase
@@ -82,7 +83,6 @@ __all__ = [
82
83
  'PeopleCountingUseCase',
83
84
  'CustomerServiceUseCase',
84
85
  'AdvancedCustomerServiceUseCase',
85
- 'HumanActivityUseCase',
86
86
  'BasicCountingTrackingUseCase',
87
87
  'LicensePlateUseCase',
88
88
  'ColorDetectionUseCase',
@@ -137,6 +137,8 @@ __all__ = [
137
137
  'WaterBodyUseCase',
138
138
  'LitterDetectionUseCase',
139
139
  'LeakDetectionUseCase',
140
+ 'HumanActivityRecognitionUseCase',
141
+ 'GasLeakUseCase',
140
142
 
141
143
  #Put all IMAGE based usecases here
142
144
  'BloodCancerDetectionUseCase',
@@ -151,7 +153,6 @@ __all__ = [
151
153
  'ParkingSpaceConfig',
152
154
  'CustomerServiceConfig',
153
155
  'AdvancedCustomerServiceConfig',
154
- 'HumanActivityConfig',
155
156
  'PPEComplianceConfig',
156
157
  'LicensePlateConfig',
157
158
  'PotholeConfig',
@@ -204,6 +205,8 @@ __all__ = [
204
205
  'WaterBodyConfig',
205
206
  'LitterDetectionConfig',
206
207
  'LeakDetectionConfig',
208
+ 'HumanActivityRecognitionConfig',
209
+ 'GasLeakConfig',
207
210
 
208
211
 
209
212
  #Put all IMAGE based usecase CONFIGS here