Skip to content

Commit c67d04a

Browse files
committed
adapt to mobile model
1 parent e11b8af commit c67d04a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

deploy/pdserving/det_local_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, args):
4141
elif self.det_algorithm == "EAST":
4242
self.fetch = ["sigmoid_0.tmp_0", "tmp_2"]
4343
elif self.det_algorithm == "DB":
44-
self.fetch = ["sigmoid_0.tmp_0"]
44+
self.fetch = ["save_infer_model/scale_0.tmp_0"]
4545

4646
def preprocess(self, img):
4747
img = img.copy()

deploy/pdserving/det_rpc_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, args):
4141
elif self.det_algorithm == "EAST":
4242
self.fetch = ["sigmoid_0.tmp_0", "tmp_2"]
4343
elif self.det_algorithm == "DB":
44-
self.fetch = ["sigmoid_0.tmp_0"]
44+
self.fetch = ["save_infer_model/scale_0.tmp_0"]
4545

4646
def preprocess(self, img):
4747
im, ratio_list = self.preprocess_op(img)

deploy/pdserving/params.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def read_params():
1414

1515
#params for text detector
1616
cfg.det_algorithm = "DB"
17-
cfg.det_model_dir = "./det_mv_server/"
17+
cfg.det_model_dir = "./det_infer_server/"
1818
cfg.det_max_side_len = 960
1919

2020
#DB parmas
@@ -29,7 +29,7 @@ def read_params():
2929

3030
#params for text recognizer
3131
cfg.rec_algorithm = "CRNN"
32-
cfg.rec_model_dir = "./ocr_rec_server/"
32+
cfg.rec_model_dir = "./rec_infer_server/"
3333

3434
cfg.rec_image_shape = "3, 32, 320"
3535
cfg.rec_char_type = 'ch'
@@ -41,7 +41,7 @@ def read_params():
4141

4242
#params for text classifier
4343
cfg.use_angle_cls = True
44-
cfg.cls_model_dir = "./ocr_clas_server/"
44+
cfg.cls_model_dir = "./cls_infer_server/"
4545
cfg.cls_image_shape = "3, 48, 192"
4646
cfg.label_list = ['0', '180']
4747
cfg.cls_batch_num = 30

deploy/pdserving/rec_local_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TextRecognizerHelper(TextRecognizer):
3636
def __init__(self, args):
3737
super(TextRecognizerHelper, self).__init__(args)
3838
if self.loss_type == "ctc":
39-
self.fetch = ["ctc_greedy_decoder_0.tmp_0", "softmax_0.tmp_0"]
39+
self.fetch = ["save_infer_model/scale_0.tmp_0", "save_infer_model/scale_1.tmp_0"]
4040

4141
def preprocess(self, img_list):
4242
img_num = len(img_list)
@@ -83,8 +83,8 @@ def postprocess(self, outputs, args):
8383
if self.loss_type == "ctc":
8484
rec_idx_batch = outputs[0]
8585
predict_batch = outputs[1]
86-
rec_idx_lod = args["ctc_greedy_decoder_0.tmp_0.lod"]
87-
predict_lod = args["softmax_0.tmp_0.lod"]
86+
rec_idx_lod = args["save_infer_model/scale_0.tmp_0.lod"]
87+
predict_lod = args["save_infer_model/scale_1.tmp_0.lod"]
8888
indices = args["indices"]
8989
rec_res = [['', 0.0]] * (len(rec_idx_lod) - 1)
9090
for rno in range(len(rec_idx_lod) - 1):

deploy/pdserving/rec_rpc_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class TextRecognizerHelper(TextRecognizer):
3535
def __init__(self, args):
3636
super(TextRecognizerHelper, self).__init__(args)
3737
if self.loss_type == "ctc":
38-
self.fetch = ["ctc_greedy_decoder_0.tmp_0", "softmax_0.tmp_0"]
38+
self.fetch = ["save_infer_model/scale_0.tmp_0", "save_infer_model/scale_1.tmp_0"]
3939

4040
def preprocess(self, img_list):
4141
img_num = len(img_list)
@@ -88,8 +88,8 @@ def postprocess(self, outputs, args):
8888
if self.loss_type == "ctc":
8989
rec_idx_batch = outputs[0]
9090
predict_batch = outputs[1]
91-
rec_idx_lod = args["ctc_greedy_decoder_0.tmp_0.lod"]
92-
predict_lod = args["softmax_0.tmp_0.lod"]
91+
rec_idx_lod = args["save_infer_model/scale_0.tmp_0.lod"]
92+
predict_lod = args["save_infer_model/scale_1.tmp_0.lod"]
9393
indices = args["indices"]
9494
rec_res = [['', 0.0]] * (len(rec_idx_lod) - 1)
9595
for rno in range(len(rec_idx_lod) - 1):

0 commit comments

Comments
 (0)