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
bccf9edf
Commit
bccf9edf
authored
Dec 08, 2020
by
tink2123
Browse files
update for multi-language
parent
311569b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
ppocr/data/imaug/label_ops.py
ppocr/data/imaug/label_ops.py
+2
-2
ppocr/postprocess/rec_postprocess.py
ppocr/postprocess/rec_postprocess.py
+2
-2
No files found.
ppocr/data/imaug/label_ops.py
View file @
bccf9edf
...
@@ -80,7 +80,7 @@ class BaseRecLabelEncode(object):
...
@@ -80,7 +80,7 @@ class BaseRecLabelEncode(object):
character_type
=
'ch'
,
character_type
=
'ch'
,
use_space_char
=
False
):
use_space_char
=
False
):
support_character_type
=
[
support_character_type
=
[
'ch'
,
'en'
,
'en_sensitive'
,
'french'
,
'german'
,
'japan'
,
'
french
'
'ch'
,
'en'
,
'en_sensitive'
,
'french'
,
'german'
,
'japan'
,
'
korean
'
]
]
assert
character_type
in
support_character_type
,
"Only {} are supported now but get {}"
.
format
(
assert
character_type
in
support_character_type
,
"Only {} are supported now but get {}"
.
format
(
support_character_type
,
self
.
character_str
)
support_character_type
,
self
.
character_str
)
...
@@ -89,7 +89,7 @@ class BaseRecLabelEncode(object):
...
@@ -89,7 +89,7 @@ class BaseRecLabelEncode(object):
if
character_type
==
"en"
:
if
character_type
==
"en"
:
self
.
character_str
=
"0123456789abcdefghijklmnopqrstuvwxyz"
self
.
character_str
=
"0123456789abcdefghijklmnopqrstuvwxyz"
dict_character
=
list
(
self
.
character_str
)
dict_character
=
list
(
self
.
character_str
)
elif
character_type
in
[
"ch"
,
"french"
,
"german"
,
"japan"
,
"
french
"
]:
elif
character_type
in
[
"ch"
,
"french"
,
"german"
,
"japan"
,
"
korean
"
]:
self
.
character_str
=
""
self
.
character_str
=
""
assert
character_dict_path
is
not
None
,
"character_dict_path should not be None when character_type is ch"
assert
character_dict_path
is
not
None
,
"character_dict_path should not be None when character_type is ch"
with
open
(
character_dict_path
,
"rb"
)
as
fin
:
with
open
(
character_dict_path
,
"rb"
)
as
fin
:
...
...
ppocr/postprocess/rec_postprocess.py
View file @
bccf9edf
...
@@ -24,7 +24,7 @@ class BaseRecLabelDecode(object):
...
@@ -24,7 +24,7 @@ class BaseRecLabelDecode(object):
character_type
=
'ch'
,
character_type
=
'ch'
,
use_space_char
=
False
):
use_space_char
=
False
):
support_character_type
=
[
support_character_type
=
[
'ch'
,
'en'
,
'en_sensitive'
,
'french'
,
'german'
,
'japan'
,
'
french
'
'ch'
,
'en'
,
'en_sensitive'
,
'french'
,
'german'
,
'japan'
,
'
korean
'
]
]
assert
character_type
in
support_character_type
,
"Only {} are supported now but get {}"
.
format
(
assert
character_type
in
support_character_type
,
"Only {} are supported now but get {}"
.
format
(
support_character_type
,
self
.
character_str
)
support_character_type
,
self
.
character_str
)
...
@@ -32,7 +32,7 @@ class BaseRecLabelDecode(object):
...
@@ -32,7 +32,7 @@ class BaseRecLabelDecode(object):
if
character_type
==
"en"
:
if
character_type
==
"en"
:
self
.
character_str
=
"0123456789abcdefghijklmnopqrstuvwxyz"
self
.
character_str
=
"0123456789abcdefghijklmnopqrstuvwxyz"
dict_character
=
list
(
self
.
character_str
)
dict_character
=
list
(
self
.
character_str
)
elif
character_type
in
[
"ch"
,
"french"
,
"german"
,
"japan"
,
"
french
"
]:
elif
character_type
in
[
"ch"
,
"french"
,
"german"
,
"japan"
,
"
korean
"
]:
self
.
character_str
=
""
self
.
character_str
=
""
assert
character_dict_path
is
not
None
,
"character_dict_path should not be None when character_type is ch"
assert
character_dict_path
is
not
None
,
"character_dict_path should not be None when character_type is ch"
with
open
(
character_dict_path
,
"rb"
)
as
fin
:
with
open
(
character_dict_path
,
"rb"
)
as
fin
:
...
...
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