diff --git a/Prj-Android/hyperlpr3/src/main/assets/r2_mobile/rpv3_mdict_160_r3.mnn b/Prj-Android/hyperlpr3/src/main/assets/r2_mobile/rpv3_mdict_160_r3.mnn index d4e6c8a..ba7f5ea 100644 Binary files a/Prj-Android/hyperlpr3/src/main/assets/r2_mobile/rpv3_mdict_160_r3.mnn and b/Prj-Android/hyperlpr3/src/main/assets/r2_mobile/rpv3_mdict_160_r3.mnn differ diff --git a/Prj-Python/hyperlpr3/common/typedef.py b/Prj-Python/hyperlpr3/common/typedef.py index cabfcf5..5c9ce65 100644 --- a/Prj-Python/hyperlpr3/common/typedef.py +++ b/Prj-Python/hyperlpr3/common/typedef.py @@ -72,6 +72,9 @@ class Plate(object): def to_result(self): return [self.plate_code, self.rec_confidence, self.plate_type, self.det_bound_box.tolist(),] + def to_full_result(self): + return [self.plate_code, self.rec_confidence, self.plate_type, self.det_bound_box.tolist(), self.vertex.tolist()] + def __dict__(self): return self.to_dict() diff --git a/Prj-Python/hyperlpr3/hyperlpr3.py b/Prj-Python/hyperlpr3/hyperlpr3.py index 514edbc..6975118 100644 --- a/Prj-Python/hyperlpr3/hyperlpr3.py +++ b/Prj-Python/hyperlpr3/hyperlpr3.py @@ -14,7 +14,8 @@ class LicensePlateCatcher(object): inference: int = INFER_ONNX_RUNTIME, folder: str = _DEFAULT_FOLDER_, detect_level: int = DETECT_LEVEL_LOW, - logger_level: int = 3): + logger_level: int = 3, + full_result: bool = False): if inference == INFER_ONNX_RUNTIME: from hyperlpr3.inference.multitask_detect import MultiTaskDetectorORT from hyperlpr3.inference.recognition import PPRCNNRecognitionORT @@ -31,7 +32,7 @@ class LicensePlateCatcher(object): raise NotImplemented rec = PPRCNNRecognitionORT(join(folder, ort_cfg['rec_model_path']), input_size=(48, 160)) cls = ClassificationORT(join(folder, ort_cfg['cls_model_path']), input_size=(96, 96)) - self.pipeline = LPRMultiTaskPipeline(detector=det, recognizer=rec, classifier=cls) + self.pipeline = LPRMultiTaskPipeline(detector=det, recognizer=rec, classifier=cls, full_result=full_result) else: raise NotImplemented diff --git a/Prj-Python/hyperlpr3/inference/pipeline.py b/Prj-Python/hyperlpr3/inference/pipeline.py index bdb358c..6da2891 100644 --- a/Prj-Python/hyperlpr3/inference/pipeline.py +++ b/Prj-Python/hyperlpr3/inference/pipeline.py @@ -6,10 +6,11 @@ from hyperlpr3.common.tools_process import * class LPRMultiTaskPipeline(object): - def __init__(self, detector, recognizer, classifier): + def __init__(self, detector, recognizer, classifier, full_result=False): self.detector = detector self.recognizer = recognizer self.classifier = classifier + self.full_result = full_result def run(self, image: np.ndarray) -> list: result = list() @@ -56,7 +57,10 @@ class LPRMultiTaskPipeline(object): plate_type = GREEN plate = Plate(vertex=land_marks, plate_code=plate_code, det_bound_box=np.asarray(rect), rec_confidence=rec_confidence, dex_bound_confidence=score, plate_type=plate_type) - result.append(plate.to_result()) + if self.full_result: + result.append(plate.to_full_result()) + else: + result.append(plate.to_result()) return result diff --git a/resource/models/r2_mobile/rpv3_mdict_160_r3.mnn b/resource/models/r2_mobile/rpv3_mdict_160_r3.mnn index d4e6c8a..ba7f5ea 100644 Binary files a/resource/models/r2_mobile/rpv3_mdict_160_r3.mnn and b/resource/models/r2_mobile/rpv3_mdict_160_r3.mnn differ