matrice-analytics 0.1.37__tar.gz → 0.1.39__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.
Potentially problematic release.
This version of matrice-analytics might be problematic. Click here for more details.
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/PKG-INFO +1 -1
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/matrice_analytics.egg-info/PKG-INFO +1 -1
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/age_gender_detection.py +114 -9
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/clip.py +118 -14
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color_detection.py +11 -17
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/vehicle_monitoring.py +29 -14
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/LICENSE.txt +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/README.md +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/matrice_analytics.egg-info/SOURCES.txt +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/matrice_analytics.egg-info/dependency_links.txt +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/matrice_analytics.egg-info/not-zip-safe +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/matrice_analytics.egg-info/top_level.txt +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/pyproject.toml +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/setup.cfg +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/setup.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/README.md +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/boundary_drawing_internal.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/boundary_drawing_tool.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/boundary_tool_template.html +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/example_usage.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/usage/README.md +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/usage/boundary_drawer_launcher.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/boundary_drawing_internal/usage/simple_boundary_launcher.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/README.md +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/advanced_tracker/README.md +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/advanced_tracker/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/advanced_tracker/base.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/advanced_tracker/config.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/advanced_tracker/kalman_filter.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/advanced_tracker/matching.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/advanced_tracker/strack.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/advanced_tracker/tracker.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/config.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/core/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/core/base.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/core/config.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/core/config_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/face_reg/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/face_reg/compare_similarity.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/face_reg/embedding_manager.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/face_reg/face_recognition.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/face_reg/face_recognition_client.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/face_reg/people_activity_logging.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/easyocr_extractor.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/cli.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/dataset_stats.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/export.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/train.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/valid.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/validate_dataset.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/visualize_augmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/visualize_predictions.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/process.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/types.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/config.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/hub.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/plate_recognizer.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/py.typed +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/augmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/dataset.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/config.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/layers.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/loss.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/metric.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/model_builders.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/model_schema.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/backend_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/postprocessing.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/ocr/preprocessing.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/post_processor.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/run_tests.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_advanced_customer_service.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_basic_counting_tracking.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_comprehensive.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_config.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_customer_service.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_data_generators.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_people_counting.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_processor.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_utilities.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/test_cases/test_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/Histopathological_Cancer_Detection_img.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/abandoned_object_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/advanced_customer_service.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/age_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/anti_spoofing_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/assembly_line_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/banana_defect_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/basic_counting_tracking.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/blood_cancer_detection_img.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/car_damage_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/car_part_segmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/car_service.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/cardiomegaly_classification.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/cell_microscopy_segmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/chicken_pose_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/child_monitoring.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/clip_processor/merges.txt +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/clip_processor/preprocessor_config.json +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/clip_processor/special_tokens_map.json +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/clip_processor/tokenizer.json +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/clip_processor/tokenizer_config.json +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/clip_processor/vocab.json +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/color_map_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color/color_mapper.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/color_map_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/concrete_crack_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/crop_weed_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/customer_service.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/defect_detection_products.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/distracted_driver_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/drone_traffic_monitoring.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/drowsy_driver_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/dwell_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/emergency_vehicle_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/face_emotion.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/face_recognition.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/fashion_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/field_mapping.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/fire_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/flare_analysis.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/flower_segmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/gas_leak_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/gender_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/human_activity_recognition.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/intrusion_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/leaf.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/leaf_disease.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/leak_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/license_plate_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/license_plate_monitoring.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/litter_monitoring.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/mask_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/natural_disaster.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/parking.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/parking_space_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/pcb_defect_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/pedestrian_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/people_counting.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/people_counting_bckp.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/people_tracking.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/pipeline_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/plaque_segmentation_img.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/pothole_segmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/ppe_compliance.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/price_tag_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/proximity_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/road_lane_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/road_traffic_density.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/road_view_segmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/shelf_inventory_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/shoplifting_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/shopping_cart_analysis.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/skin_cancer_classification_img.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/smoker_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/solar_panel.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/suspicious_activity_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/template_usecase.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/theft_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/traffic_sign_monitoring.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/underground_pipeline_defect_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/underwater_pollution_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/warehouse_object_segmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/waterbody_segmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/weapon_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/weld_defect_detection.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/wildlife_monitoring.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/windmill_maintenance.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/usecases/wound_segmentation.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/__init__.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/advanced_counting_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/advanced_helper_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/advanced_tracking_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/alerting_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/category_mapping_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/color_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/counting_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/filter_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/format_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/geometry_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/smoothing_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/post_processing/utils/tracking_utils.py +0 -0
- {matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/src/matrice_analytics/py.typed +0 -0
|
@@ -31,11 +31,94 @@ import numpy as np
|
|
|
31
31
|
#import torch
|
|
32
32
|
import re
|
|
33
33
|
from matrice_analytics.post_processing.core.config import BaseConfig, AlertConfig, ZoneConfig
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
import onnxruntime
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
# Auto-install and import required dependencies for age/gender detection
|
|
35
|
+
def try_import_age_gender_deps():
|
|
36
|
+
"""Try to import onnxruntime and PIL, auto-install if missing or fix NumPy issues."""
|
|
37
|
+
try:
|
|
38
|
+
import onnxruntime as ort
|
|
39
|
+
from PIL import Image
|
|
40
|
+
print("✓ Age/Gender dependencies imported successfully (onnxruntime, PIL)")
|
|
41
|
+
return ort, Image
|
|
42
|
+
except ImportError as e:
|
|
43
|
+
error_msg = str(e)
|
|
44
|
+
print(f"⚠ Import failed: {e}")
|
|
45
|
+
|
|
46
|
+
# Check if it's a NumPy version mismatch issue
|
|
47
|
+
if "NumPy" in error_msg and ("1.x" in error_msg or "2." in error_msg):
|
|
48
|
+
print("→ DETECTED: NumPy version mismatch issue!")
|
|
49
|
+
print("→ onnxruntime was compiled with NumPy 1.x but NumPy 2.x is installed")
|
|
50
|
+
print("→ Attempting to downgrade NumPy to version <2...")
|
|
51
|
+
|
|
52
|
+
import subprocess
|
|
53
|
+
import sys
|
|
54
|
+
try:
|
|
55
|
+
print(" Downgrading numpy...")
|
|
56
|
+
result = subprocess.run(
|
|
57
|
+
[sys.executable, "-m", "pip", "install", "numpy<2", "--force-reinstall", "--no-warn-script-location"],
|
|
58
|
+
capture_output=True,
|
|
59
|
+
text=True,
|
|
60
|
+
timeout=300
|
|
61
|
+
)
|
|
62
|
+
if result.returncode == 0:
|
|
63
|
+
print(" ✓ NumPy downgraded successfully")
|
|
64
|
+
print("→ Retrying onnxruntime import...")
|
|
65
|
+
import onnxruntime as ort
|
|
66
|
+
from PIL import Image
|
|
67
|
+
print("✓ Dependencies imported after NumPy downgrade!")
|
|
68
|
+
return ort, Image
|
|
69
|
+
else:
|
|
70
|
+
print(f" ✗ NumPy downgrade failed: {result.stderr}")
|
|
71
|
+
return None, None
|
|
72
|
+
except Exception as numpy_fix_err:
|
|
73
|
+
print(f"✗ Failed to fix NumPy issue: {numpy_fix_err}")
|
|
74
|
+
return None, None
|
|
75
|
+
|
|
76
|
+
# Not a NumPy issue, try regular installation
|
|
77
|
+
print("→ Attempting auto-installation of missing packages...")
|
|
78
|
+
packages = []
|
|
79
|
+
try:
|
|
80
|
+
import onnxruntime
|
|
81
|
+
except ImportError:
|
|
82
|
+
packages.append("onnxruntime-gpu")
|
|
83
|
+
|
|
84
|
+
try:
|
|
85
|
+
from PIL import Image
|
|
86
|
+
except ImportError:
|
|
87
|
+
packages.append("pillow")
|
|
88
|
+
|
|
89
|
+
if packages:
|
|
90
|
+
print(f"→ Installing: {', '.join(packages)}")
|
|
91
|
+
import subprocess
|
|
92
|
+
import sys
|
|
93
|
+
try:
|
|
94
|
+
for pkg in packages:
|
|
95
|
+
print(f" Installing {pkg}...")
|
|
96
|
+
result = subprocess.run(
|
|
97
|
+
[sys.executable, "-m", "pip", "install", pkg, "--no-warn-script-location"],
|
|
98
|
+
capture_output=True,
|
|
99
|
+
text=True,
|
|
100
|
+
timeout=300
|
|
101
|
+
)
|
|
102
|
+
if result.returncode == 0:
|
|
103
|
+
print(f" ✓ {pkg} installed")
|
|
104
|
+
else:
|
|
105
|
+
print(f" ✗ Failed: {result.stderr}")
|
|
106
|
+
|
|
107
|
+
# Retry import
|
|
108
|
+
print("→ Retrying imports...")
|
|
109
|
+
import onnxruntime as ort
|
|
110
|
+
from PIL import Image
|
|
111
|
+
print("✓ Dependencies imported after auto-installation!")
|
|
112
|
+
return ort, Image
|
|
113
|
+
except Exception as install_err:
|
|
114
|
+
print(f"✗ Installation failed: {install_err}")
|
|
115
|
+
return None, None
|
|
116
|
+
return None, None
|
|
117
|
+
except Exception as e:
|
|
118
|
+
print(f"✗ Unexpected error: {e}")
|
|
119
|
+
return None, None
|
|
120
|
+
|
|
121
|
+
ort, Image = try_import_age_gender_deps()
|
|
39
122
|
|
|
40
123
|
|
|
41
124
|
def apply_category_mapping(results: Any, index_to_category: Dict[str, str]) -> Any:
|
|
@@ -89,9 +172,16 @@ def load_model_from_checkpoint(checkpoint_path,local_path):
|
|
|
89
172
|
"""
|
|
90
173
|
Load a model from checkpoint URL
|
|
91
174
|
"""
|
|
175
|
+
if ort is None:
|
|
176
|
+
raise RuntimeError(
|
|
177
|
+
"onnxruntime is not available. Cannot load age/gender detection models.\n"
|
|
178
|
+
"Please install: pip install onnxruntime-gpu\n"
|
|
179
|
+
"Or downgrade numpy: pip install 'numpy<2'"
|
|
180
|
+
)
|
|
181
|
+
|
|
92
182
|
try:
|
|
93
183
|
print(f"Loading model from checkpoint: {checkpoint_path}")
|
|
94
|
-
|
|
184
|
+
|
|
95
185
|
# Check if checkpoint is a URL
|
|
96
186
|
if checkpoint_path.startswith(('http://', 'https://')):
|
|
97
187
|
# Download checkpoint from URL
|
|
@@ -153,10 +243,25 @@ class AgeGenderConfig(BaseConfig):
|
|
|
153
243
|
|
|
154
244
|
def __post_init__(self):
|
|
155
245
|
if self.gender_url and self.age_url:
|
|
156
|
-
|
|
157
|
-
|
|
246
|
+
try:
|
|
247
|
+
self.age_url = load_model_from_checkpoint(self.age_url, "age_detection_prod_model.onnx")
|
|
248
|
+
self.gender_url = load_model_from_checkpoint(self.gender_url, "gender_detection_prod_model.onnx")
|
|
249
|
+
print("✓ Age and Gender models loaded successfully")
|
|
250
|
+
except RuntimeError as e:
|
|
251
|
+
print(f"✗ Failed to load Age/Gender models: {e}")
|
|
252
|
+
print("→ Age/Gender detection will be disabled")
|
|
253
|
+
self.age_url = None
|
|
254
|
+
self.gender_url = None
|
|
255
|
+
except Exception as e:
|
|
256
|
+
print(f"✗ Unexpected error loading Age/Gender models: {e}")
|
|
257
|
+
import traceback
|
|
258
|
+
traceback.print_exc()
|
|
259
|
+
self.age_url = None
|
|
260
|
+
self.gender_url = None
|
|
158
261
|
else:
|
|
159
|
-
|
|
262
|
+
print("⚠ Age and Gender model URLs not provided - detection will be disabled")
|
|
263
|
+
self.age_url = None
|
|
264
|
+
self.gender_url = None
|
|
160
265
|
|
|
161
266
|
|
|
162
267
|
class AgeGenderUseCase(BaseProcessor):
|
|
@@ -28,24 +28,102 @@ from dataclasses import dataclass, field
|
|
|
28
28
|
import cv2
|
|
29
29
|
import io
|
|
30
30
|
import threading
|
|
31
|
-
import onnxruntime as ort
|
|
32
|
-
from PIL import Image
|
|
33
31
|
|
|
32
|
+
# Auto-install and import required dependencies for CLIP color detection
|
|
33
|
+
def try_import_with_auto_install():
|
|
34
|
+
"""
|
|
35
|
+
Try to import required dependencies, auto-install if missing, then try again.
|
|
36
|
+
Returns tuple of (ort, Image, CLIPProcessor, ir_files, ir_as_file)
|
|
37
|
+
"""
|
|
38
|
+
# First attempt: try to import
|
|
39
|
+
try:
|
|
40
|
+
import onnxruntime as ort
|
|
41
|
+
from PIL import Image
|
|
42
|
+
from transformers import CLIPProcessor
|
|
43
|
+
from importlib.resources import files as ir_files, as_file as ir_as_file
|
|
44
|
+
print("✓ CLIP dependencies imported successfully (onnxruntime, PIL, transformers)")
|
|
45
|
+
return ort, Image, CLIPProcessor, ir_files, ir_as_file
|
|
46
|
+
except ImportError as e:
|
|
47
|
+
print(f"⚠ Import failed on first attempt: {e}")
|
|
48
|
+
print("→ Attempting auto-installation of missing packages...")
|
|
49
|
+
|
|
50
|
+
# Try to install missing packages
|
|
51
|
+
packages_to_install = []
|
|
52
|
+
|
|
53
|
+
# Check which specific packages are missing
|
|
54
|
+
try:
|
|
55
|
+
import onnxruntime
|
|
56
|
+
except ImportError:
|
|
57
|
+
packages_to_install.append("onnxruntime-gpu")
|
|
58
|
+
|
|
59
|
+
try:
|
|
60
|
+
from PIL import Image
|
|
61
|
+
except ImportError:
|
|
62
|
+
packages_to_install.append("pillow")
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
from transformers import CLIPProcessor
|
|
66
|
+
except ImportError:
|
|
67
|
+
packages_to_install.append("transformers")
|
|
68
|
+
|
|
69
|
+
if packages_to_install:
|
|
70
|
+
print(f"→ Installing: {', '.join(packages_to_install)}")
|
|
71
|
+
try:
|
|
72
|
+
# Use sys.executable to ensure we install to the correct Python environment
|
|
73
|
+
for package in packages_to_install:
|
|
74
|
+
print(f" Installing {package}...")
|
|
75
|
+
result = subprocess.run(
|
|
76
|
+
[sys.executable, "-m", "pip", "install", package, "--no-warn-script-location"],
|
|
77
|
+
capture_output=True,
|
|
78
|
+
text=True,
|
|
79
|
+
timeout=300 # 5 minute timeout
|
|
80
|
+
)
|
|
81
|
+
if result.returncode == 0:
|
|
82
|
+
print(f" ✓ {package} installed successfully")
|
|
83
|
+
else:
|
|
84
|
+
print(f" ✗ Failed to install {package}: {result.stderr}")
|
|
85
|
+
|
|
86
|
+
# Second attempt: try to import after installation
|
|
87
|
+
print("→ Retrying imports after installation...")
|
|
88
|
+
try:
|
|
89
|
+
import onnxruntime as ort
|
|
90
|
+
from PIL import Image
|
|
91
|
+
from transformers import CLIPProcessor
|
|
92
|
+
from importlib.resources import files as ir_files, as_file as ir_as_file
|
|
93
|
+
print("✓ CLIP dependencies imported successfully after auto-installation!")
|
|
94
|
+
return ort, Image, CLIPProcessor, ir_files, ir_as_file
|
|
95
|
+
except ImportError as e2:
|
|
96
|
+
print(f"✗ Import still failed after installation: {e2}")
|
|
97
|
+
print("→ Color detection will be disabled")
|
|
98
|
+
return None, None, None, None, None
|
|
99
|
+
|
|
100
|
+
except subprocess.TimeoutExpired:
|
|
101
|
+
print("✗ Installation timeout - packages took too long to install")
|
|
102
|
+
return None, None, None, None, None
|
|
103
|
+
except Exception as install_error:
|
|
104
|
+
print(f"✗ Installation error: {install_error}")
|
|
105
|
+
return None, None, None, None, None
|
|
106
|
+
else:
|
|
107
|
+
print("✗ Unable to determine which packages are missing")
|
|
108
|
+
return None, None, None, None, None
|
|
109
|
+
except Exception as e:
|
|
110
|
+
print(f"✗ Unexpected error during import: {e}")
|
|
111
|
+
return None, None, None, None, None
|
|
34
112
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
print("transformers imported successfully")
|
|
38
|
-
from importlib.resources import files as ir_files, as_file as ir_as_file
|
|
39
|
-
except:
|
|
40
|
-
ir_files = None
|
|
41
|
-
ir_as_file = None
|
|
42
|
-
print("Unable to import transformers/irlib-resources @ clip.py")
|
|
113
|
+
# Execute the auto-install import
|
|
114
|
+
ort, Image, CLIPProcessor, ir_files, ir_as_file = try_import_with_auto_install()
|
|
43
115
|
|
|
44
116
|
def load_model_from_checkpoint(checkpoint_url: str, providers: Optional[List] = None):
|
|
45
117
|
"""
|
|
46
118
|
Load an ONNX model from a URL directly into memory without writing locally.
|
|
47
119
|
Enforces the specified providers (e.g., CUDAExecutionProvider) for execution.
|
|
48
120
|
"""
|
|
121
|
+
if ort is None:
|
|
122
|
+
raise RuntimeError(
|
|
123
|
+
"onnxruntime is not available. Cannot load ONNX model.\n"
|
|
124
|
+
"Please install: pip install onnxruntime-gpu"
|
|
125
|
+
)
|
|
126
|
+
|
|
49
127
|
try:
|
|
50
128
|
print(f"Loading model from checkpoint: {checkpoint_url}")
|
|
51
129
|
|
|
@@ -108,6 +186,17 @@ class ClipProcessor:
|
|
|
108
186
|
processor_dir: Optional[str] = None,
|
|
109
187
|
providers: Optional[List[str]] = None):
|
|
110
188
|
|
|
189
|
+
# Check if required dependencies are available
|
|
190
|
+
if ort is None or CLIPProcessor is None or Image is None:
|
|
191
|
+
raise RuntimeError(
|
|
192
|
+
"Required dependencies for ClipProcessor are not available.\n"
|
|
193
|
+
"Missing: " +
|
|
194
|
+
(("onnxruntime " if ort is None else "") +
|
|
195
|
+
("transformers(CLIPProcessor) " if CLIPProcessor is None else "") +
|
|
196
|
+
("PIL(Image) " if Image is None else "")).strip() + "\n"
|
|
197
|
+
"Please install: pip install transformers onnxruntime-gpu pillow"
|
|
198
|
+
)
|
|
199
|
+
|
|
111
200
|
self.color_category: List[str] = ["black", "white", "yellow", "gray", "red", "blue", "light blue",
|
|
112
201
|
"green", "brown"]
|
|
113
202
|
|
|
@@ -125,14 +214,14 @@ class ClipProcessor:
|
|
|
125
214
|
cmd,
|
|
126
215
|
stdout=log_file,
|
|
127
216
|
stderr=subprocess.STDOUT,
|
|
128
|
-
preexec_fn=os.setpgrp
|
|
217
|
+
preexec_fn=os.setpgrp
|
|
129
218
|
)
|
|
130
219
|
|
|
131
220
|
# Determine and enforce providers (prefer CUDA only)
|
|
132
221
|
try:
|
|
133
222
|
available = ort.get_available_providers()
|
|
134
223
|
except Exception:
|
|
135
|
-
print("
|
|
224
|
+
print("Error getting ONNX providers - this should not happen if dependencies check passed")
|
|
136
225
|
available = []
|
|
137
226
|
print("True OG Available ONNX providers:", available, 'providers(if any):',providers)
|
|
138
227
|
|
|
@@ -155,6 +244,14 @@ class ClipProcessor:
|
|
|
155
244
|
|
|
156
245
|
# Load CLIPProcessor tokenizer/config from local package data if available
|
|
157
246
|
self.processor = None
|
|
247
|
+
|
|
248
|
+
# Double-check CLIPProcessor is available (should never be None at this point due to check above)
|
|
249
|
+
if CLIPProcessor is None:
|
|
250
|
+
raise RuntimeError(
|
|
251
|
+
"CRITICAL: CLIPProcessor is None despite early check. This should never happen.\n"
|
|
252
|
+
"The auto-installation may have failed. Please manually install: pip install transformers"
|
|
253
|
+
)
|
|
254
|
+
|
|
158
255
|
try:
|
|
159
256
|
if self.processor_path and os.path.isdir(self.processor_path):
|
|
160
257
|
self.processor = CLIPProcessor.from_pretrained(self.processor_path, local_files_only=True)
|
|
@@ -163,7 +260,13 @@ class ClipProcessor:
|
|
|
163
260
|
self.processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
|
|
164
261
|
except Exception as e:
|
|
165
262
|
print(f"Falling back to remote CLIPProcessor due to error loading local assets: {e}")
|
|
166
|
-
|
|
263
|
+
try:
|
|
264
|
+
self.processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
|
|
265
|
+
except Exception as e2:
|
|
266
|
+
raise RuntimeError(
|
|
267
|
+
f"Failed to load CLIPProcessor from both local and remote: {e2}\n"
|
|
268
|
+
"Please ensure transformers package is properly installed and you have internet connection."
|
|
269
|
+
)
|
|
167
270
|
|
|
168
271
|
tok = self.processor.tokenizer(self.color_category, padding=True, return_tensors="np")
|
|
169
272
|
ort_inputs_text = {
|
|
@@ -344,7 +447,8 @@ class ClipProcessor:
|
|
|
344
447
|
def run_image_onnx_on_crops(self, crops):
|
|
345
448
|
valid_crops = []
|
|
346
449
|
for i, crop in enumerate(crops):
|
|
347
|
-
if
|
|
450
|
+
# Check if crop is PIL Image (only if PIL.Image is available)
|
|
451
|
+
if Image is not None and isinstance(crop, Image.Image):
|
|
348
452
|
crop = np.array(crop)
|
|
349
453
|
if not isinstance(crop, np.ndarray):
|
|
350
454
|
print(f"Skipping crop {i}: not a numpy array ({type(crop)})")
|
|
@@ -220,11 +220,10 @@ class ColorDetectionUseCase(BaseProcessor):
|
|
|
220
220
|
context = ProcessingContext()
|
|
221
221
|
|
|
222
222
|
if not input_bytes:
|
|
223
|
-
|
|
223
|
+
self.logger.warning("input_bytes is required for color detection")
|
|
224
224
|
|
|
225
225
|
if not data:
|
|
226
|
-
|
|
227
|
-
print("Detection data is required for color detection")
|
|
226
|
+
self.logger.warning("Detection data is required for color detection")
|
|
228
227
|
|
|
229
228
|
input_format = match_results_structure(data)
|
|
230
229
|
context.input_format = input_format
|
|
@@ -296,36 +295,31 @@ class ColorDetectionUseCase(BaseProcessor):
|
|
|
296
295
|
|
|
297
296
|
# Initialize detector lazily on first use if enabled
|
|
298
297
|
try:
|
|
299
|
-
|
|
300
|
-
|
|
298
|
+
self.logger.debug("About to call process_color_in_frame...")
|
|
299
|
+
|
|
301
300
|
if config.enable_detector and self.detector is None:
|
|
302
|
-
|
|
301
|
+
self.logger.info("Initializing ClipProcessor for color detection...")
|
|
303
302
|
try:
|
|
304
303
|
self.detector = ClipProcessor()
|
|
305
|
-
|
|
306
|
-
logger.info("ClipProcessor loaded successfully!")
|
|
304
|
+
self.logger.info("ClipProcessor loaded successfully!")
|
|
307
305
|
except Exception as init_error:
|
|
308
|
-
|
|
309
|
-
logger.error(f"Failed to initialize ClipProcessor: {init_error}")
|
|
306
|
+
self.logger.error(f"Failed to initialize ClipProcessor: {init_error}")
|
|
310
307
|
self.detector = None
|
|
311
308
|
|
|
312
309
|
if self.detector is None:
|
|
313
|
-
|
|
314
|
-
logger.warning("Detector is disabled or failed to initialize, skipping color detection")
|
|
310
|
+
self.logger.warning("Detector is disabled or failed to initialize, skipping color detection")
|
|
315
311
|
curr_frame_color = {}
|
|
316
312
|
else:
|
|
317
|
-
|
|
313
|
+
self.logger.debug(f"Processing {len(color_processed_data)} detections for color classification")
|
|
318
314
|
curr_frame_color = self.detector.process_color_in_frame(
|
|
319
315
|
color_processed_data,
|
|
320
316
|
input_bytes,
|
|
321
317
|
config.zone_config,
|
|
322
318
|
stream_info,
|
|
323
319
|
)
|
|
324
|
-
|
|
320
|
+
self.logger.debug("process_color_in_frame completed successfully")
|
|
325
321
|
except Exception as e:
|
|
326
|
-
|
|
327
|
-
import traceback
|
|
328
|
-
traceback.print_exc()
|
|
322
|
+
self.logger.error(f"ERROR in process_color_in_frame: {e}", exc_info=True)
|
|
329
323
|
curr_frame_color = {}
|
|
330
324
|
|
|
331
325
|
self.update_vehicle_stats(curr_frame_color)
|
|
@@ -606,11 +606,13 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
|
606
606
|
getattr(config.alert_config, 'alert_value', ['JSON']))}
|
|
607
607
|
})
|
|
608
608
|
|
|
609
|
-
|
|
610
|
-
human_text_lines
|
|
611
|
-
|
|
609
|
+
# Generate human text similar to people_counting format
|
|
610
|
+
human_text_lines = []
|
|
611
|
+
human_text_lines.append(f"CURRENT FRAME @ {current_timestamp}:")
|
|
612
|
+
|
|
613
|
+
# Display current counts - zone-wise or category-wise
|
|
612
614
|
if zone_analysis:
|
|
613
|
-
human_text_lines.append("\
|
|
615
|
+
human_text_lines.append("\t- Vehicles Detected by Zone:")
|
|
614
616
|
for zone_name, zone_data in zone_analysis.items():
|
|
615
617
|
current_count = 0
|
|
616
618
|
if isinstance(zone_data, dict):
|
|
@@ -622,14 +624,20 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
|
622
624
|
"total",
|
|
623
625
|
sum(v for v in counts_dict.values() if isinstance(v, (int, float)))
|
|
624
626
|
)
|
|
625
|
-
human_text_lines.append(f"\t{zone_name}: {int(current_count)}")
|
|
627
|
+
human_text_lines.append(f"\t\t- {zone_name}: {int(current_count)}")
|
|
626
628
|
else:
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
629
|
+
human_text_lines.append(f"\t- Vehicles Detected: {total_detections}")
|
|
630
|
+
if per_category_count:
|
|
631
|
+
for cat, count in per_category_count.items():
|
|
632
|
+
if count > 0:
|
|
633
|
+
human_text_lines.append(f"\t\t- {cat}: {count}")
|
|
634
|
+
|
|
635
|
+
human_text_lines.append("")
|
|
636
|
+
human_text_lines.append(f"TOTAL SINCE @ {start_timestamp}:")
|
|
637
|
+
|
|
638
|
+
# Display total counts - zone-wise or category-wise
|
|
631
639
|
if zone_analysis:
|
|
632
|
-
human_text_lines.append("\
|
|
640
|
+
human_text_lines.append("\t- Total Vehicles by Zone:")
|
|
633
641
|
for zone_name, zone_data in zone_analysis.items():
|
|
634
642
|
total_count = 0
|
|
635
643
|
if isinstance(zone_data, dict):
|
|
@@ -643,16 +651,23 @@ class VehicleMonitoringUseCase(BaseProcessor):
|
|
|
643
651
|
# Last resort: try to sum numeric values present
|
|
644
652
|
counts_dict = zone_data if isinstance(zone_data, dict) else {}
|
|
645
653
|
total_count = sum(v for v in counts_dict.values() if isinstance(v, (int, float)))
|
|
646
|
-
human_text_lines.append(f"\t{zone_name}: {int(total_count)}")
|
|
654
|
+
human_text_lines.append(f"\t\t- {zone_name}: {int(total_count)}")
|
|
647
655
|
else:
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
656
|
+
if total_counts_dict:
|
|
657
|
+
human_text_lines.append("\t- Total Unique Vehicles:")
|
|
658
|
+
for cat, count in total_counts_dict.items():
|
|
659
|
+
if count > 0:
|
|
660
|
+
human_text_lines.append(f"\t\t- {cat}: {count}")
|
|
661
|
+
|
|
662
|
+
# Display alerts
|
|
651
663
|
if alerts:
|
|
664
|
+
human_text_lines.append("")
|
|
652
665
|
for alert in alerts:
|
|
653
666
|
human_text_lines.append(f"Alerts: {alert.get('settings', {})} sent @ {current_timestamp}")
|
|
654
667
|
else:
|
|
668
|
+
human_text_lines.append("")
|
|
655
669
|
human_text_lines.append("Alerts: None")
|
|
670
|
+
|
|
656
671
|
human_text = "\n".join(human_text_lines)
|
|
657
672
|
|
|
658
673
|
reset_settings = [{"interval_type": "daily", "reset_time": {"value": 9, "time_unit": "hour"}}]
|
|
File without changes
|
|
File without changes
|
{matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/matrice_analytics.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/matrice_analytics.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{matrice_analytics-0.1.37 → matrice_analytics-0.1.39}/matrice_analytics.egg-info/top_level.txt
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
|
|
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
|