From ed400c86451942a16b9733ea3eaf523250db7608 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Tue, 26 Jan 2021 13:01:45 +0800 Subject: [PATCH] mv3 small support det --- ppocr/modeling/backbones/det_mobilenet_v3.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ppocr/modeling/backbones/det_mobilenet_v3.py b/ppocr/modeling/backbones/det_mobilenet_v3.py index 508f2bbf..0b1f5dc0 100755 --- a/ppocr/modeling/backbones/det_mobilenet_v3.py +++ b/ppocr/modeling/backbones/det_mobilenet_v3.py @@ -32,6 +32,7 @@ class MobileNetV3(): """ self.scale = params['scale'] model_name = params['model_name'] + self.model_name = model_name self.inplanes = 16 if model_name == "large": self.cfg = [ @@ -80,7 +81,7 @@ class MobileNetV3(): "supported scale are {} but input scale is {}".format(supported_scale, self.scale) self.disable_se = params.get('disable_se', False) - + def __call__(self, input): scale = self.scale inplanes = self.inplanes @@ -102,7 +103,8 @@ class MobileNetV3(): inplanes = self.make_divisible(inplanes * scale) outs = [] for layer_cfg in cfg: - if layer_cfg[5] == 2 and i > 2: + start_idx = 2 if self.model_name == 'large' else 0 + if layer_cfg[5] == 2 and i > start_idx: outs.append(conv) conv = self.residual_unit( input=conv, -- GitLab