diff --git a/ppstructure/layout/predict_layout.py b/ppstructure/layout/predict_layout.py index a108d1005a7ed4b571071c07371c68e182f2dd09..a58a63f4931336686cf7e7b4841819b17c31fdbf 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 80090fd9d5d936a36d3fa613d3a2df760f6c0ee8..d79658f13090a3b25d3e42a83cbac8a164f1e97c 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)