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
301b0d34
Unverified
Commit
301b0d34
authored
Jan 19, 2021
by
littletomatodonkey
Committed by
GitHub
Jan 19, 2021
Browse files
fix duplicate (#1771)
* fix duplicate * fix default action
parent
b7e4528d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
ppocr/postprocess/rec_postprocess.py
ppocr/postprocess/rec_postprocess.py
+2
-2
No files found.
ppocr/postprocess/rec_postprocess.py
View file @
301b0d34
...
@@ -60,7 +60,7 @@ class BaseRecLabelDecode(object):
...
@@ -60,7 +60,7 @@ class BaseRecLabelDecode(object):
def
add_special_char
(
self
,
dict_character
):
def
add_special_char
(
self
,
dict_character
):
return
dict_character
return
dict_character
def
decode
(
self
,
text_index
,
text_prob
=
None
,
is_remove_duplicate
=
Tru
e
):
def
decode
(
self
,
text_index
,
text_prob
=
None
,
is_remove_duplicate
=
Fals
e
):
""" convert text-index into text-label. """
""" convert text-index into text-label. """
result_list
=
[]
result_list
=
[]
ignored_tokens
=
self
.
get_ignored_tokens
()
ignored_tokens
=
self
.
get_ignored_tokens
()
...
@@ -110,7 +110,7 @@ class CTCLabelDecode(BaseRecLabelDecode):
...
@@ -110,7 +110,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
,
is_remove_duplicate
=
False
)
label
=
self
.
decode
(
label
)
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