matrice-analytics 0.1.60__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_analytics/__init__.py +28 -0
- matrice_analytics/boundary_drawing_internal/README.md +305 -0
- matrice_analytics/boundary_drawing_internal/__init__.py +45 -0
- matrice_analytics/boundary_drawing_internal/boundary_drawing_internal.py +1207 -0
- matrice_analytics/boundary_drawing_internal/boundary_drawing_tool.py +429 -0
- matrice_analytics/boundary_drawing_internal/boundary_tool_template.html +1036 -0
- matrice_analytics/boundary_drawing_internal/data/.gitignore +12 -0
- matrice_analytics/boundary_drawing_internal/example_usage.py +206 -0
- matrice_analytics/boundary_drawing_internal/usage/README.md +110 -0
- matrice_analytics/boundary_drawing_internal/usage/boundary_drawer_launcher.py +102 -0
- matrice_analytics/boundary_drawing_internal/usage/simple_boundary_launcher.py +107 -0
- matrice_analytics/post_processing/README.md +455 -0
- matrice_analytics/post_processing/__init__.py +732 -0
- matrice_analytics/post_processing/advanced_tracker/README.md +650 -0
- matrice_analytics/post_processing/advanced_tracker/__init__.py +17 -0
- matrice_analytics/post_processing/advanced_tracker/base.py +99 -0
- matrice_analytics/post_processing/advanced_tracker/config.py +77 -0
- matrice_analytics/post_processing/advanced_tracker/kalman_filter.py +370 -0
- matrice_analytics/post_processing/advanced_tracker/matching.py +195 -0
- matrice_analytics/post_processing/advanced_tracker/strack.py +230 -0
- matrice_analytics/post_processing/advanced_tracker/tracker.py +367 -0
- matrice_analytics/post_processing/config.py +146 -0
- matrice_analytics/post_processing/core/__init__.py +63 -0
- matrice_analytics/post_processing/core/base.py +704 -0
- matrice_analytics/post_processing/core/config.py +3291 -0
- matrice_analytics/post_processing/core/config_utils.py +925 -0
- matrice_analytics/post_processing/face_reg/__init__.py +43 -0
- matrice_analytics/post_processing/face_reg/compare_similarity.py +556 -0
- matrice_analytics/post_processing/face_reg/embedding_manager.py +950 -0
- matrice_analytics/post_processing/face_reg/face_recognition.py +2234 -0
- matrice_analytics/post_processing/face_reg/face_recognition_client.py +606 -0
- matrice_analytics/post_processing/face_reg/people_activity_logging.py +321 -0
- matrice_analytics/post_processing/ocr/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/easyocr_extractor.py +250 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/__init__.py +9 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/__init__.py +4 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/cli.py +33 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/dataset_stats.py +139 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/export.py +398 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/train.py +447 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/utils.py +129 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/valid.py +93 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/validate_dataset.py +240 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/visualize_augmentation.py +176 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/visualize_predictions.py +96 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/__init__.py +3 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/process.py +246 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/types.py +60 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/utils.py +87 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/__init__.py +3 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/config.py +82 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/hub.py +141 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/plate_recognizer.py +323 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/py.typed +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/augmentation.py +101 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/dataset.py +97 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/config.py +114 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/layers.py +553 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/loss.py +55 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/metric.py +86 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/model_builders.py +95 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/model_schema.py +395 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/backend_utils.py +38 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/utils.py +214 -0
- matrice_analytics/post_processing/ocr/postprocessing.py +270 -0
- matrice_analytics/post_processing/ocr/preprocessing.py +52 -0
- matrice_analytics/post_processing/post_processor.py +1175 -0
- matrice_analytics/post_processing/test_cases/__init__.py +1 -0
- matrice_analytics/post_processing/test_cases/run_tests.py +143 -0
- matrice_analytics/post_processing/test_cases/test_advanced_customer_service.py +841 -0
- matrice_analytics/post_processing/test_cases/test_basic_counting_tracking.py +523 -0
- matrice_analytics/post_processing/test_cases/test_comprehensive.py +531 -0
- matrice_analytics/post_processing/test_cases/test_config.py +852 -0
- matrice_analytics/post_processing/test_cases/test_customer_service.py +585 -0
- matrice_analytics/post_processing/test_cases/test_data_generators.py +583 -0
- matrice_analytics/post_processing/test_cases/test_people_counting.py +510 -0
- matrice_analytics/post_processing/test_cases/test_processor.py +524 -0
- matrice_analytics/post_processing/test_cases/test_usecases.py +165 -0
- matrice_analytics/post_processing/test_cases/test_utilities.py +356 -0
- matrice_analytics/post_processing/test_cases/test_utils.py +743 -0
- matrice_analytics/post_processing/usecases/Histopathological_Cancer_Detection_img.py +604 -0
- matrice_analytics/post_processing/usecases/__init__.py +267 -0
- matrice_analytics/post_processing/usecases/abandoned_object_detection.py +797 -0
- matrice_analytics/post_processing/usecases/advanced_customer_service.py +1601 -0
- matrice_analytics/post_processing/usecases/age_detection.py +842 -0
- matrice_analytics/post_processing/usecases/age_gender_detection.py +1085 -0
- matrice_analytics/post_processing/usecases/anti_spoofing_detection.py +656 -0
- matrice_analytics/post_processing/usecases/assembly_line_detection.py +841 -0
- matrice_analytics/post_processing/usecases/banana_defect_detection.py +624 -0
- matrice_analytics/post_processing/usecases/basic_counting_tracking.py +667 -0
- matrice_analytics/post_processing/usecases/blood_cancer_detection_img.py +881 -0
- matrice_analytics/post_processing/usecases/car_damage_detection.py +834 -0
- matrice_analytics/post_processing/usecases/car_part_segmentation.py +946 -0
- matrice_analytics/post_processing/usecases/car_service.py +1601 -0
- matrice_analytics/post_processing/usecases/cardiomegaly_classification.py +864 -0
- matrice_analytics/post_processing/usecases/cell_microscopy_segmentation.py +897 -0
- matrice_analytics/post_processing/usecases/chicken_pose_detection.py +648 -0
- matrice_analytics/post_processing/usecases/child_monitoring.py +814 -0
- matrice_analytics/post_processing/usecases/color/clip.py +660 -0
- matrice_analytics/post_processing/usecases/color/clip_processor/merges.txt +48895 -0
- matrice_analytics/post_processing/usecases/color/clip_processor/preprocessor_config.json +28 -0
- matrice_analytics/post_processing/usecases/color/clip_processor/special_tokens_map.json +30 -0
- matrice_analytics/post_processing/usecases/color/clip_processor/tokenizer.json +245079 -0
- matrice_analytics/post_processing/usecases/color/clip_processor/tokenizer_config.json +32 -0
- matrice_analytics/post_processing/usecases/color/clip_processor/vocab.json +1 -0
- matrice_analytics/post_processing/usecases/color/color_map_utils.py +70 -0
- matrice_analytics/post_processing/usecases/color/color_mapper.py +468 -0
- matrice_analytics/post_processing/usecases/color_detection.py +1936 -0
- matrice_analytics/post_processing/usecases/color_map_utils.py +70 -0
- matrice_analytics/post_processing/usecases/concrete_crack_detection.py +827 -0
- matrice_analytics/post_processing/usecases/crop_weed_detection.py +781 -0
- matrice_analytics/post_processing/usecases/customer_service.py +1008 -0
- matrice_analytics/post_processing/usecases/defect_detection_products.py +936 -0
- matrice_analytics/post_processing/usecases/distracted_driver_detection.py +822 -0
- matrice_analytics/post_processing/usecases/drone_traffic_monitoring.py +585 -0
- matrice_analytics/post_processing/usecases/drowsy_driver_detection.py +829 -0
- matrice_analytics/post_processing/usecases/dwell_detection.py +829 -0
- matrice_analytics/post_processing/usecases/emergency_vehicle_detection.py +827 -0
- matrice_analytics/post_processing/usecases/face_emotion.py +813 -0
- matrice_analytics/post_processing/usecases/face_recognition.py +827 -0
- matrice_analytics/post_processing/usecases/fashion_detection.py +835 -0
- matrice_analytics/post_processing/usecases/field_mapping.py +902 -0
- matrice_analytics/post_processing/usecases/fire_detection.py +1146 -0
- matrice_analytics/post_processing/usecases/flare_analysis.py +836 -0
- matrice_analytics/post_processing/usecases/flower_segmentation.py +1006 -0
- matrice_analytics/post_processing/usecases/gas_leak_detection.py +837 -0
- matrice_analytics/post_processing/usecases/gender_detection.py +832 -0
- matrice_analytics/post_processing/usecases/human_activity_recognition.py +871 -0
- matrice_analytics/post_processing/usecases/intrusion_detection.py +1672 -0
- matrice_analytics/post_processing/usecases/leaf.py +821 -0
- matrice_analytics/post_processing/usecases/leaf_disease.py +840 -0
- matrice_analytics/post_processing/usecases/leak_detection.py +837 -0
- matrice_analytics/post_processing/usecases/license_plate_detection.py +1188 -0
- matrice_analytics/post_processing/usecases/license_plate_monitoring.py +1781 -0
- matrice_analytics/post_processing/usecases/litter_monitoring.py +717 -0
- matrice_analytics/post_processing/usecases/mask_detection.py +869 -0
- matrice_analytics/post_processing/usecases/natural_disaster.py +907 -0
- matrice_analytics/post_processing/usecases/parking.py +787 -0
- matrice_analytics/post_processing/usecases/parking_space_detection.py +822 -0
- matrice_analytics/post_processing/usecases/pcb_defect_detection.py +888 -0
- matrice_analytics/post_processing/usecases/pedestrian_detection.py +808 -0
- matrice_analytics/post_processing/usecases/people_counting.py +706 -0
- matrice_analytics/post_processing/usecases/people_counting_bckp.py +1683 -0
- matrice_analytics/post_processing/usecases/people_tracking.py +1842 -0
- matrice_analytics/post_processing/usecases/pipeline_detection.py +605 -0
- matrice_analytics/post_processing/usecases/plaque_segmentation_img.py +874 -0
- matrice_analytics/post_processing/usecases/pothole_segmentation.py +915 -0
- matrice_analytics/post_processing/usecases/ppe_compliance.py +645 -0
- matrice_analytics/post_processing/usecases/price_tag_detection.py +822 -0
- matrice_analytics/post_processing/usecases/proximity_detection.py +1901 -0
- matrice_analytics/post_processing/usecases/road_lane_detection.py +623 -0
- matrice_analytics/post_processing/usecases/road_traffic_density.py +832 -0
- matrice_analytics/post_processing/usecases/road_view_segmentation.py +915 -0
- matrice_analytics/post_processing/usecases/shelf_inventory_detection.py +583 -0
- matrice_analytics/post_processing/usecases/shoplifting_detection.py +822 -0
- matrice_analytics/post_processing/usecases/shopping_cart_analysis.py +899 -0
- matrice_analytics/post_processing/usecases/skin_cancer_classification_img.py +864 -0
- matrice_analytics/post_processing/usecases/smoker_detection.py +833 -0
- matrice_analytics/post_processing/usecases/solar_panel.py +810 -0
- matrice_analytics/post_processing/usecases/suspicious_activity_detection.py +1030 -0
- matrice_analytics/post_processing/usecases/template_usecase.py +380 -0
- matrice_analytics/post_processing/usecases/theft_detection.py +648 -0
- matrice_analytics/post_processing/usecases/traffic_sign_monitoring.py +724 -0
- matrice_analytics/post_processing/usecases/underground_pipeline_defect_detection.py +775 -0
- matrice_analytics/post_processing/usecases/underwater_pollution_detection.py +842 -0
- matrice_analytics/post_processing/usecases/vehicle_monitoring.py +1029 -0
- matrice_analytics/post_processing/usecases/warehouse_object_segmentation.py +899 -0
- matrice_analytics/post_processing/usecases/waterbody_segmentation.py +923 -0
- matrice_analytics/post_processing/usecases/weapon_detection.py +771 -0
- matrice_analytics/post_processing/usecases/weld_defect_detection.py +615 -0
- matrice_analytics/post_processing/usecases/wildlife_monitoring.py +898 -0
- matrice_analytics/post_processing/usecases/windmill_maintenance.py +834 -0
- matrice_analytics/post_processing/usecases/wound_segmentation.py +856 -0
- matrice_analytics/post_processing/utils/__init__.py +150 -0
- matrice_analytics/post_processing/utils/advanced_counting_utils.py +400 -0
- matrice_analytics/post_processing/utils/advanced_helper_utils.py +317 -0
- matrice_analytics/post_processing/utils/advanced_tracking_utils.py +461 -0
- matrice_analytics/post_processing/utils/alerting_utils.py +213 -0
- matrice_analytics/post_processing/utils/category_mapping_utils.py +94 -0
- matrice_analytics/post_processing/utils/color_utils.py +592 -0
- matrice_analytics/post_processing/utils/counting_utils.py +182 -0
- matrice_analytics/post_processing/utils/filter_utils.py +261 -0
- matrice_analytics/post_processing/utils/format_utils.py +293 -0
- matrice_analytics/post_processing/utils/geometry_utils.py +300 -0
- matrice_analytics/post_processing/utils/smoothing_utils.py +358 -0
- matrice_analytics/post_processing/utils/tracking_utils.py +234 -0
- matrice_analytics/py.typed +0 -0
- matrice_analytics-0.1.60.dist-info/METADATA +481 -0
- matrice_analytics-0.1.60.dist-info/RECORD +196 -0
- matrice_analytics-0.1.60.dist-info/WHEEL +5 -0
- matrice_analytics-0.1.60.dist-info/licenses/LICENSE.txt +21 -0
- matrice_analytics-0.1.60.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Post-processing utilities for Matrice SDK.
|
|
3
|
+
|
|
4
|
+
This module provides a unified, clean interface for post-processing model outputs
|
|
5
|
+
with support for various use cases like people counting, customer service analysis,
|
|
6
|
+
and more.
|
|
7
|
+
|
|
8
|
+
Key Features:
|
|
9
|
+
- Unified PostProcessor class for all processing needs
|
|
10
|
+
- Built-in use case processors for common scenarios
|
|
11
|
+
- Flexible configuration management with JSON/YAML support
|
|
12
|
+
- Comprehensive validation and error handling
|
|
13
|
+
- Processing statistics and insights
|
|
14
|
+
- Zone-based analysis and tracking
|
|
15
|
+
|
|
16
|
+
Quick Start:
|
|
17
|
+
from matrice_analytics.post_processing import PostProcessor
|
|
18
|
+
|
|
19
|
+
# Simple processing
|
|
20
|
+
processor = PostProcessor()
|
|
21
|
+
result = processor.process_simple(
|
|
22
|
+
raw_results, "people_counting",
|
|
23
|
+
confidence_threshold=0.5
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
# With configuration file
|
|
27
|
+
result = processor.process_from_file(raw_results, "config.json")
|
|
28
|
+
|
|
29
|
+
# Get available use cases
|
|
30
|
+
usecases = processor.list_available_usecases()
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
# Core components - main processing interface
|
|
34
|
+
from .post_processor import (
|
|
35
|
+
PostProcessor,
|
|
36
|
+
process_simple,
|
|
37
|
+
create_config_template,
|
|
38
|
+
list_available_usecases,
|
|
39
|
+
validate_config
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# Core data structures and base classes
|
|
43
|
+
from .core.base import (
|
|
44
|
+
ProcessingResult,
|
|
45
|
+
ProcessingContext,
|
|
46
|
+
ProcessingStatus,
|
|
47
|
+
ResultFormat,
|
|
48
|
+
BaseProcessor,
|
|
49
|
+
BaseUseCase,
|
|
50
|
+
ProcessorRegistry,
|
|
51
|
+
registry
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Configuration system
|
|
55
|
+
from .core.config import (
|
|
56
|
+
BaseConfig,
|
|
57
|
+
PeopleCountingConfig,
|
|
58
|
+
CustomerServiceConfig,
|
|
59
|
+
ProximityConfig,
|
|
60
|
+
ZoneConfig,
|
|
61
|
+
TrackingConfig,
|
|
62
|
+
AlertConfig,
|
|
63
|
+
ConfigManager,
|
|
64
|
+
config_manager,
|
|
65
|
+
ConfigValidationError
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# Additional config imports
|
|
69
|
+
from .usecases.color_detection import ColorDetectionConfig
|
|
70
|
+
from .usecases.fire_detection import FireSmokeUseCase, FireSmokeConfig
|
|
71
|
+
from .usecases.license_plate_detection import LicensePlateConfig
|
|
72
|
+
from .usecases.pothole_segmentation import PotholeConfig
|
|
73
|
+
from .usecases.wound_segmentation import WoundConfig, WoundSegmentationUseCase
|
|
74
|
+
from .usecases.face_emotion import FaceEmotionConfig
|
|
75
|
+
from .usecases.pipeline_detection import PipelineDetectionUseCase
|
|
76
|
+
from .usecases.parking_space_detection import ParkingSpaceConfig
|
|
77
|
+
from .usecases.underwater_pollution_detection import UnderwaterPlasticConfig
|
|
78
|
+
from .usecases.pedestrian_detection import PedestrianDetectionConfig
|
|
79
|
+
from .usecases.age_detection import AgeDetectionConfig
|
|
80
|
+
from .usecases.mask_detection import MaskDetectionConfig
|
|
81
|
+
from .usecases.pipeline_detection import PipelineDetectionConfig
|
|
82
|
+
from .usecases.chicken_pose_detection import ChickenPoseDetectionConfig
|
|
83
|
+
from .usecases.field_mapping import FieldMappingConfig, FieldMappingUseCase
|
|
84
|
+
from .usecases.leaf_disease import LeafDiseaseDetectionConfig, LeafDiseaseDetectionUseCase
|
|
85
|
+
from .usecases.parking import ParkingConfig
|
|
86
|
+
from .usecases.abandoned_object_detection import AbandonedObjectConfig
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
from .usecases.weld_defect_detection import WeldDefectConfig
|
|
90
|
+
from .usecases.weapon_detection import WeaponDetectionConfig
|
|
91
|
+
|
|
92
|
+
from .usecases.car_damage_detection import CarDamageConfig
|
|
93
|
+
from .usecases.price_tag_detection import PriceTagConfig
|
|
94
|
+
from .usecases.banana_defect_detection import BananaMonitoringConfig
|
|
95
|
+
from .usecases.distracted_driver_detection import DistractedDriverConfig
|
|
96
|
+
from .usecases.emergency_vehicle_detection import EmergencyVehicleConfig
|
|
97
|
+
from .usecases.solar_panel import SolarPanelConfig
|
|
98
|
+
from .usecases.theft_detection import TheftDetectionConfig
|
|
99
|
+
from .usecases.traffic_sign_monitoring import TrafficSignMonitoringConfig
|
|
100
|
+
from .usecases.crop_weed_detection import CropWeedDetectionConfig
|
|
101
|
+
from .usecases.child_monitoring import ChildMonitoringConfig
|
|
102
|
+
from .usecases.gender_detection import GenderDetectionConfig
|
|
103
|
+
from .usecases.concrete_crack_detection import ConcreteCrackConfig
|
|
104
|
+
from .usecases.fashion_detection import FashionDetectionConfig, FashionDetectionUseCase
|
|
105
|
+
from .usecases.shelf_inventory_detection import ShelfInventoryConfig
|
|
106
|
+
from .usecases.road_lane_detection import LaneDetectionConfig
|
|
107
|
+
|
|
108
|
+
from .usecases.warehouse_object_segmentation import WarehouseObjectConfig
|
|
109
|
+
from .usecases.shopping_cart_analysis import ShoppingCartConfig
|
|
110
|
+
from .usecases.anti_spoofing_detection import AntiSpoofingDetectionConfig
|
|
111
|
+
|
|
112
|
+
from .usecases.shoplifting_detection import ShopliftingDetectionConfig, ShopliftingDetectionUseCase
|
|
113
|
+
from .usecases.defect_detection_products import BottleDefectUseCase, BottleDefectConfig
|
|
114
|
+
from .usecases.assembly_line_detection import AssemblyLineUseCase, AssemblyLineConfig
|
|
115
|
+
from .usecases.car_part_segmentation import CarPartSegmentationUseCase, CarPartSegmentationConfig
|
|
116
|
+
from .usecases.windmill_maintenance import WindmillMaintenanceUseCase, WindmillMaintenanceConfig
|
|
117
|
+
from .usecases.flower_segmentation import FlowerUseCase, FlowerConfig
|
|
118
|
+
from .usecases.leaf import LeafConfig, LeafUseCase
|
|
119
|
+
from .usecases.litter_monitoring import LitterDetectionUseCase,LitterDetectionConfig
|
|
120
|
+
from .usecases.human_activity_recognition import HumanActivityUseCase, HumanActivityConfig
|
|
121
|
+
from .usecases.gas_leak_detection import GasLeakDetectionConfig, GasLeakDetectionUseCase
|
|
122
|
+
from .usecases.license_plate_monitoring import LicensePlateMonitorConfig,LicensePlateMonitorUseCase
|
|
123
|
+
from .usecases.dwell_detection import DwellConfig,DwellUseCase
|
|
124
|
+
from .usecases.age_gender_detection import AgeGenderConfig, AgeGenderUseCase
|
|
125
|
+
from .usecases.people_tracking import PeopleTrackingConfig,PeopleTrackingUseCase
|
|
126
|
+
from .usecases.wildlife_monitoring import WildLifeMonitoringConfig, WildLifeMonitoringUseCase
|
|
127
|
+
from .usecases.pcb_defect_detection import PCBDefectConfig, PCBDefectUseCase
|
|
128
|
+
from .usecases.underground_pipeline_defect_detection import UndergroundPipelineDefectConfig,UndergroundPipelineDefectUseCase
|
|
129
|
+
from .usecases.suspicious_activity_detection import SusActivityConfig, SusActivityUseCase
|
|
130
|
+
from .usecases.natural_disaster import NaturalDisasterConfig, NaturalDisasterUseCase
|
|
131
|
+
|
|
132
|
+
#Put all IMAGE based usecases here
|
|
133
|
+
from .usecases.blood_cancer_detection_img import BloodCancerDetectionConfig, BloodCancerDetectionUseCase
|
|
134
|
+
from .usecases.skin_cancer_classification_img import SkinCancerClassificationConfig, SkinCancerClassificationUseCase
|
|
135
|
+
from .usecases.plaque_segmentation_img import PlaqueSegmentationConfig, PlaqueSegmentationUseCase
|
|
136
|
+
from .usecases.smoker_detection import SmokerDetectionUseCase, SmokerDetectionConfig
|
|
137
|
+
from .usecases.Histopathological_Cancer_Detection_img import HistopathologicalCancerDetectionConfig, HistopathologicalCancerDetectionUseCase
|
|
138
|
+
from .usecases.drone_traffic_monitoring import DroneTrafficMonitoringUsecase, VehiclePeopleDroneMonitoringConfig
|
|
139
|
+
|
|
140
|
+
# Face recognition with embeddings
|
|
141
|
+
from .face_reg.face_recognition import FaceRecognitionEmbeddingUseCase, FaceRecognitionEmbeddingConfig
|
|
142
|
+
|
|
143
|
+
# Use case implementations
|
|
144
|
+
from .usecases import (
|
|
145
|
+
PeopleCountingUseCase,
|
|
146
|
+
CustomerServiceUseCase,
|
|
147
|
+
ProximityUseCase,
|
|
148
|
+
AdvancedCustomerServiceUseCase,
|
|
149
|
+
BasicCountingTrackingUseCase,
|
|
150
|
+
LicensePlateUseCase,
|
|
151
|
+
ColorDetectionUseCase,
|
|
152
|
+
PPEComplianceUseCase,
|
|
153
|
+
CarDamageDetectionUseCase,
|
|
154
|
+
VehicleMonitoringUseCase,
|
|
155
|
+
DroneTrafficMonitoringUsecase,
|
|
156
|
+
FireSmokeUseCase,
|
|
157
|
+
MaskDetectionUseCase,
|
|
158
|
+
ParkingSpaceUseCase,
|
|
159
|
+
FlareAnalysisUseCase,
|
|
160
|
+
PotholeSegmentationUseCase,
|
|
161
|
+
ParkingUseCase,
|
|
162
|
+
FaceEmotionUseCase,
|
|
163
|
+
UnderwaterPlasticUseCase,
|
|
164
|
+
PedestrianDetectionUseCase,
|
|
165
|
+
LeafUseCase,
|
|
166
|
+
WoundSegmentationUseCase,
|
|
167
|
+
AgeDetectionUseCase,
|
|
168
|
+
BananaMonitoringUseCase,
|
|
169
|
+
WeldDefectUseCase,
|
|
170
|
+
PriceTagUseCase,
|
|
171
|
+
DistractedDriverUseCase,
|
|
172
|
+
EmergencyVehicleUseCase,
|
|
173
|
+
SolarPanelUseCase,
|
|
174
|
+
ChickenPoseDetectionUseCase,
|
|
175
|
+
LeafDiseaseDetectionUseCase,
|
|
176
|
+
TheftDetectionUseCase,
|
|
177
|
+
TrafficSignMonitoringUseCase,
|
|
178
|
+
CropWeedDetectionUseCase,
|
|
179
|
+
ChildMonitoringUseCase,
|
|
180
|
+
GenderDetectionUseCase,
|
|
181
|
+
WeaponDetectionUseCase,
|
|
182
|
+
FashionDetectionUseCase,
|
|
183
|
+
ConcreteCrackUseCase,
|
|
184
|
+
WarehouseObjectUseCase,
|
|
185
|
+
ShoppingCartUseCase,
|
|
186
|
+
BottleDefectUseCase,
|
|
187
|
+
AssemblyLineUseCase,
|
|
188
|
+
FieldMappingUseCase,
|
|
189
|
+
AntiSpoofingDetectionUseCase,
|
|
190
|
+
ShelfInventoryUseCase,
|
|
191
|
+
LaneDetectionUseCase,
|
|
192
|
+
WindmillMaintenanceUseCase,
|
|
193
|
+
CarPartSegmentationUseCase,
|
|
194
|
+
FlowerUseCase,
|
|
195
|
+
SmokerDetectionUseCase,
|
|
196
|
+
LitterDetectionUseCase,
|
|
197
|
+
AbandonedObjectDetectionUseCase,
|
|
198
|
+
LicensePlateMonitorUseCase,
|
|
199
|
+
DwellUseCase,
|
|
200
|
+
AgeGenderUseCase,
|
|
201
|
+
WildLifeMonitoringUseCase,
|
|
202
|
+
PCBDefectUseCase,
|
|
203
|
+
HumanActivityUseCase,
|
|
204
|
+
UndergroundPipelineDefectUseCase,
|
|
205
|
+
|
|
206
|
+
SusActivityUseCase,
|
|
207
|
+
NaturalDisasterUseCase,
|
|
208
|
+
|
|
209
|
+
#Put all IMAGE based usecases here
|
|
210
|
+
BloodCancerDetectionUseCase,
|
|
211
|
+
SkinCancerClassificationUseCase,
|
|
212
|
+
PlaqueSegmentationUseCase,
|
|
213
|
+
HistopathologicalCancerDetectionUseCase,
|
|
214
|
+
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
# Register use cases automatically
|
|
218
|
+
_people_counting = PeopleCountingUseCase()
|
|
219
|
+
_drone_traffic_monitoring = DroneTrafficMonitoringUsecase()
|
|
220
|
+
_customer_service = CustomerServiceUseCase()
|
|
221
|
+
_proximity_detection = ProximityUseCase()
|
|
222
|
+
_advanced_customer_service = AdvancedCustomerServiceUseCase()
|
|
223
|
+
_basic_counting_tracking = BasicCountingTrackingUseCase()
|
|
224
|
+
_license_plate = LicensePlateUseCase()
|
|
225
|
+
_color_detection = ColorDetectionUseCase()
|
|
226
|
+
_ppe_compliance = PPEComplianceUseCase()
|
|
227
|
+
_vehicle_monitoring = VehicleMonitoringUseCase()
|
|
228
|
+
_fire_detection = FireSmokeUseCase()
|
|
229
|
+
_flare_analysis = FlareAnalysisUseCase()
|
|
230
|
+
_pothole_segmentation = PotholeSegmentationUseCase()
|
|
231
|
+
_face_emotion = FaceEmotionUseCase()
|
|
232
|
+
_parking_space_detection = ParkingSpaceUseCase()
|
|
233
|
+
_underwater_pollution_detection = UnderwaterPlasticUseCase()
|
|
234
|
+
_pedestrian_detection = PedestrianDetectionUseCase()
|
|
235
|
+
_age_detection = AgeDetectionUseCase()
|
|
236
|
+
_mask_detection = MaskDetectionUseCase()
|
|
237
|
+
_pipeline_detection = PipelineDetectionUseCase()
|
|
238
|
+
_banana_defect_detection = BananaMonitoringUseCase()
|
|
239
|
+
_chicken_pose_detection = ChickenPoseDetectionUseCase()
|
|
240
|
+
_theft_detection = TheftDetectionUseCase()
|
|
241
|
+
_traffic_sign_monitoring = TrafficSignMonitoringUseCase()
|
|
242
|
+
_shelf_inventory = ShelfInventoryUseCase()
|
|
243
|
+
_lane_detection = LaneDetectionUseCase()
|
|
244
|
+
|
|
245
|
+
_weld_defect_detection = WeldDefectUseCase()
|
|
246
|
+
_pricetag_detection = PriceTagUseCase()
|
|
247
|
+
_car_damage = CarDamageDetectionUseCase()
|
|
248
|
+
_distracted_driver = DistractedDriverUseCase()
|
|
249
|
+
_emergency_vehicle_detection = EmergencyVehicleUseCase()
|
|
250
|
+
_solar_panel = SolarPanelUseCase()
|
|
251
|
+
_crop_weed_detection = CropWeedDetectionUseCase()
|
|
252
|
+
_child_monitoring = ChildMonitoringUseCase()
|
|
253
|
+
_gender_detection = GenderDetectionUseCase()
|
|
254
|
+
_weapon_tracking = WeaponDetectionUseCase()
|
|
255
|
+
_concrete_crack_detection = ConcreteCrackUseCase()
|
|
256
|
+
_fashion_detection = FashionDetectionUseCase()
|
|
257
|
+
|
|
258
|
+
_warehouse_object_segmentation = WarehouseObjectUseCase()
|
|
259
|
+
_shopping_cart_analysis = ShoppingCartUseCase()
|
|
260
|
+
_anti_spoofing_detection = AntiSpoofingDetectionUseCase()
|
|
261
|
+
_parking_det = ParkingUseCase()
|
|
262
|
+
|
|
263
|
+
_shoplifting_detection = ShopliftingDetectionUseCase()
|
|
264
|
+
_defect_detection_products = BottleDefectUseCase()
|
|
265
|
+
_assembly_line_detection = AssemblyLineUseCase()
|
|
266
|
+
_car_part_segmentation = CarPartSegmentationUseCase()
|
|
267
|
+
|
|
268
|
+
_windmill_maintenance = WindmillMaintenanceUseCase()
|
|
269
|
+
|
|
270
|
+
_field_mapping = FieldMappingUseCase()
|
|
271
|
+
_wound_segmentation = WoundSegmentationUseCase()
|
|
272
|
+
_leaf_disease = LeafDiseaseDetectionUseCase()
|
|
273
|
+
_flower_segmentation = FlowerUseCase()
|
|
274
|
+
_leaf_det = LeafUseCase()
|
|
275
|
+
_smoker_detection = SmokerDetectionUseCase()
|
|
276
|
+
_litter_detection = LitterDetectionUseCase()
|
|
277
|
+
_abandoned_object_detection = AbandonedObjectDetectionUseCase()
|
|
278
|
+
_human_activity_recognition = HumanActivityUseCase()
|
|
279
|
+
_gas_leak_detection = GasLeakDetectionUseCase()
|
|
280
|
+
_license_plate_monitor = LicensePlateMonitorUseCase()
|
|
281
|
+
_dwell = DwellUseCase()
|
|
282
|
+
_age_gender_detection = AgeGenderUseCase()
|
|
283
|
+
_people_tracking = PeopleTrackingUseCase()
|
|
284
|
+
_wildlife_monitoring = WildLifeMonitoringUseCase()
|
|
285
|
+
_pcb_defect_detection = PCBDefectUseCase()
|
|
286
|
+
_underground_pipeline_defect = UndergroundPipelineDefectUseCase()
|
|
287
|
+
_suspicious_activity_detection = SusActivityUseCase()
|
|
288
|
+
_natural_disaster = NaturalDisasterUseCase()
|
|
289
|
+
|
|
290
|
+
# Face recognition with embeddings
|
|
291
|
+
_face_recognition = FaceRecognitionEmbeddingUseCase()
|
|
292
|
+
|
|
293
|
+
#Put all IMAGE based usecases here
|
|
294
|
+
_blood_cancer_detection = BloodCancerDetectionUseCase()
|
|
295
|
+
_skin_cancer_classification = SkinCancerClassificationUseCase()
|
|
296
|
+
_plaque_segmentation = PlaqueSegmentationUseCase()
|
|
297
|
+
_histopathological_cancer_detection = HistopathologicalCancerDetectionUseCase()
|
|
298
|
+
|
|
299
|
+
registry.register_use_case(_abandoned_object_detection.category, _abandoned_object_detection.name, AbandonedObjectDetectionUseCase)
|
|
300
|
+
registry.register_use_case(_litter_detection.category, _litter_detection.name, LitterDetectionUseCase)
|
|
301
|
+
registry.register_use_case(_people_counting.category, _people_counting.name, PeopleCountingUseCase)
|
|
302
|
+
registry.register_use_case(_drone_traffic_monitoring.category, _drone_traffic_monitoring.name, DroneTrafficMonitoringUsecase)
|
|
303
|
+
registry.register_use_case(_proximity_detection.category, _proximity_detection.name, ProximityUseCase)
|
|
304
|
+
registry.register_use_case(_customer_service.category, _customer_service.name, CustomerServiceUseCase)
|
|
305
|
+
registry.register_use_case(_advanced_customer_service.category, _advanced_customer_service.name, AdvancedCustomerServiceUseCase)
|
|
306
|
+
registry.register_use_case(_basic_counting_tracking.category, _basic_counting_tracking.name, BasicCountingTrackingUseCase)
|
|
307
|
+
registry.register_use_case(_license_plate.category, _license_plate.name, LicensePlateUseCase)
|
|
308
|
+
registry.register_use_case(_color_detection.category, _color_detection.name, ColorDetectionUseCase)
|
|
309
|
+
registry.register_use_case(_ppe_compliance.category, _ppe_compliance.name, PPEComplianceUseCase)
|
|
310
|
+
registry.register_use_case(_vehicle_monitoring.category,_vehicle_monitoring.name,VehicleMonitoringUseCase)
|
|
311
|
+
registry.register_use_case(_fire_detection.category,_fire_detection.name,FireSmokeUseCase)
|
|
312
|
+
registry.register_use_case(_flare_analysis.category,_flare_analysis.name,FlareAnalysisUseCase)
|
|
313
|
+
registry.register_use_case(_pothole_segmentation.category, _pothole_segmentation.name, PotholeSegmentationUseCase)
|
|
314
|
+
registry.register_use_case(_face_emotion.category, _face_emotion.name, FaceEmotionUseCase)
|
|
315
|
+
registry.register_use_case(_parking_space_detection.category, _parking_space_detection.name, ParkingSpaceUseCase )
|
|
316
|
+
registry.register_use_case(_underwater_pollution_detection.category, _underwater_pollution_detection.name, UnderwaterPlasticUseCase)
|
|
317
|
+
registry.register_use_case(_pedestrian_detection.category, _pedestrian_detection.name, PedestrianDetectionUseCase)
|
|
318
|
+
registry.register_use_case(_age_detection.category, _age_detection.name, AgeDetectionUseCase)
|
|
319
|
+
registry.register_use_case(_pricetag_detection.category, _pricetag_detection.name, PriceTagUseCase)
|
|
320
|
+
registry.register_use_case(_weld_defect_detection.category, _weld_defect_detection.name, WeldDefectUseCase )
|
|
321
|
+
registry.register_use_case(_mask_detection.category, _mask_detection.name, MaskDetectionUseCase)
|
|
322
|
+
registry.register_use_case(_pipeline_detection.category, _pipeline_detection.name, PipelineDetectionUseCase)
|
|
323
|
+
registry.register_use_case(_banana_defect_detection.category, _banana_defect_detection.name, BananaMonitoringUseCase)
|
|
324
|
+
registry.register_use_case(_chicken_pose_detection.category, _chicken_pose_detection.name, ChickenPoseDetectionUseCase)
|
|
325
|
+
registry.register_use_case(_theft_detection.category, _theft_detection.name, TheftDetectionUseCase)
|
|
326
|
+
registry.register_use_case(_traffic_sign_monitoring.category, _traffic_sign_monitoring.name, TrafficSignMonitoringUseCase)
|
|
327
|
+
registry.register_use_case(_gender_detection.category, _gender_detection.name, GenderDetectionUseCase)
|
|
328
|
+
registry.register_use_case(_anti_spoofing_detection.category, _anti_spoofing_detection.name, AntiSpoofingDetectionUseCase)
|
|
329
|
+
registry.register_use_case(_shelf_inventory.category, _shelf_inventory.name, ShelfInventoryUseCase)
|
|
330
|
+
registry.register_use_case(_lane_detection.category, _lane_detection.name, LaneDetectionUseCase)
|
|
331
|
+
|
|
332
|
+
registry.register_use_case(_car_damage.category, _car_damage.name, CarDamageDetectionUseCase)
|
|
333
|
+
registry.register_use_case(_distracted_driver.category, _distracted_driver.name, DistractedDriverUseCase)
|
|
334
|
+
|
|
335
|
+
registry.register_use_case(_emergency_vehicle_detection.category, _emergency_vehicle_detection.name, EmergencyVehicleUseCase)
|
|
336
|
+
registry.register_use_case(_solar_panel.category, _solar_panel.name, SolarPanelUseCase)
|
|
337
|
+
registry.register_use_case(_crop_weed_detection.category, _crop_weed_detection.name, CropWeedDetectionUseCase)
|
|
338
|
+
registry.register_use_case(_child_monitoring.category, _child_monitoring.name, ChildMonitoringUseCase)
|
|
339
|
+
registry.register_use_case(_weapon_tracking.category, _weapon_tracking.name, WeaponDetectionUseCase)
|
|
340
|
+
registry.register_use_case(_concrete_crack_detection.category, _concrete_crack_detection.name, ConcreteCrackUseCase)
|
|
341
|
+
registry.register_use_case(_fashion_detection.category, _fashion_detection.name, FashionDetectionUseCase)
|
|
342
|
+
|
|
343
|
+
registry.register_use_case(_warehouse_object_segmentation.category, _warehouse_object_segmentation.name, WarehouseObjectUseCase)
|
|
344
|
+
registry.register_use_case(_shopping_cart_analysis.category, _shopping_cart_analysis.name, ShoppingCartUseCase)
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
registry.register_use_case(_shoplifting_detection.category, _shoplifting_detection.name, ShopliftingDetectionUseCase)
|
|
348
|
+
registry.register_use_case(_defect_detection_products.category, _defect_detection_products.name, BottleDefectUseCase)
|
|
349
|
+
registry.register_use_case(_assembly_line_detection.category, _assembly_line_detection.name, AssemblyLineUseCase)
|
|
350
|
+
registry.register_use_case(_car_part_segmentation.category, _car_part_segmentation.name, CarPartSegmentationUseCase)
|
|
351
|
+
|
|
352
|
+
registry.register_use_case(_windmill_maintenance.category, _windmill_maintenance.name, WindmillMaintenanceUseCase)
|
|
353
|
+
|
|
354
|
+
registry.register_use_case(_field_mapping.category, _field_mapping.name, FieldMappingUseCase)
|
|
355
|
+
registry.register_use_case(_wound_segmentation.category, _wound_segmentation.name,WoundSegmentationUseCase)
|
|
356
|
+
registry.register_use_case(_leaf_disease.category, _leaf_disease.name, LeafDiseaseDetectionUseCase)
|
|
357
|
+
registry.register_use_case(_flower_segmentation.category, _flower_segmentation.name, FlowerUseCase)
|
|
358
|
+
registry.register_use_case(_parking_det.category, _parking_det.name, ParkingUseCase)
|
|
359
|
+
registry.register_use_case(_leaf_det.category, _leaf_det.name, LeafUseCase)
|
|
360
|
+
registry.register_use_case(_smoker_detection.category, _smoker_detection.name, SmokerDetectionUseCase)
|
|
361
|
+
registry.register_use_case(_human_activity_recognition.category, _human_activity_recognition.name, HumanActivityUseCase)
|
|
362
|
+
registry.register_use_case(_gas_leak_detection.category, _gas_leak_detection.name, GasLeakDetectionUseCase)
|
|
363
|
+
registry.register_use_case(_license_plate_monitor.category, _license_plate_monitor.name, LicensePlateMonitorUseCase)
|
|
364
|
+
registry.register_use_case(_dwell.category, _dwell.name, DwellUseCase)
|
|
365
|
+
registry.register_use_case(_face_recognition.category, _face_recognition.name, FaceRecognitionEmbeddingUseCase)
|
|
366
|
+
registry.register_use_case(_age_gender_detection.category, _age_gender_detection.name, AgeDetectionUseCase)
|
|
367
|
+
registry.register_use_case(_people_tracking.category, _people_tracking.name, PeopleTrackingUseCase)
|
|
368
|
+
registry.register_use_case(_wildlife_monitoring.category, _wildlife_monitoring.name, WildLifeMonitoringUseCase)
|
|
369
|
+
registry.register_use_case(_pcb_defect_detection.category, _pcb_defect_detection.name, PCBDefectUseCase)
|
|
370
|
+
registry.register_use_case(_underground_pipeline_defect.category, _underground_pipeline_defect.name, UndergroundPipelineDefectUseCase)
|
|
371
|
+
registry.register_use_case(_suspicious_activity_detection.category, _suspicious_activity_detection.name, SusActivityUseCase)
|
|
372
|
+
registry.register_use_case(_natural_disaster.category, _natural_disaster.name, NaturalDisasterUseCase)
|
|
373
|
+
|
|
374
|
+
#Put all IMAGE based usecases here
|
|
375
|
+
registry.register_use_case(_blood_cancer_detection.category, _blood_cancer_detection.name, BloodCancerDetectionUseCase)
|
|
376
|
+
registry.register_use_case(_skin_cancer_classification.category, _skin_cancer_classification.name, SkinCancerClassificationUseCase)
|
|
377
|
+
registry.register_use_case(_plaque_segmentation.category, _plaque_segmentation.name, PlaqueSegmentationUseCase)
|
|
378
|
+
registry.register_use_case(_histopathological_cancer_detection.category, _histopathological_cancer_detection.name, HistopathologicalCancerDetectionUseCase)
|
|
379
|
+
|
|
380
|
+
# Utility functions - organized by category
|
|
381
|
+
from .utils import ( # noqa: E402
|
|
382
|
+
# Geometry utilities
|
|
383
|
+
point_in_polygon,
|
|
384
|
+
get_bbox_center,
|
|
385
|
+
calculate_distance,
|
|
386
|
+
calculate_bbox_overlap,
|
|
387
|
+
calculate_iou,
|
|
388
|
+
get_bbox_area,
|
|
389
|
+
normalize_bbox,
|
|
390
|
+
denormalize_bbox,
|
|
391
|
+
line_segments_intersect,
|
|
392
|
+
|
|
393
|
+
# Format utilities
|
|
394
|
+
convert_to_coco_format,
|
|
395
|
+
convert_to_yolo_format,
|
|
396
|
+
convert_to_tracking_format,
|
|
397
|
+
convert_detection_to_tracking_format,
|
|
398
|
+
convert_tracking_to_detection_format,
|
|
399
|
+
match_results_structure,
|
|
400
|
+
|
|
401
|
+
# Filter utilities
|
|
402
|
+
filter_by_confidence,
|
|
403
|
+
filter_by_categories,
|
|
404
|
+
calculate_bbox_fingerprint,
|
|
405
|
+
clean_expired_tracks,
|
|
406
|
+
remove_duplicate_detections,
|
|
407
|
+
apply_category_mapping,
|
|
408
|
+
filter_by_area,
|
|
409
|
+
|
|
410
|
+
# Counting utilities
|
|
411
|
+
count_objects_by_category,
|
|
412
|
+
count_objects_in_zones,
|
|
413
|
+
count_unique_tracks,
|
|
414
|
+
calculate_counting_summary,
|
|
415
|
+
|
|
416
|
+
# Tracking utilities
|
|
417
|
+
track_objects_in_zone,
|
|
418
|
+
detect_line_crossings,
|
|
419
|
+
analyze_track_movements,
|
|
420
|
+
filter_tracks_by_duration,
|
|
421
|
+
|
|
422
|
+
# New utilities
|
|
423
|
+
create_people_counting_config,
|
|
424
|
+
create_intrusion_detection_config,
|
|
425
|
+
create_proximity_detection_config,
|
|
426
|
+
create_customer_service_config,
|
|
427
|
+
create_advanced_customer_service_config,
|
|
428
|
+
create_basic_counting_tracking_config,
|
|
429
|
+
create_zone_from_bbox,
|
|
430
|
+
create_polygon_zone,
|
|
431
|
+
create_config_from_template,
|
|
432
|
+
validate_zone_polygon,
|
|
433
|
+
get_use_case_examples,
|
|
434
|
+
create_retail_store_zones,
|
|
435
|
+
create_office_zones,
|
|
436
|
+
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
# Convenience functions for backward compatibility and simple usage
|
|
440
|
+
def process_usecase(raw_results, usecase: str, category: str = "general", **config):
|
|
441
|
+
"""
|
|
442
|
+
Process raw results with a specific use case.
|
|
443
|
+
|
|
444
|
+
Args:
|
|
445
|
+
raw_results: Raw model output
|
|
446
|
+
usecase: Use case name ('people_counting', 'customer_service', etc.)
|
|
447
|
+
category: Use case category (default: 'general')
|
|
448
|
+
**config: Configuration parameters
|
|
449
|
+
|
|
450
|
+
Returns:
|
|
451
|
+
ProcessingResult: Processing result with insights
|
|
452
|
+
|
|
453
|
+
Example:
|
|
454
|
+
result = process_usecase(
|
|
455
|
+
raw_results, "people_counting",
|
|
456
|
+
confidence_threshold=0.5,
|
|
457
|
+
zones={"entrance": [[0, 0], [100, 0], [100, 100], [0, 100]]}
|
|
458
|
+
)
|
|
459
|
+
"""
|
|
460
|
+
return process_simple(raw_results, usecase, category, **config)
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
def get_config_template(usecase: str) -> dict:
|
|
464
|
+
"""
|
|
465
|
+
Get configuration template for a use case.
|
|
466
|
+
|
|
467
|
+
Args:
|
|
468
|
+
usecase: Use case name
|
|
469
|
+
|
|
470
|
+
Returns:
|
|
471
|
+
dict: Configuration template
|
|
472
|
+
"""
|
|
473
|
+
return create_config_template(usecase)
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
def get_available_usecases() -> dict:
|
|
477
|
+
"""
|
|
478
|
+
Get all available use cases organized by category.
|
|
479
|
+
|
|
480
|
+
Returns:
|
|
481
|
+
dict: Available use cases by category
|
|
482
|
+
"""
|
|
483
|
+
return list_available_usecases()
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
def create_processor() -> PostProcessor:
|
|
487
|
+
"""
|
|
488
|
+
Create a new PostProcessor instance.
|
|
489
|
+
|
|
490
|
+
Returns:
|
|
491
|
+
PostProcessor: New processor instance
|
|
492
|
+
"""
|
|
493
|
+
return PostProcessor()
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
# Main exports for external use
|
|
498
|
+
__all__ = [
|
|
499
|
+
# Main processor class
|
|
500
|
+
'PostProcessor',
|
|
501
|
+
|
|
502
|
+
# Core data structures
|
|
503
|
+
'ProcessingResult',
|
|
504
|
+
'ProcessingContext',
|
|
505
|
+
'ProcessingStatus',
|
|
506
|
+
'ResultFormat',
|
|
507
|
+
|
|
508
|
+
# Configuration classes
|
|
509
|
+
'BaseConfig',
|
|
510
|
+
'PeopleCountingConfig',
|
|
511
|
+
'ProximityConfig',
|
|
512
|
+
'CustomerServiceConfig',
|
|
513
|
+
'ColorDetectionConfig',
|
|
514
|
+
'LicensePlateConfig',
|
|
515
|
+
'MaskDetectionConfig',
|
|
516
|
+
'ShopliftingDetectionConfig',
|
|
517
|
+
'LeafConfig',
|
|
518
|
+
'CarDamageConfig',
|
|
519
|
+
'LeafDiseaseDetectionConfig',
|
|
520
|
+
'WoundConfig',
|
|
521
|
+
'FieldMappingConfig',
|
|
522
|
+
'ParkingConfig',
|
|
523
|
+
'ParkingSpaceConfig',
|
|
524
|
+
'PotholeConfig',
|
|
525
|
+
'VehicleMonitoringConfig',
|
|
526
|
+
'ZoneConfig',
|
|
527
|
+
'TrackingConfig',
|
|
528
|
+
'AlertConfig',
|
|
529
|
+
'ConfigManager',
|
|
530
|
+
'config_manager',
|
|
531
|
+
'ConfigValidationError',
|
|
532
|
+
'FireSmokeConfig',
|
|
533
|
+
'FlareAnalysisConfig',
|
|
534
|
+
'FaceEmotionConfig',
|
|
535
|
+
'UnderwaterPlasticConfig',
|
|
536
|
+
'PedestrianDetectionConfig',
|
|
537
|
+
'AgeDetectionConfig',
|
|
538
|
+
'WeldDefectConfig',
|
|
539
|
+
'PriceTagConfig',
|
|
540
|
+
'BananaMonitoringConfig',
|
|
541
|
+
'DistractedDriverConfig',
|
|
542
|
+
'EmergencyVehicleConfig',
|
|
543
|
+
'SolarPanelConfig',
|
|
544
|
+
'ChickenPoseDetectionConfig',
|
|
545
|
+
'TheftDetectionConfig',
|
|
546
|
+
'TrafficSignMonitoringConfig',
|
|
547
|
+
'CropWeedDetectionConfig',
|
|
548
|
+
'ChildMonitoringConfig',
|
|
549
|
+
'GenderDetectionConfig',
|
|
550
|
+
'WeaponDetectionConfig',
|
|
551
|
+
'ConcreteCrackConfig',
|
|
552
|
+
'FashionDetectionConfig',
|
|
553
|
+
'WarehouseObjectConfig',
|
|
554
|
+
'ShoppingCartConfig',
|
|
555
|
+
'BottleDefectConfig',
|
|
556
|
+
'AssemblyLineConfig',
|
|
557
|
+
'AntiSpoofingDetectionConfig',
|
|
558
|
+
'ShelfInventoryConfig',
|
|
559
|
+
'CarPartSegmentationConfig',
|
|
560
|
+
'LaneDetectionConfig',
|
|
561
|
+
'WindmillMaintenanceConfig',
|
|
562
|
+
'FlowerConfig',
|
|
563
|
+
'SmokerDetectionConfig',
|
|
564
|
+
'LitterDetectionConfig',
|
|
565
|
+
'AbandonedObjectConfig',
|
|
566
|
+
'GasLeakDetectionConfig',
|
|
567
|
+
'HumanActivityConfig',
|
|
568
|
+
'FaceRecognitionEmbeddingConfig',
|
|
569
|
+
'LicensePlateMonitorConfig',
|
|
570
|
+
'DwellConfig',
|
|
571
|
+
'AgeGenderConfig',
|
|
572
|
+
'WildLifeMonitoringConfig',
|
|
573
|
+
'PCBDefectConfig',
|
|
574
|
+
'UndergroundPipelineDefectConfig',
|
|
575
|
+
'SusActivityConfig',
|
|
576
|
+
'NaturalDisasterConfig',
|
|
577
|
+
'VehiclePeopleDroneMonitoringConfig'
|
|
578
|
+
#Put all IMAGE based usecase CONFIGS here
|
|
579
|
+
'BloodCancerDetectionConfig',
|
|
580
|
+
'SkinCancerClassificationConfig',
|
|
581
|
+
'PlaqueSegmentationConfig',
|
|
582
|
+
'HistopathologicalCancerDetectionConfig',
|
|
583
|
+
|
|
584
|
+
# Use case classes
|
|
585
|
+
'PeopleCountingUseCase',
|
|
586
|
+
'CustomerServiceUseCase',
|
|
587
|
+
'DroneTrafficMonitoringUsecase',
|
|
588
|
+
'ProximityUseCase',
|
|
589
|
+
'AdvancedCustomerServiceUseCase',
|
|
590
|
+
'BasicCountingTrackingUseCase',
|
|
591
|
+
'LicensePlateUseCase',
|
|
592
|
+
'ColorDetectionUseCase',
|
|
593
|
+
'PPEComplianceUseCase',
|
|
594
|
+
'PotholeSegmentationUseCase',
|
|
595
|
+
'WoundSegmentationUseCase',
|
|
596
|
+
'MaskDetectionUseCase',
|
|
597
|
+
'VehicleMonitoringUseCase',
|
|
598
|
+
'FireSmokeUseCase',
|
|
599
|
+
'CarDamageDetectionUseCase',
|
|
600
|
+
'LeafUseCase',
|
|
601
|
+
'ParkingUseCase',
|
|
602
|
+
'ParkingSpaceUseCase',
|
|
603
|
+
'FlareAnalysisUseCase',
|
|
604
|
+
'FieldMappingUseCase',
|
|
605
|
+
'FaceEmotionUseCase',
|
|
606
|
+
'UnderwaterPlasticUseCase',
|
|
607
|
+
'PedestrianDetectionUseCase',
|
|
608
|
+
'AgeDetectionUseCase',
|
|
609
|
+
'ShopliftingDetectionUseCase',
|
|
610
|
+
'WeldDefectUseCase',
|
|
611
|
+
'BananaMonitoringUseCase',
|
|
612
|
+
'LeafDiseaseDetectionUseCase',
|
|
613
|
+
'PriceTagUseCase',
|
|
614
|
+
'DistractedDriverUseCase',
|
|
615
|
+
'EmergencyVehicleUseCase',
|
|
616
|
+
'SolarPanelUseCase',
|
|
617
|
+
'ChickenPoseDetectionUseCase',
|
|
618
|
+
'TheftDetectionUseCase',
|
|
619
|
+
'TrafficSignMonitoringUseCase',
|
|
620
|
+
'WeaponDetectionUseCase',
|
|
621
|
+
'ShelfInventoryUseCase',
|
|
622
|
+
|
|
623
|
+
'CropWeedDetectionUseCase',
|
|
624
|
+
'ChildMonitoringUseCase',
|
|
625
|
+
'GenderDetectionUseCase',
|
|
626
|
+
'ConcreteCrackUseCase',
|
|
627
|
+
'FashionDetectionUseCase',
|
|
628
|
+
'WarehouseObjectUseCase',
|
|
629
|
+
'ShoppingCartUseCase',
|
|
630
|
+
'BottleDefectUseCase',
|
|
631
|
+
'AssemblyLineUseCase',
|
|
632
|
+
'AntiSpoofingDetectionUseCase',
|
|
633
|
+
'CarPartSegmentationUseCase',
|
|
634
|
+
'LaneDetectionUseCase',
|
|
635
|
+
'WindmillMaintenanceUseCase',
|
|
636
|
+
'FlowerUseCase',
|
|
637
|
+
'SmokerDetectionUseCase',
|
|
638
|
+
'LitterDetectionUseCase',
|
|
639
|
+
'AbandonedObjectDetectionUseCase',
|
|
640
|
+
'HumanActivityUseCase',
|
|
641
|
+
'GasLeakDetectionUseCase',
|
|
642
|
+
'FaceRecognitionEmbeddingUseCase',
|
|
643
|
+
'LicensePlateMonitorUseCase',
|
|
644
|
+
'DwellUseCase',
|
|
645
|
+
'AgeGenderUseCase',
|
|
646
|
+
'WildLifeMonitoringUseCase',
|
|
647
|
+
'PCBDefectUseCase',
|
|
648
|
+
'UndergroundPipelineDefectUseCase',
|
|
649
|
+
'SusActivityUseCase',
|
|
650
|
+
'NaturalDisasterUseCase',
|
|
651
|
+
|
|
652
|
+
#Put all IMAGE based usecases here
|
|
653
|
+
'BloodCancerDetectionUseCase',
|
|
654
|
+
'SkinCancerClassificationUseCase',
|
|
655
|
+
'PlaqueSegmentationUseCase',
|
|
656
|
+
'HistopathologicalCancerDetectionUseCase',
|
|
657
|
+
|
|
658
|
+
# Base classes for extension
|
|
659
|
+
'BaseProcessor',
|
|
660
|
+
'BaseUseCase',
|
|
661
|
+
'ProcessorRegistry',
|
|
662
|
+
'registry',
|
|
663
|
+
|
|
664
|
+
# Convenience functions
|
|
665
|
+
'process_simple',
|
|
666
|
+
'process_usecase',
|
|
667
|
+
'create_config_template',
|
|
668
|
+
'get_config_template',
|
|
669
|
+
'list_available_usecases',
|
|
670
|
+
'get_available_usecases',
|
|
671
|
+
'validate_config',
|
|
672
|
+
'create_processor',
|
|
673
|
+
|
|
674
|
+
# Geometry utilities
|
|
675
|
+
'point_in_polygon',
|
|
676
|
+
'get_bbox_center',
|
|
677
|
+
'calculate_distance',
|
|
678
|
+
'calculate_bbox_overlap',
|
|
679
|
+
'calculate_iou',
|
|
680
|
+
'get_bbox_area',
|
|
681
|
+
'normalize_bbox',
|
|
682
|
+
'denormalize_bbox',
|
|
683
|
+
'line_segments_intersect',
|
|
684
|
+
|
|
685
|
+
# Format utilities
|
|
686
|
+
'convert_to_coco_format',
|
|
687
|
+
'convert_to_yolo_format',
|
|
688
|
+
'convert_to_tracking_format',
|
|
689
|
+
'convert_detection_to_tracking_format',
|
|
690
|
+
'convert_tracking_to_detection_format',
|
|
691
|
+
'match_results_structure',
|
|
692
|
+
|
|
693
|
+
# Filter utilities
|
|
694
|
+
'filter_by_confidence',
|
|
695
|
+
'filter_by_categories',
|
|
696
|
+
'calculate_bbox_fingerprint',
|
|
697
|
+
'clean_expired_tracks',
|
|
698
|
+
'remove_duplicate_detections',
|
|
699
|
+
'apply_category_mapping',
|
|
700
|
+
'filter_by_area',
|
|
701
|
+
|
|
702
|
+
# Counting utilities
|
|
703
|
+
'count_objects_by_category',
|
|
704
|
+
'count_objects_in_zones',
|
|
705
|
+
'count_unique_tracks',
|
|
706
|
+
'calculate_counting_summary',
|
|
707
|
+
|
|
708
|
+
# Tracking utilities
|
|
709
|
+
'track_objects_in_zone',
|
|
710
|
+
'detect_line_crossings',
|
|
711
|
+
'analyze_track_movements',
|
|
712
|
+
'filter_tracks_by_duration',
|
|
713
|
+
|
|
714
|
+
# New utilities
|
|
715
|
+
'create_people_counting_config',
|
|
716
|
+
'create_intrusion_detection_config',
|
|
717
|
+
'create_proximity_detection_config',
|
|
718
|
+
'create_customer_service_config',
|
|
719
|
+
'create_advanced_customer_service_config',
|
|
720
|
+
'create_basic_counting_tracking_config',
|
|
721
|
+
'create_zone_from_bbox',
|
|
722
|
+
'create_polygon_zone',
|
|
723
|
+
'create_config_from_template',
|
|
724
|
+
'validate_zone_polygon',
|
|
725
|
+
'get_use_case_examples',
|
|
726
|
+
'create_retail_store_zones',
|
|
727
|
+
'create_office_zones',
|
|
728
|
+
|
|
729
|
+
# Functions
|
|
730
|
+
'list_available_usecases',
|
|
731
|
+
'create_config_from_template'
|
|
732
|
+
]
|