From 4f3eef69f026357788475ccbe12c1c8c25b64fa8 Mon Sep 17 00:00:00 2001 From: an1018 <614803115@qq.com> Date: Wed, 10 Aug 2022 13:53:43 +0800 Subject: [PATCH] update layout --- ppstructure/layout/predict_layout.py | 6 +++--- ppstructure/utility.py | 16 +++------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/ppstructure/layout/predict_layout.py b/ppstructure/layout/predict_layout.py index a108d100..a58a63f4 100755 --- a/ppstructure/layout/predict_layout.py +++ b/ppstructure/layout/predict_layout.py @@ -16,7 +16,7 @@ import sys __dir__ = os.path.dirname(os.path.abspath(__file__)) sys.path.append(__dir__) -sys.path.append(os.path.abspath(os.path.join(__dir__, '../..'))) +sys.path.insert(0, os.path.abspath(os.path.join(__dir__, '../..'))) os.environ["FLAGS_allocator_strategy"] = 'auto_growth' @@ -57,8 +57,8 @@ class LayoutPredictor(object): postprocess_params = { 'name': 'PicoDetPostProcess', "layout_dict_path": args.layout_dict_path, - "score_threshold": args.score_threshold, - "nms_threshold": args.nms_threshold, + "score_threshold": args.layout_score_threshold, + "nms_threshold": args.layout_nms_threshold, } self.preprocess_op = create_operators(pre_process_list) diff --git a/ppstructure/utility.py b/ppstructure/utility.py index 80090fd9..d79658f1 100644 --- a/ppstructure/utility.py +++ b/ppstructure/utility.py @@ -36,24 +36,14 @@ def init_args(): parser.add_argument( "--layout_dict_path", type=str, - default="../../ppocr/utils/dict/layout_pubalynet_dict.txt") + default="../ppocr/utils/dict/layout_pubalynet_dict.txt") parser.add_argument( - "--score_threshold", + "--layout_score_threshold", type=float, default=0.5, help="Threshold of score.") parser.add_argument( - "--nms_threshold", type=float, default=0.5, help="Threshold of nms.") - - parser.add_argument( - "--layout_path_model", - type=str, - default="lp://PubLayNet/ppyolov2_r50vd_dcn_365e_publaynet/config") - parser.add_argument( - "--layout_label_map", - type=ast.literal_eval, - default=None, - help='label map according to ppstructure/layout/README_ch.md') + "--layout_nms_threshold", type=float, default=0.5, help="Threshold of nms.") # params for vqa parser.add_argument("--vqa_algorithm", type=str, default='LayoutXLM') parser.add_argument("--ser_model_dir", type=str) -- GitLab