1
- import warnings
2
-
3
1
import torch .nn as nn
4
2
import torch .nn .functional as F
5
3
from mmcv .cnn import ConvModule
@@ -25,17 +23,13 @@ class FPN(BaseModule):
25
23
build the feature pyramid. Default: -1, which means the last level.
26
24
add_extra_convs (bool | str): If bool, it decides whether to add conv
27
25
layers on top of the original feature maps. Default to False.
28
- If True, its actual mode is specified by `extra_convs_on_inputs `.
26
+ If True, it is equivalent to `add_extra_convs='on_input' `.
29
27
If str, it specifies the source feature map of the extra convs.
30
28
Only the following options are allowed
31
29
32
30
- 'on_input': Last feat map of neck inputs (i.e. backbone feature).
33
31
- 'on_lateral': Last feature map after lateral convs.
34
32
- 'on_output': The last output feature map after fpn convs.
35
- extra_convs_on_inputs (bool, deprecated): Whether to apply extra convs
36
- on the original feature from the backbone. If True,
37
- it is equivalent to `add_extra_convs='on_input'`. If False, it is
38
- equivalent to set `add_extra_convs='on_output'`. Default to True.
39
33
relu_before_extra_convs (bool): Whether to apply relu before the extra
40
34
conv. Default: False.
41
35
no_norm_on_lateral (bool): Whether to apply norm on lateral.
@@ -71,7 +65,6 @@ def __init__(self,
71
65
start_level = 0 ,
72
66
end_level = - 1 ,
73
67
add_extra_convs = False ,
74
- extra_convs_on_inputs = True ,
75
68
relu_before_extra_convs = False ,
76
69
no_norm_on_lateral = False ,
77
70
conv_cfg = None ,
@@ -107,15 +100,7 @@ def __init__(self,
107
100
# Extra_convs_source choices: 'on_input', 'on_lateral', 'on_output'
108
101
assert add_extra_convs in ('on_input' , 'on_lateral' , 'on_output' )
109
102
elif add_extra_convs : # True
110
- if extra_convs_on_inputs :
111
- # TODO: deprecate `extra_convs_on_inputs`
112
- warnings .simplefilter ('once' )
113
- warnings .warn (
114
- '"extra_convs_on_inputs" will be deprecated in v2.9.0,'
115
- 'Please use "add_extra_convs"' , DeprecationWarning )
116
- self .add_extra_convs = 'on_input'
117
- else :
118
- self .add_extra_convs = 'on_output'
103
+ self .add_extra_convs = 'on_input'
119
104
120
105
self .lateral_convs = nn .ModuleList ()
121
106
self .fpn_convs = nn .ModuleList ()
0 commit comments