diff --git a/configs/rec/rec_r32_gaspin_bilstm_att.yml b/configs/rec/rec_r32_gaspin_bilstm_att.yml index f7c1b813fcd6d0553027c3c6d0f7191e950c63ad..aea71388f703376120af4d0caf2fa8ccd4d92cce 100644 --- a/configs/rec/rec_r32_gaspin_bilstm_att.yml +++ b/configs/rec/rec_r32_gaspin_bilstm_att.yml @@ -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 diff --git a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py index 775ceec83f135d656dfd447c2afe936fe1a75a42..97539faf232ec157340d3136d2efc0daca8deda8 100644 --- a/ppocr/data/imaug/label_ops.py +++ b/ppocr/data/imaug/label_ops.py @@ -1217,7 +1217,7 @@ class ABINetLabelEncode(BaseRecLabelEncode): dict_character = [''] + 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): diff --git a/ppocr/postprocess/__init__.py b/ppocr/postprocess/__init__.py index 204ae0bdfdc9a88f3f3e52f6928ffbd1645c6815..eeebc5803f321df0d6709bb57a009692659bfe77 100644 --- a/ppocr/postprocess/__init__.py +++ b/ppocr/postprocess/__init__.py @@ -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': diff --git a/ppocr/postprocess/rec_postprocess.py b/ppocr/postprocess/rec_postprocess.py index 3e7c29d8d20f0172884c1b8c12d12477bc43699a..3fe29aabe58f42faa02d1b25b4255ba8a19b3ea3 100644 --- a/ppocr/postprocess/rec_postprocess.py +++ b/ppocr/postprocess/rec_postprocess.py @@ -668,12 +668,12 @@ class ABINetLabelDecode(NRTRLabelDecode): dict_character = [''] + 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): diff --git a/test_tipc/configs/rec_r32_gaspin_bilstm_att/rec_r32_gaspin_bilstm_att.yml b/test_tipc/configs/rec_r32_gaspin_bilstm_att/rec_r32_gaspin_bilstm_att.yml index a08efe579642e3dc959a568a7ca40c8ca3f8614c..d0cb20481f56a093f96c3d13f5fa2c2d13ae0c69 100644 --- a/test_tipc/configs/rec_r32_gaspin_bilstm_att/rec_r32_gaspin_bilstm_att.yml +++ b/test_tipc/configs/rec_r32_gaspin_bilstm_att/rec_r32_gaspin_bilstm_att.yml @@ -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