diff --git a/deploy/hubserving/ocr_det/module.py b/deploy/hubserving/ocr_det/module.py index 595f4cea9c74664dd1578735f062dbe4bac74a55..9534c09c7145672d15ce1861eaa66de646027692 100644 --- a/deploy/hubserving/ocr_det/module.py +++ b/deploy/hubserving/ocr_det/module.py @@ -17,6 +17,8 @@ import paddlehub as hub from tools.infer.utility import base64_to_cv2 from tools.infer.predict_det import TextDetector + +from deploy.hubserving.ocr_det.params import read_params from tools.infer.utility import parse_args @@ -32,6 +34,7 @@ class OCRDet(hub.Module): """ initialize with the necessary elements """ + cfg = self.merge_configs() cfg.use_gpu = use_gpu @@ -57,7 +60,6 @@ class OCRDet(hub.Module): sys.argv = sys.argv[:1] cfg = parse_args() - from ocr_det.params import read_params update_cfg_map = vars(read_params()) for key in update_cfg_map: diff --git a/deploy/hubserving/ocr_rec/module.py b/deploy/hubserving/ocr_rec/module.py index 70998241dcd2ed04ae94dd3eb33d5d18244652d6..1c2039afbd7b4b164aac6e61146e65081b0cc7c3 100644 --- a/deploy/hubserving/ocr_rec/module.py +++ b/deploy/hubserving/ocr_rec/module.py @@ -15,6 +15,8 @@ import paddlehub as hub from tools.infer.utility import base64_to_cv2 from tools.infer.predict_rec import TextRecognizer + +from deploy.hubserving.ocr_rec.params import read_params from tools.infer.utility import parse_args @@ -30,6 +32,7 @@ class OCRRec(hub.Module): """ initialize with the necessary elements """ + cfg = self.merge_configs() cfg.use_gpu = use_gpu @@ -55,7 +58,6 @@ class OCRRec(hub.Module): sys.argv = sys.argv[:1] cfg = parse_args() - from ocr_det.params import read_params update_cfg_map = vars(read_params()) for key in update_cfg_map: diff --git a/deploy/hubserving/ocr_system/module.py b/deploy/hubserving/ocr_system/module.py index 7a65db09cecac6b49804bf260f3e738177dd3cbf..cd997a586d9aadfb5a7beed789e7c62b8c419983 100644 --- a/deploy/hubserving/ocr_system/module.py +++ b/deploy/hubserving/ocr_system/module.py @@ -18,6 +18,7 @@ import paddlehub as hub from tools.infer.utility import base64_to_cv2 from tools.infer.predict_system import TextSystem +from deploy.hubserving.ocr_system.params import read_params from tools.infer.utility import parse_args @@ -58,7 +59,6 @@ class OCRSystem(hub.Module): sys.argv = sys.argv[:1] cfg = parse_args() - from ocr_det.params import read_params update_cfg_map = vars(read_params()) for key in update_cfg_map: