matrice-analytics 0.1.55__tar.gz → 0.1.58__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.

Files changed (201) hide show
  1. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/PKG-INFO +1 -1
  2. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/matrice_analytics.egg-info/PKG-INFO +1 -1
  3. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/face_reg/embedding_manager.py +89 -14
  4. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/face_reg/face_recognition.py +98 -11
  5. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/LICENSE.txt +0 -0
  6. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/README.md +0 -0
  7. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/matrice_analytics.egg-info/SOURCES.txt +0 -0
  8. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/matrice_analytics.egg-info/dependency_links.txt +0 -0
  9. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/matrice_analytics.egg-info/not-zip-safe +0 -0
  10. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/matrice_analytics.egg-info/top_level.txt +0 -0
  11. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/pyproject.toml +0 -0
  12. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/setup.cfg +0 -0
  13. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/setup.py +0 -0
  14. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/__init__.py +0 -0
  15. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/README.md +0 -0
  16. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/__init__.py +0 -0
  17. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/boundary_drawing_internal.py +0 -0
  18. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/boundary_drawing_tool.py +0 -0
  19. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/boundary_tool_template.html +0 -0
  20. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/example_usage.py +0 -0
  21. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/usage/README.md +0 -0
  22. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/usage/boundary_drawer_launcher.py +0 -0
  23. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/boundary_drawing_internal/usage/simple_boundary_launcher.py +0 -0
  24. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/README.md +0 -0
  25. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/__init__.py +0 -0
  26. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/advanced_tracker/README.md +0 -0
  27. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/advanced_tracker/__init__.py +0 -0
  28. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/advanced_tracker/base.py +0 -0
  29. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/advanced_tracker/config.py +0 -0
  30. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/advanced_tracker/kalman_filter.py +0 -0
  31. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/advanced_tracker/matching.py +0 -0
  32. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/advanced_tracker/strack.py +0 -0
  33. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/advanced_tracker/tracker.py +0 -0
  34. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/config.py +0 -0
  35. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/core/__init__.py +0 -0
  36. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/core/base.py +0 -0
  37. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/core/config.py +0 -0
  38. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/core/config_utils.py +0 -0
  39. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/face_reg/__init__.py +0 -0
  40. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/face_reg/compare_similarity.py +0 -0
  41. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/face_reg/face_recognition_client.py +0 -0
  42. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/face_reg/people_activity_logging.py +0 -0
  43. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/__init__.py +0 -0
  44. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/easyocr_extractor.py +0 -0
  45. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/__init__.py +0 -0
  46. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/__init__.py +0 -0
  47. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/cli.py +0 -0
  48. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/dataset_stats.py +0 -0
  49. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/export.py +0 -0
  50. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/train.py +0 -0
  51. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/utils.py +0 -0
  52. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/valid.py +0 -0
  53. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/validate_dataset.py +0 -0
  54. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/visualize_augmentation.py +0 -0
  55. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/visualize_predictions.py +0 -0
  56. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/__init__.py +0 -0
  57. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/process.py +0 -0
  58. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/types.py +0 -0
  59. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/utils.py +0 -0
  60. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/__init__.py +0 -0
  61. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/config.py +0 -0
  62. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/hub.py +0 -0
  63. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/plate_recognizer.py +0 -0
  64. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/py.typed +0 -0
  65. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/__init__.py +0 -0
  66. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/__init__.py +0 -0
  67. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/augmentation.py +0 -0
  68. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/dataset.py +0 -0
  69. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/__init__.py +0 -0
  70. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/config.py +0 -0
  71. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/layers.py +0 -0
  72. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/loss.py +0 -0
  73. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/metric.py +0 -0
  74. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/model_builders.py +0 -0
  75. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/model_schema.py +0 -0
  76. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/__init__.py +0 -0
  77. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/backend_utils.py +0 -0
  78. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/utils.py +0 -0
  79. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/postprocessing.py +0 -0
  80. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/ocr/preprocessing.py +0 -0
  81. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/post_processor.py +0 -0
  82. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/__init__.py +0 -0
  83. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/run_tests.py +0 -0
  84. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_advanced_customer_service.py +0 -0
  85. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_basic_counting_tracking.py +0 -0
  86. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_comprehensive.py +0 -0
  87. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_config.py +0 -0
  88. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_customer_service.py +0 -0
  89. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_data_generators.py +0 -0
  90. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_people_counting.py +0 -0
  91. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_processor.py +0 -0
  92. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_usecases.py +0 -0
  93. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_utilities.py +0 -0
  94. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/test_cases/test_utils.py +0 -0
  95. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/Histopathological_Cancer_Detection_img.py +0 -0
  96. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/__init__.py +0 -0
  97. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/abandoned_object_detection.py +0 -0
  98. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/advanced_customer_service.py +0 -0
  99. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/age_detection.py +0 -0
  100. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/age_gender_detection.py +0 -0
  101. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/anti_spoofing_detection.py +0 -0
  102. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/assembly_line_detection.py +0 -0
  103. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/banana_defect_detection.py +0 -0
  104. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/basic_counting_tracking.py +0 -0
  105. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/blood_cancer_detection_img.py +0 -0
  106. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/car_damage_detection.py +0 -0
  107. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/car_part_segmentation.py +0 -0
  108. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/car_service.py +0 -0
  109. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/cardiomegaly_classification.py +0 -0
  110. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/cell_microscopy_segmentation.py +0 -0
  111. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/chicken_pose_detection.py +0 -0
  112. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/child_monitoring.py +0 -0
  113. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/clip.py +0 -0
  114. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/clip_processor/merges.txt +0 -0
  115. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/clip_processor/preprocessor_config.json +0 -0
  116. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/clip_processor/special_tokens_map.json +0 -0
  117. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/clip_processor/tokenizer.json +0 -0
  118. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/clip_processor/tokenizer_config.json +0 -0
  119. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/clip_processor/vocab.json +0 -0
  120. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/color_map_utils.py +0 -0
  121. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color/color_mapper.py +0 -0
  122. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color_detection.py +0 -0
  123. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/color_map_utils.py +0 -0
  124. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/concrete_crack_detection.py +0 -0
  125. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/crop_weed_detection.py +0 -0
  126. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/customer_service.py +0 -0
  127. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/defect_detection_products.py +0 -0
  128. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/distracted_driver_detection.py +0 -0
  129. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/drone_traffic_monitoring.py +0 -0
  130. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/drowsy_driver_detection.py +0 -0
  131. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/dwell_detection.py +0 -0
  132. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/emergency_vehicle_detection.py +0 -0
  133. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/face_emotion.py +0 -0
  134. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/face_recognition.py +0 -0
  135. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/fashion_detection.py +0 -0
  136. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/field_mapping.py +0 -0
  137. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/fire_detection.py +0 -0
  138. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/flare_analysis.py +0 -0
  139. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/flower_segmentation.py +0 -0
  140. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/gas_leak_detection.py +0 -0
  141. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/gender_detection.py +0 -0
  142. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/human_activity_recognition.py +0 -0
  143. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/intrusion_detection.py +0 -0
  144. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/leaf.py +0 -0
  145. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/leaf_disease.py +0 -0
  146. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/leak_detection.py +0 -0
  147. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/license_plate_detection.py +0 -0
  148. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/license_plate_monitoring.py +0 -0
  149. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/litter_monitoring.py +0 -0
  150. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/mask_detection.py +0 -0
  151. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/natural_disaster.py +0 -0
  152. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/parking.py +0 -0
  153. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/parking_space_detection.py +0 -0
  154. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/pcb_defect_detection.py +0 -0
  155. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/pedestrian_detection.py +0 -0
  156. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/people_counting.py +0 -0
  157. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/people_counting_bckp.py +0 -0
  158. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/people_tracking.py +0 -0
  159. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/pipeline_detection.py +0 -0
  160. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/plaque_segmentation_img.py +0 -0
  161. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/pothole_segmentation.py +0 -0
  162. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/ppe_compliance.py +0 -0
  163. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/price_tag_detection.py +0 -0
  164. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/proximity_detection.py +0 -0
  165. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/road_lane_detection.py +0 -0
  166. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/road_traffic_density.py +0 -0
  167. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/road_view_segmentation.py +0 -0
  168. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/shelf_inventory_detection.py +0 -0
  169. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/shoplifting_detection.py +0 -0
  170. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/shopping_cart_analysis.py +0 -0
  171. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/skin_cancer_classification_img.py +0 -0
  172. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/smoker_detection.py +0 -0
  173. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/solar_panel.py +0 -0
  174. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/suspicious_activity_detection.py +0 -0
  175. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/template_usecase.py +0 -0
  176. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/theft_detection.py +0 -0
  177. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/traffic_sign_monitoring.py +0 -0
  178. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/underground_pipeline_defect_detection.py +0 -0
  179. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/underwater_pollution_detection.py +0 -0
  180. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/vehicle_monitoring.py +0 -0
  181. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/warehouse_object_segmentation.py +0 -0
  182. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/waterbody_segmentation.py +0 -0
  183. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/weapon_detection.py +0 -0
  184. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/weld_defect_detection.py +0 -0
  185. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/wildlife_monitoring.py +0 -0
  186. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/windmill_maintenance.py +0 -0
  187. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/usecases/wound_segmentation.py +0 -0
  188. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/__init__.py +0 -0
  189. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/advanced_counting_utils.py +0 -0
  190. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/advanced_helper_utils.py +0 -0
  191. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/advanced_tracking_utils.py +0 -0
  192. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/alerting_utils.py +0 -0
  193. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/category_mapping_utils.py +0 -0
  194. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/color_utils.py +0 -0
  195. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/counting_utils.py +0 -0
  196. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/filter_utils.py +0 -0
  197. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/format_utils.py +0 -0
  198. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/geometry_utils.py +0 -0
  199. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/smoothing_utils.py +0 -0
  200. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/post_processing/utils/tracking_utils.py +0 -0
  201. {matrice_analytics-0.1.55 → matrice_analytics-0.1.58}/src/matrice_analytics/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_analytics
3
- Version: 0.1.55
3
+ Version: 0.1.58
4
4
  Summary: Common server utilities for Matrice.ai services
5
5
  Author-email: "Matrice.ai" <dipendra@matrice.ai>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice_analytics
3
- Version: 0.1.55
3
+ Version: 0.1.58
4
4
  Summary: Common server utilities for Matrice.ai services
5
5
  Author-email: "Matrice.ai" <dipendra@matrice.ai>
6
6
  License-Expression: MIT
@@ -56,7 +56,26 @@ class EmbeddingConfig:
56
56
 
57
57
 
58
58
  class EmbeddingManager:
59
- """Manages face embeddings, search operations, and caching."""
59
+ """
60
+ Manages face embeddings, search operations, and caching.
61
+
62
+ CRITICAL INITIALIZATION FLOW:
63
+ 1. __init__() creates the manager but does NOT load embeddings or start background refresh
64
+ 2. External caller MUST call await _load_staff_embeddings() to load embeddings synchronously
65
+ 3. After successful load, caller SHOULD call start_background_refresh() for periodic updates
66
+ 4. The _embeddings_loaded flag tracks whether embeddings are ready for use
67
+ 5. All search operations check _embeddings_loaded before proceeding
68
+
69
+ This design prevents race conditions where:
70
+ - Background thread tries to load while main thread is loading
71
+ - Search operations are called before embeddings are loaded
72
+ - Multiple threads compete for the embeddings_lock during initialization
73
+
74
+ Thread Safety:
75
+ - _embeddings_lock protects embeddings_matrix and embedding_metadata
76
+ - _cache_lock protects track_id_cache
77
+ - _embeddings_loaded is set only after successful load under lock
78
+ """
60
79
 
