Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions ppdet/engine/export_utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import
Expand Down Expand Up @@ -394,8 +394,8 @@ def _dump_infer_config(config, path, image_shape, model, input_spec):
hpi_dynamic_shape = list(d['image'].shape[2:])
def get_dynamic_shapes(hpi_shape):
return [
[batch_sizes[0], 3] + hpi_shape,
[batch_sizes[1], 3] + hpi_shape,
[batch_sizes[0], 3] + hpi_shape,
[batch_sizes[1], 3] + hpi_shape,
[batch_sizes[2], 3] + hpi_shape
]

Expand Down Expand Up @@ -424,7 +424,8 @@ def get_dynamic_shapes(hpi_shape):
"BlazeFace",
"BlazeFace-FPN-SSH",
"PP-YOLOE_seg",
"SOLOv2"
"SOLOv2",
"PP-DocLayout-L",
]
if any(name in pdx_model_name for name in model_names_required_imgsize):
shapes["im_shape"] = [[batch_sizes[0], 2], [batch_sizes[1], 2], [batch_sizes[2], 2]]
Expand Down Expand Up @@ -453,7 +454,7 @@ def get_dynamic_shapes(hpi_shape):
infer_cfg['arch'] = 'GFL'
head_name = 'PicoHeadV2' if config['PicoHeadV2'] else 'PicoHead'
infer_cfg['NMS'] = config[head_name]['nms']
# In order to speed up the prediction, the threshold of nms
# In order to speed up the prediction, the threshold of nms
# is adjusted here, which can be changed in infer_cfg.yml
config[head_name]['nms']["score_threshold"] = 0.3
config[head_name]['nms']["nms_threshold"] = 0.5
Expand Down