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
a88ce7a5
"git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "b70255afabd2cc12a158a12a34e0e5088d53ed00"
Commit
a88ce7a5
authored
Oct 20, 2020
by
WenmuZhou
Browse files
修正对label decode时重复字符会消失的bug
parent
ca9ea622
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
ppocr/postprocess/rec_postprocess.py
ppocr/postprocess/rec_postprocess.py
+2
-1
No files found.
ppocr/postprocess/rec_postprocess.py
View file @
a88ce7a5
...
@@ -70,6 +70,7 @@ class BaseRecLabelDecode(object):
...
@@ -70,6 +70,7 @@ class BaseRecLabelDecode(object):
if
text_index
[
batch_idx
][
idx
]
in
ignored_tokens
:
if
text_index
[
batch_idx
][
idx
]
in
ignored_tokens
:
continue
continue
if
is_remove_duplicate
:
if
is_remove_duplicate
:
# only for predict
if
idx
>
0
and
text_index
[
batch_idx
][
idx
-
1
]
==
text_index
[
if
idx
>
0
and
text_index
[
batch_idx
][
idx
-
1
]
==
text_index
[
batch_idx
][
idx
]:
batch_idx
][
idx
]:
continue
continue
...
@@ -107,7 +108,7 @@ class CTCLabelDecode(BaseRecLabelDecode):
...
@@ -107,7 +108,7 @@ class CTCLabelDecode(BaseRecLabelDecode):
text
=
self
.
decode
(
preds_idx
,
preds_prob
)
text
=
self
.
decode
(
preds_idx
,
preds_prob
)
if
label
is
None
:
if
label
is
None
:
return
text
return
text
label
=
self
.
decode
(
label
)
label
=
self
.
decode
(
label
,
is_remove_duplicate
=
False
)
return
text
,
label
return
text
,
label
def
add_special_char
(
self
,
dict_character
):
def
add_special_char
(
self
,
dict_character
):
...
...
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