Skip to content

Commit faf6587

Browse files
Jon Mortonfacebook-github-bot
authored andcommitted
Update mmdetection to latest github master
Summary: Wanted to use some of the latest additions to mmdetection; in particular, the UniformAssignment from YOLOF (Free box AP win, even in two stage models!). I just cloned latest mmdetection and copied into `deeplearning/projects/third_party/mmdetection`. Reviewed By: ppwwyyxx Differential Revision: D30598178 fbshipit-source-id: 05fc559534a2fde41b36fc8c088c4e5c1729e7a2
1 parent cbbc1ce commit faf6587

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

detectron2/modeling/mmdet_wrapper.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def __init__(
4545
backbone: Union[nn.Module, Mapping],
4646
neck: Union[nn.Module, Mapping, None] = None,
4747
*,
48-
pretrained_backbone: Optional[str] = None,
4948
output_shapes: List[ShapeSpec],
5049
output_names: Optional[List[str]] = None,
5150
):
@@ -77,12 +76,11 @@ def __init__(
7776
neck = build_neck(_to_container(neck))
7877
self.neck = neck
7978

80-
# It's confusing that backbone weights are given as a separate argument,
81-
# but "neck" weights, if any, are part of neck itself. This is the interface
79+
# "Neck" weights, if any, are part of neck itself. This is the interface
8280
# of mmdet so we follow it. Reference:
8381
# https://github.com/open-mmlab/mmdetection/blob/master/mmdet/models/detectors/two_stage.py
84-
logger.info(f"Initializing mmdet backbone weights: {pretrained_backbone} ...")
85-
self.backbone.init_weights(pretrained_backbone)
82+
logger.info(f"Initializing mmdet backbone weights...")
83+
self.backbone.init_weights()
8684
# train() in mmdet modules is non-trivial, and has to be explicitly
8785
# called. Reference:
8886
# https://github.com/open-mmlab/mmdetection/blob/master/mmdet/models/backbones/resnet.py

tests/modeling/test_mmdet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ def test_detector(self):
4646
MMDetDetector(
4747
detector=dict(
4848
type="MaskRCNN",
49-
# skip pretrained model for tests
50-
# pretrained="torchvision://resnet50",
5149
backbone=dict(
5250
type="ResNet",
5351
depth=50,
@@ -57,6 +55,8 @@ def test_detector(self):
5755
norm_cfg=dict(type="BN", requires_grad=True),
5856
norm_eval=True,
5957
style="pytorch",
58+
# skip pretrained model for tests
59+
# init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50'))
6060
),
6161
neck=dict(
6262
type="FPN", in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5

0 commit comments

Comments
 (0)