Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert SPPF to SPP #240

Merged
merged 2 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions yolort/models/darknetv4.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import torch
from torch import nn, Tensor
from yolort.utils import load_state_dict_from_url
from yolort.v5 import Conv, Focus, BottleneckCSP, C3, SPPF
from yolort.v5 import Conv, Focus, BottleneckCSP, C3, SPP

from ._utils import _make_divisible

Expand Down Expand Up @@ -95,7 +95,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(SPPF(last_channel, last_channel, k=5, version=version))
layers.append(SPP(last_channel, last_channel, k=(5, 9, 13), version=version))

self.features = nn.Sequential(*layers)
self.avgpool = nn.AdaptiveAvgPool2d(1)
Expand Down
4 changes: 2 additions & 2 deletions yolort/models/path_aggregation_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import torch
from torch import nn, Tensor
from yolort.v5 import Conv, BottleneckCSP, C3, SPPF
from yolort.v5 import Conv, BottleneckCSP, C3, SPP


class IntermediateLevelP6(nn.Module):
Expand Down Expand Up @@ -106,7 +106,7 @@ def __init__(
depth_gain = max(round(3 * depth_multiple), 1)

if version == "r6.0":
init_block = SPPF(in_channels[-1], in_channels[-1], k=5)
init_block = SPP(in_channels[-1], in_channels[-1], k=(5, 9, 13))
elif version in ["r3.1", "r4.0"]:
init_block = block(in_channels[-1], in_channels[-1], n=depth_gain, shortcut=False)
else:
Expand Down