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
febd743b
Unverified
Commit
febd743b
authored
May 10, 2022
by
andyjpaddle
Committed by
GitHub
May 10, 2022
Browse files
Update rec name (#6223)
* update cpp serving for v3 * update v3 rec name
parent
efbb0aba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
paddleocr.py
paddleocr.py
+2
-2
tools/infer/utility.py
tools/infer/utility.py
+4
-4
No files found.
paddleocr.py
View file @
febd743b
...
...
@@ -47,8 +47,8 @@ __all__ = [
]
SUPPORT_DET_MODEL
=
[
'DB'
]
VERSION
=
'2.5.0.
1
'
SUPPORT_REC_MODEL
=
[
'CRNN'
]
VERSION
=
'2.5.0.
2
'
SUPPORT_REC_MODEL
=
[
'CRNN'
,
'SVTR_LCNet'
]
BASE_DIR
=
os
.
path
.
expanduser
(
"~/.paddleocr/"
)
DEFAULT_OCR_MODEL_VERSION
=
'PP-OCRv3'
...
...
tools/infer/utility.py
View file @
febd743b
...
...
@@ -79,7 +79,7 @@ def init_args():
parser
.
add_argument
(
"--det_fce_box_type"
,
type
=
str
,
default
=
'poly'
)
# params for text recognizer
parser
.
add_argument
(
"--rec_algorithm"
,
type
=
str
,
default
=
'
CRNN
'
)
parser
.
add_argument
(
"--rec_algorithm"
,
type
=
str
,
default
=
'
SVTR_LCNet
'
)
parser
.
add_argument
(
"--rec_model_dir"
,
type
=
str
)
parser
.
add_argument
(
"--rec_image_shape"
,
type
=
str
,
default
=
"3, 48, 320"
)
parser
.
add_argument
(
"--rec_batch_num"
,
type
=
int
,
default
=
6
)
...
...
@@ -269,11 +269,11 @@ def create_predictor(args, mode, logger):
max_input_shape
.
update
(
max_pact_shape
)
opt_input_shape
.
update
(
opt_pact_shape
)
elif
mode
==
"rec"
:
if
args
.
rec_algorithm
!=
"CRNN"
:
if
args
.
rec_algorithm
not
in
[
"CRNN"
,
"SVTR_LCNet"
]
:
use_dynamic_shape
=
False
imgH
=
int
(
args
.
rec_image_shape
.
split
(
','
)[
-
2
])
min_input_shape
=
{
"x"
:
[
1
,
3
,
imgH
,
10
]}
max_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
imgH
,
1536
]}
max_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
imgH
,
2304
]}
opt_input_shape
=
{
"x"
:
[
args
.
rec_batch_num
,
3
,
imgH
,
320
]}
elif
mode
==
"cls"
:
min_input_shape
=
{
"x"
:
[
1
,
3
,
48
,
10
]}
...
...
@@ -320,7 +320,7 @@ def create_predictor(args, mode, logger):
def
get_output_tensors
(
args
,
mode
,
predictor
):
output_names
=
predictor
.
get_output_names
()
output_tensors
=
[]
if
mode
==
"rec"
and
args
.
rec_algorithm
==
"CRNN"
:
if
mode
==
"rec"
and
args
.
rec_algorithm
in
[
"CRNN"
,
"SVTR_LCNet"
]
:
output_name
=
'softmax_0.tmp_0'
if
output_name
in
output_names
:
return
[
predictor
.
get_output_handle
(
output_name
)]
...
...
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