-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MMSIG#357] Add new configs for panoptic_fpn (#11109)
- Loading branch information
1 parent
627e00c
commit 47063a1
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
mmdet/configs/panoptic_fpn/panoptic_fpn_r101_fpn_1x_coco.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
from mmengine.config import read_base | ||
from mmengine.model.weight_init import PretrainedInit | ||
|
||
with read_base(): | ||
from .panoptic_fpn_r50_fpn_1x_coco import * | ||
|
||
model.update( | ||
dict( | ||
backbone=dict( | ||
depth=101, | ||
init_cfg=dict( | ||
type=PretrainedInit, checkpoint='torchvision://resnet101')))) |
13 changes: 13 additions & 0 deletions
13
mmdet/configs/panoptic_fpn/panoptic_fpn_r101_fpn_ms_3x_coco.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
from mmengine.config import read_base | ||
from mmengine.model.weight_init import PretrainedInit | ||
|
||
with read_base(): | ||
from .panoptic_fpn_r50_fpn_ms_3x_coco import * | ||
|
||
model.update( | ||
dict( | ||
backbone=dict( | ||
depth=101, | ||
init_cfg=dict( | ||
type=PretrainedInit, checkpoint='torchvision://resnet101')))) |
45 changes: 45 additions & 0 deletions
45
mmdet/configs/panoptic_fpn/panoptic_fpn_r50_fpn_ms_3x_coco.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
from mmengine.config import read_base | ||
from mmengine.optim.scheduler.lr_scheduler import LinearLR, MultiStepLR | ||
|
||
with read_base(): | ||
from .panoptic_fpn_r50_fpn_1x_coco import * | ||
|
||
from mmcv.transforms import RandomResize | ||
from mmcv.transforms.loading import LoadImageFromFile | ||
|
||
from mmdet.datasets.transforms.formatting import PackDetInputs | ||
from mmdet.datasets.transforms.loading import LoadPanopticAnnotations | ||
from mmdet.datasets.transforms.transforms import RandomFlip | ||
|
||
# In mstrain 3x config, img_scale=[(1333, 640), (1333, 800)], | ||
# multiscale_mode='range' | ||
train_pipeline = [ | ||
dict(type=LoadImageFromFile), | ||
dict( | ||
type=LoadPanopticAnnotations, | ||
with_bbox=True, | ||
with_mask=True, | ||
with_seg=True), | ||
dict(type=RandomResize, scale=[(1333, 640), (1333, 800)], keep_ratio=True), | ||
dict(type=RandomFlip, prob=0.5), | ||
dict(type=PackDetInputs) | ||
] | ||
|
||
train_dataloader.update(dict(dataset=dict(pipeline=train_pipeline))) | ||
|
||
# TODO: Use RepeatDataset to speed up training | ||
# training schedule for 3x | ||
train_cfg.update(dict(max_epochs=36, val_interval=3)) | ||
|
||
# learning rate | ||
param_scheduler = [ | ||
dict(type=LinearLR, start_factor=0.001, by_epoch=False, begin=0, end=500), | ||
dict( | ||
type=MultiStepLR, | ||
begin=0, | ||
end=36, | ||
by_epoch=True, | ||
milestones=[24, 33], | ||
gamma=0.1) | ||
] |