提交 20354397 编写于 作者: F felixhjh

change postprocess name

上级 ccf6d601
......@@ -213,13 +213,13 @@ class RecOp(Op):
res_list = []
if isinstance(fetch_data, dict):
if len(fetch_data) > 0:
rec_batch_res = self.ocr_reader.postprocess(
rec_batch_res = self.ocr_reader.postprocess_ocrv2(
fetch_data, with_score=True)
for res in rec_batch_res:
res_list.append(res[0])
elif isinstance(fetch_data, list):
for one_batch in fetch_data:
one_batch_res = self.ocr_reader.postprocess(
one_batch_res = self.ocr_reader.postprocess_ocrv2(
one_batch, with_score=True)
for res in one_batch_res:
res_list.append(res[0])
......
......@@ -279,7 +279,7 @@ class OCRReader(object):
return norm_img_batch[0]
def postprocess_old(self, outputs, with_score=False):
def postprocess(self, outputs, with_score=False):
rec_res = []
rec_idx_lod = outputs["ctc_greedy_decoder_0.tmp_0.lod"]
rec_idx_batch = outputs["ctc_greedy_decoder_0.tmp_0"]
......@@ -309,7 +309,7 @@ class OCRReader(object):
rec_res.append([preds_text])
return rec_res
def postprocess(self, outputs, with_score=False):
def postprocess_ocrv2(self, outputs, with_score=False):
preds = outputs["save_infer_model/scale_0.tmp_1"]
try:
preds = preds.numpy()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册