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
adafa3e6
Commit
adafa3e6
authored
Jan 20, 2021
by
WenmuZhou
Browse files
Merge branch 'dygraph' of
https://github.com/PaddlePaddle/PaddleOCR
into dygraph_rc
parents
8ebaf27d
301b0d34
Changes
42
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
ppocr/postprocess/rec_postprocess.py
ppocr/postprocess/rec_postprocess.py
+2
-2
ppocr/utils/utility.py
ppocr/utils/utility.py
+1
-1
No files found.
ppocr/postprocess/rec_postprocess.py
View file @
adafa3e6
...
@@ -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
):
...
...
ppocr/utils/utility.py
View file @
adafa3e6
...
@@ -57,7 +57,7 @@ def get_image_file_list(img_file):
...
@@ -57,7 +57,7 @@ def get_image_file_list(img_file):
elif
os
.
path
.
isdir
(
img_file
):
elif
os
.
path
.
isdir
(
img_file
):
for
single_file
in
os
.
listdir
(
img_file
):
for
single_file
in
os
.
listdir
(
img_file
):
file_path
=
os
.
path
.
join
(
img_file
,
single_file
)
file_path
=
os
.
path
.
join
(
img_file
,
single_file
)
if
imghdr
.
what
(
file_path
)
in
img_end
:
if
os
.
path
.
isfile
(
file_path
)
and
imghdr
.
what
(
file_path
)
in
img_end
:
imgs_lists
.
append
(
file_path
)
imgs_lists
.
append
(
file_path
)
if
len
(
imgs_lists
)
==
0
:
if
len
(
imgs_lists
)
==
0
:
raise
Exception
(
"not found any img file in {}"
.
format
(
img_file
))
raise
Exception
(
"not found any img file in {}"
.
format
(
img_file
))
...
...
Prev
1
2
3
Next
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