-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhousecat6d_yopo_swinl.py
More file actions
62 lines (55 loc) · 2.06 KB
/
housecat6d_yopo_swinl.py
File metadata and controls
62 lines (55 loc) · 2.06 KB
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
_base_ = './housecat6d_yopo_r50.py'
load_from = 'https://github.com/RistoranteRist/mmlab-weights/releases/download/dino-swinl/dino-5scale_swin-l_8xb2-36e_coco-5486e051.pth' # noqa
num_levels = 5
model = 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),
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))),
bbox_head=dict(
num_classes=10,
)
)
optim_wrapper = dict(
type='OptimWrapper',
optimizer=dict(type='AdamW', lr=0.0002, weight_decay=0.0001),
clip_grad=dict(max_norm=0.1, norm_type=2),
paramwise_cfg=dict(custom_keys=dict(backbone=dict(lr_mult=0.1))))
auto_scale_lr = dict(base_batch_size=16, enable=False)
# Override train_pipeline: use RandomFlipFor9DPose instead of RandomRotationFor9DPose
backend_args = None
scale = (640, 480)
train_pipeline = [
dict(type='LoadImageFromFile', backend_args=backend_args),
dict(type='Load9DPoseAnnotations', with_bbox=True,
with_centers_2d=True, with_z=True),
dict(type='ResizeforPose', scale=scale, keep_ratio=True),
dict(type='YOLOXHSVRandomAug'),
dict(type='RandomTranslatePixels', prob=0.5, max_translate_offset=50),
dict(type='RandomFlipFor9DPose', prob=0.5),
dict(type='FilterAnnotations', min_gt_bbox_wh=(1e-2, 1e-2)),
dict(type='Pack9DPoseInputs')
]
train_dataloader = dict(
batch_size=4,
num_workers=2,
dataset=dict(pipeline=train_pipeline))