From 438060d36b0b9821872cf3a28046353126ac2c05 Mon Sep 17 00:00:00 2001 From: Double_V Date: Sun, 25 Apr 2021 14:30:44 +0800 Subject: [PATCH] Fix hub 21 (#2626) * fix hubserving * fix hubserving --- deploy/hubserving/ocr_det/module.py | 4 +++- deploy/hubserving/ocr_rec/module.py | 4 +++- deploy/hubserving/ocr_system/module.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/deploy/hubserving/ocr_det/module.py b/deploy/hubserving/ocr_det/module.py index 595f4cea..9534c09c 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 70998241..1c2039af 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 7a65db09..cd997a58 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: -- GitLab