matrice-analytics 0.1.3__py3-none-any.whl → 0.1.31__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of matrice-analytics might be problematic. Click here for more details.
- matrice_analytics/post_processing/advanced_tracker/matching.py +3 -3
- matrice_analytics/post_processing/advanced_tracker/strack.py +1 -1
- matrice_analytics/post_processing/face_reg/compare_similarity.py +5 -5
- matrice_analytics/post_processing/face_reg/embedding_manager.py +14 -7
- matrice_analytics/post_processing/face_reg/face_recognition.py +123 -34
- matrice_analytics/post_processing/face_reg/face_recognition_client.py +332 -82
- matrice_analytics/post_processing/face_reg/people_activity_logging.py +29 -22
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/__init__.py +9 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/__init__.py +4 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/cli.py +33 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/dataset_stats.py +139 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/export.py +398 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/train.py +447 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/utils.py +129 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/valid.py +93 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/validate_dataset.py +240 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/visualize_augmentation.py +176 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/cli/visualize_predictions.py +96 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/__init__.py +3 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/process.py +246 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/types.py +60 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/core/utils.py +87 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/__init__.py +3 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/config.py +82 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/hub.py +141 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/inference/plate_recognizer.py +323 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/py.typed +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/augmentation.py +101 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/data/dataset.py +97 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/config.py +114 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/layers.py +553 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/loss.py +55 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/metric.py +86 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/model_builders.py +95 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/model/model_schema.py +395 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/__init__.py +0 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/backend_utils.py +38 -0
- matrice_analytics/post_processing/ocr/fast_plate_ocr_py38/train/utilities/utils.py +214 -0
- matrice_analytics/post_processing/ocr/postprocessing.py +0 -1
- matrice_analytics/post_processing/post_processor.py +19 -5
- matrice_analytics/post_processing/usecases/color/clip.py +42 -8
- matrice_analytics/post_processing/usecases/color/color_mapper.py +2 -2
- matrice_analytics/post_processing/usecases/color_detection.py +21 -98
- matrice_analytics/post_processing/usecases/drone_traffic_monitoring.py +41 -386
- matrice_analytics/post_processing/usecases/flare_analysis.py +1 -56
- matrice_analytics/post_processing/usecases/license_plate_detection.py +476 -202
- matrice_analytics/post_processing/usecases/license_plate_monitoring.py +252 -11
- matrice_analytics/post_processing/usecases/people_counting.py +408 -1431
- matrice_analytics/post_processing/usecases/people_counting_bckp.py +1683 -0
- matrice_analytics/post_processing/usecases/vehicle_monitoring.py +39 -10
- matrice_analytics/post_processing/utils/__init__.py +8 -8
- {matrice_analytics-0.1.3.dist-info → matrice_analytics-0.1.31.dist-info}/METADATA +1 -1
- {matrice_analytics-0.1.3.dist-info → matrice_analytics-0.1.31.dist-info}/RECORD +59 -24
- {matrice_analytics-0.1.3.dist-info → matrice_analytics-0.1.31.dist-info}/WHEEL +0 -0
- {matrice_analytics-0.1.3.dist-info → matrice_analytics-0.1.31.dist-info}/licenses/LICENSE.txt +0 -0
- {matrice_analytics-0.1.3.dist-info → matrice_analytics-0.1.31.dist-info}/top_level.txt +0 -0
|
@@ -13,7 +13,6 @@ from ..utils import (
|
|
|
13
13
|
filter_by_categories,
|
|
14
14
|
apply_category_mapping,
|
|
15
15
|
match_results_structure,
|
|
16
|
-
extract_major_colors,
|
|
17
16
|
bbox_smoothing,
|
|
18
17
|
BBoxSmoothingConfig,
|
|
19
18
|
BBoxSmoothingTracker
|
|
@@ -462,60 +461,6 @@ class FlareAnalysisUseCase(BaseProcessor):
|
|
|
462
461
|
is_video = self._is_video_bytes(media_bytes)
|
|
463
462
|
return self._analyze_flares_in_video(data, media_bytes, config) if is_video else self._analyze_flares_in_image(data, media_bytes, config)
|
|
464
463
|
|
|
465
|
-
def _analyze_flares_in_video(self, data: Any, video_bytes: bytes, config: FlareAnalysisConfig) -> List[Dict[str, Any]]:
|
|
466
|
-
with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as temp_video:
|
|
467
|
-
temp_video.write(video_bytes)
|
|
468
|
-
video_path = temp_video.name
|
|
469
|
-
try:
|
|
470
|
-
cap = cv2.VideoCapture(video_path)
|
|
471
|
-
if not cap.isOpened():
|
|
472
|
-
raise RuntimeError("Failed to open video file")
|
|
473
|
-
fps = config.fps or cap.get(cv2.CAP_PROP_FPS)
|
|
474
|
-
flare_analysis = []
|
|
475
|
-
frame_id = 0
|
|
476
|
-
while True:
|
|
477
|
-
ret, frame = cap.read()
|
|
478
|
-
if not ret:
|
|
479
|
-
break
|
|
480
|
-
if frame_id % config.frame_skip != 0:
|
|
481
|
-
frame_id += 1
|
|
482
|
-
continue
|
|
483
|
-
frame_key = str(frame_id)
|
|
484
|
-
timestamp = frame_id / fps
|
|
485
|
-
frame_detections = self._get_frame_detections(data, frame_key)
|
|
486
|
-
if not frame_detections:
|
|
487
|
-
frame_id += 1
|
|
488
|
-
continue
|
|
489
|
-
rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
|
490
|
-
for detection in frame_detections:
|
|
491
|
-
if detection.get("confidence", 1.0) < config.confidence_threshold:
|
|
492
|
-
continue
|
|
493
|
-
bbox = detection.get("bounding_box", detection.get("bbox"))
|
|
494
|
-
if not bbox:
|
|
495
|
-
continue
|
|
496
|
-
crop = self._crop_bbox(rgb_frame, bbox, config.bbox_format)
|
|
497
|
-
if crop.size == 0:
|
|
498
|
-
continue
|
|
499
|
-
major_colors = extract_major_colors(crop, k=config.top_k_colors)
|
|
500
|
-
main_color = major_colors[0][0] if major_colors else "unknown"
|
|
501
|
-
flare_record = {
|
|
502
|
-
"frame_id": frame_key,
|
|
503
|
-
"timestamp": round(timestamp, 2),
|
|
504
|
-
"category": detection.get("category", "unknown"),
|
|
505
|
-
"confidence": round(detection.get("confidence", 0.0), 3),
|
|
506
|
-
"main_color": main_color,
|
|
507
|
-
"major_colors": major_colors,
|
|
508
|
-
"bounding_box": bbox,
|
|
509
|
-
"detection_id": detection.get("id", f"det_{len(flare_analysis)}"),
|
|
510
|
-
"track_id": detection.get("track_id")
|
|
511
|
-
}
|
|
512
|
-
flare_analysis.append(flare_record)
|
|
513
|
-
frame_id += 1
|
|
514
|
-
cap.release()
|
|
515
|
-
return flare_analysis
|
|
516
|
-
finally:
|
|
517
|
-
if os.path.exists(video_path):
|
|
518
|
-
os.unlink(video_path)
|
|
519
464
|
|
|
520
465
|
def _analyze_flares_in_image(self, data: Any, image_bytes: bytes, config: FlareAnalysisConfig) -> List[Dict[str, Any]]:
|
|
521
466
|
image_array = np.frombuffer(image_bytes, np.uint8)
|
|
@@ -534,7 +479,7 @@ class FlareAnalysisUseCase(BaseProcessor):
|
|
|
534
479
|
crop = self._crop_bbox(rgb_image, bbox, config.bbox_format)
|
|
535
480
|
if crop.size == 0:
|
|
536
481
|
continue
|
|
537
|
-
major_colors = extract_major_colors(crop, k=config.top_k_colors)
|
|
482
|
+
major_colors = [()] #extract_major_colors(crop, k=config.top_k_colors)
|
|
538
483
|
main_color = major_colors[0][0] if major_colors else "unknown"
|
|
539
484
|
flare_record = {
|
|
540
485
|
"frame_id": "0",
|