Skip to content

Commit decc87f

Browse files
committed
geminifusion visualization exist label error, bbox error
1 parent ad5a1b2 commit decc87f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4094
-30
lines changed

configs/_base_/schedules/schedule_2x.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# training schedule for 2x
2-
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=1)
2+
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=100, val_interval=1)
33
val_cfg = dict(type='ValLoop')
44
test_cfg = dict(type='TestLoop')
55

@@ -10,7 +10,7 @@
1010
dict(
1111
type='MultiStepLR',
1212
begin=0,
13-
end=24,
13+
end=100,
1414
by_epoch=True,
1515
milestones=[16, 22],
1616
gamma=0.1)

custom_configs/DELIVER/deliver_dataset.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Dataset basic info
1010
dataset_type = 'DELIVERDetectionDataset'
11-
data_root = '/mnt/nvme/workspace/AnySeg/data/DELIVER/' # Added trailing slash
11+
data_root = '/SSDb/jemo_maeng/dset/DELIVER/' # Added trailing slash
1212
backend_args = None
1313
classes = ('Vehicle', 'Human')
1414

@@ -44,7 +44,11 @@
4444
prob=0.5,
4545
bbox_format='xywh' # 🔥 xywh format 명시
4646
),
47-
dict(type='PackDELIVERDetInputs')
47+
# dict(type='PackDELIVERDetInputs')
48+
dict(
49+
type='PackDELIVERDetInputs',
50+
meta_keys=('img_path', 'img_id', 'ori_shape', 'img_shape', 'scale_factor', 'flip', 'flip_direction')
51+
)
4852
]
4953

5054
test_pipeline = [
@@ -55,7 +59,11 @@
5559
keep_ratio=True,
5660
bbox_format='xywh' # 🔥 xywh format 명시
5761
),
58-
dict(type='PackDELIVERDetInputs')
62+
# dict(type='PackDELIVERDetInputs')
63+
dict(
64+
type='PackDELIVERDetInputs',
65+
meta_keys=('img_path', 'img_id', 'ori_shape', 'img_shape', 'scale_factor', 'flip', 'flip_direction')
66+
)
5967
]
6068

6169
# Dataset configs
@@ -133,7 +141,7 @@
133141
]
134142

135143
# Training settings
136-
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=1) # Updated for 2x
144+
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=100, val_interval=1) # Updated for 2x
137145
val_cfg = dict(type='ValLoop')
138146
test_cfg = dict(type='TestLoop')
139147

custom_configs/DELIVER/hinton-deliver_geminifusion_rcnn_lr0.01.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
'./deliver_dataset.py' # Inherit dataset config
88
]
99

10-
data_root= '/mnt/nvme/workspace/AnySeg/data/DELIVER'
10+
data_root= '/SSDb/jemo_maeng/dset/DELIVER'
1111