61
80
  def __init__(self, config: EmbeddingConfig, face_client: FacialRecognitionClient = None):
62
81
  self.config = config
@@ -89,11 +108,47 @@ class EmbeddingManager:
89
108
  self._is_running = False
90
109
  self._stop_event = threading.Event()
91
110
 
92
- # Start background refresh if enabled
93
- if self.config.enable_background_refresh and self.face_client:
94
- self.start_background_refresh()
95
- self.logger.info(f"Background embedding refresh enabled - interval: {self.config.background_refresh_interval}s")
111
+ # Initialization status flag
112
+ self._embeddings_loaded = False
113
+
114
+ # DON'T start background refresh yet - wait for initial load in initialize()
115
+ # This prevents race conditions where background thread interferes with main init
116
+ self.logger.info(f"EmbeddingManager created - background refresh will start after initial load (interval: {self.config.background_refresh_interval}s)")
117
+
118
+ def is_ready(self) -> bool:
119
+ """
120
+ Check if embeddings are loaded and ready for use.
96
121
 
122
+ Returns:
123
+ True if embeddings are loaded and matrix is valid, False otherwise
124
+ """
125
+ return (
126
+ self._embeddings_loaded
127
+ and self.embeddings_matrix is not None
128
+ and len(self.embedding_metadata) > 0
129
+ )
130
+
131
+ def get_status(self) -> Dict[str, Any]:
132
+ """
133
+ Get detailed status of embedding manager for debugging and health checks.
134
+
135
+ Returns:
136
+ Dictionary with status information
137
+ """
138
+ with self._embeddings_lock:
139
+ matrix_shape = self.embeddings_matrix.shape if self.embeddings_matrix is not None else None
140
+
141
+ return {
142
+ "embeddings_loaded": self._embeddings_loaded,
143
+ "embeddings_count": len(self.staff_embeddings),
144
+ "matrix_shape": matrix_shape,
145
+ "metadata_count": len(self.embedding_metadata),
146
+ "cache_size": len(self.track_id_cache),
147
+ "last_update": self.staff_embeddings_last_update,
148
+ "is_running": self._is_running,
149
+ "is_ready": self.is_ready(),
150
+ }
151
+
97
152
  def set_face_client(self, face_client: FacialRecognitionClient):
