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
87ce916a
Commit
87ce916a
authored
Jun 30, 2020
by
tink2123
Browse files
fix resize shape
parent
25f16f24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
ppocr/data/rec/img_tools.py
ppocr/data/rec/img_tools.py
+3
-2
No files found.
ppocr/data/rec/img_tools.py
View file @
87ce916a
...
@@ -97,7 +97,7 @@ def process_image(img,
...
@@ -97,7 +97,7 @@ def process_image(img,
max_text_length
=
None
,
max_text_length
=
None
,
tps
=
None
,
tps
=
None
,
infer_mode
=
False
):
infer_mode
=
False
):
if
not
infer_mode
or
char_ops
.
character_type
==
"en"
or
tps
!=
None
:
if
not
infer_mode
and
(
char_ops
.
character_type
==
"en"
or
tps
!=
None
)
:
norm_img
=
resize_norm_img
(
img
,
image_shape
)
norm_img
=
resize_norm_img
(
img
,
image_shape
)
else
:
else
:
norm_img
=
resize_norm_img_chinese
(
img
,
image_shape
)
norm_img
=
resize_norm_img_chinese
(
img
,
image_shape
)
...
@@ -109,7 +109,8 @@ def process_image(img,
...
@@ -109,7 +109,8 @@ def process_image(img,
logger
.
info
(
logger
.
info
(
"Warning in ppocr/data/rec/img_tools.py:line106: Wrong data type."
"Warning in ppocr/data/rec/img_tools.py:line106: Wrong data type."
"Excepted string with length between 1 and {}, but "
"Excepted string with length between 1 and {}, but "
"got '{}'. Label is '{}'"
.
format
(
max_text_length
,
len
(
text
),
label
))
"got '{}'. Label is '{}'"
.
format
(
max_text_length
,
len
(
text
),
label
))
return
None
return
None
else
:
else
:
if
loss_type
==
"ctc"
:
if
loss_type
==
"ctc"
:
...
...
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