update dict

This commit is contained in:
andyjpaddle
2022-08-09 01:44:16 +00:00
parent cad04bbbf1
commit 3380010d9a
4 changed files with 8 additions and 37 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ Global:
use_visualdl: True
infer_img: doc/imgs_words/en/word_2.png
# for data or label process
character_dict_path: ppocr/utils/dict36.txt
character_dict_path:
max_text_length: &max_text_length 25
training_step: &training_step LA
infer_mode: False
+5
View File
@@ -1267,6 +1267,11 @@ class VLLabelEncode(BaseRecLabelEncode):
**kwargs):
super(VLLabelEncode, self).__init__(
max_text_length, character_dict_path, use_space_char, lower)
self.character = self.character[10:] + self.character[
1:10] + [self.character[0]]
self.dict = {}
for i, char in enumerate(self.character):
self.dict[char] = i
def __call__(self, data):
text = data['label'] # original string
+2
View File
@@ -693,6 +693,8 @@ class VLLabelDecode(BaseRecLabelDecode):
super(VLLabelDecode, self).__init__(character_dict_path, use_space_char)
self.max_text_length = kwargs.get('max_text_length', 25)
self.nclass = len(self.character) + 1
self.character = self.character[10:] + self.character[
1:10] + [self.character[0]]
def decode(self, text_index, text_prob=None, is_remove_duplicate=False):
""" convert text-index into text-label. """
-36
View File
@@ -1,36 +0,0 @@
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
1
2
3
4
5
6
7
8
9
0