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
7d832ac3
Unverified
Commit
7d832ac3
authored
Jun 08, 2022
by
xiaoting
Committed by
GitHub
Jun 08, 2022
Browse files
fix export and kie backbone (#6526)
parent
fe150eb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
ppocr/modeling/backbones/kie_unet_sdmgr.py
ppocr/modeling/backbones/kie_unet_sdmgr.py
+1
-6
tools/export_model.py
tools/export_model.py
+1
-1
No files found.
ppocr/modeling/backbones/kie_unet_sdmgr.py
View file @
7d832ac3
...
@@ -176,11 +176,6 @@ class Kie_backbone(nn.Layer):
...
@@ -176,11 +176,6 @@ class Kie_backbone(nn.Layer):
x
=
self
.
img_feat
(
img
)
x
=
self
.
img_feat
(
img
)
boxes
,
rois_num
=
self
.
bbox2roi
(
gt_bboxes
)
boxes
,
rois_num
=
self
.
bbox2roi
(
gt_bboxes
)
feats
=
paddle
.
vision
.
ops
.
roi_align
(
feats
=
paddle
.
vision
.
ops
.
roi_align
(
x
,
x
,
boxes
,
spatial_scale
=
1.0
,
output_size
=
7
,
boxes_num
=
rois_num
)
boxes
,
spatial_scale
=
1.0
,
pooled_height
=
7
,
pooled_width
=
7
,
rois_num
=
rois_num
)
feats
=
self
.
maxpool
(
feats
).
squeeze
(
-
1
).
squeeze
(
-
1
)
feats
=
self
.
maxpool
(
feats
).
squeeze
(
-
1
).
squeeze
(
-
1
)
return
[
relations
,
texts
,
feats
]
return
[
relations
,
texts
,
feats
]
tools/export_model.py
View file @
7d832ac3
...
@@ -76,7 +76,7 @@ def export_single_model(model, arch_config, save_path, logger, quanter=None):
...
@@ -76,7 +76,7 @@ def export_single_model(model, arch_config, save_path, logger, quanter=None):
else
:
else
:
infer_shape
=
[
3
,
-
1
,
-
1
]
infer_shape
=
[
3
,
-
1
,
-
1
]
if
arch_config
[
"model_type"
]
==
"rec"
:
if
arch_config
[
"model_type"
]
==
"rec"
:
infer_shape
=
[
3
,
32
,
-
1
]
# for rec model, H must be 32
infer_shape
=
[
3
,
48
,
-
1
]
# for rec model, H must be 32
if
"Transform"
in
arch_config
and
arch_config
[
if
"Transform"
in
arch_config
and
arch_config
[
"Transform"
]
is
not
None
and
arch_config
[
"Transform"
][
"Transform"
]
is
not
None
and
arch_config
[
"Transform"
][
"name"
]
==
"TPS"
:
"name"
]
==
"TPS"
:
...
...
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