matrice 1.0.99393__tar.gz → 1.0.99395__tar.gz
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-1.0.99393/src/matrice.egg-info → matrice-1.0.99395}/PKG-INFO +1 -1
- {matrice-1.0.99393 → matrice-1.0.99395}/setup.py +1 -1
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/vehicle_monitoring.py +158 -139
- {matrice-1.0.99393 → matrice-1.0.99395/src/matrice.egg-info}/PKG-INFO +1 -1
- {matrice-1.0.99393 → matrice-1.0.99395}/LICENSE.txt +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/README.md +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/setup.cfg +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/action.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/actionTracker.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/action_tracker.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/annotation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/app_store.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/application.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/action_instance.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/actions_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/actions_scaledown_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/instance_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/instance_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/prechecks.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/resources_tracker.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/scaling.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/shutdown_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/task_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/aug_server.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/aug_server_v2.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/base.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/bit_depth_reduction.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/blur.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/brightness_contrast.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/color_jitter.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/compression_artifacts.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/downscale_upscale.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/film_grain.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/flip.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/fog.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/horizontal_flip.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/hsv.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/iso_noise.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/low_light.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/posterize.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/rain.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/random_affine.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/salt_pepper.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/shadows.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/snow.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/speckle.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/strategies/sunflare.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/client.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/client_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/create_dataset.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_augmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_augmentor.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/imagenet_classification.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/labelbox_classification.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/labelbox_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/mscoco_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/pascalvoc_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/unlabelled.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/video_davis_segmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/video_detection_mscoco.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/video_imagenet_classification.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/video_kinetics_activity_recognition.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/video_mot_tracking.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/video_mscoco_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/video_youtube_bb_tracking.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/yolo_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_labelling.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_prep.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_processor.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/image_augmentations.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/image_data_augmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/new_data_augmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/pipeline.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/server.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/server_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/video_server.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/dataset.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/aggregator/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/aggregator/aggregator.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/aggregator/analytics.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/aggregator/ingestor.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/aggregator/pipeline.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/aggregator/publisher.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/aggregator/synchronizer.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/auto_streaming/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/auto_streaming/auto_streaming.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/auto_streaming/auto_streaming_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/client.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/client_stream_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/client_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/streaming_gateway/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/streaming_gateway/streaming_gateway.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/streaming_gateway/streaming_gateway_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/client/streaming_gateway/streaming_results_handler.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/optimize/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/optimize/cache_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/optimize/frame_comparators.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/optimize/frame_difference.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/optimize/transmission.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/inference/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/inference/batch_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/inference/inference_interface.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/inference/model_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/inference/triton_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/proxy/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/proxy/proxy_interface.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/proxy/proxy_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/server.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/stream/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/stream/inference_worker.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/stream/kafka_consumer_worker.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/stream/kafka_producer_worker.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/stream/stream_debug_logger.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/stream/stream_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/server/stream/video_buffer.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/stream/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/stream/kafka_stream.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/stream/redis_stream.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/boundary_drawing_internal/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/boundary_drawing_internal/boundary_drawing_internal.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/boundary_drawing_internal/boundary_drawing_tool.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/boundary_drawing_internal/example_usage.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/advanced_tracker/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/advanced_tracker/base.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/advanced_tracker/config.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/advanced_tracker/kalman_filter.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/advanced_tracker/matching.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/advanced_tracker/strack.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/advanced_tracker/tracker.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/config.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/core/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/core/base.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/core/config.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/core/config_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/ocr/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/ocr/easyocr_extractor.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/ocr/postprocessing.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/ocr/preprocessing.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/processor.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/run_tests.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_advanced_customer_service.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_basic_counting_tracking.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_comprehensive.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_config.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_customer_service.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_data_generators.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_people_counting.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_processor.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_utilities.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/test_cases/test_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/Histopathological_Cancer_Detection_img.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/abandoned_object_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/advanced_customer_service.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/age_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/anti_spoofing_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/assembly_line_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/banana_defect_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/basic_counting_tracking.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/blood_cancer_detection_img.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/car_damage_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/car_part_segmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/car_service.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/cardiomegaly_classification.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/chicken_pose_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/child_monitoring.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/color_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/color_map_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/concrete_crack_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/crop_weed_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/customer_service.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/defect_detection_products.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/distracted_driver_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/drowsy_driver_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/emergency_vehicle_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/face_emotion.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/face_recognition.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/fashion_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/field_mapping.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/fire_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/flare_analysis.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/flower_segmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/gas_leak_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/gender_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/human_activity_recognition.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/intrusion_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/leaf.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/leaf_disease.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/leak_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/license_plate_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/license_plate_monitoring.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/litter_monitoring.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/mask_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/parking.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/parking_space_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/pedestrian_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/people_counting.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/pipeline_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/plaque_segmentation_img.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/pothole_segmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/ppe_compliance.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/price_tag_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/proximity_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/road_lane_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/road_traffic_density.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/road_view_segmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/shelf_inventory_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/shoplifting_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/shopping_cart_analysis.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/skin_cancer_classification_img.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/smoker_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/solar_panel.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/template_usecase.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/theft_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/traffic_sign_monitoring.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/underwater_pollution_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/warehouse_object_segmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/waterbody_segmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/weapon_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/weld_defect_detection.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/windmill_maintenance.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/usecases/wound_segmentation.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/advanced_counting_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/advanced_helper_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/advanced_tracking_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/alerting_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/category_mapping_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/color_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/counting_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/filter_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/format_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/geometry_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/smoothing_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deploy/utils/post_processing/utils/tracking_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deployment/__init__.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deployment/camera_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deployment/deployment.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deployment/inference_pipeline.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/deployment/streaming_gateway_manager.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/docker_utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/drift_monitor.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/exported_model.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/local_test.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/metrics_calculator.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/metrics_calculator_oop.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/model_store.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/models.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/pipeline.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/projects.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/rpc.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/scaling.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/session.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/testing.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/token_auth.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/utils.py +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice.egg-info/SOURCES.txt +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice.egg-info/dependency_links.txt +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice.egg-info/requires.txt +0 -0
- {matrice-1.0.99393 → matrice-1.0.99395}/src/matrice.egg-info/top_level.txt +0 -0
@@ -1,22 +1,24 @@
|
|
1
1
|
from typing import Any, Dict, List, Optional, Tuple
|
2
|
+
from dataclasses import asdict
|
2
3
|
import time
|
3
4
|
from datetime import datetime, timezone
|
4
5
|
|
5
|
-
from ..core.base import BaseProcessor, ProcessingContext, ProcessingResult, ConfigProtocol
|
6
|
+
from ..core.base import BaseProcessor, ProcessingContext, ProcessingResult, ConfigProtocol, ResultFormat
|
6
7
|
from ..utils import (
|
7
8
|
filter_by_confidence,
|
8
9
|
filter_by_categories,
|
9
10
|
apply_category_mapping,
|
10
11
|
count_objects_by_category,
|
11
12
|
count_objects_in_zones,
|
13
|
+
calculate_counting_summary,
|
12
14
|
match_results_structure,
|
13
15
|
bbox_smoothing,
|
14
16
|
BBoxSmoothingConfig,
|
15
17
|
BBoxSmoothingTracker
|
16
18
|
)
|
17
|
-
from ..utils.geometry_utils import point_in_polygon, get_bbox_bottom25_center
|
18
19
|
from dataclasses import dataclass, field
|
19
20
|
from ..core.config import BaseConfig, AlertConfig, ZoneConfig
|
21
|
+
from ..utils.geometry_utils import get_bbox_center, point_in_polygon, get_bbox_bottom25_center
|
20
22
|
|
21
23
|
@dataclass
|
22
24
|
class VehicleMonitoringConfig(BaseConfig):
|
@@ -30,24 +32,26 @@ class VehicleMonitoringConfig(BaseConfig):
|
|
30
32
|
zone_config: Optional[ZoneConfig] = None
|
31
33
|
usecase_categories: List[str] = field(
|
32
34
|
default_factory=lambda: [
|
33
|
-
"person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat"
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
,"baseball glove", "skateboard", "surfboard", "tennis racket", "bottle",
|
38
|
-
,"fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich",
|
39
|
-
,"carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch",
|
40
|
-
,"dining table", "toilet", "tv", "laptop", "mouse", "remote",
|
41
|
-
|
42
|
-
,"teddy bear", "hair drier", "toothbrush"
|
35
|
+
"person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat",
|
36
|
+
"traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog",
|
37
|
+
"horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella",
|
38
|
+
"handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports ball", "kite",
|
39
|
+
"baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle",
|
40
|
+
"wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich",
|
41
|
+
"orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch",
|
42
|
+
"potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote",
|
43
|
+
"keyboard", "cell phone", "microwave", "oven", "toaster", "sink", "refrigerator", "book",
|
44
|
+
"clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush"
|
43
45
|
]
|
44
46
|
)
|
45
47
|
target_categories: List[str] = field(
|
46
|
-
default_factory=lambda: [
|
48
|
+
default_factory=lambda: [
|
49
|
+
'car', 'bicycle', 'bus', 'truck', 'motorcycle']
|
47
50
|
)
|
48
51
|
alert_config: Optional[AlertConfig] = None
|
49
52
|
index_to_category: Optional[Dict[int, str]] = field(
|
50
|
-
default_factory=lambda:{
|
53
|
+
default_factory=lambda: {
|
54
|
+
0: "person", 1: "bicycle", 2: "car", 3: "motorcycle", 4: "airplane", 5: "bus",
|
51
55
|
6: "train", 7: "truck", 8: "boat", 9: "traffic light", 10: "fire hydrant",
|
52
56
|
11: "stop sign", 12: "parking meter", 13: "bench", 14: "bird", 15: "cat",
|
53
57
|
16: "dog", 17: "horse", 18: "sheep", 19: "cow", 20: "elephant", 21: "bear",
|
@@ -62,7 +66,8 @@ class VehicleMonitoringConfig(BaseConfig):
|
|
62
66
|
62: "tv", 63: "laptop", 64: "mouse", 65: "remote", 66: "keyboard",
|
63
67
|
67: "cell phone", 68: "microwave", 69: "oven", 70: "toaster", 71: "sink",
|
64
68
|
72: "refrigerator", 73: "book", 74: "clock", 75: "vase", 76: "scissors",
|
65
|
-
77: "teddy bear", 78: "hair drier", 79: "toothbrush"
|
69
|
+
77: "teddy bear", 78: "hair drier", 79: "toothbrush"
|
70
|
+
}
|
66
71
|
)
|
67
72
|
|
68
73
|
class VehicleMonitoringUseCase(BaseProcessor):
|
@@ -82,7 +87,7 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
82
87
|
self.category = "traffic"
|
83
88
|
self.CASE_TYPE: Optional[str] = 'vehicle_monitoring'
|
84
89
|
self.CASE_VERSION: Optional[str] = '1.0'
|
85
|
-
self.target_categories = ['car', 'bicycle', 'bus', 'truck', '
|
90
|
+
self.target_categories = ['car', 'bicycle', 'bus', 'truck', 'motorcycle']
|
86
91
|
self.smoothing_tracker = None
|
87
92
|
self.tracker = None
|
88
93
|
self._total_frame_counter = 0
|
@@ -95,11 +100,22 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
95
100
|
self._ascending_alert_list: List[int] = []
|
96
101
|
self.current_incident_end_timestamp: str = "N/A"
|
97
102
|
self.start_timer = None
|
98
|
-
|
103
|
+
|
104
|
+
# Track ID storage for total count calculation
|
105
|
+
self._total_track_ids = set() # Store all unique track IDs seen across calls
|
106
|
+
self._current_frame_track_ids = set() # Store track IDs from current frame
|
107
|
+
self._total_count = 0 # Cached total count
|
108
|
+
self._last_update_time = time.time() # Track when last updated
|
109
|
+
|
110
|
+
# Zone-based tracking storage
|
111
|
+
self._zone_current_track_ids = {} # zone_name -> set of current track IDs in zone
|
112
|
+
self._zone_total_track_ids = {} # zone_name -> set of all track IDs that have been in zone
|
113
|
+
self._zone_current_counts = {} # zone_name -> current count in zone
|
114
|
+
self._zone_total_counts = {} # zone_name -> total count that have been in zone
|
99
115
|
|
100
116
|
def process(self, data: Any, config: ConfigProtocol, context: Optional[ProcessingContext] = None,
|
101
117
|
stream_info: Optional[Dict[str, Any]] = None) -> ProcessingResult:
|
102
|
-
|
118
|
+
start_time = time.time()
|
103
119
|
if not isinstance(config, VehicleMonitoringConfig):
|
104
120
|
return self.create_error_result("Invalid config type", usecase=self.name, category=self.category, context=context)
|
105
121
|
if context is None:
|
@@ -151,36 +167,7 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
151
167
|
except Exception as e:
|
152
168
|
self.logger.warning(f"AdvancedTracker failed: {e}")
|
153
169
|
|
154
|
-
|
155
|
-
detections_for_counting = processed_data
|
156
|
-
if getattr(config, 'zone_config', None) and getattr(config.zone_config, 'zones', None):
|
157
|
-
zones = config.zone_config.zones
|
158
|
-
in_zone_detections = []
|
159
|
-
for det in processed_data:
|
160
|
-
matched_zones = []
|
161
|
-
for zone_name, zone_polygon in zones.items():
|
162
|
-
if self._is_detection_in_zone(det, zone_polygon):
|
163
|
-
matched_zones.append(zone_name)
|
164
|
-
if matched_zones:
|
165
|
-
det_copy = dict(det)
|
166
|
-
det_copy['zones'] = matched_zones
|
167
|
-
in_zone_detections.append(det_copy)
|
168
|
-
detections_for_counting = in_zone_detections
|
169
|
-
|
170
|
-
self._update_tracking_state(detections_for_counting)
|
171
|
-
# Maintain cumulative per-zone unique track counts using canonicalized track_ids
|
172
|
-
if getattr(config, 'zone_config', None) and getattr(config.zone_config, 'zones', None):
|
173
|
-
if not hasattr(self, '_per_zone_total_track_ids'):
|
174
|
-
self._per_zone_total_track_ids = {}
|
175
|
-
for det in detections_for_counting:
|
176
|
-
track_id = det.get('track_id')
|
177
|
-
if track_id is None:
|
178
|
-
continue
|
179
|
-
category = det.get('category', 'unknown')
|
180
|
-
for zone_name in det.get('zones', []):
|
181
|
-
zone_map = self._per_zone_total_track_ids.setdefault(zone_name, {})
|
182
|
-
cat_set = zone_map.setdefault(category, set())
|
183
|
-
cat_set.add(track_id)
|
170
|
+
self._update_tracking_state(processed_data)
|
184
171
|
self._total_frame_counter += 1
|
185
172
|
|
186
173
|
frame_number = None
|
@@ -191,40 +178,42 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
191
178
|
if start_frame is not None and end_frame is not None and start_frame == end_frame:
|
192
179
|
frame_number = start_frame
|
193
180
|
|
194
|
-
|
195
|
-
|
196
|
-
if getattr(config, 'zone_config', None) and getattr(config.zone_config, 'zones', None):
|
197
|
-
try:
|
198
|
-
zone_counts = count_objects_in_zones(detections_for_counting, config.zone_config.zones)
|
199
|
-
except Exception as e:
|
200
|
-
self.logger.warning("Zone counting failed: %s", e)
|
201
|
-
counting_summary = self._count_categories(detections_for_counting, config)
|
181
|
+
general_counting_summary = calculate_counting_summary(data)
|
182
|
+
counting_summary = self._count_categories(processed_data, config)
|
202
183
|
total_counts = self.get_total_counts()
|
203
184
|
counting_summary['total_counts'] = total_counts
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
print("-----------------------------
|
185
|
+
counting_summary['categories'] = {}
|
186
|
+
for detection in processed_data:
|
187
|
+
category = detection.get("category", "unknown")
|
188
|
+
counting_summary["categories"][category] = counting_summary["categories"].get(category, 0) + 1
|
189
|
+
|
190
|
+
zone_analysis = {}
|
191
|
+
if config.zone_config and config.zone_config.zones:
|
192
|
+
# Convert single frame to format expected by count_objects_in_zones
|
193
|
+
frame_data = processed_data #[frame_detections]
|
194
|
+
zone_analysis = count_objects_in_zones(frame_data, config.zone_config.zones)
|
195
|
+
|
196
|
+
# Update zone tracking with current frame data
|
197
|
+
if zone_analysis and config.enable_tracking:
|
198
|
+
enhanced_zone_analysis = self._update_zone_tracking(zone_analysis, processed_data, config)
|
199
|
+
# Merge enhanced zone analysis with original zone analysis
|
200
|
+
for zone_name, enhanced_data in enhanced_zone_analysis.items():
|
201
|
+
zone_analysis[zone_name] = enhanced_data
|
202
|
+
|
203
|
+
print("-----------------------------ZONEEEE-----------------------------------")
|
204
|
+
print(zone_analysis)
|
205
|
+
print("-----------------------------ZONEEEE-----------------------------------")
|
206
|
+
|
207
|
+
alerts = self._check_alerts(counting_summary,zone_analysis, frame_number, config)
|
208
|
+
predictions = self._extract_predictions(processed_data)
|
209
|
+
|
210
|
+
incidents_list = self._generate_incidents(counting_summary,zone_analysis, alerts, config, frame_number, stream_info)
|
211
|
+
tracking_stats_list = self._generate_tracking_stats(counting_summary,zone_analysis, alerts, config, frame_number, stream_info)
|
212
|
+
print("---------------------------TS--------------------------------------")
|
225
213
|
print(tracking_stats_list)
|
226
|
-
print("
|
227
|
-
|
214
|
+
print("---------------------------TS--------------------------------------")
|
215
|
+
business_analytics_list = self._generate_business_analytics(counting_summary,zone_analysis, alerts, config, stream_info, is_empty=True)
|
216
|
+
summary_list = self._generate_summary(counting_summary,zone_analysis, incidents_list, tracking_stats_list, business_analytics_list, alerts)
|
228
217
|
|
229
218
|
incidents = incidents_list[0] if incidents_list else {}
|
230
219
|
tracking_stats = tracking_stats_list[0] if tracking_stats_list else {}
|
@@ -235,12 +224,9 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
235
224
|
"tracking_stats": tracking_stats,
|
236
225
|
"business_analytics": business_analytics,
|
237
226
|
"alerts": alerts,
|
238
|
-
"zone_analysis":
|
227
|
+
"zone_analysis": zone_analysis,
|
239
228
|
"human_text": summary}
|
240
229
|
}
|
241
|
-
print("--------------------------------agg_summary--------------------------------")
|
242
|
-
print(agg_summary)
|
243
|
-
print("--------------------------------agg_summary--------------------------------")
|
244
230
|
|
245
231
|
context.mark_completed()
|
246
232
|
result = self.create_result(
|
@@ -251,6 +237,84 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
251
237
|
)
|
252
238
|
return result
|
253
239
|
|
240
|
+
def _update_zone_tracking(self, zone_analysis: Dict[str, Dict[str, int]], detections: List[Dict], config: VehicleMonitoringConfig) -> Dict[str, Dict[str, Any]]:
|
241
|
+
"""
|
242
|
+
Update zone tracking with current frame data.
|
243
|
+
|
244
|
+
Args:
|
245
|
+
zone_analysis: Current zone analysis results
|
246
|
+
detections: List of detections with track IDs
|
247
|
+
|
248
|
+
Returns:
|
249
|
+
Enhanced zone analysis with tracking information
|
250
|
+
"""
|
251
|
+
if not zone_analysis or not config.zone_config or not config.zone_config.zones:
|
252
|
+
return {}
|
253
|
+
|
254
|
+
enhanced_zone_analysis = {}
|
255
|
+
zones = config.zone_config.zones
|
256
|
+
|
257
|
+
# Get current frame track IDs in each zone
|
258
|
+
current_frame_zone_tracks = {}
|
259
|
+
|
260
|
+
# Initialize zone tracking for all zones
|
261
|
+
for zone_name in zones.keys():
|
262
|
+
current_frame_zone_tracks[zone_name] = set()
|
263
|
+
if zone_name not in self._zone_current_track_ids:
|
264
|
+
self._zone_current_track_ids[zone_name] = set()
|
265
|
+
if zone_name not in self._zone_total_track_ids:
|
266
|
+
self._zone_total_track_ids[zone_name] = set()
|
267
|
+
|
268
|
+
# Check each detection against each zone
|
269
|
+
for detection in detections:
|
270
|
+
track_id = detection.get("track_id")
|
271
|
+
if track_id is None:
|
272
|
+
continue
|
273
|
+
|
274
|
+
# Get detection bbox
|
275
|
+
bbox = detection.get("bounding_box", detection.get("bbox"))
|
276
|
+
if not bbox:
|
277
|
+
continue
|
278
|
+
|
279
|
+
# Get detection center point
|
280
|
+
center_point = get_bbox_bottom25_center(bbox) #get_bbox_center(bbox)
|
281
|
+
|
282
|
+
# Check which zone this detection is in using actual zone polygons
|
283
|
+
for zone_name, zone_polygon in zones.items():
|
284
|
+
# Convert polygon points to tuples for point_in_polygon function
|
285
|
+
# zone_polygon format: [[x1, y1], [x2, y2], [x3, y3], ...]
|
286
|
+
polygon_points = [(point[0], point[1]) for point in zone_polygon]
|
287
|
+
|
288
|
+
# Check if detection center is inside the zone polygon using ray casting algorithm
|
289
|
+
if point_in_polygon(center_point, polygon_points):
|
290
|
+
current_frame_zone_tracks[zone_name].add(track_id)
|
291
|
+
|
292
|
+
# Update zone tracking for each zone
|
293
|
+
for zone_name, zone_counts in zone_analysis.items():
|
294
|
+
# Get current frame tracks for this zone
|
295
|
+
current_tracks = current_frame_zone_tracks.get(zone_name, set())
|
296
|
+
|
297
|
+
# Update current zone tracks
|
298
|
+
self._zone_current_track_ids[zone_name] = current_tracks
|
299
|
+
|
300
|
+
# Update total zone tracks (accumulate all track IDs that have been in this zone)
|
301
|
+
self._zone_total_track_ids[zone_name].update(current_tracks)
|
302
|
+
|
303
|
+
# Update counts
|
304
|
+
self._zone_current_counts[zone_name] = len(current_tracks)
|
305
|
+
self._zone_total_counts[zone_name] = len(self._zone_total_track_ids[zone_name])
|
306
|
+
|
307
|
+
# Create enhanced zone analysis
|
308
|
+
enhanced_zone_analysis[zone_name] = {
|
309
|
+
"current_count": self._zone_current_counts[zone_name],
|
310
|
+
"total_count": self._zone_total_counts[zone_name],
|
311
|
+
"current_track_ids": list(current_tracks),
|
312
|
+
"total_track_ids": list(self._zone_total_track_ids[zone_name]),
|
313
|
+
"original_counts": zone_counts # Preserve original zone counts
|
314
|
+
}
|
315
|
+
|
316
|
+
return enhanced_zone_analysis
|
317
|
+
|
254
318
|
def _normalize_yolo_results(self, data: Any, index_to_category: Optional[Dict[int, str]] = None) -> Any:
|
255
319
|
"""
|
256
320
|
Normalize YOLO-style outputs to internal detection schema:
|
@@ -324,7 +388,7 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
324
388
|
return normalized_dict
|
325
389
|
return data
|
326
390
|
|
327
|
-
def _check_alerts(self, summary: dict, frame_number: Any, config: VehicleMonitoringConfig) -> List[Dict]:
|
391
|
+
def _check_alerts(self, summary: dict, zone_analysis: Dict, frame_number: Any, config: VehicleMonitoringConfig) -> List[Dict]:
|
328
392
|
def get_trend(data, lookback=900, threshold=0.6):
|
329
393
|
window = data[-lookback:] if len(data) >= lookback else data
|
330
394
|
if len(window) < 2:
|
@@ -357,7 +421,7 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
357
421
|
"threshold_level": threshold,
|
358
422
|
"ascending": get_trend(self._ascending_alert_list, lookback=900, threshold=0.8),
|
359
423
|
"settings": {t: v for t, v in zip(getattr(config.alert_config, 'alert_type', ['Default']),
|
360
|
-
|
424
|
+
getattr(config.alert_config, 'alert_value', ['JSON']))}
|
361
425
|
})
|
362
426
|
elif category in per_category_count and per_category_count[category] > threshold:
|
363
427
|
alerts.append({
|
@@ -367,12 +431,12 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
367
431
|
"threshold_level": threshold,
|
368
432
|
"ascending": get_trend(self._ascending_alert_list, lookback=900, threshold=0.8),
|
369
433
|
"settings": {t: v for t, v in zip(getattr(config.alert_config, 'alert_type', ['Default']),
|
370
|
-
|
434
|
+
getattr(config.alert_config, 'alert_value', ['JSON']))}
|
371
435
|
})
|
372
436
|
return alerts
|
373
437
|
|
374
|
-
def _generate_incidents(self, counting_summary: Dict, alerts: List, config: VehicleMonitoringConfig,
|
375
|
-
|
438
|
+
def _generate_incidents(self, counting_summary: Dict, zone_analysis: Dict, alerts: List, config: VehicleMonitoringConfig,
|
439
|
+
frame_number: Optional[int] = None, stream_info: Optional[Dict[str, Any]] = None) -> List[Dict]:
|
376
440
|
incidents = []
|
377
441
|
total_detections = counting_summary.get("total_count", 0)
|
378
442
|
current_timestamp = self._get_current_timestamp_str(stream_info)
|
@@ -458,7 +522,7 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
458
522
|
incidents.append({})
|
459
523
|
return incidents
|
460
524
|
|
461
|
-
def _generate_tracking_stats(self, counting_summary: Dict, alerts: List, config: VehicleMonitoringConfig,
|
525
|
+
def _generate_tracking_stats(self, counting_summary: Dict, zone_analysis: Dict, alerts: List, config: VehicleMonitoringConfig,
|
462
526
|
frame_number: Optional[int] = None, stream_info: Optional[Dict[str, Any]] = None) -> List[Dict]:
|
463
527
|
camera_info = self.get_camera_info_from_stream(stream_info)
|
464
528
|
tracking_stats = []
|
@@ -504,49 +568,11 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
504
568
|
human_text_lines = [f"Tracking Statistics:"]
|
505
569
|
human_text_lines.append(f"CURRENT FRAME @ {current_timestamp}")
|
506
570
|
for cat, count in per_category_count.items():
|
507
|
-
|
508
|
-
human_text_lines.append(f"\t{cat}: {count}")
|
509
|
-
else:
|
510
|
-
human_text_lines.append("No Detections in Frame")
|
511
|
-
# Append zone analysis for the current frame if available
|
512
|
-
zone_analysis = counting_summary.get("zone_analysis", {})
|
513
|
-
if zone_analysis:
|
514
|
-
human_text_lines.append("ZONE ANALYSIS (CURRENT FRAME):")
|
515
|
-
for zone_name, cat_counts in zone_analysis.items():
|
516
|
-
if isinstance(cat_counts, dict):
|
517
|
-
total_in_zone = sum(cat_counts.values())
|
518
|
-
car_count = (
|
519
|
-
cat_counts.get('car', 0)
|
520
|
-
+ cat_counts.get('truck', 0)
|
521
|
-
)
|
522
|
-
if car_count > 0:
|
523
|
-
human_text_lines.append(f"\t{zone_name}: total={total_in_zone} (car: {car_count})")
|
524
|
-
else:
|
525
|
-
human_text_lines.append(f"\t{zone_name}: total={total_in_zone}")
|
526
|
-
else:
|
527
|
-
human_text_lines.append(f"\t{zone_name}: total=0")
|
571
|
+
human_text_lines.append(f"\t{cat}: {count}")
|
528
572
|
human_text_lines.append(f"TOTAL SINCE {start_timestamp}")
|
529
573
|
for cat, count in total_counts_dict.items():
|
530
|
-
if
|
531
|
-
|
532
|
-
human_text_lines.append(f"\t{cat}: {count}")
|
533
|
-
# Append zone analysis totals across time if available
|
534
|
-
zone_analysis_total = counting_summary.get("zone_analysis_total", {})
|
535
|
-
if zone_analysis_total:
|
536
|
-
human_text_lines.append("ZONE ANALYSIS (TOTAL SINCE START):")
|
537
|
-
for zone_name, cat_counts in zone_analysis_total.items():
|
538
|
-
if isinstance(cat_counts, dict):
|
539
|
-
total_in_zone = sum(cat_counts.values())
|
540
|
-
car_count = (
|
541
|
-
cat_counts.get('car', 0)
|
542
|
-
+ cat_counts.get('truck', 0)
|
543
|
-
)
|
544
|
-
if car_count > 0:
|
545
|
-
human_text_lines.append(f"\t{zone_name}: total={total_in_zone} (car: {car_count})")
|
546
|
-
else:
|
547
|
-
human_text_lines.append(f"\t{zone_name}: total={total_in_zone}")
|
548
|
-
else:
|
549
|
-
human_text_lines.append(f"\t{zone_name}: total=0")
|
574
|
+
if count > 0:
|
575
|
+
human_text_lines.append(f"\t{cat}: {count}")
|
550
576
|
if alerts:
|
551
577
|
for alert in alerts:
|
552
578
|
human_text_lines.append(f"Alerts: {alert.get('settings', {})} sent @ {current_timestamp}")
|
@@ -570,12 +596,12 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
570
596
|
tracking_stats.append(tracking_stat)
|
571
597
|
return tracking_stats
|
572
598
|
|
573
|
-
def _generate_business_analytics(self, counting_summary: Dict, alerts: Any, config: VehicleMonitoringConfig,
|
599
|
+
def _generate_business_analytics(self, counting_summary: Dict, zone_analysis: Dict, alerts: Any, config: VehicleMonitoringConfig,
|
574
600
|
stream_info: Optional[Dict[str, Any]] = None, is_empty=False) -> List[Dict]:
|
575
601
|
if is_empty:
|
576
602
|
return []
|
577
603
|
|
578
|
-
def _generate_summary(self, summary: dict, incidents: List, tracking_stats: List, business_analytics: List, alerts: List) -> List[str]:
|
604
|
+
def _generate_summary(self, summary: dict, zone_analysis: Dict, incidents: List, tracking_stats: List, business_analytics: List, alerts: List) -> List[str]:
|
579
605
|
"""
|
580
606
|
Generate a human_text string for the tracking_stat, incident, business analytics and alerts.
|
581
607
|
"""
|
@@ -835,13 +861,6 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
835
861
|
union_area = area1 + area2 - inter_area
|
836
862
|
return (inter_area / union_area) if union_area > 0 else 0.0
|
837
863
|
|
838
|
-
def _is_detection_in_zone(self, detection: Dict[str, Any], zone_polygon: List[List[float]]) -> bool:
|
839
|
-
bbox = detection.get("bounding_box", detection.get("bbox"))
|
840
|
-
if not bbox:
|
841
|
-
return False
|
842
|
-
bottom25_center = get_bbox_bottom25_center(bbox)
|
843
|
-
return point_in_polygon(bottom25_center, [(p[0], p[1]) for p in zone_polygon])
|
844
|
-
|
845
864
|
def _merge_or_register_track(self, raw_id: Any, bbox: Any) -> Any:
|
846
865
|
if raw_id is None or bbox is None:
|
847
866
|
return raw_id
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/compute_manager/actions_scaledown_manager.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/__init__.py
RENAMED
File without changes
|
{matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/augmentation_utils/base.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{matrice-1.0.99393 → matrice-1.0.99395}/src/matrice/data_processing/data_formats/mscoco_detection.py
RENAMED
File without changes
|
File without changes
|