add export model of pse

This commit is contained in:
WenmuZhou 2021-07-29 19:33:47 +08:00
parent a6a44ea124
commit 026f96b657
2 changed files with 2 additions and 4 deletions

View File

@ -223,9 +223,7 @@ class TextDetector(object):
#self.predictor.try_shrink_memory()
post_result = self.postprocess_op(preds, shape_list)
dt_boxes = post_result[0]['points']
if self.det_algorithm == "SAST" and self.det_sast_polygon:
dt_boxes = self.filter_tag_det_res_only_clip(dt_boxes, ori_im.shape)
elif self.det_algorithm == "PSE" and self.det_pse_box_type=='poly':
if (self.det_algorithm == "SAST" and self.det_sast_polygon) or (self.det_algorithm == "PSE" and self.det_pse_box_type=='poly'):
dt_boxes = self.filter_tag_det_res_only_clip(dt_boxes, ori_im.shape)
else:
dt_boxes = self.filter_tag_det_res(dt_boxes, ori_im.shape)

View File

@ -66,7 +66,7 @@ def init_args():
parser.add_argument("--det_pse_thresh", type=float, default=0)
parser.add_argument("--det_pse_box_thresh", type=float, default=0.85)
parser.add_argument("--det_pse_min_area", type=float, default=16)
parser.add_argument("--det_pse_box_type", type=str, default='poly')
parser.add_argument("--det_pse_box_type", type=str, default='box')
parser.add_argument("--det_pse_scale", type=int, default=1)
# params for text recognizer