-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Labels
Description
Hi, thank you for your great work. I'm learning FCOS these days. I find some differences about position of center-ness between code and paper. In paper(https://arxiv.org/abs/1904.01355), the center-ness branch is put together with the classification branch.
But in the code, the center-ness and regression branches are put together.
vision/torchvision/models/detection/fcos.py
Lines 202 to 233 in a1232c2
class FCOSRegressionHead(nn.Module): | |
""" | |
A regression head for use in FCOS. | |
Args: | |
in_channels (int): number of channels of the input feature | |
num_anchors (int): number of anchors to be predicted | |
num_convs (Optional[int]): number of conv layer. Default: 4. | |
norm_layer: Module specifying the normalization layer to use. | |
""" | |
def __init__( | |
self, | |
in_channels: int, | |
num_anchors: int, | |
num_convs: int = 4, | |
norm_layer: Optional[Callable[..., nn.Module]] = None, | |
): | |
super().__init__() | |
if norm_layer is None: | |
norm_layer = partial(nn.GroupNorm, 32) | |
conv = [] | |
for _ in range(num_convs): | |
conv.append(nn.Conv2d(in_channels, in_channels, kernel_size=3, stride=1, padding=1)) | |
conv.append(norm_layer(in_channels)) | |
conv.append(nn.ReLU()) | |
self.conv = nn.Sequential(*conv) | |
self.bbox_reg = nn.Conv2d(in_channels, num_anchors * 4, kernel_size=3, stride=1, padding=1) | |
self.bbox_ctrness = nn.Conv2d(in_channels, num_anchors * 1, kernel_size=3, stride=1, padding=1) |
Could you tell me why? thanks.