update layout

This commit is contained in:
an1018 2022-08-10 13:53:43 +08:00
parent c94025f266
commit 4f3eef69f0
2 changed files with 6 additions and 16 deletions

View File

@ -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)

View File

@ -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)