98
153
  """Set the face recognition client."""
99
154
  self.face_client = face_client
@@ -175,11 +230,14 @@ class EmbeddingManager:
175
230
  """Load all staff embeddings from API and cache them."""
176
231
  if not self.face_client:
177
232
  self.logger.error("Face client not available for loading staff embeddings")
233
+ print("ERROR: Face client not available for loading staff embeddings")
178
234
  return False
179
235
 
180
236
  try:
181
237
  self.logger.info("Loading staff embeddings from API...")
238
+ print("=============== LOADING STAFF EMBEDDINGS FROM API ===============")
182
239
  response = await self.face_client.get_all_staff_embeddings()
240
+ print(f"API RESPONSE TYPE: {type(response)}, IS_LIST: {isinstance(response, list)}, LEN: {len(response) if isinstance(response, list) else 'N/A'}")
183
241
 
184
242
  # Robust response handling: accept dict with data or raw list
185
243
  embeddings_data: List[Dict[str, Any]] = []
@@ -269,27 +327,33 @@ class EmbeddingManager:
269
327
 
270
328
  self.embedding_metadata = self.staff_embeddings.copy()
271
329
  self.staff_embeddings_last_update = time.time()
330
+ self._embeddings_loaded = True # Mark as successfully loaded
331
+
272
332
  self.logger.info(f"Successfully loaded and cached {len(self.staff_embeddings)} staff embeddings (dim={self.embeddings_matrix.shape[1]})")
333
+ print(f"=============== SUCCESS: LOADED {len(self.staff_embeddings)} EMBEDDINGS, MATRIX SHAPE: {self.embeddings_matrix.shape} ===============")
273
334
  try:
274
335
  # Quick sanity metrics
275
336
  row0_sum = float(np.sum(self.embeddings_matrix[0])) if self.embeddings_matrix.shape[0] > 0 else 0.0
