mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2026-09-24 23:33:08 +08:00
update dict
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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. """
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user