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
03b7daa5
Unverified
Commit
03b7daa5
authored
Sep 01, 2021
by
littletomatodonkey
Committed by
GitHub
Sep 01, 2021
Browse files
fix distillation model export and pred save (#3869)
parent
073a591c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
tools/export_model.py
tools/export_model.py
+3
-0
tools/infer_rec.py
tools/infer_rec.py
+1
-1
No files found.
tools/export_model.py
View file @
03b7daa5
...
@@ -93,6 +93,9 @@ def main():
...
@@ -93,6 +93,9 @@ def main():
for
key
in
config
[
"Architecture"
][
"Models"
]:
for
key
in
config
[
"Architecture"
][
"Models"
]:
config
[
"Architecture"
][
"Models"
][
key
][
"Head"
][
config
[
"Architecture"
][
"Models"
][
key
][
"Head"
][
"out_channels"
]
=
char_num
"out_channels"
]
=
char_num
# just one final tensor needs to to exported for inference
config
[
"Architecture"
][
"Models"
][
key
][
"return_all_feats"
]
=
False
else
:
# base rec model
else
:
# base rec model
config
[
"Architecture"
][
"Head"
][
"out_channels"
]
=
char_num
config
[
"Architecture"
][
"Head"
][
"out_channels"
]
=
char_num
model
=
build_model
(
config
[
"Architecture"
])
model
=
build_model
(
config
[
"Architecture"
])
...
...
tools/infer_rec.py
View file @
03b7daa5
...
@@ -121,7 +121,7 @@ def main():
...
@@ -121,7 +121,7 @@ def main():
if
len
(
post_result
[
key
][
0
])
>=
2
:
if
len
(
post_result
[
key
][
0
])
>=
2
:
rec_info
[
key
]
=
{
rec_info
[
key
]
=
{
"label"
:
post_result
[
key
][
0
][
0
],
"label"
:
post_result
[
key
][
0
][
0
],
"score"
:
post_result
[
key
][
0
][
1
],
"score"
:
float
(
post_result
[
key
][
0
][
1
]
)
,
}
}
info
=
json
.
dumps
(
rec_info
)
info
=
json
.
dumps
(
rec_info
)
else
:
else
:
...
...
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