Spaces:
Runtime error
Runtime error
rockeycoss
commited on
Commit
·
369d2ad
1
Parent(s):
d8c32ac
add r50 and swin configs
Browse files
projects/configs/hdetr/r50-hdetr_sam-vit-b.py
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = [
|
2 |
+
'../_base_/datasets/coco_panoptic.py', '../_base_/default_runtime.py'
|
3 |
+
]
|
4 |
+
|
5 |
+
plugin = True
|
6 |
+
plugin_dir = 'projects/instance_segment_anything/'
|
7 |
+
|
8 |
+
model = dict(
|
9 |
+
type='DetWrapperInstanceSAM',
|
10 |
+
det_wrapper_type='hdetr',
|
11 |
+
det_wrapper_cfg=dict(aux_loss=True,
|
12 |
+
backbone='resnet50',
|
13 |
+
num_classes=91,
|
14 |
+
cache_mode=False,
|
15 |
+
dec_layers=6,
|
16 |
+
dec_n_points=4,
|
17 |
+
dilation=False,
|
18 |
+
dim_feedforward=2048,
|
19 |
+
drop_path_rate=0.2,
|
20 |
+
dropout=0.0,
|
21 |
+
enc_layers=6,
|
22 |
+
enc_n_points=4,
|
23 |
+
focal_alpha=0.25,
|
24 |
+
frozen_weights=None,
|
25 |
+
hidden_dim=256,
|
26 |
+
k_one2many=6,
|
27 |
+
lambda_one2many=1.0,
|
28 |
+
look_forward_twice=True,
|
29 |
+
masks=False,
|
30 |
+
mixed_selection=True,
|
31 |
+
nheads=8,
|
32 |
+
num_feature_levels=4,
|
33 |
+
num_queries_one2many=1500,
|
34 |
+
num_queries_one2one=300,
|
35 |
+
position_embedding='sine',
|
36 |
+
position_embedding_scale=6.283185307179586,
|
37 |
+
remove_difficult=False,
|
38 |
+
topk=100,
|
39 |
+
two_stage=True,
|
40 |
+
use_checkpoint=False,
|
41 |
+
use_fp16=False,
|
42 |
+
with_box_refine=True),
|
43 |
+
det_model_ckpt='ckpt/r50_hdetr.pth',
|
44 |
+
num_classes=80,
|
45 |
+
model_type='vit_b',
|
46 |
+
sam_checkpoint='ckpt/sam_vit_b_01ec64.pth',
|
47 |
+
use_sam_iou=True,
|
48 |
+
)
|
49 |
+
img_norm_cfg = dict(
|
50 |
+
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
51 |
+
# test_pipeline, NOTE the Pad's size_divisor is different from the default
|
52 |
+
# setting (size_divisor=32). While there is little effect on the performance
|
53 |
+
# whether we use the default setting or use size_divisor=1.
|
54 |
+
|
55 |
+
test_pipeline = [
|
56 |
+
dict(type='LoadImageFromFile'),
|
57 |
+
dict(
|
58 |
+
type='MultiScaleFlipAug',
|
59 |
+
img_scale=(1333, 800),
|
60 |
+
flip=False,
|
61 |
+
transforms=[
|
62 |
+
dict(type='Resize', keep_ratio=True),
|
63 |
+
dict(type='RandomFlip'),
|
64 |
+
dict(type='Normalize', **img_norm_cfg),
|
65 |
+
dict(type='Pad', size_divisor=1),
|
66 |
+
dict(type='ImageToTensor', keys=['img']),
|
67 |
+
dict(type='Collect', keys=['img'])
|
68 |
+
])
|
69 |
+
]
|
70 |
+
|
71 |
+
dataset_type = 'CocoDataset'
|
72 |
+
data_root = 'data/coco/'
|
73 |
+
|
74 |
+
data = dict(
|
75 |
+
samples_per_gpu=1,
|
76 |
+
workers_per_gpu=1,
|
77 |
+
test=dict(
|
78 |
+
type=dataset_type,
|
79 |
+
ann_file=data_root + 'annotations/instances_val2017.json',
|
80 |
+
img_prefix=data_root + 'val2017/',
|
81 |
+
pipeline=test_pipeline))
|
projects/configs/hdetr/r50-hdetr_sam-vit-l.py
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = [
|
2 |
+
'../_base_/datasets/coco_panoptic.py', '../_base_/default_runtime.py'
|
3 |
+
]
|
4 |
+
|
5 |
+
plugin = True
|
6 |
+
plugin_dir = 'projects/instance_segment_anything/'
|
7 |
+
|
8 |
+
model = dict(
|
9 |
+
type='DetWrapperInstanceSAM',
|
10 |
+
det_wrapper_type='hdetr',
|
11 |
+
det_wrapper_cfg=dict(aux_loss=True,
|
12 |
+
backbone='resnet50',
|
13 |
+
num_classes=91,
|
14 |
+
cache_mode=False,
|
15 |
+
dec_layers=6,
|
16 |
+
dec_n_points=4,
|
17 |
+
dilation=False,
|
18 |
+
dim_feedforward=2048,
|
19 |
+
drop_path_rate=0.2,
|
20 |
+
dropout=0.0,
|
21 |
+
enc_layers=6,
|
22 |
+
enc_n_points=4,
|
23 |
+
focal_alpha=0.25,
|
24 |
+
frozen_weights=None,
|
25 |
+
hidden_dim=256,
|
26 |
+
k_one2many=6,
|
27 |
+
lambda_one2many=1.0,
|
28 |
+
look_forward_twice=True,
|
29 |
+
masks=False,
|
30 |
+
mixed_selection=True,
|
31 |
+
nheads=8,
|
32 |
+
num_feature_levels=4,
|
33 |
+
num_queries_one2many=1500,
|
34 |
+
num_queries_one2one=300,
|
35 |
+
position_embedding='sine',
|
36 |
+
position_embedding_scale=6.283185307179586,
|
37 |
+
remove_difficult=False,
|
38 |
+
topk=100,
|
39 |
+
two_stage=True,
|
40 |
+
use_checkpoint=False,
|
41 |
+
use_fp16=False,
|
42 |
+
with_box_refine=True),
|
43 |
+
det_model_ckpt='ckpt/r50_hdetr.pth',
|
44 |
+
num_classes=80,
|
45 |
+
model_type='vit_l',
|
46 |
+
sam_checkpoint='ckpt/sam_vit_l_0b3195.pth',
|
47 |
+
use_sam_iou=True,
|
48 |
+
)
|
49 |
+
img_norm_cfg = dict(
|
50 |
+
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
51 |
+
# test_pipeline, NOTE the Pad's size_divisor is different from the default
|
52 |
+
# setting (size_divisor=32). While there is little effect on the performance
|
53 |
+
# whether we use the default setting or use size_divisor=1.
|
54 |
+
|
55 |
+
test_pipeline = [
|
56 |
+
dict(type='LoadImageFromFile'),
|
57 |
+
dict(
|
58 |
+
type='MultiScaleFlipAug',
|
59 |
+
img_scale=(1333, 800),
|
60 |
+
flip=False,
|
61 |
+
transforms=[
|
62 |
+
dict(type='Resize', keep_ratio=True),
|
63 |
+
dict(type='RandomFlip'),
|
64 |
+
dict(type='Normalize', **img_norm_cfg),
|
65 |
+
dict(type='Pad', size_divisor=1),
|
66 |
+
dict(type='ImageToTensor', keys=['img']),
|
67 |
+
dict(type='Collect', keys=['img'])
|
68 |
+
])
|
69 |
+
]
|
70 |
+
|
71 |
+
dataset_type = 'CocoDataset'
|
72 |
+
data_root = 'data/coco/'
|
73 |
+
|
74 |
+
data = dict(
|
75 |
+
samples_per_gpu=1,
|
76 |
+
workers_per_gpu=1,
|
77 |
+
test=dict(
|
78 |
+
type=dataset_type,
|
79 |
+
ann_file=data_root + 'annotations/instances_val2017.json',
|
80 |
+
img_prefix=data_root + 'val2017/',
|
81 |
+
pipeline=test_pipeline))
|
projects/configs/hdetr/swin-t-hdetr_sam-vit-b.py
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = [
|
2 |
+
'../_base_/datasets/coco_panoptic.py', '../_base_/default_runtime.py'
|
3 |
+
]
|
4 |
+
|
5 |
+
plugin = True
|
6 |
+
plugin_dir = 'projects/instance_segment_anything/'
|
7 |
+
|
8 |
+
model = dict(
|
9 |
+
type='DetWrapperInstanceSAM',
|
10 |
+
det_wrapper_type='hdetr',
|
11 |
+
det_wrapper_cfg=dict(aux_loss=True,
|
12 |
+
backbone='swin_tiny',
|
13 |
+
num_classes=91,
|
14 |
+
cache_mode=False,
|
15 |
+
dec_layers=6,
|
16 |
+
dec_n_points=4,
|
17 |
+
dilation=False,
|
18 |
+
dim_feedforward=2048,
|
19 |
+
drop_path_rate=0.2,
|
20 |
+
dropout=0.0,
|
21 |
+
enc_layers=6,
|
22 |
+
enc_n_points=4,
|
23 |
+
focal_alpha=0.25,
|
24 |
+
frozen_weights=None,
|
25 |
+
hidden_dim=256,
|
26 |
+
k_one2many=6,
|
27 |
+
lambda_one2many=1.0,
|
28 |
+
look_forward_twice=True,
|
29 |
+
masks=False,
|
30 |
+
mixed_selection=True,
|
31 |
+
nheads=8,
|
32 |
+
num_feature_levels=4,
|
33 |
+
num_queries_one2many=1500,
|
34 |
+
num_queries_one2one=300,
|
35 |
+
position_embedding='sine',
|
36 |
+
position_embedding_scale=6.283185307179586,
|
37 |
+
remove_difficult=False,
|
38 |
+
topk=100,
|
39 |
+
two_stage=True,
|
40 |
+
use_checkpoint=False,
|
41 |
+
use_fp16=False,
|
42 |
+
with_box_refine=True),
|
43 |
+
det_model_ckpt='ckpt/swin_t_hdetr.pth',
|
44 |
+
num_classes=80,
|
45 |
+
model_type='vit_b',
|
46 |
+
sam_checkpoint='ckpt/sam_vit_b_01ec64.pth',
|
47 |
+
use_sam_iou=True,
|
48 |
+
)
|
49 |
+
img_norm_cfg = dict(
|
50 |
+
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
51 |
+
# test_pipeline, NOTE the Pad's size_divisor is different from the default
|
52 |
+
# setting (size_divisor=32). While there is little effect on the performance
|
53 |
+
# whether we use the default setting or use size_divisor=1.
|
54 |
+
|
55 |
+
test_pipeline = [
|
56 |
+
dict(type='LoadImageFromFile'),
|
57 |
+
dict(
|
58 |
+
type='MultiScaleFlipAug',
|
59 |
+
img_scale=(1333, 800),
|
60 |
+
flip=False,
|
61 |
+
transforms=[
|
62 |
+
dict(type='Resize', keep_ratio=True),
|
63 |
+
dict(type='RandomFlip'),
|
64 |
+
dict(type='Normalize', **img_norm_cfg),
|
65 |
+
dict(type='Pad', size_divisor=1),
|
66 |
+
dict(type='ImageToTensor', keys=['img']),
|
67 |
+
dict(type='Collect', keys=['img'])
|
68 |
+
])
|
69 |
+
]
|
70 |
+
|
71 |
+
dataset_type = 'CocoDataset'
|
72 |
+
data_root = 'data/coco/'
|
73 |
+
|
74 |
+
data = dict(
|
75 |
+
samples_per_gpu=1,
|
76 |
+
workers_per_gpu=1,
|
77 |
+
test=dict(
|
78 |
+
type=dataset_type,
|
79 |
+
ann_file=data_root + 'annotations/instances_val2017.json',
|
80 |
+
img_prefix=data_root + 'val2017/',
|
81 |
+
pipeline=test_pipeline))
|
projects/configs/hdetr/swin-t-hdetr_sam-vit-l.py
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = [
|
2 |
+
'../_base_/datasets/coco_panoptic.py', '../_base_/default_runtime.py'
|
3 |
+
]
|
4 |
+
|
5 |
+
plugin = True
|
6 |
+
plugin_dir = 'projects/instance_segment_anything/'
|
7 |
+
|
8 |
+
model = dict(
|
9 |
+
type='DetWrapperInstanceSAM',
|
10 |
+
det_wrapper_type='hdetr',
|
11 |
+
det_wrapper_cfg=dict(aux_loss=True,
|
12 |
+
backbone='swin_tiny',
|
13 |
+
num_classes=91,
|
14 |
+
cache_mode=False,
|
15 |
+
dec_layers=6,
|
16 |
+
dec_n_points=4,
|
17 |
+
dilation=False,
|
18 |
+
dim_feedforward=2048,
|
19 |
+
drop_path_rate=0.2,
|
20 |
+
dropout=0.0,
|
21 |
+
enc_layers=6,
|
22 |
+
enc_n_points=4,
|
23 |
+
focal_alpha=0.25,
|
24 |
+
frozen_weights=None,
|
25 |
+
hidden_dim=256,
|
26 |
+
k_one2many=6,
|
27 |
+
lambda_one2many=1.0,
|
28 |
+
look_forward_twice=True,
|
29 |
+
masks=False,
|
30 |
+
mixed_selection=True,
|
31 |
+
nheads=8,
|
32 |
+
num_feature_levels=4,
|
33 |
+
num_queries_one2many=1500,
|
34 |
+
num_queries_one2one=300,
|
35 |
+
position_embedding='sine',
|
36 |
+
position_embedding_scale=6.283185307179586,
|
37 |
+
remove_difficult=False,
|
38 |
+
topk=100,
|
39 |
+
two_stage=True,
|
40 |
+
use_checkpoint=False,
|
41 |
+
use_fp16=False,
|
42 |
+
with_box_refine=True),
|
43 |
+
det_model_ckpt='ckpt/swin_t_hdetr.pth',
|
44 |
+
num_classes=80,
|
45 |
+
model_type='vit_l',
|
46 |
+
sam_checkpoint='ckpt/sam_vit_l_0b3195.pth',
|
47 |
+
use_sam_iou=True,
|
48 |
+
)
|
49 |
+
img_norm_cfg = dict(
|
50 |
+
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
51 |
+
# test_pipeline, NOTE the Pad's size_divisor is different from the default
|
52 |
+
# setting (size_divisor=32). While there is little effect on the performance
|
53 |
+
# whether we use the default setting or use size_divisor=1.
|
54 |
+
|
55 |
+
test_pipeline = [
|
56 |
+
dict(type='LoadImageFromFile'),
|
57 |
+
dict(
|
58 |
+
type='MultiScaleFlipAug',
|
59 |
+
img_scale=(1333, 800),
|
60 |
+
flip=False,
|
61 |
+
transforms=[
|
62 |
+
dict(type='Resize', keep_ratio=True),
|
63 |
+
dict(type='RandomFlip'),
|
64 |
+
dict(type='Normalize', **img_norm_cfg),
|
65 |
+
dict(type='Pad', size_divisor=1),
|
66 |
+
dict(type='ImageToTensor', keys=['img']),
|
67 |
+
dict(type='Collect', keys=['img'])
|
68 |
+
])
|
69 |
+
]
|
70 |
+
|
71 |
+
dataset_type = 'CocoDataset'
|
72 |
+
data_root = 'data/coco/'
|
73 |
+
|
74 |
+
data = dict(
|
75 |
+
samples_per_gpu=1,
|
76 |
+
workers_per_gpu=1,
|
77 |
+
test=dict(
|
78 |
+
type=dataset_type,
|
79 |
+
ann_file=data_root + 'annotations/instances_val2017.json',
|
80 |
+
img_prefix=data_root + 'val2017/',
|
81 |
+
pipeline=test_pipeline))
|