Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
37cd4ed3
Commit
37cd4ed3
authored
Sep 02, 2021
by
andyjpaddle
Browse files
delete dict90, update sar postprocess, update sar.yml
parent
ea019601
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
97 deletions
+10
-97
configs/rec/rec_r31_sar.yml
configs/rec/rec_r31_sar.yml
+5
-4
ppocr/postprocess/rec_postprocess.py
ppocr/postprocess/rec_postprocess.py
+5
-3
ppocr/utils/dict90.txt
ppocr/utils/dict90.txt
+0
-90
No files found.
configs/rec/rec_r31_sar.yml
View file @
37cd4ed3
...
@@ -15,7 +15,7 @@ Global:
...
@@ -15,7 +15,7 @@ Global:
infer_img
:
infer_img
:
# for data or label process
# for data or label process
character_dict_path
:
ppocr/utils/dict90.txt
character_dict_path
:
ppocr/utils/dict90.txt
character_type
:
ch
character_type
:
EN_symbol
max_text_length
:
30
max_text_length
:
30
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
...
@@ -47,6 +47,7 @@ Loss:
...
@@ -47,6 +47,7 @@ Loss:
PostProcess
:
PostProcess
:
name
:
SARLabelDecode
name
:
SARLabelDecode
rm_symbol
:
True
Metric
:
Metric
:
name
:
RecMetric
name
:
RecMetric
...
@@ -56,8 +57,8 @@ Train:
...
@@ -56,8 +57,8 @@ Train:
dataset
:
dataset
:
name
:
SimpleDataSet
name
:
SimpleDataSet
delimiter
:
'
'
delimiter
:
'
'
label_file_list
:
[
'
/paddle/data/concat
_data/train_list.txt'
]
label_file_list
:
[
'
./train
_data/train_list.txt'
]
data_dir
:
/paddle/data/concat
_data/
data_dir
:
./train
_data/
ratio_list
:
1.0
ratio_list
:
1.0
transforms
:
transforms
:
-
DecodeImage
:
# load image
-
DecodeImage
:
# load image
...
@@ -79,7 +80,7 @@ Train:
...
@@ -79,7 +80,7 @@ Train:
Eval
:
Eval
:
dataset
:
dataset
:
name
:
LMDBDataSet
name
:
LMDBDataSet
data_dir
:
/paddle/data/ocr
_data/evaluation/
data_dir
:
./eval
_data/evaluation/
transforms
:
transforms
:
-
DecodeImage
:
# load image
-
DecodeImage
:
# load image
img_mode
:
BGR
img_mode
:
BGR
...
...
ppocr/postprocess/rec_postprocess.py
View file @
37cd4ed3
...
@@ -526,6 +526,7 @@ class SARLabelDecode(BaseRecLabelDecode):
...
@@ -526,6 +526,7 @@ class SARLabelDecode(BaseRecLabelDecode):
character_dict_path
=
None
,
character_dict_path
=
None
,
character_type
=
'ch'
,
character_type
=
'ch'
,
use_space_char
=
False
,
use_space_char
=
False
,
rm_symbol
=
True
,
**
kwargs
):
**
kwargs
):
super
(
SARLabelDecode
,
self
).
__init__
(
character_dict_path
,
super
(
SARLabelDecode
,
self
).
__init__
(
character_dict_path
,
character_type
,
use_space_char
)
character_type
,
use_space_char
)
...
@@ -572,9 +573,10 @@ class SARLabelDecode(BaseRecLabelDecode):
...
@@ -572,9 +573,10 @@ class SARLabelDecode(BaseRecLabelDecode):
else
:
else
:
conf_list
.
append
(
1
)
conf_list
.
append
(
1
)
text
=
''
.
join
(
char_list
)
text
=
''
.
join
(
char_list
)
comp
=
re
.
compile
(
'[^A-Z^a-z^0-9^
\u4e00
-
\u9fa5
]'
)
if
self
.
rm_symbol
:
text
=
text
.
lower
()
comp
=
re
.
compile
(
'[^A-Z^a-z^0-9^
\u4e00
-
\u9fa5
]'
)
text
=
comp
.
sub
(
''
,
text
)
text
=
text
.
lower
()
text
=
comp
.
sub
(
''
,
text
)
result_list
.
append
((
text
,
np
.
mean
(
conf_list
)))
result_list
.
append
((
text
,
np
.
mean
(
conf_list
)))
return
result_list
return
result_list
...
...
ppocr/utils/dict90.txt
deleted
100644 → 0
View file @
ea019601
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
!
"
#
$
%
&
'
(
)
*
+
,
-
.
/
:
;
<
=
>
?
@
[
\
]
_
`
~
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment