From 13b68f853733658d4a82981f433fa2e59568b05a Mon Sep 17 00:00:00 2001 From: gaotingquan Date: Tue, 29 Apr 2025 13:24:42 +0000 Subject: [PATCH] add PP-DocLayout-L to model_names_required_imgsize --- ppdet/engine/export_utils.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ppdet/engine/export_utils.py b/ppdet/engine/export_utils.py index 01184136b9..10eff6e284 100644 --- a/ppdet/engine/export_utils.py +++ b/ppdet/engine/export_utils.py @@ -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 @@ -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 ] @@ -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]] @@ -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