matrice 1.0.99146__py3-none-any.whl → 1.0.99148__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/utils/post_processing/__init__.py +6 -0
- matrice/deploy/utils/post_processing/config.py +2 -0
- matrice/deploy/utils/post_processing/core/config.py +30 -0
- matrice/deploy/utils/post_processing/processor.py +4 -2
- matrice/deploy/utils/post_processing/usecases/__init__.py +3 -0
- matrice/deploy/utils/post_processing/usecases/fire_detection.py +472 -473
- matrice/deploy/utils/post_processing/usecases/smoker_detection.py +833 -0
- {matrice-1.0.99146.dist-info → matrice-1.0.99148.dist-info}/METADATA +1 -1
- {matrice-1.0.99146.dist-info → matrice-1.0.99148.dist-info}/RECORD +12 -11
- {matrice-1.0.99146.dist-info → matrice-1.0.99148.dist-info}/WHEEL +0 -0
- {matrice-1.0.99146.dist-info → matrice-1.0.99148.dist-info}/licenses/LICENSE.txt +0 -0
- {matrice-1.0.99146.dist-info → matrice-1.0.99148.dist-info}/top_level.txt +0 -0
@@ -119,6 +119,7 @@ from .usecases.leaf import LeafConfig, LeafUseCase
|
|
119
119
|
from .usecases.blood_cancer_detection_img import BloodCancerDetectionConfig, BloodCancerDetectionUseCase
|
120
120
|
from .usecases.skin_cancer_classification_img import SkinCancerClassificationConfig, SkinCancerClassificationUseCase
|
121
121
|
from .usecases.plaque_segmentation_img import PlaqueSegmentationConfig, PlaqueSegmentationUseCase
|
122
|
+
from .usecases.smoker_detection import SmokerDetectionUseCase, SmokerDetectionConfig
|
122
123
|
|
123
124
|
# Use case implementations
|
124
125
|
from .usecases import (
|
@@ -170,6 +171,7 @@ from .usecases import (
|
|
170
171
|
WindmillMaintenanceUseCase,
|
171
172
|
CarPartSegmentationUseCase,
|
172
173
|
FlowerUseCase,
|
174
|
+
SmokerDetectionUseCase,
|
173
175
|
|
174
176
|
#Put all IMAGE based usecases here
|
175
177
|
BloodCancerDetectionUseCase,
|
@@ -233,6 +235,7 @@ _wound_segmentation = WoundSegmentationUseCase()
|
|
233
235
|
_leaf_disease = LeafDiseaseDetectionUseCase()
|
234
236
|
_flower_segmentation = FlowerUseCase()
|
235
237
|
_leaf_det = LeafUseCase()
|
238
|
+
_smoker_detection = SmokerDetectionUseCase()
|
236
239
|
|
237
240
|
#Put all IMAGE based usecases here
|
238
241
|
_blood_cancer_detection = BloodCancerDetectionUseCase()
|
@@ -297,6 +300,7 @@ registry.register_use_case(_leaf_disease.category, _leaf_disease.name, LeafDisea
|
|
297
300
|
registry.register_use_case(_flower_segmentation.category, _flower_segmentation.name, FlowerUseCase)
|
298
301
|
registry.register_use_case(_parking_det.category, _parking_det.name, ParkingUseCase)
|
299
302
|
registry.register_use_case(_leaf_det.category, _leaf_det.name, LeafUseCase)
|
303
|
+
registry.register_use_case(_smoker_detection.category, _smoker_detection.name, SmokerDetectionUseCase)
|
300
304
|
|
301
305
|
#Put all IMAGE based usecases here
|
302
306
|
registry.register_use_case(_blood_cancer_detection.category, _blood_cancer_detection.name, BloodCancerDetectionUseCase)
|
@@ -483,6 +487,7 @@ __all__ = [
|
|
483
487
|
'LaneDetectionConfig',
|
484
488
|
'WindmillMaintenanceConfig',
|
485
489
|
'FlowerConfig',
|
490
|
+
'SmokerDetectionConfig',
|
486
491
|
|
487
492
|
#Put all IMAGE based usecase CONFIGS here
|
488
493
|
'BloodCancerDetectionConfig',
|
@@ -540,6 +545,7 @@ __all__ = [
|
|
540
545
|
'LaneDetectionUseCase',
|
541
546
|
'WindmillMaintenanceUseCase',
|
542
547
|
'FlowerUseCase',
|
548
|
+
'SmokerDetectionUseCase',
|
543
549
|
|
544
550
|
#Put all IMAGE based usecases here
|
545
551
|
'BloodCancerDetectionUseCase',
|
@@ -29,6 +29,7 @@ APP_NAME_TO_USECASE = {
|
|
29
29
|
"concrete_crack_detection": "concrete_crack_detection",
|
30
30
|
"lane_detection" : "lane_detection",
|
31
31
|
"shelf_inventory" :"shelf_inventory",
|
32
|
+
"smoker_detection": "smoker_detection"
|
32
33
|
}
|
33
34
|
|
34
35
|
APP_NAME_TO_CATEGORY = {
|
@@ -62,6 +63,7 @@ APP_NAME_TO_CATEGORY = {
|
|
62
63
|
"concrete_crack_detection": "general",
|
63
64
|
"lane_detection" : "traffic",
|
64
65
|
"shelf_inventory" : "retail",
|
66
|
+
"smoker_detection": "general"
|
65
67
|
}
|
66
68
|
|
67
69
|
def get_usecase_from_app_name(app_name: str) -> str:
|
@@ -448,6 +448,7 @@ class ConfigManager:
|
|
448
448
|
'windmill_maintenance': None,
|
449
449
|
'face_emotion': None,
|
450
450
|
'flower_segmentation': None,
|
451
|
+
'smoker_detection': None,
|
451
452
|
|
452
453
|
#Put all image based usecases here::
|
453
454
|
'blood_cancer_detection_img': None,
|
@@ -794,6 +795,14 @@ class ConfigManager:
|
|
794
795
|
except ImportError:
|
795
796
|
return None
|
796
797
|
|
798
|
+
def smoker_detection_config_class(self):
|
799
|
+
"""Register a configuration class for a use case."""
|
800
|
+
try:
|
801
|
+
from ..usecases.smoker_detection import SmokerDetectionConfig
|
802
|
+
return SmokerDetectionConfig
|
803
|
+
except ImportError:
|
804
|
+
return None
|
805
|
+
|
797
806
|
#put all image based usecases here::
|
798
807
|
def blood_cancer_detection_config_class(self):
|
799
808
|
"""Register a configuration class for a use case."""
|
@@ -1618,6 +1627,22 @@ class ConfigManager:
|
|
1618
1627
|
alert_config=alert_config,
|
1619
1628
|
**kwargs
|
1620
1629
|
)
|
1630
|
+
|
1631
|
+
elif usecase == "smoker_detection":
|
1632
|
+
# Import here to avoid circular import
|
1633
|
+
from ..usecases.smoker_detection import SmokerDetectionConfig
|
1634
|
+
|
1635
|
+
# Handle nested configurations
|
1636
|
+
alert_config = kwargs.pop("alert_config", None)
|
1637
|
+
if alert_config and isinstance(alert_config, dict):
|
1638
|
+
alert_config = AlertConfig(**alert_config)
|
1639
|
+
|
1640
|
+
config = SmokerDetectionConfig(
|
1641
|
+
category=category or "general",
|
1642
|
+
usecase=usecase,
|
1643
|
+
alert_config=alert_config,
|
1644
|
+
**kwargs
|
1645
|
+
)
|
1621
1646
|
|
1622
1647
|
|
1623
1648
|
#Add IMAGE based usecases here::
|
@@ -2003,6 +2028,11 @@ class ConfigManager:
|
|
2003
2028
|
from ..usecases.flower_segmentation import FlowerConfig
|
2004
2029
|
default_config = FlowerConfig()
|
2005
2030
|
return default_config.to_dict()
|
2031
|
+
elif usecase == "smoker_detection":
|
2032
|
+
# Import here to avoid circular import
|
2033
|
+
from ..usecases.smoker_detection import SmokerDetectionConfig
|
2034
|
+
default_config = SmokerDetectionConfig()
|
2035
|
+
return default_config.to_dict()
|
2006
2036
|
|
2007
2037
|
#Add all image based usecases here
|
2008
2038
|
elif usecase == "blood_cancer_detection_img":
|
@@ -83,6 +83,7 @@ from .usecases import (
|
|
83
83
|
CarPartSegmentationUseCase,
|
84
84
|
WindmillMaintenanceUseCase,
|
85
85
|
FlowerUseCase,
|
86
|
+
SmokerDetectionUseCase,
|
86
87
|
|
87
88
|
#Put all IMAGE based usecases here
|
88
89
|
BloodCancerDetectionUseCase,
|
@@ -204,6 +205,7 @@ class PostProcessor:
|
|
204
205
|
registry.register_use_case("agriculture", "flower_segmentation", FlowerUseCase)
|
205
206
|
registry.register_use_case("general", "parking_det", ParkingUseCase)
|
206
207
|
registry.register_use_case("agriculture", "leaf_det", LeafUseCase)
|
208
|
+
registry.register_use_case("general", "smoker_detection", SmokerDetectionUseCase)
|
207
209
|
|
208
210
|
#Put all IMAGE based usecases here
|
209
211
|
registry.register_use_case("healthcare", "bloodcancer_img_detection", BloodCancerDetectionUseCase)
|
@@ -354,8 +356,8 @@ class PostProcessor:
|
|
354
356
|
result = use_case.process(data, parsed_config, context, stream_info)
|
355
357
|
elif isinstance(use_case, LeafUseCase):
|
356
358
|
result = use_case.process(data, parsed_config, context, stream_info)
|
357
|
-
|
358
|
-
|
359
|
+
elif isinstance(use_case, SmokerDetectionUseCase):
|
360
|
+
result = use_case.process(data, parsed_config, context, stream_info)
|
359
361
|
|
360
362
|
|
361
363
|
#Put all IMAGE based usecases here
|
@@ -66,6 +66,7 @@ from .leaf import LeafConfig, LeafUseCase
|
|
66
66
|
from .blood_cancer_detection_img import BloodCancerDetectionConfig, BloodCancerDetectionUseCase
|
67
67
|
from .skin_cancer_classification_img import SkinCancerClassificationConfig, SkinCancerClassificationUseCase
|
68
68
|
from .plaque_segmentation_img import PlaqueSegmentationConfig, PlaqueSegmentationUseCase
|
69
|
+
from .smoker_detection import SmokerDetectionConfig, SmokerDetectionUseCase
|
69
70
|
|
70
71
|
__all__ = [
|
71
72
|
'PeopleCountingUseCase',
|
@@ -117,6 +118,7 @@ __all__ = [
|
|
117
118
|
'LaneDetectionUseCase',
|
118
119
|
'WindmillMaintenanceUseCase',
|
119
120
|
'FlowerUseCase',
|
121
|
+
'SmokerDetectionUseCase',
|
120
122
|
|
121
123
|
#Put all IMAGE based usecases here
|
122
124
|
'BloodCancerDetectionUseCase',
|
@@ -173,6 +175,7 @@ __all__ = [
|
|
173
175
|
'LaneDetectionConfig',
|
174
176
|
'WindmillMaintenanceConfig',
|
175
177
|
'FlowerConfig',
|
178
|
+
'SmokerDetectionConfig',
|
176
179
|
|
177
180
|
|
178
181
|
|