"official/projects/yolo/ops/mosaic.py" did not exist on "43b55bf48c689b93e27c66de499d380b93cbeeb1"
pgd_r101-caffe_fpn_head-gn_4xb3-4x_kitti-mono3d.py 4.33 KB
Newer Older
Tai-Wang's avatar
Tai-Wang committed
1
2
_base_ = [
    '../_base_/datasets/kitti-mono3d.py', '../_base_/models/pgd.py',
3
    '../_base_/schedules/mmdet-schedule-1x.py', '../_base_/default_runtime.py'
Tai-Wang's avatar
Tai-Wang committed
4
5
6
]
# model settings
model = dict(
ZCMax's avatar
ZCMax committed
7
8
9
10
11
12
    data_preprocessor=dict(
        type='Det3DDataPreprocessor',
        mean=[103.530, 116.280, 123.675],
        std=[1.0, 1.0, 1.0],
        bgr_to_rgb=False,
        pad_size_divisor=32),
Tai-Wang's avatar
Tai-Wang committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    backbone=dict(frozen_stages=0),
    neck=dict(start_level=0, num_outs=4),
    bbox_head=dict(
        num_classes=3,
        bbox_code_size=7,
        pred_attrs=False,
        pred_velo=False,
        pred_bbox2d=True,
        use_onlyreg_proj=True,
        strides=(4, 8, 16, 32),
        regress_ranges=((-1, 64), (64, 128), (128, 256), (256, 1e8)),
        group_reg_dims=(2, 1, 3, 1, 16,
                        4),  # offset, depth, size, rot, kpts, bbox2d
        reg_branch=(
            (256, ),  # offset
            (256, ),  # depth
            (256, ),  # size
            (256, ),  # rot
            (256, ),  # kpts
            (256, )  # bbox2d
        ),
        centerness_branch=(256, ),
        loss_cls=dict(
ZCMax's avatar
ZCMax committed
36
            type='mmdet.FocalLoss',
Tai-Wang's avatar
Tai-Wang committed
37
38
39
40
            use_sigmoid=True,
            gamma=2.0,
            alpha=0.25,
            loss_weight=1.0),
ZCMax's avatar
ZCMax committed
41
42
        loss_bbox=dict(
            type='mmdet.SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0),
Tai-Wang's avatar
Tai-Wang committed
43
        loss_dir=dict(
ZCMax's avatar
ZCMax committed
44
            type='mmdet.CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
Tai-Wang's avatar
Tai-Wang committed
45
        loss_centerness=dict(
ZCMax's avatar
ZCMax committed
46
            type='mmdet.CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
Tai-Wang's avatar
Tai-Wang committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
        use_depth_classifier=True,
        depth_branch=(256, ),
        depth_range=(0, 70),
        depth_unit=10,
        division='uniform',
        depth_bins=8,
        pred_keypoints=True,
        weight_dim=1,
        loss_depth=dict(
            type='UncertainSmoothL1Loss', alpha=1.0, beta=3.0,
            loss_weight=1.0),
        bbox_coder=dict(
            type='PGDBBoxCoder',
            base_depths=((28.01, 16.32), ),
            base_dims=((0.8, 1.73, 0.6), (1.76, 1.73, 0.6), (3.9, 1.56, 1.6)),
            code_size=7)),
    # set weight 1.0 for base 7 dims (offset, depth, size, rot)
    # 0.2 for 16-dim keypoint offsets and 1.0 for 4-dim 2D distance targets
    train_cfg=dict(code_weight=[
        1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
        0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 1.0, 1.0, 1.0, 1.0
    ]),
    test_cfg=dict(nms_pre=100, nms_thr=0.05, score_thr=0.001, max_per_img=20))

ZCMax's avatar
ZCMax committed
71
72
73
74
75
76
77
78
79
80
81
82
83
# file_client_args = dict(backend='disk')
# Uncomment the following if use ceph or other file clients.
# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient
# for more details.
file_client_args = dict(
    backend='petrel',
    path_mapping=dict({
        './data/kitti/':
        's3://openmmlab/datasets/detection3d/kitti/',
        'data/kitti/':
        's3://openmmlab/datasets/detection3d/kitti/'
    }))

Tai-Wang's avatar
Tai-Wang committed
84
train_pipeline = [
85
    dict(type='LoadImageFromFileMono3D'),
Tai-Wang's avatar
Tai-Wang committed
86
87
88
89
90
91
92
93
    dict(
        type='LoadAnnotations3D',
        with_bbox=True,
        with_label=True,
        with_attr_label=False,
        with_bbox_3d=True,
        with_label_3d=True,
        with_bbox_depth=True),
ZCMax's avatar
ZCMax committed
94
    dict(type='mmdet.Resize', scale=(1242, 375), keep_ratio=True),
Tai-Wang's avatar
Tai-Wang committed
95
96
    dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5),
    dict(
ZCMax's avatar
ZCMax committed
97
        type='Pack3DDetInputs',
Tai-Wang's avatar
Tai-Wang committed
98
99
        keys=[
            'img', 'gt_bboxes', 'gt_labels', 'gt_bboxes_3d', 'gt_labels_3d',
ZCMax's avatar
ZCMax committed
100
            'centers_2d', 'depths'
Tai-Wang's avatar
Tai-Wang committed
101
102
103
        ]),
]
test_pipeline = [
104
    dict(type='LoadImageFromFileMono3D'),
ZCMax's avatar
ZCMax committed
105
106
    dict(type='mmdet.Resize', scale_factor=1.0),
    dict(type='Pack3DDetInputs', keys=['img'])
Tai-Wang's avatar
Tai-Wang committed
107
]
ZCMax's avatar
ZCMax committed
108
109
110
111
112
113

train_dataloader = dict(
    batch_size=3, num_workers=3, dataset=dict(pipeline=train_pipeline))
test_dataloader = dict(dataset=dict(pipeline=test_pipeline))
val_dataloader = dict(dataset=dict(pipeline=test_pipeline))

Tai-Wang's avatar
Tai-Wang committed
114
# optimizer
ZCMax's avatar
ZCMax committed
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
optim_wrapper = dict(
    optimizer=dict(lr=0.01),
    paramwise_cfg=dict(bias_lr_mult=2., bias_decay_mult=0.),
    clip_grad=dict(max_norm=35, norm_type=2))

# learning rate
param_scheduler = [
    dict(
        type='LinearLR',
        start_factor=1.0 / 3,
        by_epoch=False,
        begin=0,
        end=500),
    dict(
        type='MultiStepLR',
        begin=0,
        end=48,
        by_epoch=True,
        milestones=[32, 44],
        gamma=0.1)
]

train_cfg = dict(max_epochs=48)