-
Notifications
You must be signed in to change notification settings - Fork 24
/
mask_rcnn_flash_intern_image_s_fpn_1x_coco.py
84 lines (81 loc) · 4.69 KB
/
mask_rcnn_flash_intern_image_s_fpn_1x_coco.py
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# --------------------------------------------------------
# DCNv4
# Copyright (c) 2023 OpenGVLab
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
_base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/coco_instance.py',
'../_base_/schedules/schedule_1x.py',
'../_base_/default_runtime.py'
]
pretrained = 'https://huggingface.co/OpenGVLab/DCNv4/resolve/main/flash_intern_image_s_1k_224.pth'
model = dict(
backbone=dict(
_delete_=True,
type='FlashInternImage',
core_op='DCNv4',
channels=80,
depths=[4, 4, 21, 4],
groups=[5, 10, 20, 40],
mlp_ratio=4.,
drop_path_rate=0.3,
norm_layer='LN',
layer_scale=1.0,
offset_scale=1.0,
post_norm=True,
with_cp=True,
dw_kernel_size=3,
out_indices=(0, 1, 2, 3),
init_cfg=dict(type='Pretrained', checkpoint=pretrained)),
# We leverage the FPN implemented in ViTDet for stable training,
# and we don't benefit from this FPN in terms of performance.
neck=dict(
type='FPN_vitdet',
in_channels=[80, 160, 320, 640],
out_channels=256,
norm_cfg=dict(type='LN', requires_grad=True),
use_residual=True,
num_outs=5),
)
# By default, models are trained on 8 GPUs with 2 images per GPU
data = dict(samples_per_gpu=2)
optimizer = dict(
_delete_=True, type='AdamW', lr=0.0001, weight_decay=0.05,
constructor='CustomLayerDecayOptimizerConstructor',
paramwise_cfg=dict(num_layers=33, layer_decay_rate=1.0,
depths=[4, 4, 21, 4]))
optimizer_config = dict(grad_clip=None)
# fp16 = dict(loss_scale=dict(init_scale=512))
evaluation = dict(save_best='auto')
checkpoint_config = dict(
interval=1,
max_keep_ckpts=1,
save_last=True,
)
# BBox
# Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.492
# Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=1000 ] = 0.707
# Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=1000 ] = 0.539
# Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.328
# Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.531
# Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.647
# Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.609
# Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=300 ] = 0.609
# Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=1000 ] = 0.609
# Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.431
# Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.650
# Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.768
# Segm
# Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.440
# Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=1000 ] = 0.678
# Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=1000 ] = 0.476
# Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.245
# Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.470
# Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.633
# Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.551
# Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=300 ] = 0.551
# Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=1000 ] = 0.551
# Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.372
# Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.591
# Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.714