Commit 4a950602 authored by dengjb's avatar dengjb
Browse files

update codes

parent 3e89e256
Pipeline #1044 failed with stages
in 0 seconds
# Copyright (c) OpenMMLab. All rights reserved.
from mmengine.config import read_base
from mmengine.runner.loops import EpochBasedTrainLoop
with read_base():
from .dino_4scale_r50_8xb2_12e_coco import *
max_epochs = 24
train_cfg.update(
dict(type=EpochBasedTrainLoop, max_epochs=max_epochs, val_interval=1))
param_scheduler[0].update(dict(milestones=[20]))
# Copyright (c) OpenMMLab. All rights reserved.
from mmengine.config import read_base
from mmengine.runner.loops import EpochBasedTrainLoop
with read_base():
from .dino_4scale_r50_8xb2_12e_coco import *
max_epochs = 36
train_cfg.update(
dict(type=EpochBasedTrainLoop, max_epochs=max_epochs, val_interval=1))
param_scheduler[0].update(dict(milestones=[30]))
# Copyright (c) OpenMMLab. All rights reserved.
from mmengine.config import read_base
with read_base():
from .dino_4scale_r50_8xb2_12e_coco import *
# from deformable detr hyper
model.update(
dict(
backbone=dict(frozen_stages=-1),
bbox_head=dict(loss_cls=dict(loss_weight=2.0)),
positional_encoding=dict(offset=-0.5, temperature=10000),
dn_cfg=dict(group_cfg=dict(num_dn_queries=300))))
# optimizer
optim_wrapper.update(
dict(
optimizer=dict(lr=0.0002),
paramwise_cfg=dict(
custom_keys={
'backbone': dict(lr_mult=0.1),
'sampling_offsets': dict(lr_mult=0.1),
'reference_points': dict(lr_mult=0.1)
})))
# Copyright (c) OpenMMLab. All rights reserved.
from mmengine.config import read_base
from mmengine.model.weight_init import PretrainedInit
from mmdet.models import SwinTransformer
with read_base():
from .dino_4scale_r50_8xb2_12e_coco import *
pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_large_patch4_window12_384_22k.pth' # noqa
num_levels = 5
model.merge(
dict(
num_feature_levels=num_levels,
backbone=dict(
_delete_=True,
type=SwinTransformer,
pretrain_img_size=384,
embed_dims=192,
depths=[2, 2, 18, 2],
num_heads=[6, 12, 24, 48],
window_size=12,
mlp_ratio=4,
qkv_bias=True,
qk_scale=None,
drop_rate=0.,
attn_drop_rate=0.,
drop_path_rate=0.2,
patch_norm=True,
out_indices=(0, 1, 2, 3),
# Please only add indices that would be used
# in FPN, otherwise some parameter will not be used
with_cp=True,
convert_weights=True,
init_cfg=dict(type=PretrainedInit, checkpoint=pretrained)),
neck=dict(in_channels=[192, 384, 768, 1536], num_outs=num_levels),
encoder=dict(
layer_cfg=dict(self_attn_cfg=dict(num_levels=num_levels))),
decoder=dict(
layer_cfg=dict(cross_attn_cfg=dict(num_levels=num_levels)))))
# Copyright (c) OpenMMLab. All rights reserved.
from mmengine.config import read_base
from mmengine.runner.loops import EpochBasedTrainLoop
with read_base():
from .dino_5scale_swin_l_8xb2_12e_coco import *
max_epochs = 36
train_cfg.update(
dict(type=EpochBasedTrainLoop, max_epochs=max_epochs, val_interval=1))
param_scheduler[0].update(dict(milestones=[27, 33]))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .._base_.datasets.coco_detection import *
from .._base_.default_runtime import *
from .._base_.models.faster_rcnn_r50_fpn import *
from .._base_.schedules.schedule_1x import *
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_fpn_poly_1x_coco import *
from mmengine.model.weight_init import PretrainedInit
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(
type=PretrainedInit,
checkpoint='open-mmlab://detectron2/resnet101_caffe')))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from ..common.ms_poly_3x_coco_instance import *
from .._base_.models.mask_rcnn_r50_fpn import *
from mmengine.model.weight_init import PretrainedInit
model = dict(
# use caffe img_norm
data_preprocessor=dict(
mean=[103.530, 116.280, 123.675],
std=[1.0, 1.0, 1.0],
bgr_to_rgb=False),
backbone=dict(
depth=101,
norm_cfg=dict(requires_grad=False),
norm_eval=True,
style='caffe',
init_cfg=dict(
type=PretrainedInit,
checkpoint='open-mmlab://detectron2/resnet101_caffe')))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .._base_.models.mask_rcnn_r50_fpn import *
from mmengine.model.weight_init import PretrainedInit
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(
type=PretrainedInit, checkpoint='torchvision://resnet101')))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_fpn_2x_coco import *
from mmengine.model.weight_init import PretrainedInit
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(
type=PretrainedInit, checkpoint='torchvision://resnet101')))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r18_fpn_8xb8_amp_lsj_200e_coco import *
from mmengine.model.weight_init import PretrainedInit
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(
type=PretrainedInit, checkpoint='torchvision://resnet101')))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from ..common.ms_poly_3x_coco_instance import *
from .._base_.models.mask_rcnn_r50_fpn import *
from mmengine.model.weight_init import PretrainedInit
model = dict(
backbone=dict(
depth=101,
init_cfg=dict(
type=PretrainedInit, checkpoint='torchvision://resnet101')))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_fpn_8xb8_amp_lsj_200e_coco import *
from mmengine.model.weight_init import PretrainedInit
model = dict(
backbone=dict(
depth=18,
init_cfg=dict(
type=PretrainedInit, checkpoint='torchvision://resnet18')),
neck=dict(in_channels=[64, 128, 256, 512]))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .._base_.datasets.coco_instance import *
from .._base_.default_runtime import *
from .._base_.models.mask_rcnn_r50_caffe_c4 import *
from .._base_.schedules.schedule_1x import *
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_fpn_1x_coco import *
from mmengine.model.weight_init import PretrainedInit
model = dict(
# use caffe img_norm
data_preprocessor=dict(
mean=[103.530, 116.280, 123.675],
std=[1.0, 1.0, 1.0],
bgr_to_rgb=False),
backbone=dict(
norm_cfg=dict(requires_grad=False),
style='caffe',
init_cfg=dict(
type=PretrainedInit,
checkpoint='open-mmlab://detectron2/resnet50_caffe')))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_fpn_1x_coco import *
from mmcv.transforms import RandomChoiceResize
from mmengine.model.weight_init import PretrainedInit
model = dict(
# use caffe img_norm
data_preprocessor=dict(
mean=[103.530, 116.280, 123.675],
std=[1.0, 1.0, 1.0],
bgr_to_rgb=False),
backbone=dict(
norm_cfg=dict(requires_grad=False),
style='caffe',
init_cfg=dict(
type=PretrainedInit,
checkpoint='open-mmlab://detectron2/resnet50_caffe')))
train_pipeline = [
dict(type=LoadImageFromFile, backend_args={{_base_.backend_args}}),
dict(type=LoadAnnotations, with_bbox=True, with_mask=True),
dict(
type=RandomChoiceResize,
scales=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
(1333, 768), (1333, 800)],
keep_ratio=True),
dict(type=RandomFlip, prob=0.5),
dict(type=PackDetInputs),
]
train_dataloader.update(dict(dataset=dict(pipeline=train_pipeline)))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_fpn_1x_coco import *
from mmcv.transforms import RandomChoiceResize
from mmengine.model.weight_init import PretrainedInit
model = dict(
# use caffe img_norm
data_preprocessor=dict(
mean=[103.530, 116.280, 123.675],
std=[1.0, 1.0, 1.0],
bgr_to_rgb=False),
backbone=dict(
norm_cfg=dict(requires_grad=False),
style='caffe',
init_cfg=dict(
type=PretrainedInit,
checkpoint='open-mmlab://detectron2/resnet50_caffe')))
train_pipeline = [
dict(type=LoadImageFromFile, backend_args={{_base_.backend_args}}),
dict(
type=LoadAnnotations, with_bbox=True, with_mask=True, poly2mask=False),
dict(
type=RandomChoiceResize,
scales=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
(1333, 768), (1333, 800)],
keep_ratio=True),
dict(type=RandomFlip, prob=0.5),
dict(type=PackDetInputs)
]
train_dataloader.update(dict(dataset=dict(pipeline=train_pipeline)))
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_caffe_fpn_ms_poly_1x_coco import *
train_cfg = dict(max_epochs=24)
# learning rate
param_scheduler = [
dict(type=LinearLR, start_factor=0.001, by_epoch=False, begin=0, end=500),
dict(
type=MultiStepLR,
begin=0,
end=24,
by_epoch=True,
milestones=[16, 22],
gamma=0.1)
]
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_caffe_fpn_ms_poly_1x_coco import *
train_cfg = dict(max_epochs=36)
# learning rate
param_scheduler = [
dict(type=LinearLR, start_factor=0.001, by_epoch=False, begin=0, end=500),
dict(
type=MultiStepLR,
begin=0,
end=24,
by_epoch=True,
milestones=[28, 34],
gamma=0.1)
]
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rcnn_r50_fpn_1x_coco import *
from mmengine.model.weight_init import PretrainedInit
from mmdet.models.losses import SmoothL1Loss
model = dict(
# use caffe img_norm
data_preprocessor=dict(
mean=[103.530, 116.280, 123.675],
std=[1.0, 1.0, 1.0],
bgr_to_rgb=False),
backbone=dict(
norm_cfg=dict(requires_grad=False),
style='caffe',
init_cfg=dict(
type=PretrainedInit,
checkpoint='open-mmlab://detectron2/resnet50_caffe')),
rpn_head=dict(
loss_bbox=dict(type=SmoothL1Loss, beta=1.0 / 9.0, loss_weight=1.0)),
roi_head=dict(
bbox_roi_extractor=dict(
roi_layer=dict(
type=RoIAlign, output_size=7, sampling_ratio=2,
aligned=False)),
bbox_head=dict(
loss_bbox=dict(type=SmoothL1Loss, beta=1.0, loss_weight=1.0)),
mask_roi_extractor=dict(
roi_layer=dict(
type=RoIAlign, output_size=14, sampling_ratio=2,
aligned=False))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment