matrice 1.0.99397__py3-none-any.whl → 1.0.99398__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matrice/deploy/utils/post_processing/usecases/license_plate_monitoring.py +18 -2
- {matrice-1.0.99397.dist-info → matrice-1.0.99398.dist-info}/METADATA +1 -1
- {matrice-1.0.99397.dist-info → matrice-1.0.99398.dist-info}/RECORD +6 -6
- {matrice-1.0.99397.dist-info → matrice-1.0.99398.dist-info}/WHEEL +0 -0
- {matrice-1.0.99397.dist-info → matrice-1.0.99398.dist-info}/licenses/LICENSE.txt +0 -0
- {matrice-1.0.99397.dist-info → matrice-1.0.99398.dist-info}/top_level.txt +0 -0
@@ -313,6 +313,7 @@ class LicensePlateMonitorUseCase(BaseProcessor):
|
|
313
313
|
def _analyze_ocr_in_media(self, data: Any, media_bytes: bytes, config: LicensePlateMonitorConfig) -> List[Dict[str, Any]]:
|
314
314
|
"""Analyze OCR of license plates in video frames or images."""
|
315
315
|
is_video = self._is_video_bytes(media_bytes)
|
316
|
+
print('is_video',is_video)
|
316
317
|
if is_video:
|
317
318
|
return self._analyze_ocr_in_video(data, media_bytes, config)
|
318
319
|
else:
|
@@ -397,20 +398,26 @@ class LicensePlateMonitorUseCase(BaseProcessor):
|
|
397
398
|
rgb_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
398
399
|
ocr_analysis = []
|
399
400
|
detections = self._get_frame_detections(data, "0")
|
401
|
+
|
402
|
+
print("OCR-detections", detections)
|
400
403
|
|
401
404
|
for detection in detections:
|
405
|
+
print("---------OCR DETECTION",detection)
|
402
406
|
if detection.get("confidence", 1.0) < config.confidence_threshold:
|
403
407
|
continue
|
404
408
|
|
405
409
|
bbox = detection.get("bounding_box", detection.get("bbox"))
|
410
|
+
print("---------OCR BBOX",bbox)
|
406
411
|
if not bbox:
|
407
412
|
continue
|
408
413
|
|
409
414
|
crop = self._crop_bbox(rgb_image, bbox, config.bbox_format)
|
415
|
+
print("---------OCR CROP SIZEE",crop.size)
|
410
416
|
if crop.size == 0:
|
411
417
|
continue
|
412
|
-
|
418
|
+
|
413
419
|
plate_text_raw = self._run_ocr(crop)
|
420
|
+
print("---------OCR PLATE TEXT",plate_text_raw)
|
414
421
|
plate_text = plate_text_raw if plate_text_raw else None
|
415
422
|
|
416
423
|
ocr_record = {
|
@@ -465,6 +472,9 @@ class LicensePlateMonitorUseCase(BaseProcessor):
|
|
465
472
|
|
466
473
|
def _run_ocr(self, crop: np.ndarray) -> str:
|
467
474
|
"""Run OCR on a cropped plate image and return cleaned text or empty string."""
|
475
|
+
print("---------OCR CROP22",crop)
|
476
|
+
print("---------OCR CROP SIZE22",crop.size)
|
477
|
+
|
468
478
|
if crop is None or crop.size == 0 or self.ocr_model is None:
|
469
479
|
return ""
|
470
480
|
try:
|
@@ -521,12 +531,15 @@ class LicensePlateMonitorUseCase(BaseProcessor):
|
|
521
531
|
unique_texts: set = set()
|
522
532
|
valid_detections: List[Dict[str, Any]] = []
|
523
533
|
|
534
|
+
print("---------SUMMARY COUNT CATEGORIES",detections)
|
524
535
|
for det in detections:
|
525
536
|
if not all(k in det for k in ['category', 'confidence', 'bounding_box']):
|
526
537
|
continue
|
527
538
|
|
528
|
-
cat = det.get('category', '
|
539
|
+
cat = det.get('category', 'license_plate')
|
529
540
|
plate_text_raw = det.get('plate_text', '')
|
541
|
+
print("---------SUMMARY COUNT CATEGORIES PLATE TEXT RAW",plate_text_raw)
|
542
|
+
print("---------SUMMARY COUNT CATEGORIES PLATE TEXT RAW",det)
|
530
543
|
cleaned_text = self._clean_text(plate_text_raw)
|
531
544
|
|
532
545
|
# Consider as unique only if meets criteria
|
@@ -545,6 +558,9 @@ class LicensePlateMonitorUseCase(BaseProcessor):
|
|
545
558
|
|
546
559
|
counts = {"License_Plate": len(unique_texts)} if unique_texts else {}
|
547
560
|
|
561
|
+
print("---------SUMMARY COUNT CATEGORIES VALID DETECTIONS",valid_detections)
|
562
|
+
print(len(unique_texts),'per_cat_count',counts)
|
563
|
+
|
548
564
|
return {
|
549
565
|
"total_count": len(unique_texts),
|
550
566
|
"per_category_count": counts,
|
@@ -210,7 +210,7 @@ matrice/deploy/utils/post_processing/usecases/leaf.py,sha256=cwgB1ZNxkQFtkk-thSJ
|
|
210
210
|
matrice/deploy/utils/post_processing/usecases/leaf_disease.py,sha256=bkiLccTdf4KUq3he4eCpBlKXb5exr-WBhQ_oWQ7os68,36225
|
211
211
|
matrice/deploy/utils/post_processing/usecases/leak_detection.py,sha256=oOCLLVMuXVeXPHyN8FUrD3U9JYJJwIz-5fcEMgvLdls,40531
|
212
212
|
matrice/deploy/utils/post_processing/usecases/license_plate_detection.py,sha256=WmVmtp-GLUSNtBxjZHUtUk_M9lPp_8gA0rdzFXVL1SY,44961
|
213
|
-
matrice/deploy/utils/post_processing/usecases/license_plate_monitoring.py,sha256=
|
213
|
+
matrice/deploy/utils/post_processing/usecases/license_plate_monitoring.py,sha256=Ir0nEFAPxf8SMztfYxAMFekLTrjZ3WhF9tVQsl2X1UA,55556
|
214
214
|
matrice/deploy/utils/post_processing/usecases/litter_monitoring.py,sha256=XaHAUGRBDJg_iVbu8hRMjTR-5TqrLj6ZNCRkInbzZTY,33255
|
215
215
|
matrice/deploy/utils/post_processing/usecases/mask_detection.py,sha256=MNpCcuefOdW7C8g_x_mNuWYA4mbyg8UNwomwBPoKtr0,39684
|
216
216
|
matrice/deploy/utils/post_processing/usecases/parking.py,sha256=lqTGqcjUZZPFw3tu11Ha8BSsZ311K5--wEZnlVsXakU,34534
|
@@ -261,8 +261,8 @@ matrice/deployment/camera_manager.py,sha256=e1Lc81RJP5wUWRdTgHO6tMWF9BkBdHOSVyx3
|
|
261
261
|
matrice/deployment/deployment.py,sha256=HFt151eWq6iqIAMsQvurpV2WNxW6Cx_gIUVfnVy5SWE,48093
|
262
262
|
matrice/deployment/inference_pipeline.py,sha256=6b4Mm3-qt-Zy0BeiJfFQdImOn3FzdNCY-7ET7Rp8PMk,37911
|
263
263
|
matrice/deployment/streaming_gateway_manager.py,sha256=ifYGl3g25wyU39HwhPQyI2OgF3M6oIqKMWt8RXtMxY8,21401
|
264
|
-
matrice-1.0.
|
265
|
-
matrice-1.0.
|
266
|
-
matrice-1.0.
|
267
|
-
matrice-1.0.
|
268
|
-
matrice-1.0.
|
264
|
+
matrice-1.0.99398.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
|
265
|
+
matrice-1.0.99398.dist-info/METADATA,sha256=b3J2CplYOqjkR3waKBvff83-SO2QiPHMlRyn45PqZNI,14624
|
266
|
+
matrice-1.0.99398.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
267
|
+
matrice-1.0.99398.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
|
268
|
+
matrice-1.0.99398.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|