From da2759c80d9863785a94e1f8ee99d8ec191fddc0 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Fri, 6 Nov 2020 10:21:30 +0800 Subject: [PATCH] Add inference support for efficientdet (#1661) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reuse RetinaNet pipeline for now, force merge to prevent CI block --- tools/export_model.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/export_model.py b/tools/export_model.py index e646b7cc0..4557542a4 100644 --- a/tools/export_model.py +++ b/tools/export_model.py @@ -78,6 +78,15 @@ def parse_reader(reader_cfg, metric, arch): params['image_shape'] = image_shape[1:] if 'target_dim' in params: params.pop('target_dim') + if p['type'] == 'ResizeAndPad': + assert has_shape_def, "missing input shape" + p['type'] = 'Resize' + p['target_size'] = params['target_dim'] + p['max_size'] = params['target_dim'] + p['interp'] = params['interp'] + p['image_shape'] = image_shape[1:] + preprocess_list.append(p) + continue p.update(params) preprocess_list.append(p) batch_transforms = reader_cfg.get('batch_transforms', None) @@ -116,9 +125,9 @@ def dump_infer_config(FLAGS, config): 'Face': 3, 'TTFNet': 3, 'FCOS': 3, - 'EfficientDet': 40 } infer_arch = config['architecture'] + infer_arch = 'RetinaNet' if infer_arch == 'EfficientDet' else infer_arch for arch, min_subgraph_size in trt_min_subgraph.items(): if arch in infer_arch: -- GitLab