fix arabic postprocess bug
@@ -38,6 +38,10 @@ class BaseRecLabelDecode(object):
if use_space_char:
self.character_str.append(" ")
dict_character = list(self.character_str)
+ if 'arabic' in character_dict_path:
+ self.reverse = True
+ else:
+ self.reverse = False
dict_character = self.add_special_char(dict_character)
self.dict = {}
@@ -45,11 +49,6 @@ class BaseRecLabelDecode(object):
self.dict[char] = i
self.character = dict_character
- if 'arabic' in character_dict_path:
- self.reverse = True
- else:
- self.reverse = False
-
def pred_reverse(self, pred):
pred_re = []
c_current = ''
