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
e7d24ac8
"vscode:/vscode.git/clone" did not exist on "1e5eaca754bce676ce9142cab7ccaaee78df4696"
Commit
e7d24ac8
authored
Feb 01, 2021
by
LDOUBLEV
Browse files
fix comment
parent
0f4d92b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
21 deletions
+0
-21
configs/rec/rec_r34_vd_tps_bilstm_att.yml
configs/rec/rec_r34_vd_tps_bilstm_att.yml
+0
-2
ppocr/postprocess/rec_postprocess.py
ppocr/postprocess/rec_postprocess.py
+0
-19
No files found.
configs/rec/rec_r34_vd_tps_bilstm_att.yml
View file @
e7d24ac8
...
...
@@ -43,7 +43,6 @@ Architecture:
Backbone
:
name
:
ResNet
layers
:
34
Neck
:
name
:
SequenceEncoder
encoder_type
:
rnn
...
...
@@ -52,7 +51,6 @@ Architecture:
name
:
AttentionHead
# AttentionHead
hidden_size
:
256
#
l2_decay
:
0.00001
Loss
:
name
:
AttentionLoss
...
...
ppocr/postprocess/rec_postprocess.py
View file @
e7d24ac8
...
...
@@ -192,25 +192,6 @@ class AttnLabelDecode(BaseRecLabelDecode):
label
=
self
.
decode
(
label
,
is_remove_duplicate
=
False
)
return
text
,
label
def
encoder
(
self
,
labels
,
labels_length
):
"""
used to encoder labels readed from LMDB dataset, forexample:
[35, 25, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] encode to
'you': [0, 35,25,31, 37, 0, ...] 'sos'you'eos'
"""
if
isinstance
(
labels
,
paddle
.
Tensor
):
labels
=
labels
.
numpy
()
batch_max_length
=
labels
.
shape
[
1
]
+
2
# add start token 'sos' and end token 'eos'
new_labels
=
np
.
zeros
(
[
labels
.
shape
[
0
],
batch_max_length
]).
astype
(
np
.
int64
)
for
i
in
range
(
labels
.
shape
[
0
]):
new_labels
[
i
,
1
:
1
+
labels_length
[
i
]]
=
labels
[
i
,
:
labels_length
[
i
]]
# new_labels[i, 0] = 'sos' token
new_labels
[
i
,
labels_length
[
i
]
+
1
]
=
len
(
self
.
character
)
-
1
# add end charactor 'eos' token
return
new_labels
def
get_ignored_tokens
(
self
):
beg_idx
=
self
.
get_beg_end_flag_idx
(
"beg"
)
end_idx
=
self
.
get_beg_end_flag_idx
(
"end"
)
...
...
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