PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
Apache License 2.0
40.26k stars 7.45k forks source link

测试russia识别别字典报错 #13120

Open cqray1990 opened 2 weeks ago

cqray1990 commented 2 weeks ago

问题描述 / Problem Description

运行环境 / Runtime Environment

错误: self.character[text_id] IndexError: list index out of range

[2024/06/18 18:30:31] ppocr INFO: list index out of range

图片路径:doc/imgs_words/russia/ru_1.jpg 字典:ppocr/utils/dict/ru_dict.txt 模型:https://github.com/PaddlePaddle/PaddleOCR/issues/1048

GreatV commented 1 week ago

这可能是bug,dict长度少了一个词

к
в
а
з
и
у
р
о
н
я
х
п
л
ы 
г
е
т
м
д
ж
ш
ь
с
ё
б
й
ч
ю
ц
щ
М
э
ф
А
ъ
С
Ф
Ю
В
К
Т
Н
О
Э
У
И
Г
Л
Р
Д
Б
Ш
П
З
Х
Е
Ж
Я
Ц
Ч
Й
Щ
0
1
2
3
4
5
6
7
8
9
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
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
python tools/infer/predict_rec.py --image_dir=doc/imgs_words/russia/ru_1.jpg --rec_model_dir="./inference/ru_mobile_v2.0_rec_infer" --rec_char_dict_path=ppocr/utils/dict/ru_dict.txt --use_space_char=True --rec_algorithm=CRNN --rec_image_shape="3,32,320"
[2024/06/23 20:25:10] ppocr INFO: Predicts of doc/imgs_words/russia/ru_1.jpg:('разоена пожданивьит', 0.999894917011261)
cqray1990 commented 1 week ago

这可能是bug,dict长度少了一个词

к
в
а
з
и
у
р
о
н
я
х
п
л
ы 
г
е
т
м
д
ж
ш
ь
с
ё
б
й
ч
ю
ц
щ
М
э
ф
А
ъ
С
Ф
Ю
В
К
Т
Н
О
Э
У
И
Г
Л
Р
Д
Б
Ш
П
З
Х
Е
Ж
Я
Ц
Ч
Й
Щ
0
1
2
3
4
5
6
7
8
9
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
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
python tools/infer/predict_rec.py --image_dir=doc/imgs_words/russia/ru_1.jpg --rec_model_dir="./inference/ru_mobile_v2.0_rec_infer" --rec_char_dict_path=ppocr/utils/dict/ru_dict.txt --use_space_char=True --rec_algorithm=CRNN --rec_image_shape="3,32,320"
[2024/06/23 20:25:10] ppocr INFO: Predicts of doc/imgs_words/russia/ru_1.jpg:('разоена пожданивьит', 0.999894917011261)

少了个什么词?空格有3个,重复了,我测试好几个字典都有问题

GreatV commented 1 week ago

我的意思是再padding 1 个位置它就正常了,推测是少了一个词。