提交 6e03b3de 编写于 作者: W WenmuZhou

del unused params

上级 cf1385a7
...@@ -325,14 +325,8 @@ class TableLabelDecode(object): ...@@ -325,14 +325,8 @@ class TableLabelDecode(object):
""" """ """ """
def __init__(self, def __init__(self,
max_text_length,
max_elem_length,
max_cell_num,
character_dict_path, character_dict_path,
**kwargs): **kwargs):
self.max_text_length = max_text_length
self.max_elem_length = max_elem_length
self.max_cell_num = max_cell_num
list_character, list_elem = self.load_char_elem_dict(character_dict_path) list_character, list_elem = self.load_char_elem_dict(character_dict_path)
list_character = self.add_special_char(list_character) list_character = self.add_special_char(list_character)
list_elem = self.add_special_char(list_elem) list_elem = self.add_special_char(list_elem)
...@@ -369,18 +363,6 @@ class TableLabelDecode(object): ...@@ -369,18 +363,6 @@ class TableLabelDecode(object):
list_character = [self.beg_str] + list_character + [self.end_str] list_character = [self.beg_str] + list_character + [self.end_str]
return list_character return list_character
def get_sp_tokens(self):
char_beg_idx = self.get_beg_end_flag_idx('beg', 'char')
char_end_idx = self.get_beg_end_flag_idx('end', 'char')
elem_beg_idx = self.get_beg_end_flag_idx('beg', 'elem')
elem_end_idx = self.get_beg_end_flag_idx('end', 'elem')
elem_char_idx1 = self.dict_elem['<td>']
elem_char_idx2 = self.dict_elem['<td']
sp_tokens = np.array([char_beg_idx, char_end_idx, elem_beg_idx,
elem_end_idx, elem_char_idx1, elem_char_idx2, self.max_text_length,
self.max_elem_length, self.max_cell_num])
return sp_tokens
def __call__(self, preds): def __call__(self, preds):
structure_probs = preds['structure_probs'] structure_probs = preds['structure_probs']
loc_preds = preds['loc_preds'] loc_preds = preds['loc_preds']
......
...@@ -63,9 +63,6 @@ class TableStructurer(object): ...@@ -63,9 +63,6 @@ class TableStructurer(object):
'name': 'TableLabelDecode', 'name': 'TableLabelDecode',
"character_type": args.structure_char_type, "character_type": args.structure_char_type,
"character_dict_path": args.structure_char_dict_path, "character_dict_path": args.structure_char_dict_path,
"max_text_length": args.structure_max_text_length,
"max_elem_length": args.structure_max_elem_length,
"max_cell_num": args.structure_max_cell_num
} }
self.preprocess_op = create_operators(pre_process_list) self.preprocess_op = create_operators(pre_process_list)
......
...@@ -24,9 +24,6 @@ def init_args(): ...@@ -24,9 +24,6 @@ def init_args():
parser.add_argument("--output", type=str, default='./output/table') parser.add_argument("--output", type=str, default='./output/table')
# params for table structure # params for table structure
parser.add_argument("--structure_max_len", type=int, default=488) parser.add_argument("--structure_max_len", type=int, default=488)
parser.add_argument("--structure_max_text_length", type=int, default=100)
parser.add_argument("--structure_max_elem_length", type=int, default=800)
parser.add_argument("--structure_max_cell_num", type=int, default=500)
parser.add_argument("--structure_model_dir", type=str) parser.add_argument("--structure_model_dir", type=str)
parser.add_argument("--structure_char_type", type=str, default='en') parser.add_argument("--structure_char_type", type=str, default='en')
parser.add_argument("--structure_char_dict_path", type=str, default="../ppocr/utils/dict/table_structure_dict.txt") parser.add_argument("--structure_char_dict_path", type=str, default="../ppocr/utils/dict/table_structure_dict.txt")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册