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
042034b6
Commit
042034b6
authored
Dec 10, 2020
by
WenmuZhou
Browse files
The parameters of export are consistent with the static image
parent
7e0324a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
tools/export_model.py
tools/export_model.py
+5
-11
No files found.
tools/export_model.py
View file @
042034b6
...
@@ -28,21 +28,15 @@ from ppocr.modeling.architectures import build_model
...
@@ -28,21 +28,15 @@ from ppocr.modeling.architectures import build_model
from
ppocr.postprocess
import
build_post_process
from
ppocr.postprocess
import
build_post_process
from
ppocr.utils.save_load
import
init_model
from
ppocr.utils.save_load
import
init_model
from
ppocr.utils.logging
import
get_logger
from
ppocr.utils.logging
import
get_logger
from
tools.program
import
load_config
from
tools.program
import
load_config
,
merge_config
,
ArgsParser
def
parse_args
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"-c"
,
"--config"
,
help
=
"configuration file to use"
)
parser
.
add_argument
(
"-o"
,
"--output_path"
,
type
=
str
,
default
=
'./output/infer/'
)
return
parser
.
parse_args
()
def
main
():
def
main
():
FLAGS
=
parse_args
()
FLAGS
=
ArgsParser
().
parse_args
()
config
=
load_config
(
FLAGS
.
config
)
config
=
load_config
(
FLAGS
.
config
)
merge_config
(
FLAGS
.
opt
)
logger
=
get_logger
()
logger
=
get_logger
()
print
(
config
)
# build post process
# build post process
post_process_class
=
build_post_process
(
config
[
'PostProcess'
],
post_process_class
=
build_post_process
(
config
[
'PostProcess'
],
...
@@ -57,7 +51,7 @@ def main():
...
@@ -57,7 +51,7 @@ def main():
init_model
(
config
,
model
,
logger
)
init_model
(
config
,
model
,
logger
)
model
.
eval
()
model
.
eval
()
save_path
=
'{}/inference'
.
format
(
FLAGS
.
output_path
)
save_path
=
'{}/inference'
.
format
(
config
[
'Global'
][
'save_inference_dir'
]
)
infer_shape
=
[
3
,
32
,
100
]
if
config
[
'Architecture'
][
infer_shape
=
[
3
,
32
,
100
]
if
config
[
'Architecture'
][
'model_type'
]
!=
"det"
else
[
3
,
640
,
640
]
'model_type'
]
!=
"det"
else
[
3
,
640
,
640
]
model
=
to_static
(
model
=
to_static
(
...
...
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