CVRPDataset commited on
Commit
5e0043e
·
verified ·
1 Parent(s): 527792c

Delete model_configs/CVRP_segformer.py

Browse files
Files changed (1) hide show
  1. model_configs/CVRP_segformer.py +0 -322
model_configs/CVRP_segformer.py DELETED
@@ -1,322 +0,0 @@
1
- checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/segformer/mit_b5_20220624-658746d9.pth'
2
- crop_size = (
3
- 512,
4
- 512,
5
- )
6
- data_preprocessor = dict(
7
- bgr_to_rgb=True,
8
- mean=[
9
- 123.675,
10
- 116.28,
11
- 103.53,
12
- ],
13
- pad_val=0,
14
- seg_pad_val=255,
15
- size=(
16
- 512,
17
- 512,
18
- ),
19
- std=[
20
- 58.395,
21
- 57.12,
22
- 57.375,
23
- ],
24
- type='SegDataPreProcessor')
25
- data_root = 'PanicleDataset/'
26
- dataset_type = 'TzyDataset'
27
- default_hooks = dict(
28
- checkpoint=dict(
29
- by_epoch=False,
30
- interval=2500,
31
- max_keep_ckpts=1,
32
- save_best='mIoU',
33
- type='CheckpointHook'),
34
- logger=dict(interval=100, log_metric_by_epoch=False, type='LoggerHook'),
35
- param_scheduler=dict(type='ParamSchedulerHook'),
36
- sampler_seed=dict(type='DistSamplerSeedHook'),
37
- timer=dict(type='IterTimerHook'),
38
- visualization=dict(type='SegVisualizationHook'))
39
- default_scope = 'mmseg'
40
- env_cfg = dict(
41
- cudnn_benchmark=True,
42
- dist_cfg=dict(backend='nccl'),
43
- mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
44
- img_ratios = [
45
- 0.5,
46
- 0.75,
47
- 1.0,
48
- 1.25,
49
- 1.5,
50
- 1.75,
51
- ]
52
- load_from = None
53
- log_level = 'INFO'
54
- log_processor = dict(by_epoch=False)
55
- model = dict(
56
- backbone=dict(
57
- attn_drop_rate=0.0,
58
- drop_path_rate=0.1,
59
- drop_rate=0.0,
60
- embed_dims=64,
61
- in_channels=3,
62
- init_cfg=dict(
63
- checkpoint=
64
- 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/segformer/mit_b5_20220624-658746d9.pth',
65
- type='Pretrained'),
66
- mlp_ratio=4,
67
- num_heads=[
68
- 1,
69
- 2,
70
- 5,
71
- 8,
72
- ],
73
- num_layers=[
74
- 3,
75
- 6,
76
- 40,
77
- 3,
78
- ],
79
- num_stages=4,
80
- out_indices=(
81
- 0,
82
- 1,
83
- 2,
84
- 3,
85
- ),
86
- patch_sizes=[
87
- 7,
88
- 3,
89
- 3,
90
- 3,
91
- ],
92
- qkv_bias=True,
93
- sr_ratios=[
94
- 8,
95
- 4,
96
- 2,
97
- 1,
98
- ],
99
- type='MixVisionTransformer'),
100
- data_preprocessor=dict(
101
- bgr_to_rgb=True,
102
- mean=[
103
- 123.675,
104
- 116.28,
105
- 103.53,
106
- ],
107
- pad_val=0,
108
- seg_pad_val=255,
109
- size=(
110
- 512,
111
- 512,
112
- ),
113
- std=[
114
- 58.395,
115
- 57.12,
116
- 57.375,
117
- ],
118
- type='SegDataPreProcessor'),
119
- decode_head=dict(
120
- align_corners=False,
121
- channels=256,
122
- dropout_ratio=0.1,
123
- in_channels=[
124
- 64,
125
- 128,
126
- 320,
127
- 512,
128
- ],
129
- in_index=[
130
- 0,
131
- 1,
132
- 2,
133
- 3,
134
- ],
135
- loss_decode=dict(
136
- loss_weight=1.0, type='CrossEntropyLoss', use_sigmoid=False),
137
- norm_cfg=dict(requires_grad=True, type='BN'),
138
- num_classes=2,
139
- type='SegformerHead'),
140
- pretrained=None,
141
- test_cfg=dict(mode='whole'),
142
- train_cfg=dict(),
143
- type='EncoderDecoder')
144
- norm_cfg = dict(requires_grad=True, type='BN')
145
- optim_wrapper = dict(
146
- optimizer=dict(
147
- betas=(
148
- 0.9,
149
- 0.999,
150
- ), lr=6e-05, type='AdamW', weight_decay=0.01),
151
- paramwise_cfg=dict(
152
- custom_keys=dict(
153
- head=dict(lr_mult=10.0),
154
- norm=dict(decay_mult=0.0),
155
- pos_block=dict(decay_mult=0.0))),
156
- type='OptimWrapper')
157
- optimizer = dict(lr=0.01, momentum=0.9, type='SGD', weight_decay=0.0005)
158
- param_scheduler = [
159
- dict(
160
- begin=0, by_epoch=False, end=1500, start_factor=1e-06,
161
- type='LinearLR'),
162
- dict(
163
- begin=1500,
164
- by_epoch=False,
165
- end=160000,
166
- eta_min=0.0,
167
- power=1.0,
168
- type='PolyLR'),
169
- ]
170
- randomness = dict(seed=0)
171
- resume = False
172
- test_cfg = dict(type='TestLoop')
173
- test_dataloader = dict(
174
- batch_size=1,
175
- dataset=dict(
176
- data_prefix=dict(img_path='img_dir/val', seg_map_path='ann_dir/val'),
177
- data_root='PanicleDataset/',
178
- pipeline=[
179
- dict(type='LoadImageFromFile'),
180
- dict(keep_ratio=True, scale=(
181
- 2048,
182
- 1024,
183
- ), type='Resize'),
184
- dict(type='LoadAnnotations'),
185
- dict(type='PackSegInputs'),
186
- ],
187
- type='TzyDataset'),
188
- num_workers=4,
189
- persistent_workers=True,
190
- sampler=dict(shuffle=False, type='DefaultSampler'))
191
- test_evaluator = dict(
192
- iou_metrics=[
193
- 'mIoU',
194
- 'mDice',
195
- 'mFscore',
196
- ], type='IoUMetric')
197
- test_pipeline = [
198
- dict(type='LoadImageFromFile'),
199
- dict(keep_ratio=True, scale=(
200
- 2048,
201
- 1024,
202
- ), type='Resize'),
203
- dict(type='LoadAnnotations'),
204
- dict(type='PackSegInputs'),
205
- ]
206
- train_cfg = dict(max_iters=20000, type='IterBasedTrainLoop', val_interval=500)
207
- train_dataloader = dict(
208
- batch_size=2,
209
- dataset=dict(
210
- data_prefix=dict(
211
- img_path='img_dir/train', seg_map_path='ann_dir/train'),
212
- data_root='PanicleDataset/',
213
- pipeline=[
214
- dict(type='LoadImageFromFile'),
215
- dict(type='LoadAnnotations'),
216
- dict(
217
- keep_ratio=True,
218
- ratio_range=(
219
- 0.5,
220
- 2.0,
221
- ),
222
- scale=(
223
- 2048,
224
- 1024,
225
- ),
226
- type='RandomResize'),
227
- dict(
228
- cat_max_ratio=0.75, crop_size=(
229
- 512,
230
- 512,
231
- ), type='RandomCrop'),
232
- dict(prob=0.5, type='RandomFlip'),
233
- dict(type='PhotoMetricDistortion'),
234
- dict(type='PackSegInputs'),
235
- ],
236
- type='TzyDataset'),
237
- num_workers=2,
238
- persistent_workers=True,
239
- sampler=dict(shuffle=True, type='InfiniteSampler'))
240
- train_pipeline = [
241
- dict(type='LoadImageFromFile'),
242
- dict(type='LoadAnnotations'),
243
- dict(
244
- keep_ratio=True,
245
- ratio_range=(
246
- 0.5,
247
- 2.0,
248
- ),
249
- scale=(
250
- 2048,
251
- 1024,
252
- ),
253
- type='RandomResize'),
254
- dict(cat_max_ratio=0.75, crop_size=(
255
- 512,
256
- 512,
257
- ), type='RandomCrop'),
258
- dict(prob=0.5, type='RandomFlip'),
259
- dict(type='PhotoMetricDistortion'),
260
- dict(type='PackSegInputs'),
261
- ]
262
- tta_model = dict(type='SegTTAModel')
263
- tta_pipeline = [
264
- dict(file_client_args=dict(backend='disk'), type='LoadImageFromFile'),
265
- dict(
266
- transforms=[
267
- [
268
- dict(keep_ratio=True, scale_factor=0.5, type='Resize'),
269
- dict(keep_ratio=True, scale_factor=0.75, type='Resize'),
270
- dict(keep_ratio=True, scale_factor=1.0, type='Resize'),
271
- dict(keep_ratio=True, scale_factor=1.25, type='Resize'),
272
- dict(keep_ratio=True, scale_factor=1.5, type='Resize'),
273
- dict(keep_ratio=True, scale_factor=1.75, type='Resize'),
274
- ],
275
- [
276
- dict(direction='horizontal', prob=0.0, type='RandomFlip'),
277
- dict(direction='horizontal', prob=1.0, type='RandomFlip'),
278
- ],
279
- [
280
- dict(type='LoadAnnotations'),
281
- ],
282
- [
283
- dict(type='PackSegInputs'),
284
- ],
285
- ],
286
- type='TestTimeAug'),
287
- ]
288
- val_cfg = dict(type='ValLoop')
289
- val_dataloader = dict(
290
- batch_size=1,
291
- dataset=dict(
292
- data_prefix=dict(img_path='img_dir/val', seg_map_path='ann_dir/val'),
293
- data_root='PanicleDataset/',
294
- pipeline=[
295
- dict(type='LoadImageFromFile'),
296
- dict(keep_ratio=True, scale=(
297
- 2048,
298
- 1024,
299
- ), type='Resize'),
300
- dict(type='LoadAnnotations'),
301
- dict(type='PackSegInputs'),
302
- ],
303
- type='TzyDataset'),
304
- num_workers=4,
305
- persistent_workers=True,
306
- sampler=dict(shuffle=False, type='DefaultSampler'))
307
- val_evaluator = dict(
308
- iou_metrics=[
309
- 'mIoU',
310
- 'mDice',
311
- 'mFscore',
312
- ], type='IoUMetric')
313
- vis_backends = [
314
- dict(type='LocalVisBackend'),
315
- ]
316
- visualizer = dict(
317
- name='visualizer',
318
- type='SegLocalVisualizer',
319
- vis_backends=[
320
- dict(type='LocalVisBackend'),
321
- ])
322
- work_dir = './work_dirs/TzyDataset-Segformer-0721'