提交 6aa35c18 编写于 作者: xuyang2233's avatar xuyang2233

modified head

上级 bc1c19c5
...@@ -33,8 +33,8 @@ def build_head(config): ...@@ -33,8 +33,8 @@ def build_head(config):
from .rec_aster_head import AsterHead from .rec_aster_head import AsterHead
from .rec_pren_head import PRENHead from .rec_pren_head import PRENHead
from .rec_multi_head import MultiHead from .rec_multi_head import MultiHead
from .rec_robustscanner_head import RobustScannerHead
from .rec_abinet_head import ABINetHead from .rec_abinet_head import ABINetHead
from .rec_robustscanner_head import RobustScannerHead
# cls head # cls head
from .cls_head import ClsHead from .cls_head import ClsHead
......
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
......
...@@ -79,7 +79,7 @@ def export_single_model(model, ...@@ -79,7 +79,7 @@ def export_single_model(model,
] ]
model = to_static(model, input_spec=other_shape) model = to_static(model, input_spec=other_shape)
elif arch_config["algorithm"] == "RobustScanner": elif arch_config["algorithm"] == "RobustScanner":
max_seq_len = arch_config["Head"]["max_seq_len"] max_text_length = arch_config["Head"]["max_text_length"]
other_shape = [ other_shape = [
paddle.static.InputSpec( paddle.static.InputSpec(
shape=[None, 3, 48, 160], dtype="float32"), shape=[None, 3, 48, 160], dtype="float32"),
...@@ -89,7 +89,7 @@ def export_single_model(model, ...@@ -89,7 +89,7 @@ def export_single_model(model,
shape=[None, ], shape=[None, ],
dtype="float32"), dtype="float32"),
paddle.static.InputSpec( paddle.static.InputSpec(
shape=[None, max_seq_len], shape=[None, max_text_length],
dtype="int64") dtype="int64")
] ]
] ]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册