From 451f3e4be72700ab08c8a1617a5ef4cfc3d0869a Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Fri, 8 Oct 2021 10:19:29 -0400 Subject: [PATCH] Replace SPP with SPPF in darknet --- yolort/models/darknetv5.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yolort/models/darknetv5.py b/yolort/models/darknetv5.py index 8701253f..47e60784 100644 --- a/yolort/models/darknetv5.py +++ b/yolort/models/darknetv5.py @@ -5,7 +5,7 @@ from torch import nn, Tensor from torch.hub import load_state_dict_from_url -from yolort.v5 import Conv, Focus, BottleneckCSP, C3, SPP +from yolort.v5 import Conv, Focus, BottleneckCSP, C3, SPPF from ._utils import _make_divisible @@ -88,7 +88,7 @@ def __init__( # building last CSP blocks last_channel = _make_divisible(last_channel * width_multiple, round_nearest) layers.append(Conv(input_channel, last_channel, k=3, s=2, version=version)) - layers.append(SPP(last_channel, last_channel, k=(5, 9, 13), version=version)) + layers.append(SPPF(last_channel, last_channel, k=5, version=version)) self.features = nn.Sequential(*layers) self.avgpool = nn.AdaptiveAvgPool2d(1)