-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCenterMask2_modi.patch
465 lines (433 loc) · 19.5 KB
/
CenterMask2_modi.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
diff --git a/centermask/config/defaults.py b/centermask/config/defaults.py
index f9a0531..3a64a8a 100644
--- a/centermask/config/defaults.py
+++ b/centermask/config/defaults.py
@@ -9,44 +9,44 @@ from detectron2.config import CfgNode as CN
_C.MODEL.MOBILENET = False
# ---------------------------------------------------------------------------- #
-# FCOS Head
+# FCOS_CENTERMASK Head
# ---------------------------------------------------------------------------- #
-_C.MODEL.FCOS = CN()
+_C.MODEL.FCOS_CENTERMASK = CN()
# This is the number of foreground classes.
-_C.MODEL.FCOS.NUM_CLASSES = 80
-_C.MODEL.FCOS.IN_FEATURES = ["p3", "p4", "p5", "p6", "p7"]
-_C.MODEL.FCOS.FPN_STRIDES = [8, 16, 32, 64, 128]
-_C.MODEL.FCOS.PRIOR_PROB = 0.01
-_C.MODEL.FCOS.INFERENCE_TH_TRAIN = 0.05
-_C.MODEL.FCOS.INFERENCE_TH_TEST = 0.05
-_C.MODEL.FCOS.NMS_TH = 0.6
-_C.MODEL.FCOS.PRE_NMS_TOPK_TRAIN = 1000
-_C.MODEL.FCOS.PRE_NMS_TOPK_TEST = 1000
-_C.MODEL.FCOS.POST_NMS_TOPK_TRAIN = 100
-_C.MODEL.FCOS.POST_NMS_TOPK_TEST = 100
-_C.MODEL.FCOS.TOP_LEVELS = 2
-_C.MODEL.FCOS.NORM = "GN" # Support GN or none
-_C.MODEL.FCOS.USE_SCALE = True
+_C.MODEL.FCOS_CENTERMASK.NUM_CLASSES = 80
+_C.MODEL.FCOS_CENTERMASK.IN_FEATURES = ["p3", "p4", "p5", "p6", "p7"]
+_C.MODEL.FCOS_CENTERMASK.FPN_STRIDES = [8, 16, 32, 64, 128]
+_C.MODEL.FCOS_CENTERMASK.PRIOR_PROB = 0.01
+_C.MODEL.FCOS_CENTERMASK.INFERENCE_TH_TRAIN = 0.05
+_C.MODEL.FCOS_CENTERMASK.INFERENCE_TH_TEST = 0.05
+_C.MODEL.FCOS_CENTERMASK.NMS_TH = 0.6
+_C.MODEL.FCOS_CENTERMASK.PRE_NMS_TOPK_TRAIN = 1000
+_C.MODEL.FCOS_CENTERMASK.PRE_NMS_TOPK_TEST = 1000
+_C.MODEL.FCOS_CENTERMASK.POST_NMS_TOPK_TRAIN = 100
+_C.MODEL.FCOS_CENTERMASK.POST_NMS_TOPK_TEST = 100
+_C.MODEL.FCOS_CENTERMASK.TOP_LEVELS = 2
+_C.MODEL.FCOS_CENTERMASK.NORM = "GN" # Support GN or none
+_C.MODEL.FCOS_CENTERMASK.USE_SCALE = True
# Multiply centerness before threshold
# This will affect the final performance by about 0.05 AP but save some time
-_C.MODEL.FCOS.THRESH_WITH_CTR = False
+_C.MODEL.FCOS_CENTERMASK.THRESH_WITH_CTR = False
# Focal loss parameters
-_C.MODEL.FCOS.LOSS_ALPHA = 0.25
-_C.MODEL.FCOS.LOSS_GAMMA = 2.0
-_C.MODEL.FCOS.SIZES_OF_INTEREST = [64, 128, 256, 512]
-_C.MODEL.FCOS.USE_RELU = True
-_C.MODEL.FCOS.USE_DEFORMABLE = False
+_C.MODEL.FCOS_CENTERMASK.LOSS_ALPHA = 0.25
+_C.MODEL.FCOS_CENTERMASK.LOSS_GAMMA = 2.0
+_C.MODEL.FCOS_CENTERMASK.SIZES_OF_INTEREST = [64, 128, 256, 512]
+_C.MODEL.FCOS_CENTERMASK.USE_RELU = True
+_C.MODEL.FCOS_CENTERMASK.USE_DEFORMABLE = False
# the number of convolutions used in the cls and bbox tower
-_C.MODEL.FCOS.NUM_CLS_CONVS = 4
-_C.MODEL.FCOS.NUM_BOX_CONVS = 4
-_C.MODEL.FCOS.NUM_SHARE_CONVS = 0
-_C.MODEL.FCOS.CENTER_SAMPLE = True
-_C.MODEL.FCOS.POS_RADIUS = 1.5
-_C.MODEL.FCOS.LOC_LOSS_TYPE = 'giou'
+_C.MODEL.FCOS_CENTERMASK.NUM_CLS_CONVS = 4
+_C.MODEL.FCOS_CENTERMASK.NUM_BOX_CONVS = 4
+_C.MODEL.FCOS_CENTERMASK.NUM_SHARE_CONVS = 0
+_C.MODEL.FCOS_CENTERMASK.CENTER_SAMPLE = True
+_C.MODEL.FCOS_CENTERMASK.POS_RADIUS = 1.5
+_C.MODEL.FCOS_CENTERMASK.LOC_LOSS_TYPE = 'giou'
# ---------------------------------------------------------------------------- #
diff --git a/centermask/modeling/__init__.py b/centermask/modeling/__init__.py
index c595912..1e04479 100644
--- a/centermask/modeling/__init__.py
+++ b/centermask/modeling/__init__.py
@@ -1,3 +1,3 @@
-from .fcos import FCOS
-from .backbone import build_fcos_resnet_fpn_backbone
+from .fcos import FCOS_CENTERMASK
+from .backbone import build_fcos_resnet_fpn_backbone_for_centermask
from .centermask import CenterROIHeads
diff --git a/centermask/modeling/backbone/__init__.py b/centermask/modeling/backbone/__init__.py
index b777f5a..e0302e3 100644
--- a/centermask/modeling/backbone/__init__.py
+++ b/centermask/modeling/backbone/__init__.py
@@ -1,4 +1,4 @@
# Copyright (c) Youngwan Lee (ETRI) All Rights Reserved.
-from .fpn import build_fcos_resnet_fpn_backbone, LastLevelP6P7, LastLevelP6
-from .vovnet import build_vovnet_fpn_backbone, build_vovnet_backbone, build_fcos_vovnet_fpn_backbone
-from .mobilenet import build_mnv2_backbone, build_mobilenetv2_fpn_backbone, build_fcos_mobilenetv2_fpn_backbone
+from .fpn import build_fcos_resnet_fpn_backbone_for_centermask, LastLevelP6P7, LastLevelP6
+from .vovnet import build_vovnet_fpn_backbone_for_centermask, build_vovnet_backbone_for_centermask, build_fcos_vovnet_fpn_backbone_for_centermask
+from .mobilenet import build_mnv2_backbone_for_centermask, build_mobilenetv2_fpn_backbone, build_fcos_mobilenetv2_fpn_backbone
diff --git a/centermask/modeling/backbone/fpn.py b/centermask/modeling/backbone/fpn.py
index b457efb..553eba9 100644
--- a/centermask/modeling/backbone/fpn.py
+++ b/centermask/modeling/backbone/fpn.py
@@ -11,7 +11,7 @@ __all__ = [
"FPN",
"LastLevelP6P7",
"LastLevelP6",
- "build_fcos_resnet_fpn_backbone"
+ "build_fcos_resnet_fpn_backbone_for_centermask"
]
class LastLevelP6P7(nn.Module):
@@ -54,7 +54,7 @@ class LastLevelP6(nn.Module):
@BACKBONE_REGISTRY.register()
-def build_fcos_resnet_fpn_backbone(cfg, input_shape: ShapeSpec):
+def build_fcos_resnet_fpn_backbone_for_centermask(cfg, input_shape: ShapeSpec):
"""
Args:
cfg: a detectron2 CfgNode
@@ -63,12 +63,12 @@ def build_fcos_resnet_fpn_backbone(cfg, input_shape: ShapeSpec):
backbone (Backbone): backbone module, must be a subclass of :class:`Backbone`.
"""
if cfg.MODEL.MOBILENET:
- bottom_up = build_mnv2_backbone(cfg, input_shape)
+ bottom_up = build_mnv2_backbone_for_centermask(cfg, input_shape)
else:
bottom_up = build_resnet_backbone(cfg, input_shape)
in_features = cfg.MODEL.FPN.IN_FEATURES
out_channels = cfg.MODEL.FPN.OUT_CHANNELS
- top_levels = cfg.MODEL.FCOS.TOP_LEVELS
+ top_levels = cfg.MODEL.FCOS_CENTERMASK.TOP_LEVELS
in_channels_top = out_channels
if top_levels == 2:
top_block = LastLevelP6P7(in_channels_top, out_channels, "p5")
diff --git a/centermask/modeling/backbone/mobilenet.py b/centermask/modeling/backbone/mobilenet.py
index 6872e0d..8d4cca8 100644
--- a/centermask/modeling/backbone/mobilenet.py
+++ b/centermask/modeling/backbone/mobilenet.py
@@ -14,7 +14,7 @@ from .fpn import LastLevelP6, LastLevelP6P7
__all__ = [
"MobileNetV2",
- "build_mnv2_backbone",
+ "build_mnv2_backbone_for_centermask",
"build_mobilenetv2_fpn_backbone",
"build_fcos_mobilenetv2_fpn_backbone"
]
@@ -145,7 +145,7 @@ class MobileNetV2(Backbone):
m.bias.data.zero_()
@BACKBONE_REGISTRY.register()
-def build_mnv2_backbone(cfg, input_shape):
+def build_mnv2_backbone_for_centermask(cfg, input_shape):
"""
Create a MobileNetV2 instance from config.
Returns:
@@ -171,7 +171,7 @@ def build_mobilenetv2_fpn_backbone(cfg, input_shape: ShapeSpec):
Returns:
backbone (Backbone): backbone module, must be a subclass of :class:`Backbone`.
"""
- bottom_up = build_mnv2_backbone(cfg, input_shape)
+ bottom_up = build_mnv2_backbone_for_centermask(cfg, input_shape)
in_features = cfg.MODEL.FPN.IN_FEATURES
out_channels = cfg.MODEL.FPN.OUT_CHANNELS
backbone = FPN(
@@ -193,10 +193,10 @@ def build_fcos_mobilenetv2_fpn_backbone(cfg, input_shape: ShapeSpec):
Returns:
backbone (Backbone): backbone module, must be a subclass of :class:`Backbone`.
"""
- bottom_up = build_mnv2_backbone(cfg, input_shape)
+ bottom_up = build_mnv2_backbone_for_centermask(cfg, input_shape)
in_features = cfg.MODEL.FPN.IN_FEATURES
out_channels = cfg.MODEL.FPN.OUT_CHANNELS
- top_levels = cfg.MODEL.FCOS.TOP_LEVELS
+ top_levels = cfg.MODEL.FCOS_CENTERMASK.TOP_LEVELS
in_channels_top = out_channels
if top_levels == 2:
top_block = LastLevelP6P7(in_channels_top, out_channels, "p5")
diff --git a/centermask/modeling/backbone/vovnet.py b/centermask/modeling/backbone/vovnet.py
index 2978d2d..ecda480 100644
--- a/centermask/modeling/backbone/vovnet.py
+++ b/centermask/modeling/backbone/vovnet.py
@@ -20,9 +20,9 @@ from .fpn import LastLevelP6, LastLevelP6P7
__all__ = [
"VoVNet",
- "build_vovnet_backbone",
- "build_vovnet_fpn_backbone",
- "build_fcos_vovnet_fpn_backbone"
+ "build_vovnet_backbone_for_centermask",
+ "build_vovnet_fpn_backbone_for_centermask",
+ "build_fcos_vovnet_fpn_backbone_for_centermask"
]
_NORM = False
@@ -490,7 +490,7 @@ class VoVNet(Backbone):
@BACKBONE_REGISTRY.register()
-def build_vovnet_backbone(cfg, input_shape):
+def build_vovnet_backbone_for_centermask(cfg, input_shape):
"""
Create a VoVNet instance from config.
@@ -502,7 +502,7 @@ def build_vovnet_backbone(cfg, input_shape):
@BACKBONE_REGISTRY.register()
-def build_vovnet_fpn_backbone(cfg, input_shape: ShapeSpec):
+def build_vovnet_fpn_backbone_for_centermask(cfg, input_shape: ShapeSpec):
"""
Args:
cfg: a detectron2 CfgNode
@@ -510,7 +510,7 @@ def build_vovnet_fpn_backbone(cfg, input_shape: ShapeSpec):
Returns:
backbone (Backbone): backbone module, must be a subclass of :class:`Backbone`.
"""
- bottom_up = build_vovnet_backbone(cfg, input_shape)
+ bottom_up = build_vovnet_backbone_for_centermask(cfg, input_shape)
in_features = cfg.MODEL.FPN.IN_FEATURES
out_channels = cfg.MODEL.FPN.OUT_CHANNELS
backbone = FPN(
@@ -525,7 +525,7 @@ def build_vovnet_fpn_backbone(cfg, input_shape: ShapeSpec):
@BACKBONE_REGISTRY.register()
-def build_fcos_vovnet_fpn_backbone(cfg, input_shape: ShapeSpec):
+def build_fcos_vovnet_fpn_backbone_for_centermask(cfg, input_shape: ShapeSpec):
"""
Args:
cfg: a detectron2 CfgNode
@@ -533,10 +533,10 @@ def build_fcos_vovnet_fpn_backbone(cfg, input_shape: ShapeSpec):
Returns:
backbone (Backbone): backbone module, must be a subclass of :class:`Backbone`.
"""
- bottom_up = build_vovnet_backbone(cfg, input_shape)
+ bottom_up = build_vovnet_backbone_for_centermask(cfg, input_shape)
in_features = cfg.MODEL.FPN.IN_FEATURES
out_channels = cfg.MODEL.FPN.OUT_CHANNELS
- top_levels = cfg.MODEL.FCOS.TOP_LEVELS
+ top_levels = cfg.MODEL.FCOS_CENTERMASK.TOP_LEVELS
in_channels_top = out_channels
if top_levels == 2:
top_block = LastLevelP6P7(in_channels_top, out_channels, "p5")
diff --git a/centermask/modeling/fcos/__init__.py b/centermask/modeling/fcos/__init__.py
index 6571ba1..14b921c 100644
--- a/centermask/modeling/fcos/__init__.py
+++ b/centermask/modeling/fcos/__init__.py
@@ -1 +1 @@
-from .fcos import FCOS
+from .fcos import FCOS_CENTERMASK
diff --git a/centermask/modeling/fcos/fcos.py b/centermask/modeling/fcos/fcos.py
index 1bff7c3..8506c4b 100644
--- a/centermask/modeling/fcos/fcos.py
+++ b/centermask/modeling/fcos/fcos.py
@@ -11,7 +11,7 @@ from centermask.layers import DFConv2d, IOULoss
from .fcos_outputs import FCOSOutputs
-__all__ = ["FCOS"]
+__all__ = ["FCOS_CENTERMASK"]
INF = 100000000
@@ -26,32 +26,32 @@ class Scale(nn.Module):
@PROPOSAL_GENERATOR_REGISTRY.register()
-class FCOS(nn.Module):
+class FCOS_CENTERMASK(nn.Module):
def __init__(self, cfg, input_shape: Dict[str, ShapeSpec]):
super().__init__()
# fmt: off
- self.in_features = cfg.MODEL.FCOS.IN_FEATURES
- self.fpn_strides = cfg.MODEL.FCOS.FPN_STRIDES
- self.focal_loss_alpha = cfg.MODEL.FCOS.LOSS_ALPHA
- self.focal_loss_gamma = cfg.MODEL.FCOS.LOSS_GAMMA
- self.center_sample = cfg.MODEL.FCOS.CENTER_SAMPLE
- self.strides = cfg.MODEL.FCOS.FPN_STRIDES
- self.radius = cfg.MODEL.FCOS.POS_RADIUS
- self.pre_nms_thresh_train = cfg.MODEL.FCOS.INFERENCE_TH_TRAIN
- self.pre_nms_thresh_test = cfg.MODEL.FCOS.INFERENCE_TH_TEST
- self.pre_nms_topk_train = cfg.MODEL.FCOS.PRE_NMS_TOPK_TRAIN
- self.pre_nms_topk_test = cfg.MODEL.FCOS.PRE_NMS_TOPK_TEST
- self.nms_thresh = cfg.MODEL.FCOS.NMS_TH
- self.post_nms_topk_train = cfg.MODEL.FCOS.POST_NMS_TOPK_TRAIN
- self.post_nms_topk_test = cfg.MODEL.FCOS.POST_NMS_TOPK_TEST
- self.thresh_with_ctr = cfg.MODEL.FCOS.THRESH_WITH_CTR
+ self.in_features = cfg.MODEL.FCOS_CENTERMASK.IN_FEATURES
+ self.fpn_strides = cfg.MODEL.FCOS_CENTERMASK.FPN_STRIDES
+ self.focal_loss_alpha = cfg.MODEL.FCOS_CENTERMASK.LOSS_ALPHA
+ self.focal_loss_gamma = cfg.MODEL.FCOS_CENTERMASK.LOSS_GAMMA
+ self.center_sample = cfg.MODEL.FCOS_CENTERMASK.CENTER_SAMPLE
+ self.strides = cfg.MODEL.FCOS_CENTERMASK.FPN_STRIDES
+ self.radius = cfg.MODEL.FCOS_CENTERMASK.POS_RADIUS
+ self.pre_nms_thresh_train = cfg.MODEL.FCOS_CENTERMASK.INFERENCE_TH_TRAIN
+ self.pre_nms_thresh_test = cfg.MODEL.FCOS_CENTERMASK.INFERENCE_TH_TEST
+ self.pre_nms_topk_train = cfg.MODEL.FCOS_CENTERMASK.PRE_NMS_TOPK_TRAIN
+ self.pre_nms_topk_test = cfg.MODEL.FCOS_CENTERMASK.PRE_NMS_TOPK_TEST
+ self.nms_thresh = cfg.MODEL.FCOS_CENTERMASK.NMS_TH
+ self.post_nms_topk_train = cfg.MODEL.FCOS_CENTERMASK.POST_NMS_TOPK_TRAIN
+ self.post_nms_topk_test = cfg.MODEL.FCOS_CENTERMASK.POST_NMS_TOPK_TEST
+ self.thresh_with_ctr = cfg.MODEL.FCOS_CENTERMASK.THRESH_WITH_CTR
self.mask_on = cfg.MODEL.MASK_ON #ywlee
# fmt: on
- self.iou_loss = IOULoss(cfg.MODEL.FCOS.LOC_LOSS_TYPE)
+ self.iou_loss = IOULoss(cfg.MODEL.FCOS_CENTERMASK.LOC_LOSS_TYPE)
# generate sizes of interest
soi = []
prev_size = -1
- for s in cfg.MODEL.FCOS.SIZES_OF_INTEREST:
+ for s in cfg.MODEL.FCOS_CENTERMASK.SIZES_OF_INTEREST:
soi.append([prev_size, s])
prev_size = s
soi.append([prev_size, INF])
@@ -152,15 +152,15 @@ class FCOSHead(nn.Module):
"""
super().__init__()
# TODO: Implement the sigmoid version first.
- self.num_classes = cfg.MODEL.FCOS.NUM_CLASSES
- self.fpn_strides = cfg.MODEL.FCOS.FPN_STRIDES
- head_configs = {"cls": (cfg.MODEL.FCOS.NUM_CLS_CONVS,
+ self.num_classes = cfg.MODEL.FCOS_CENTERMASK.NUM_CLASSES
+ self.fpn_strides = cfg.MODEL.FCOS_CENTERMASK.FPN_STRIDES
+ head_configs = {"cls": (cfg.MODEL.FCOS_CENTERMASK.NUM_CLS_CONVS,
False),
- "bbox": (cfg.MODEL.FCOS.NUM_BOX_CONVS,
- cfg.MODEL.FCOS.USE_DEFORMABLE),
- "share": (cfg.MODEL.FCOS.NUM_SHARE_CONVS,
- cfg.MODEL.FCOS.USE_DEFORMABLE)}
- norm = None if cfg.MODEL.FCOS.NORM == "none" else cfg.MODEL.FCOS.NORM
+ "bbox": (cfg.MODEL.FCOS_CENTERMASK.NUM_BOX_CONVS,
+ cfg.MODEL.FCOS_CENTERMASK.USE_DEFORMABLE),
+ "share": (cfg.MODEL.FCOS_CENTERMASK.NUM_SHARE_CONVS,
+ cfg.MODEL.FCOS_CENTERMASK.USE_DEFORMABLE)}
+ norm = None if cfg.MODEL.FCOS_CENTERMASK.NORM == "none" else cfg.MODEL.FCOS_CENTERMASK.NORM
in_channels = [s.channels for s in input_shape]
assert len(set(in_channels)) == 1, "Each level must have the same channel!"
@@ -199,7 +199,7 @@ class FCOSHead(nn.Module):
stride=1, padding=1
)
- if cfg.MODEL.FCOS.USE_SCALE:
+ if cfg.MODEL.FCOS_CENTERMASK.USE_SCALE:
self.scales = nn.ModuleList([Scale(init_value=1.0) for _ in self.fpn_strides])
else:
self.scales = None
@@ -215,7 +215,7 @@ class FCOSHead(nn.Module):
torch.nn.init.constant_(l.bias, 0)
# initialize the bias for focal loss
- prior_prob = cfg.MODEL.FCOS.PRIOR_PROB
+ prior_prob = cfg.MODEL.FCOS_CENTERMASK.PRIOR_PROB
bias_value = -math.log((1 - prior_prob) / prior_prob)
torch.nn.init.constant_(self.cls_logits.bias, bias_value)
@@ -234,7 +234,7 @@ class FCOSHead(nn.Module):
reg = self.bbox_pred(bbox_tower)
if self.scales is not None:
reg = self.scales[l](reg)
- # Note that we use relu, as in the improved FCOS, instead of exp.
+ # Note that we use relu, as in the improved FCOS_CENTERMASK, instead of exp.
bbox_reg.append(F.relu(reg))
return logits, bbox_reg, ctrness, bbox_towers
diff --git a/configs/centermask/Base-CenterMask-Lite-VoVNet.yaml b/configs/centermask/Base-CenterMask-Lite-VoVNet.yaml
index 7b332f2..3f97ad3 100644
--- a/configs/centermask/Base-CenterMask-Lite-VoVNet.yaml
+++ b/configs/centermask/Base-CenterMask-Lite-VoVNet.yaml
@@ -1,7 +1,7 @@
MODEL:
META_ARCHITECTURE: "GeneralizedRCNN"
BACKBONE:
- NAME: "build_fcos_vovnet_fpn_backbone"
+ NAME: "build_fcos_vovnet_fpn_backbone_for_centermask"
FREEZE_AT: 0
VOVNET:
OUT_FEATURES: ["stage3", "stage4", "stage5"]
@@ -9,8 +9,8 @@ MODEL:
IN_FEATURES: ["stage3", "stage4", "stage5"]
OUT_CHANNELS: 128
PROPOSAL_GENERATOR:
- NAME: "FCOS"
- FCOS:
+ NAME: "FCOS_CENTERMASK"
+ FCOS_CENTERMASK:
POST_NMS_TOPK_TEST: 50
NUM_CLS_CONVS: 2
NUM_BOX_CONVS: 2
diff --git a/configs/centermask/Base-CenterMask-ResNet.yaml b/configs/centermask/Base-CenterMask-ResNet.yaml
index a4b03de..03cc3d7 100644
--- a/configs/centermask/Base-CenterMask-ResNet.yaml
+++ b/configs/centermask/Base-CenterMask-ResNet.yaml
@@ -1,14 +1,14 @@
MODEL:
META_ARCHITECTURE: "GeneralizedRCNN"
BACKBONE:
- NAME: "build_fcos_resnet_fpn_backbone"
+ NAME: "build_fcos_resnet_fpn_backbone_for_centermask"
RESNETS:
OUT_FEATURES: ["res3", "res4", "res5"]
FPN:
IN_FEATURES: ["res3", "res4", "res5"]
PROPOSAL_GENERATOR:
- NAME: "FCOS"
- FCOS:
+ NAME: "FCOS_CENTERMASK"
+ FCOS_CENTERMASK:
POST_NMS_TOPK_TEST: 50
# PIXEL_MEAN: [102.9801, 115.9465, 122.7717]
MASK_ON: True
diff --git a/configs/centermask/Base-CenterMask-VoVNet.yaml b/configs/centermask/Base-CenterMask-VoVNet.yaml
index fb50a8b..9ce6840 100644
--- a/configs/centermask/Base-CenterMask-VoVNet.yaml
+++ b/configs/centermask/Base-CenterMask-VoVNet.yaml
@@ -1,15 +1,15 @@
MODEL:
META_ARCHITECTURE: "GeneralizedRCNN"
BACKBONE:
- NAME: "build_fcos_vovnet_fpn_backbone"
+ NAME: "build_fcos_vovnet_fpn_backbone_for_centermask"
FREEZE_AT: 0
VOVNET:
OUT_FEATURES: ["stage3", "stage4", "stage5"]
FPN:
IN_FEATURES: ["stage3", "stage4", "stage5"]
PROPOSAL_GENERATOR:
- NAME: "FCOS"
- FCOS:
+ NAME: "FCOS_CENTERMASK"
+ FCOS_CENTERMASK:
POST_NMS_TOPK_TEST: 50
# PIXEL_MEAN: [102.9801, 115.9465, 122.7717]
MASK_ON: True
diff --git a/configs/centermask/centermask_lite_Mv2_FPN_ms_4x.yaml b/configs/centermask/centermask_lite_Mv2_FPN_ms_4x.yaml
index f22e0b5..08d411a 100644
--- a/configs/centermask/centermask_lite_Mv2_FPN_ms_4x.yaml
+++ b/configs/centermask/centermask_lite_Mv2_FPN_ms_4x.yaml
@@ -10,8 +10,8 @@ MODEL:
IN_FEATURES: ["res3", "res4", "res5"]
OUT_CHANNELS: 128
PROPOSAL_GENERATOR:
- NAME: "FCOS"
- FCOS:
+ NAME: "FCOS_CENTERMASK"
+ FCOS_CENTERMASK:
POST_NMS_TOPK_TEST: 50
NUM_CLS_CONVS: 2
NUM_BOX_CONVS: 2
diff --git a/demo/demo.py b/demo/demo.py
index 9c9460f..3f0009b 100644
--- a/demo/demo.py
+++ b/demo/demo.py
@@ -29,7 +29,7 @@ def setup_cfg(args):
# Set score_threshold for builtin models
cfg.MODEL.RETINANET.SCORE_THRESH_TEST = args.confidence_threshold
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = args.confidence_threshold
- cfg.MODEL.FCOS.INFERENCE_TH_TEST = args.confidence_threshold
+ cfg.MODEL.FCOS_CENTERMASK.INFERENCE_TH_TEST = args.confidence_threshold
cfg.MODEL.PANOPTIC_FPN.COMBINE.INSTANCES_CONFIDENCE_THRESH = args.confidence_threshold
cfg.freeze()
return cfg