1212
# Model settings
1313
model = dict(
1414
type='FasterRCNN',
1515
data_preprocessor=_base_.data_preprocessor, # This comes from _base_
1616
backbone=dict(
17-
type='GeminiFusion',
17+
type='GeminiFusion_second',
1818
# variant='B2',
1919
backbone='GeminiFusion-B2',
2020
modals=['rgb', 'depth', 'event', 'lidar'],
@@ -147,7 +147,7 @@
147147
)
148148

149149
train_dataloader = dict(
150-
batch_size=8,
150+
batch_size=4,
151151
num_workers=2,
152152
persistent_workers=True,
153153
sampler=dict(type='DefaultSampler', shuffle=True),
@@ -188,7 +188,7 @@
188188

189189

190190
# Experiment name for logging
191-
experiment_name = 'deliver_cmnext_b2_faster_rcnn_2x_lr0.01'
191+
experiment_name = 'deliver_cmnext_b2_faster_rcnn_2x_lr0.01_2'
192192

193193
# Override work_dir if needed
194194
work_dir = f'./work_dirs/{experiment_name}'
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# geminifusion_rcnn.py
2+
3+
# CMNeXt Detection with RCNN detector
4+
# custom_configs/DELIVER/deliver_cmnext_rcnn.py
5+
import os
6+
_base_ = [
7+
'./deliver_dataset.py' # Inherit dataset config
8+
]
9+
10+
data_root= '/SSDb/jemo_maeng/dset/DELIVER'
11+
12+
# Model settings
13+
model = dict(
14+
type='FasterRCNN',
15+
data_preprocessor=_base_.data_preprocessor, # This comes from _base_
16+
backbone=dict(
17+
type='GeminiFusion',
18+
# variant='B2',
19+
backbone='GeminiFusion-B2',
20+
# modals=['rgb', 'depth', 'event', 'lidar'],
21+
modals=['rgb', 'depth'],
22+
out_indices=(0, 1, 2, 3),
23+
# frozen_stages=-1,
24+
# pretrained='/mnt/nvme/workspace/drone-mmdetection-jm/ckpts/mit_b2.pth'
25+
# num_modal=4,
26+
# out_indices=(0, 1, 2, 3),
27+
frozen_stages=-1,
28+
# adapter_type='every_one',
29+
30+
# pretrained='/mnt/nvme/workspace/drone-mmdetection-jm/ckpts/mit_b2.pth'
31+
),
32+
neck=dict(
33+
type='FPN', # MMDetection 표준 FPN 사용
34+
in_channels=[64, 128, 320, 512],
35+
# in_channels=[64, 128],
36+
out_channels=256,
37+
num_outs=5
38+
),
39+
rpn_head=dict(
40+
type='RPNHead',
41+
in_channels=256,
42+
feat_channels=256,
43+
anchor_generator=dict(
44+
type='AnchorGenerator', # 32 16 8 4
45+
# scales=[8],
46+
scales=[2, 4, 8, 16],
47+
ratios=[0.5, 1.0, 2.0],
48+
strides=[4, 8, 16, 32, 64]
49+
),
50+
bbox_coder=dict(
51+
type='DeltaXYWHBBoxCoder',
52+
target_means=[.0, .0, .0, .0],
53+
target_stds=[1.0, 1.0, 1.0, 1.0]
54+
),
55+
loss_cls=dict(
56+
type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0
57+
),
58+
loss_bbox=dict(type='L1Loss', loss_weight=1.0)
59+
),
60+
roi_head=dict(
61+
type='StandardRoIHead',
62+
bbox_roi_extractor=dict(
63+
type='SingleRoIExtractor',
64+
roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
65+
out_channels=256,
66+
featmap_strides=[4, 8, 16, 32]
67+
),
68+
bbox_head=dict(
69+
type='Shared2FCBBoxHead',
70+
in_channels=256,
71+
fc_out_channels=1024,
72+
roi_feat_size=7,
73+
num_classes=2, # Vehicle, Human
74+
bbox_coder=dict(
75+
type='DeltaXYWHBBoxCoder',
76+
target_means=[0., 0., 0., 0.],
77+
target_stds=[0.1, 0.1, 0.2, 0.2]
78+
),
79+
reg_class_agnostic=False,
80+
loss_cls=dict(
81+
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0
82+
),
83+
loss_bbox=dict(type='L1Loss', loss_weight=1.0)
84+
)
85+
),
86+
# Training config
87+
train_cfg=dict(
88+
rpn=dict(
89+
assigner=dict(
90+
type='MaxIoUAssigner',
91+
pos_iou_thr=0.7,
92+
neg_iou_thr=0.3,
93+
min_pos_iou=0.3,
94+
match_low_quality=True,
95+
ignore_iof_thr=-1
96+
),
97+
sampler=dict(
98+
type='RandomSampler',
99+
num=256,
100+
pos_fraction=0.5,
101+
neg_pos_ub=-1,
102+
add_gt_as_proposals=False
103+
),
104+
allowed_border=-1,
105+
pos_weight=-1,
106+
debug=False
107+
),
108+
rpn_proposal=dict(
109+
nms_pre=2000,
110+
max_per_img=1000,
111+
nms=dict(type='nms', iou_threshold=0.7),
112+
min_bbox_size=0
113+
),
114+
rcnn=dict(
115+
assigner=dict(
116+
type='MaxIoUAssigner',
117+
pos_iou_thr=0.5, # 🔥 0.5 → 0.3
118+
neg_iou_thr=0.5, # 🔥 0.5 → 0.1
119+
min_pos_iou=0.5, # 🔥 0.5 → 0.1
120+
match_low_quality=False, # 🔥 False → True
121+
ignore_iof_thr=-1
122+
),
123+
sampler=dict(
124+
type='RandomSampler',
125+
num=512,
126+
pos_fraction=0.25,
127+
neg_pos_ub=-1,
128+
add_gt_as_proposals=True
129+
),
130+
pos_weight=-1,
131+
debug=False
132+
)
133+
),
134+
# Testing config
135+
test_cfg=dict(
136+
rpn=dict(
137+
nms_pre=1000,
138+
max_per_img=1000,
139+
nms=dict(type='nms', iou_threshold=0.7),
140+
min_bbox_size=0
141+
),
142+
rcnn=dict(
143+
score_thr=0.05,
144+
nms=dict(type='nms', iou_threshold=0.5),
145+
max_per_img=100
146+
)
147+
)
148+
)
149+
150+
train_dataloader = dict(
151+
batch_size=4,
152+
num_workers=2,
153+
persistent_workers=True,
154+
sampler=dict(type='DefaultSampler', shuffle=True),
155+
dataset=dict(
156+
data_root=data_root,
157+
ann_file='coco_train_xywh.json',
158+
),
159+
)
160+
161+
val_dataloader = dict(
162+
batch_size=1,
163+
num_workers=2,
164+
persistent_workers=True,
165+
drop_last=False,
166+
sampler=dict(type='DefaultSampler', shuffle=False),
167+
dataset=dict(
168+
data_root=data_root,
169+
ann_file='coco_val_xywh.json',
170+
),
171+
)
172+
173+
test_dataloader = val_dataloader
174+
175+
# Evaluation settings
176+
val_evaluator = dict(
177+
type='CocoMetric',
178+
ann_file=os.path.join(data_root, 'coco_val_xywh.json'), # Fixed: consistent with dataset
179+
metric='bbox',
180+
format_only=False
181+
)
182+
183+
optim_wrapper = dict(
184+
type='OptimWrapper',
185+
optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001),
186+
clip_grad=dict(max_norm=5, norm_type=2),
187+
accumulative_counts=4
188+
)
189+
190+
191+
# Experiment name for logging
192+
experiment_name = 'deliver_cmnext_b2_faster_rcnn_2x_lr0.01_feature_fusion'
193+
194+
# Override work_dir if needed
195+
work_dir = f'./work_dirs/{experiment_name}'

0 commit comments

Comments
 (0)