modified SPINLabelEncode SPINLabelDecode
parent
f614274672
commit
484bf2f7dc
|
@ -60,7 +60,7 @@ Loss:
|
|||
ignore_index: 0
|
||||
|
||||
PostProcess:
|
||||
name: SPINAttnLabelDecode
|
||||
name: SPINLabelDecode
|
||||
use_space_char: False
|
||||
|
||||
|
||||
|
@ -78,7 +78,7 @@ Train:
|
|||
- DecodeImage: # load image
|
||||
img_mode: BGR
|
||||
channel_first: False
|
||||
- SPINAttnLabelEncode: # Class handling label
|
||||
- SPINLabelEncode: # Class handling label
|
||||
- SPINRecResizeImg:
|
||||
image_shape: [100, 32]
|
||||
interpolation : 2
|
||||
|
@ -101,7 +101,7 @@ Eval:
|
|||
- DecodeImage: # load image
|
||||
img_mode: BGR
|
||||
channel_first: False
|
||||
- SPINAttnLabelEncode: # Class handling label
|
||||
- SPINLabelEncode: # Class handling label
|
||||
- SPINRecResizeImg:
|
||||
image_shape: [100, 32]
|
||||
interpolation : 2
|
||||
|
|
|
@ -1217,7 +1217,7 @@ class ABINetLabelEncode(BaseRecLabelEncode):
|
|||
dict_character = ['</s>'] + dict_character
|
||||
return dict_character
|
||||
|
||||
class SPINAttnLabelEncode(AttnLabelEncode):
|
||||
class SPINLabelEncode(AttnLabelEncode):
|
||||
""" Convert between text-label and text-index """
|
||||
|
||||
def __init__(self,
|
||||
|
@ -1226,7 +1226,7 @@ class SPINAttnLabelEncode(AttnLabelEncode):
|
|||
use_space_char=False,
|
||||
lower=True,
|
||||
**kwargs):
|
||||
super(SPINAttnLabelEncode, self).__init__(
|
||||
super(SPINLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char)
|
||||
self.lower = lower
|
||||
def add_special_char(self, dict_character):
|
||||
|
|
|
@ -28,7 +28,7 @@ from .fce_postprocess import FCEPostProcess
|
|||
from .rec_postprocess import CTCLabelDecode, AttnLabelDecode, SRNLabelDecode, \
|
||||
DistillationCTCLabelDecode, NRTRLabelDecode, SARLabelDecode, \
|
||||
SEEDLabelDecode, PRENLabelDecode, ViTSTRLabelDecode, ABINetLabelDecode, \
|
||||
SPINAttnLabelDecode
|
||||
SPINLabelDecode
|
||||
from .cls_postprocess import ClsPostProcess
|
||||
from .pg_postprocess import PGPostProcess
|
||||
from .vqa_token_ser_layoutlm_postprocess import VQASerTokenLayoutLMPostProcess
|
||||
|
@ -45,7 +45,7 @@ def build_post_process(config, global_config=None):
|
|||
'SEEDLabelDecode', 'VQASerTokenLayoutLMPostProcess',
|
||||
'VQAReTokenLayoutLMPostProcess', 'PRENLabelDecode',
|
||||
'DistillationSARLabelDecode', 'ViTSTRLabelDecode', 'ABINetLabelDecode',
|
||||
'TableMasterLabelDecode', 'SPINAttnLabelDecode'
|
||||
'TableMasterLabelDecode', 'SPINLabelDecode'
|
||||
]
|
||||
|
||||
if config['name'] == 'PSEPostProcess':
|
||||
|
|
|
@ -668,12 +668,12 @@ class ABINetLabelDecode(NRTRLabelDecode):
|
|||
dict_character = ['</s>'] + dict_character
|
||||
return dict_character
|
||||
|
||||
class SPINAttnLabelDecode(AttnLabelDecode):
|
||||
class SPINLabelDecode(AttnLabelDecode):
|
||||
""" Convert between text-label and text-index """
|
||||
|
||||
def __init__(self, character_dict_path=None, use_space_char=False,
|
||||
**kwargs):
|
||||
super(SPINAttnLabelDecode, self).__init__(character_dict_path,
|
||||
super(SPINLabelDecode, self).__init__(character_dict_path,
|
||||
use_space_char)
|
||||
|
||||
def add_special_char(self, dict_character):
|
||||
|
|
|
@ -61,7 +61,7 @@ Loss:
|
|||
ignore_index: 0
|
||||
|
||||
PostProcess:
|
||||
name: SPINAttnLabelDecode
|
||||
name: SPINLabelDecode
|
||||
use_space_char: False
|
||||
|
||||
|
||||
|
@ -79,7 +79,7 @@ Train:
|
|||
- DecodeImage: # load image
|
||||
img_mode: BGR
|
||||
channel_first: False
|
||||
- SPINAttnLabelEncode: # Class handling label
|
||||
- SPINLabelEncode: # Class handling label
|
||||
- SPINRecResizeImg:
|
||||
image_shape: [100, 32]
|
||||
interpolation : 2
|
||||
|
@ -102,7 +102,7 @@ Eval:
|
|||
- DecodeImage: # load image
|
||||
img_mode: BGR
|
||||
channel_first: False
|
||||
- SPINAttnLabelEncode: # Class handling label
|
||||
- SPINLabelEncode: # Class handling label
|
||||
- SPINRecResizeImg:
|
||||
image_shape: [100, 32]
|
||||
interpolation : 2
|
||||
|
|
Loading…
Reference in New Issue