337
+ row0_norm = float(np.linalg.norm(self.embeddings_matrix[0])) if self.embeddings_matrix.shape[0] > 0 else 0.0
338
+ print(f"SANITY CHECK: row0_sum={row0_sum:.4f}, row0_norm={row0_norm:.4f} (should be ~1.0 after normalization)")
276
339
  self.logger.debug(f"Embeddings matrix shape: {self.embeddings_matrix.shape}, dtype={self.embeddings_matrix.dtype}, row0_sum={row0_sum:.4f}")
277
- except Exception:
278
- pass
340
+ except Exception as e:
341
+ print(f"ERROR in sanity check: {e}")
279
342
  return True
280
343
  else:
281
344
  # Build diagnostics and raise to stop pipeline early with actionable info
282
345
  dims_summary: Dict[int, int] = {}
283
346
  for d in dims_observed:
284
347
  dims_summary[d] = dims_summary.get(d, 0) + 1
285
- self.logger.error(
286
- "No valid staff embeddings loaded. Observed dimension distribution: "
287
- f"{dims_summary}. Expected_dim={expected_dim}. Mismatch examples (staffId, dim): "
288
- f"{mismatch_examples[:5]}"
289
- )
290
- raise RuntimeError(
291
- f"Failed to load staff embeddings due to dimension mismatch. Observed dims: {dims_summary}"
348
+ error_msg = (
349
+ f"No valid staff embeddings loaded. Observed dimension distribution: {dims_summary}. "
350
+ f"Expected_dim={expected_dim}. Mismatch examples (staffId, dim): {mismatch_examples[:5]}"
292
351
  )
352
+ self.logger.error(error_msg)
353
+ print(f"=============== ERROR: NO VALID EMBEDDINGS ===============")
354
+ print(f"ERROR: {error_msg}")
355
+ print(f"=============== STOPPING PIPELINE ===============")
356
+ raise RuntimeError(f"Failed to load staff embeddings due to dimension mismatch. Observed dims: {dims_summary}")
293
357
 
294
358
  except Exception as e:
295
359
  self.logger.error(f"Error loading staff embeddings: {e}", exc_info=True)
@@ -329,8 +393,16 @@ class EmbeddingManager:
329
393
 
330
394
  def _find_best_local_match(self, query_embedding: List[float]) -> Optional[Tuple[StaffEmbedding, float]]:
331
395
  """Find best matching staff member using optimized matrix operations (thread-safe)."""
396
+ # Check if embeddings are loaded at all
397
+ if not self._embeddings_loaded:
398
+ print(f"ERROR: _find_best_local_match called but embeddings not loaded yet (_embeddings_loaded={self._embeddings_loaded})")
399
+ self.logger.error("Embeddings not loaded - _find_best_local_match cannot proceed")
400
+ return None
401
+
332
402
  with self._embeddings_lock:
333
403
  if self.embeddings_matrix is None or len(self.embedding_metadata) == 0:
404
+ print(f"ERROR: _find_best_local_match - embeddings_matrix is None={self.embeddings_matrix is None}, metadata_len={len(self.embedding_metadata)}, _embeddings_loaded={self._embeddings_loaded}")
405
+ self.logger.error(f"Embeddings matrix is None despite _embeddings_loaded={self._embeddings_loaded}")
334
406
  return None
335
407
 
336
408
  # Create local copies to avoid issues with concurrent modifications
@@ -338,6 +410,7 @@ class EmbeddingManager:
338
410
  embedding_metadata = self.embedding_metadata.copy()
339
411
 
340
412
  if embeddings_matrix is None:
413
+ print("ERROR: _find_best_local_match - embeddings_matrix copy is None")
341
414
  return None
342
415
 
343
416
  try:
@@ -345,6 +418,7 @@ class EmbeddingManager:
345
418
  # Dimension check
346
419
  if embeddings_matrix.shape[1] != query_array.shape[1]:
347
420
  self.logger.warning(f"Query embedding dim mismatch: query={query_array.shape[1]} staff={embeddings_matrix.shape[1]}")
421
+ print(f"ERROR: DIMENSION MISMATCH - query={query_array.shape[1]} staff={embeddings_matrix.shape[1]}")
348
422
  return None
349
423
 
350
424
  # Normalize query embedding
@@ -382,6 +456,7 @@ class EmbeddingManager:
382
456
  try:
383
457
  query_array = np.array(query_embedding, dtype=np.float32).reshape(1, -1)
384
458
  if embeddings_matrix.shape[1] != query_array.shape[1]:
459
+ print(f"ERROR: get_best_similarity DIMENSION MISMATCH - query={query_array.shape[1]} staff={embeddings_matrix.shape[1]}")
385
460
  return 0.0
386
461
  qn = np.linalg.norm(query_array)
387
462
  if qn == 0:
@@ -143,6 +143,13 @@ class TemporalIdentityManager:
143
143
 
144
144
  # PRIMARY PATH: Local similarity search using EmbeddingManager (FAST - ~1-5ms)
145
145
  if self.embedding_manager:
146
+ # Defensive check: ensure embeddings are loaded before attempting search
147
+ if not self.embedding_manager.is_ready():
148
+ status = self.embedding_manager.get_status()
149
+ self.logger.error(f"EmbeddingManager not ready for search - status: {status}")
150
+ print(f"ERROR: _compute_best_identity - embeddings not ready. Status: {status}")
151
+ return None, "Unknown", 0.0, None, {}, "unknown"
152
+
146
153
  try:
147
154
  local_match = self.embedding_manager._find_best_local_match(emb)
148
155
 
@@ -540,11 +547,30 @@ class FaceRecognitionEmbeddingUseCase(BaseProcessor):
540
547
  Async initialization method to set up face client and all components.
541
548
  Must be called after __init__ before process() can be called.
542
549
 
550
+ CRITICAL INITIALIZATION SEQUENCE:
551
+ 1. Initialize face client and update deployment
552
+ 2. Create EmbeddingManager (does NOT load embeddings yet)
553
+ 3. Synchronously load embeddings with _load_staff_embeddings() - MUST succeed
554
+ 4. Verify embeddings are actually loaded (fail-fast if not)
555
+ 5. Start background refresh thread (only after successful load)
556
+ 6. Initialize TemporalIdentityManager with loaded EmbeddingManager
557
+ 7. Final verification of all components
558
+
559
+ This sequence ensures:
560
+ - No race conditions between main load and background thread
561
+ - Fail-fast behavior if embeddings can't be loaded
562
+ - All components have verified embeddings before use
563
+
543
564
  Args:
544
565
  config: Optional config to use. If not provided, uses config from __init__.
566
+
567
+ Raises:
568
+ RuntimeError: If embeddings fail to load or verification fails
545
569
  """
570
+ print("=============== INITIALIZE() CALLED ===============")
546
571
  if self._initialized:
547
572
  self.logger.debug("Use case already initialized, skipping")
573
+ print("=============== ALREADY INITIALIZED, SKIPPING ===============")
548
574
  return
549
575
 
550
576
  # Use provided config or fall back to default config from __init__
@@ -558,10 +584,12 @@ class FaceRecognitionEmbeddingUseCase(BaseProcessor):
558
584
  raise TypeError(f"Invalid config type for initialization: {type(init_config)}, expected FaceRecognitionEmbeddingConfig")
559
585
 
560
586
  self.logger.info("Initializing face recognition use case with provided config")
587
+ print("=============== STEP 1: INITIALIZING FACE CLIENT ===============")
561
588
 
562
589
  # Initialize face client (includes deployment update)
563
590
  try:
564
591
  self.face_client = await self._get_facial_recognition_client(init_config)
592
+ print(f"=============== FACE CLIENT INITIALIZED: {self.face_client is not None} ===============")
565
593
 
566
594
  # Initialize People activity logging if enabled
567
595
  if init_config.enable_people_activity_logging:
@@ -570,7 +598,9 @@ class FaceRecognitionEmbeddingUseCase(BaseProcessor):
570
598
  self.logger.info("People activity logging enabled and started")
571
599
 
572
600
  # Initialize EmbeddingManager
601
+ print("=============== STEP 2: INITIALIZING EMBEDDING MANAGER ===============")
573
602
  if not init_config.embedding_config:
603
+ print("=============== CREATING EMBEDDING CONFIG ===============")
574
604
  init_config.embedding_config = EmbeddingConfig(
575
605
  similarity_threshold=init_config.similarity_threshold,
576
606
  confidence_threshold=init_config.confidence_threshold,
@@ -581,16 +611,42 @@ class FaceRecognitionEmbeddingUseCase(BaseProcessor):
581
611
  staff_embeddings_cache_ttl=43200,
582
612
  )
583
613
  self.embedding_manager = EmbeddingManager(init_config.embedding_config, self.face_client)
614
+ print(f"=============== EMBEDDING MANAGER CREATED: {self.embedding_manager is not None} ===============")
584
615
  self.logger.info("Embedding manager initialized")
585
616
 
586
617
  # Load staff embeddings immediately for fast startup (avoid race conditions)
618
+ # This MUST succeed before we can proceed - fail fast if it doesn't
619
+ print("=============== STEP 3: CALLING _load_staff_embeddings() ===============")
587
620
  embeddings_loaded = await self.embedding_manager._load_staff_embeddings()
588
- if embeddings_loaded:
589
- self.logger.info(f"Loaded {len(self.embedding_manager.staff_embeddings)} staff embeddings at initialization")
590
- else:
591
- self.logger.warning("Failed to load staff embeddings at initialization - will retry in background")
621
+ print(f"=============== EMBEDDINGS LOADED: {embeddings_loaded} ===============")
622
+
623
+ if not embeddings_loaded:
624
+ error_msg = "CRITICAL: Failed to load staff embeddings at initialization - cannot proceed without embeddings"
625
+ print(f"=============== {error_msg} ===============")
626
+ self.logger.error(error_msg)
627
+ raise RuntimeError(error_msg)
628
+
629
+ # Verify embeddings are actually loaded using is_ready() method
630
+ if not self.embedding_manager.is_ready():
631
+ status = self.embedding_manager.get_status()
632
+ error_msg = f"CRITICAL: Embeddings not ready after load - status: {status}"
633
+ print(f"=============== {error_msg} ===============")
634
+ self.logger.error(error_msg)
635
+ raise RuntimeError(error_msg)
636
+
637
+ print(f"=============== STAFF EMBEDDINGS COUNT: {len(self.embedding_manager.staff_embeddings)} ===============")
638
+ print(f"=============== EMBEDDINGS MATRIX SHAPE: {self.embedding_manager.embeddings_matrix.shape} ===============")
639
+ print(f"=============== EMBEDDINGS LOADED FLAG: {self.embedding_manager._embeddings_loaded} ===============")
640
+ self.logger.info(f"Successfully loaded {len(self.embedding_manager.staff_embeddings)} staff embeddings at initialization")
641
+
642
+ # NOW start background refresh after successful initial load (prevents race conditions)
643
+ if init_config.embedding_config.enable_background_refresh:
644
+ print("=============== STEP 4: STARTING BACKGROUND REFRESH ===============")
645
+ self.embedding_manager.start_background_refresh()
646
+ self.logger.info("Background embedding refresh started after successful initial load")
592
647
 
593
648
  # Initialize TemporalIdentityManager with EmbeddingManager for fast local search
649
+ print("=============== STEP 5: INITIALIZING TEMPORAL IDENTITY MANAGER ===============")
594
650
  self.temporal_identity_manager = TemporalIdentityManager(
595
651
  face_client=self.face_client,
596
652
  embedding_manager=self.embedding_manager,
@@ -602,8 +658,26 @@ class FaceRecognitionEmbeddingUseCase(BaseProcessor):
602
658
  )
603
659
  self.logger.info("Temporal identity manager initialized with embedding manager for local similarity search")
604
660
 
661
+ # Final verification before marking as initialized
662
+ print("=============== STEP 6: FINAL VERIFICATION ===============")
663
+ if not self.embedding_manager.is_ready():
664
+ status = self.embedding_manager.get_status()
665
+ error_msg = f"CRITICAL: Final verification failed - embeddings not ready. Status: {status}"
666
+ print(f"=============== {error_msg} ===============")
667
+ self.logger.error(error_msg)
668
+ raise RuntimeError(error_msg)
669
+
670
+ # Log detailed status for debugging
671
+ status = self.embedding_manager.get_status()
672
+ print(f"=============== FINAL CHECKS PASSED ===============")
673
+ print(f" - Face client: {self.face_client is not None}")
674
+ print(f" - Embedding manager: {self.embedding_manager is not None}")
675
+ print(f" - Embedding manager status: {status}")
676
+ print(f" - Temporal identity manager: {self.temporal_identity_manager is not None}")
677
+
605
678
  self._initialized = True
606
- self.logger.info("Face recognition use case fully initialized")
679
+ self.logger.info("Face recognition use case fully initialized and verified")
680
+ print("=============== INITIALIZATION COMPLETE ===============")
607
681
 
608
682
  except Exception as e:
609
683
  self.logger.error(f"Error during use case initialization: {e}", exc_info=True)
@@ -747,7 +821,7 @@ class FaceRecognitionEmbeddingUseCase(BaseProcessor):
747
821
  self.logger.debug("Applied category filtering")
748
822
 
749
823
  print("------------------TILL TRACKER MS----------------------------")
750
- print("LATENCY:",(time.time() - processing_start)*1000,"| Throughput fps:",(1.0 / (time.time() - processing_start)) if (time.time() - processing_start) > 0 else None)
824
+ print(self._initialized,"LATENCY:",(time.time() - processing_start)*1000,"| Throughput fps:",(1.0 / (time.time() - processing_start)) if (time.time() - processing_start) > 0 else None)
751
825
  print("------------------TILL TRACKER MS----------------------------")
752
826
  # Advanced tracking (BYTETracker-like) - only if enabled
753
827
  if config.enable_face_tracking:
@@ -794,6 +868,19 @@ class FaceRecognitionEmbeddingUseCase(BaseProcessor):
794
868
 
795
869
  # Process face recognition for each detection (if enabled)
796
870
  if config.enable_face_recognition:
871
+ # Additional safety check: verify embeddings are still loaded and ready
872
+ if not self.embedding_manager or not self.embedding_manager.is_ready():
873
+ status = self.embedding_manager.get_status() if self.embedding_manager else {}
874
+ error_msg = f"CRITICAL: Cannot process face recognition - embeddings not ready. Status: {status}"
875
+ self.logger.error(error_msg)
876
+ print(f"ERROR: {error_msg}")
877
+ return self.create_error_result(
878
+ error_msg,
879
+ usecase=self.name,
880
+ category=self.category,
881
+ context=context,
882
+ )
883
+
797
884
  face_recognition_result = await self._process_face_recognition(
798
885
  processed_data, config, stream_info, input_bytes
799
886
  )
@@ -1603,11 +1690,11 @@ class FaceRecognitionEmbeddingUseCase(BaseProcessor):
1603
1690
  human_text_lines.append(f"\tRecognized: {face_summary.get('session_totals',{}).get('total_recognized', 0)}")
1604
1691
  human_text_lines.append(f"\tUnknown: {face_summary.get('session_totals',{}).get('total_unknown', 0)}")
1605
1692
  # Additional counts similar to compare_similarity HUD
1606
- try:
1607
- human_text_lines.append(f"\tCurrent Faces (detections): {total_detections}")
1608
- human_text_lines.append(f"\tTotal Unique Tracks: {cumulative_total}")
1609
- except Exception:
1610
- pass
1693
+ # try:
1694
+ # human_text_lines.append(f"\tCurrent Faces (detections): {total_detections}")
1695
+ # human_text_lines.append(f"\tTotal Unique Tracks: {cumulative_total}")
1696
+ # except Exception:
1697
+ # pass
1611
1698
 
1612
1699
  human_text = "\n".join(human_text_lines)
1613
1700