import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from mmdet.core import auto_fp16
from ..registry import NECKS
from ..utils import ConvModule
@NECKS.register_module
class FPN(nn.Module):
"""
Feature Pyramid Network.
This is an implementation of - Feature Pyramid Networks for Object
Detection (https://arxiv.org/abs/1612.03144)
Args:
in_channels (List[int]):
number of input channels per scale
# 不同尺度的feature map输入FPN的channel数
out_channels (int):
number of output channels (used at each scale)
# 经过FPN后不同尺度的feature map输出的channel数(默认为251)
num_outs (int):
number of output scales
#
start_level (int):
index of the first input scale to use as an output scale
end_level (int, default=-1):
index of the last input scale to use as an output scale