Stefan Wolf commited on
Commit
22da683
·
1 Parent(s): 5d666d5

Updated exported models.

Browse files
models/swin_base_b32x4-fp16_fungi+val_res_384_cb_epochs_6.py DELETED
@@ -1,283 +0,0 @@
1
- model = dict(
2
- type='ImageClassifier',
3
- backbone=dict(
4
- type='SwinTransformer',
5
- arch='base',
6
- img_size=384,
7
- stage_cfgs=dict(block_cfgs=dict(window_size=12)),
8
- drop_path_rate=0.5,
9
- init_cfg=dict(
10
- type='Pretrained',
11
- checkpoint=
12
- 'https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin-base_3rdparty_in21k-384px.pth',
13
- prefix='backbone')),
14
- neck=dict(type='GlobalAveragePooling'),
15
- head=dict(
16
- type='LinearClsHead',
17
- num_classes=1604,
18
- in_channels=1024,
19
- init_cfg=None,
20
- loss=dict(
21
- type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'),
22
- cal_acc=False),
23
- init_cfg=[
24
- dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.0),
25
- dict(type='Constant', layer='LayerNorm', val=1.0, bias=0.0)
26
- ],
27
- train_cfg=dict())
28
- rand_increasing_policies = [
29
- dict(type='AutoContrast'),
30
- dict(type='Equalize'),
31
- dict(type='Invert'),
32
- dict(type='Rotate', magnitude_key='angle', magnitude_range=(0, 30)),
33
- dict(type='Posterize', magnitude_key='bits', magnitude_range=(4, 0)),
34
- dict(type='Solarize', magnitude_key='thr', magnitude_range=(256, 0)),
35
- dict(
36
- type='SolarizeAdd',
37
- magnitude_key='magnitude',
38
- magnitude_range=(0, 110)),
39
- dict(
40
- type='ColorTransform',
41
- magnitude_key='magnitude',
42
- magnitude_range=(0, 0.9)),
43
- dict(type='Contrast', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
44
- dict(
45
- type='Brightness', magnitude_key='magnitude',
46
- magnitude_range=(0, 0.9)),
47
- dict(
48
- type='Sharpness', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
49
- dict(
50
- type='Shear',
51
- magnitude_key='magnitude',
52
- magnitude_range=(0, 0.3),
53
- direction='horizontal'),
54
- dict(
55
- type='Shear',
56
- magnitude_key='magnitude',
57
- magnitude_range=(0, 0.3),
58
- direction='vertical'),
59
- dict(
60
- type='Translate',
61
- magnitude_key='magnitude',
62
- magnitude_range=(0, 0.45),
63
- direction='horizontal'),
64
- dict(
65
- type='Translate',
66
- magnitude_key='magnitude',
67
- magnitude_range=(0, 0.45),
68
- direction='vertical')
69
- ]
70
- dataset_type = 'Fungi'
71
- data_preprocessor = dict(
72
- num_classes=1604,
73
- mean=[123.675, 116.28, 103.53],
74
- std=[58.395, 57.12, 57.375],
75
- to_rgb=True)
76
- bgr_mean = [103.53, 116.28, 123.675]
77
- bgr_std = [57.375, 57.12, 58.395]
78
- train_pipeline = [
79
- dict(type='LoadImageFromFileFungi'),
80
- dict(
81
- type='RandomResizedCrop',
82
- scale=384,
83
- backend='pillow',
84
- interpolation='bicubic'),
85
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
86
- dict(
87
- type='RandAugment',
88
- policies='timm_increasing',
89
- num_policies=2,
90
- total_level=10,
91
- magnitude_level=9,
92
- magnitude_std=0.5,
93
- hparams=dict(pad_val=[104, 116, 124], interpolation='bicubic')),
94
- dict(
95
- type='RandomErasing',
96
- erase_prob=0.25,
97
- mode='rand',
98
- min_area_ratio=0.02,
99
- max_area_ratio=0.3333333333333333,
100
- fill_color=[103.53, 116.28, 123.675],
101
- fill_std=[57.375, 57.12, 58.395]),
102
- dict(type='PackInputs')
103
- ]
104
- test_pipeline = [
105
- dict(type='LoadImageFromFileFungi'),
106
- dict(
107
- type='ResizeEdge',
108
- scale=438,
109
- edge='short',
110
- backend='pillow',
111
- interpolation='bicubic'),
112
- dict(type='CenterCrop', crop_size=384),
113
- dict(type='PackInputs')
114
- ]
115
- train_dataloader = dict(
116
- pin_memory=True,
117
- persistent_workers=True,
118
- collate_fn=dict(type='default_collate'),
119
- batch_size=32,
120
- num_workers=14,
121
- dataset=dict(
122
- type='ClassBalancedDataset',
123
- oversample_thr=0.01,
124
- dataset=dict(
125
- type='Fungi',
126
- data_root='/scratch/slurm_tmpdir/job_22252118/',
127
- ann_file='FungiCLEF2023_train_metadata_PRODUCTION.csv',
128
- data_prefix='DF20/',
129
- pipeline=[
130
- dict(type='LoadImageFromFileFungi'),
131
- dict(
132
- type='RandomResizedCrop',
133
- scale=384,
134
- backend='pillow',
135
- interpolation='bicubic'),
136
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
137
- dict(
138
- type='RandAugment',
139
- policies='timm_increasing',
140
- num_policies=2,
141
- total_level=10,
142
- magnitude_level=9,
143
- magnitude_std=0.5,
144
- hparams=dict(
145
- pad_val=[104, 116, 124], interpolation='bicubic')),
146
- dict(
147
- type='RandomErasing',
148
- erase_prob=0.25,
149
- mode='rand',
150
- min_area_ratio=0.02,
151
- max_area_ratio=0.3333333333333333,
152
- fill_color=[103.53, 116.28, 123.675],
153
- fill_std=[57.375, 57.12, 58.395]),
154
- dict(type='PackInputs')
155
- ])),
156
- sampler=dict(type='DefaultSampler', shuffle=True))
157
- val_dataloader = dict(
158
- pin_memory=True,
159
- persistent_workers=True,
160
- collate_fn=dict(type='default_collate'),
161
- batch_size=64,
162
- num_workers=12,
163
- dataset=dict(
164
- type='Fungi',
165
- data_root='/scratch/slurm_tmpdir/job_22252118/',
166
- ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
167
- data_prefix='DF21/',
168
- pipeline=[
169
- dict(type='LoadImageFromFileFungi'),
170
- dict(
171
- type='RandomResizedCrop',
172
- scale=384,
173
- backend='pillow',
174
- interpolation='bicubic'),
175
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
176
- dict(
177
- type='RandAugment',
178
- policies='timm_increasing',
179
- num_policies=2,
180
- total_level=10,
181
- magnitude_level=9,
182
- magnitude_std=0.5,
183
- hparams=dict(pad_val=[104, 116, 124],
184
- interpolation='bicubic')),
185
- dict(
186
- type='RandomErasing',
187
- erase_prob=0.25,
188
- mode='rand',
189
- min_area_ratio=0.02,
190
- max_area_ratio=0.3333333333333333,
191
- fill_color=[103.53, 116.28, 123.675],
192
- fill_std=[57.375, 57.12, 58.395]),
193
- dict(type='PackInputs')
194
- ]),
195
- sampler=dict(type='DefaultSampler', shuffle=False))
196
- val_evaluator = dict(
197
- type='SingleLabelMetric', items=['precision', 'recall', 'f1-score'])
198
- test_dataloader = dict(
199
- pin_memory=True,
200
- persistent_workers=True,
201
- collate_fn=dict(type='default_collate'),
202
- batch_size=64,
203
- num_workers=12,
204
- dataset=dict(
205
- type='FungiTest',
206
- data_root='data/fungi2023/',
207
- ann_file='FungiCLEF2023_public_test_metadata_PRODUCTION.csv',
208
- data_prefix='DF21/',
209
- pipeline=[
210
- dict(type='LoadImageFromFileFungi'),
211
- dict(
212
- type='ResizeEdge',
213
- scale=438,
214
- edge='short',
215
- backend='pillow',
216
- interpolation='bicubic'),
217
- dict(type='CenterCrop', crop_size=384),
218
- dict(
219
- type='Normalize',
220
- mean=[123.675, 116.28, 103.53],
221
- std=[58.395, 57.12, 57.375],
222
- to_rgb=True),
223
- dict(type='PackInputs'),
224
- ]),
225
- sampler=dict(type='DefaultSampler', shuffle=False))
226
- test_evaluator = dict(
227
- type='SingleLabelMetric', items=['precision', 'recall', 'f1-score'])
228
- optim_wrapper = dict(
229
- optimizer=dict(
230
- type='AdamW',
231
- lr=6.25e-05,
232
- weight_decay=0.05,
233
- eps=1e-08,
234
- betas=(0.9, 0.999)),
235
- paramwise_cfg=dict(
236
- norm_decay_mult=0.0,
237
- bias_decay_mult=0.0,
238
- flat_decay_mult=0.0,
239
- custom_keys=dict({
240
- '.absolute_pos_embed': dict(decay_mult=0.0),
241
- '.relative_position_bias_table': dict(decay_mult=0.0)
242
- })),
243
- clip_grad=dict(max_norm=5),
244
- type='AmpOptimWrapper')
245
- param_scheduler = [
246
- dict(type='LinearLR', start_factor=0.01, by_epoch=False, end=4200),
247
- dict(type='CosineAnnealingLR', eta_min=0, by_epoch=False, begin=4200)
248
- ]
249
- train_cfg = dict(by_epoch=True, max_epochs=6, val_interval=1)
250
- val_cfg = dict()
251
- test_cfg = dict()
252
- auto_scale_lr = dict(base_batch_size=64, enable=True)
253
- default_scope = 'mmpretrain'
254
- default_hooks = dict(
255
- timer=dict(type='IterTimerHook'),
256
- logger=dict(type='LoggerHook', interval=100),
257
- param_scheduler=dict(type='ParamSchedulerHook'),
258
- checkpoint=dict(type='CheckpointHook', interval=1),
259
- sampler_seed=dict(type='DistSamplerSeedHook'),
260
- visualization=dict(type='VisualizationHook', enable=False))
261
- env_cfg = dict(
262
- cudnn_benchmark=False,
263
- mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
264
- dist_cfg=dict(backend='nccl'))
265
- vis_backends = [
266
- dict(type='LocalVisBackend'),
267
- dict(type='TensorboardVisBackend')
268
- ]
269
- visualizer = dict(
270
- type='UniversalVisualizer',
271
- vis_backends=[
272
- dict(type='LocalVisBackend'),
273
- dict(type='TensorboardVisBackend')
274
- ])
275
- log_level = 'INFO'
276
- load_from = None
277
- resume = False
278
- randomness = dict(seed=None, deterministic=False)
279
- checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin-base_3rdparty_in21k-384px.pth'
280
- custom_imports = dict(
281
- imports=['mmpretrain_custom'], allow_failed_imports=False)
282
- launcher = 'pytorch'
283
- work_dir = './work_dirs/swin_base_b32x4-fp16_fungi+val_res_384_cb_epochs_6'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/swin_base_b32x4-fp16_fungi+val_res_384_cb_epochs_6_20230524-5197a7e6.pth DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5197a7e62e88740e7d950203e52a08996bcc3f6a648367c55ee9631e12220844
3
- size 358213519
 
 
 
 
models/swin_large_b12x6-fp16_fungi+val_res_384_cb_epochs_6.py DELETED
@@ -1,283 +0,0 @@
1
- model = dict(
2
- type='ImageClassifier',
3
- backbone=dict(
4
- type='SwinTransformer',
5
- arch='large',
6
- img_size=384,
7
- stage_cfgs=dict(block_cfgs=dict(window_size=12)),
8
- drop_path_rate=0.5,
9
- init_cfg=dict(
10
- type='Pretrained',
11
- checkpoint=
12
- 'https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin-base_3rdparty_in21k-384px.pth',
13
- prefix='backbone')),
14
- neck=dict(type='GlobalAveragePooling'),
15
- head=dict(
16
- type='LinearClsHead',
17
- num_classes=1604,
18
- in_channels=1536,
19
- init_cfg=None,
20
- loss=dict(
21
- type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'),
22
- cal_acc=False),
23
- init_cfg=[
24
- dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.0),
25
- dict(type='Constant', layer='LayerNorm', val=1.0, bias=0.0)
26
- ],
27
- train_cfg=dict())
28
- rand_increasing_policies = [
29
- dict(type='AutoContrast'),
30
- dict(type='Equalize'),
31
- dict(type='Invert'),
32
- dict(type='Rotate', magnitude_key='angle', magnitude_range=(0, 30)),
33
- dict(type='Posterize', magnitude_key='bits', magnitude_range=(4, 0)),
34
- dict(type='Solarize', magnitude_key='thr', magnitude_range=(256, 0)),
35
- dict(
36
- type='SolarizeAdd',
37
- magnitude_key='magnitude',
38
- magnitude_range=(0, 110)),
39
- dict(
40
- type='ColorTransform',
41
- magnitude_key='magnitude',
42
- magnitude_range=(0, 0.9)),
43
- dict(type='Contrast', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
44
- dict(
45
- type='Brightness', magnitude_key='magnitude',
46
- magnitude_range=(0, 0.9)),
47
- dict(
48
- type='Sharpness', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
49
- dict(
50
- type='Shear',
51
- magnitude_key='magnitude',
52
- magnitude_range=(0, 0.3),
53
- direction='horizontal'),
54
- dict(
55
- type='Shear',
56
- magnitude_key='magnitude',
57
- magnitude_range=(0, 0.3),
58
- direction='vertical'),
59
- dict(
60
- type='Translate',
61
- magnitude_key='magnitude',
62
- magnitude_range=(0, 0.45),
63
- direction='horizontal'),
64
- dict(
65
- type='Translate',
66
- magnitude_key='magnitude',
67
- magnitude_range=(0, 0.45),
68
- direction='vertical')
69
- ]
70
- dataset_type = 'Fungi'
71
- data_preprocessor = dict(
72
- num_classes=1604,
73
- mean=[123.675, 116.28, 103.53],
74
- std=[58.395, 57.12, 57.375],
75
- to_rgb=True)
76
- bgr_mean = [103.53, 116.28, 123.675]
77
- bgr_std = [57.375, 57.12, 58.395]
78
- train_pipeline = [
79
- dict(type='LoadImageFromFileFungi'),
80
- dict(
81
- type='RandomResizedCrop',
82
- scale=384,
83
- backend='pillow',
84
- interpolation='bicubic'),
85
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
86
- dict(
87
- type='RandAugment',
88
- policies='timm_increasing',
89
- num_policies=2,
90
- total_level=10,
91
- magnitude_level=9,
92
- magnitude_std=0.5,
93
- hparams=dict(pad_val=[104, 116, 124], interpolation='bicubic')),
94
- dict(
95
- type='RandomErasing',
96
- erase_prob=0.25,
97
- mode='rand',
98
- min_area_ratio=0.02,
99
- max_area_ratio=0.3333333333333333,
100
- fill_color=[103.53, 116.28, 123.675],
101
- fill_std=[57.375, 57.12, 58.395]),
102
- dict(type='PackInputs')
103
- ]
104
- test_pipeline = [
105
- dict(type='LoadImageFromFileFungi'),
106
- dict(
107
- type='ResizeEdge',
108
- scale=438,
109
- edge='short',
110
- backend='pillow',
111
- interpolation='bicubic'),
112
- dict(type='CenterCrop', crop_size=384),
113
- dict(type='PackInputs')
114
- ]
115
- train_dataloader = dict(
116
- pin_memory=True,
117
- persistent_workers=True,
118
- collate_fn=dict(type='default_collate'),
119
- batch_size=32,
120
- num_workers=14,
121
- dataset=dict(
122
- type='ClassBalancedDataset',
123
- oversample_thr=0.01,
124
- dataset=dict(
125
- type='Fungi',
126
- data_root='/scratch/slurm_tmpdir/job_22252118/',
127
- ann_file='FungiCLEF2023_train_metadata_PRODUCTION.csv',
128
- data_prefix='DF20/',
129
- pipeline=[
130
- dict(type='LoadImageFromFileFungi'),
131
- dict(
132
- type='RandomResizedCrop',
133
- scale=384,
134
- backend='pillow',
135
- interpolation='bicubic'),
136
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
137
- dict(
138
- type='RandAugment',
139
- policies='timm_increasing',
140
- num_policies=2,
141
- total_level=10,
142
- magnitude_level=9,
143
- magnitude_std=0.5,
144
- hparams=dict(
145
- pad_val=[104, 116, 124], interpolation='bicubic')),
146
- dict(
147
- type='RandomErasing',
148
- erase_prob=0.25,
149
- mode='rand',
150
- min_area_ratio=0.02,
151
- max_area_ratio=0.3333333333333333,
152
- fill_color=[103.53, 116.28, 123.675],
153
- fill_std=[57.375, 57.12, 58.395]),
154
- dict(type='PackInputs')
155
- ])),
156
- sampler=dict(type='DefaultSampler', shuffle=True))
157
- val_dataloader = dict(
158
- pin_memory=True,
159
- persistent_workers=True,
160
- collate_fn=dict(type='default_collate'),
161
- batch_size=64,
162
- num_workers=12,
163
- dataset=dict(
164
- type='Fungi',
165
- data_root='/scratch/slurm_tmpdir/job_22252118/',
166
- ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
167
- data_prefix='DF21/',
168
- pipeline=[
169
- dict(type='LoadImageFromFileFungi'),
170
- dict(
171
- type='RandomResizedCrop',
172
- scale=384,
173
- backend='pillow',
174
- interpolation='bicubic'),
175
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
176
- dict(
177
- type='RandAugment',
178
- policies='timm_increasing',
179
- num_policies=2,
180
- total_level=10,
181
- magnitude_level=9,
182
- magnitude_std=0.5,
183
- hparams=dict(pad_val=[104, 116, 124],
184
- interpolation='bicubic')),
185
- dict(
186
- type='RandomErasing',
187
- erase_prob=0.25,
188
- mode='rand',
189
- min_area_ratio=0.02,
190
- max_area_ratio=0.3333333333333333,
191
- fill_color=[103.53, 116.28, 123.675],
192
- fill_std=[57.375, 57.12, 58.395]),
193
- dict(type='PackInputs')
194
- ]),
195
- sampler=dict(type='DefaultSampler', shuffle=False))
196
- val_evaluator = dict(
197
- type='SingleLabelMetric', items=['precision', 'recall', 'f1-score'])
198
- test_dataloader = dict(
199
- pin_memory=True,
200
- persistent_workers=True,
201
- collate_fn=dict(type='default_collate'),
202
- batch_size=32,
203
- num_workers=12,
204
- dataset=dict(
205
- type='FungiTest',
206
- data_root='data/fungi2023/',
207
- ann_file='FungiCLEF2023_public_test_metadata_PRODUCTION.csv',
208
- data_prefix='DF21/',
209
- pipeline=[
210
- dict(type='LoadImageFromFileFungi'),
211
- dict(
212
- type='ResizeEdge',
213
- scale=438,
214
- edge='short',
215
- backend='pillow',
216
- interpolation='bicubic'),
217
- dict(type='CenterCrop', crop_size=384),
218
- dict(
219
- type='Normalize',
220
- mean=[123.675, 116.28, 103.53],
221
- std=[58.395, 57.12, 57.375],
222
- to_rgb=True),
223
- dict(type='PackInputs'),
224
- ]),
225
- sampler=dict(type='DefaultSampler', shuffle=False))
226
- test_evaluator = dict(
227
- type='SingleLabelMetric', items=['precision', 'recall', 'f1-score'])
228
- optim_wrapper = dict(
229
- optimizer=dict(
230
- type='AdamW',
231
- lr=6.25e-05,
232
- weight_decay=0.05,
233
- eps=1e-08,
234
- betas=(0.9, 0.999)),
235
- paramwise_cfg=dict(
236
- norm_decay_mult=0.0,
237
- bias_decay_mult=0.0,
238
- flat_decay_mult=0.0,
239
- custom_keys=dict({
240
- '.absolute_pos_embed': dict(decay_mult=0.0),
241
- '.relative_position_bias_table': dict(decay_mult=0.0)
242
- })),
243
- clip_grad=dict(max_norm=5),
244
- type='AmpOptimWrapper')
245
- param_scheduler = [
246
- dict(type='LinearLR', start_factor=0.01, by_epoch=False, end=4200),
247
- dict(type='CosineAnnealingLR', eta_min=0, by_epoch=False, begin=4200)
248
- ]
249
- train_cfg = dict(by_epoch=True, max_epochs=6, val_interval=1)
250
- val_cfg = dict()
251
- test_cfg = dict()
252
- auto_scale_lr = dict(base_batch_size=64, enable=True)
253
- default_scope = 'mmpretrain'
254
- default_hooks = dict(
255
- timer=dict(type='IterTimerHook'),
256
- logger=dict(type='LoggerHook', interval=100),
257
- param_scheduler=dict(type='ParamSchedulerHook'),
258
- checkpoint=dict(type='CheckpointHook', interval=1),
259
- sampler_seed=dict(type='DistSamplerSeedHook'),
260
- visualization=dict(type='VisualizationHook', enable=False))
261
- env_cfg = dict(
262
- cudnn_benchmark=False,
263
- mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
264
- dist_cfg=dict(backend='nccl'))
265
- vis_backends = [
266
- dict(type='LocalVisBackend'),
267
- dict(type='TensorboardVisBackend')
268
- ]
269
- visualizer = dict(
270
- type='UniversalVisualizer',
271
- vis_backends=[
272
- dict(type='LocalVisBackend'),
273
- dict(type='TensorboardVisBackend')
274
- ])
275
- log_level = 'INFO'
276
- load_from = None
277
- resume = False
278
- randomness = dict(seed=None, deterministic=False)
279
- checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin-base_3rdparty_in21k-384px.pth'
280
- custom_imports = dict(
281
- imports=['mmpretrain_custom'], allow_failed_imports=False)
282
- launcher = 'pytorch'
283
- work_dir = './work_dirs/swin_base_b32x4-fp16_fungi+val_res_384_cb_epochs_6'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/swin_large_b12x6-fp16_fungi+val_res_384_cb_epochs_6_20230524-9582690d.pth DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:9582690db5cf1d4f8d03db3804542adb8164bbf7e9386b30cf9029661fbeb1e1
3
- size 794832796
 
 
 
 
models/swin_large_b12x6-fp16_fungi+val_res_384_cb_epochs_6_no-margin.py DELETED
@@ -1,283 +0,0 @@
1
- model = dict(
2
- type='ImageClassifier',
3
- backbone=dict(
4
- type='SwinTransformer',
5
- arch='large',
6
- img_size=384,
7
- stage_cfgs=dict(block_cfgs=dict(window_size=12)),
8
- drop_path_rate=0.5,
9
- init_cfg=dict(
10
- type='Pretrained',
11
- checkpoint=
12
- 'https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin-base_3rdparty_in21k-384px.pth',
13
- prefix='backbone')),
14
- neck=dict(type='GlobalAveragePooling'),
15
- head=dict(
16
- type='LinearClsHead',
17
- num_classes=1604,
18
- in_channels=1536,
19
- init_cfg=None,
20
- loss=dict(
21
- type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'),
22
- cal_acc=False),
23
- init_cfg=[
24
- dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.0),
25
- dict(type='Constant', layer='LayerNorm', val=1.0, bias=0.0)
26
- ],
27
- train_cfg=dict())
28
- rand_increasing_policies = [
29
- dict(type='AutoContrast'),
30
- dict(type='Equalize'),
31
- dict(type='Invert'),
32
- dict(type='Rotate', magnitude_key='angle', magnitude_range=(0, 30)),
33
- dict(type='Posterize', magnitude_key='bits', magnitude_range=(4, 0)),
34
- dict(type='Solarize', magnitude_key='thr', magnitude_range=(256, 0)),
35
- dict(
36
- type='SolarizeAdd',
37
- magnitude_key='magnitude',
38
- magnitude_range=(0, 110)),
39
- dict(
40
- type='ColorTransform',
41
- magnitude_key='magnitude',
42
- magnitude_range=(0, 0.9)),
43
- dict(type='Contrast', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
44
- dict(
45
- type='Brightness', magnitude_key='magnitude',
46
- magnitude_range=(0, 0.9)),
47
- dict(
48
- type='Sharpness', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
49
- dict(
50
- type='Shear',
51
- magnitude_key='magnitude',
52
- magnitude_range=(0, 0.3),
53
- direction='horizontal'),
54
- dict(
55
- type='Shear',
56
- magnitude_key='magnitude',
57
- magnitude_range=(0, 0.3),
58
- direction='vertical'),
59
- dict(
60
- type='Translate',
61
- magnitude_key='magnitude',
62
- magnitude_range=(0, 0.45),
63
- direction='horizontal'),
64
- dict(
65
- type='Translate',
66
- magnitude_key='magnitude',
67
- magnitude_range=(0, 0.45),
68
- direction='vertical')
69
- ]
70
- dataset_type = 'Fungi'
71
- data_preprocessor = dict(
72
- num_classes=1604,
73
- mean=[123.675, 116.28, 103.53],
74
- std=[58.395, 57.12, 57.375],
75
- to_rgb=True)
76
- bgr_mean = [103.53, 116.28, 123.675]
77
- bgr_std = [57.375, 57.12, 58.395]
78
- train_pipeline = [
79
- dict(type='LoadImageFromFileFungi'),
80
- dict(
81
- type='RandomResizedCrop',
82
- scale=384,
83
- backend='pillow',
84
- interpolation='bicubic'),
85
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
86
- dict(
87
- type='RandAugment',
88
- policies='timm_increasing',
89
- num_policies=2,
90
- total_level=10,
91
- magnitude_level=9,
92
- magnitude_std=0.5,
93
- hparams=dict(pad_val=[104, 116, 124], interpolation='bicubic')),
94
- dict(
95
- type='RandomErasing',
96
- erase_prob=0.25,
97
- mode='rand',
98
- min_area_ratio=0.02,
99
- max_area_ratio=0.3333333333333333,
100
- fill_color=[103.53, 116.28, 123.675],
101
- fill_std=[57.375, 57.12, 58.395]),
102
- dict(type='PackInputs')
103
- ]
104
- test_pipeline = [
105
- dict(type='LoadImageFromFileFungi'),
106
- dict(
107
- type='ResizeEdge',
108
- scale=438,
109
- edge='short',
110
- backend='pillow',
111
- interpolation='bicubic'),
112
- dict(type='CenterCrop', crop_size=384),
113
- dict(type='PackInputs')
114
- ]
115
- train_dataloader = dict(
116
- pin_memory=True,
117
- persistent_workers=True,
118
- collate_fn=dict(type='default_collate'),
119
- batch_size=32,
120
- num_workers=14,
121
- dataset=dict(
122
- type='ClassBalancedDataset',
123
- oversample_thr=0.01,
124
- dataset=dict(
125
- type='Fungi',
126
- data_root='/scratch/slurm_tmpdir/job_22252118/',
127
- ann_file='FungiCLEF2023_train_metadata_PRODUCTION.csv',
128
- data_prefix='DF20/',
129
- pipeline=[
130
- dict(type='LoadImageFromFileFungi'),
131
- dict(
132
- type='RandomResizedCrop',
133
- scale=384,
134
- backend='pillow',
135
- interpolation='bicubic'),
136
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
137
- dict(
138
- type='RandAugment',
139
- policies='timm_increasing',
140
- num_policies=2,
141
- total_level=10,
142
- magnitude_level=9,
143
- magnitude_std=0.5,
144
- hparams=dict(
145
- pad_val=[104, 116, 124], interpolation='bicubic')),
146
- dict(
147
- type='RandomErasing',
148
- erase_prob=0.25,
149
- mode='rand',
150
- min_area_ratio=0.02,
151
- max_area_ratio=0.3333333333333333,
152
- fill_color=[103.53, 116.28, 123.675],
153
- fill_std=[57.375, 57.12, 58.395]),
154
- dict(type='PackInputs')
155
- ])),
156
- sampler=dict(type='DefaultSampler', shuffle=True))
157
- val_dataloader = dict(
158
- pin_memory=True,
159
- persistent_workers=True,
160
- collate_fn=dict(type='default_collate'),
161
- batch_size=64,
162
- num_workers=12,
163
- dataset=dict(
164
- type='Fungi',
165
- data_root='/scratch/slurm_tmpdir/job_22252118/',
166
- ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
167
- data_prefix='DF21/',
168
- pipeline=[
169
- dict(type='LoadImageFromFileFungi'),
170
- dict(
171
- type='RandomResizedCrop',
172
- scale=384,
173
- backend='pillow',
174
- interpolation='bicubic'),
175
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
176
- dict(
177
- type='RandAugment',
178
- policies='timm_increasing',
179
- num_policies=2,
180
- total_level=10,
181
- magnitude_level=9,
182
- magnitude_std=0.5,
183
- hparams=dict(pad_val=[104, 116, 124],
184
- interpolation='bicubic')),
185
- dict(
186
- type='RandomErasing',
187
- erase_prob=0.25,
188
- mode='rand',
189
- min_area_ratio=0.02,
190
- max_area_ratio=0.3333333333333333,
191
- fill_color=[103.53, 116.28, 123.675],
192
- fill_std=[57.375, 57.12, 58.395]),
193
- dict(type='PackInputs')
194
- ]),
195
- sampler=dict(type='DefaultSampler', shuffle=False))
196
- val_evaluator = dict(
197
- type='SingleLabelMetric', items=['precision', 'recall', 'f1-score'])
198
- test_dataloader = dict(
199
- pin_memory=True,
200
- persistent_workers=True,
201
- collate_fn=dict(type='default_collate'),
202
- batch_size=32,
203
- num_workers=12,
204
- dataset=dict(
205
- type='FungiTest',
206
- data_root='data/fungi2023/',
207
- ann_file='FungiCLEF2023_public_test_metadata_PRODUCTION.csv',
208
- data_prefix='DF21/',
209
- pipeline=[
210
- dict(type='LoadImageFromFileFungi'),
211
- dict(
212
- type='ResizeEdge',
213
- scale=384,
214
- edge='short',
215
- backend='pillow',
216
- interpolation='bicubic'),
217
- dict(type='CenterCrop', crop_size=384),
218
- dict(
219
- type='Normalize',
220
- mean=[123.675, 116.28, 103.53],
221
- std=[58.395, 57.12, 57.375],
222
- to_rgb=True),
223
- dict(type='PackInputs'),
224
- ]),
225
- sampler=dict(type='DefaultSampler', shuffle=False))
226
- test_evaluator = dict(
227
- type='SingleLabelMetric', items=['precision', 'recall', 'f1-score'])
228
- optim_wrapper = dict(
229
- optimizer=dict(
230
- type='AdamW',
231
- lr=6.25e-05,
232
- weight_decay=0.05,
233
- eps=1e-08,
234
- betas=(0.9, 0.999)),
235
- paramwise_cfg=dict(
236
- norm_decay_mult=0.0,
237
- bias_decay_mult=0.0,
238
- flat_decay_mult=0.0,
239
- custom_keys=dict({
240
- '.absolute_pos_embed': dict(decay_mult=0.0),
241
- '.relative_position_bias_table': dict(decay_mult=0.0)
242
- })),
243
- clip_grad=dict(max_norm=5),
244
- type='AmpOptimWrapper')
245
- param_scheduler = [
246
- dict(type='LinearLR', start_factor=0.01, by_epoch=False, end=4200),
247
- dict(type='CosineAnnealingLR', eta_min=0, by_epoch=False, begin=4200)
248
- ]
249
- train_cfg = dict(by_epoch=True, max_epochs=6, val_interval=1)
250
- val_cfg = dict()
251
- test_cfg = dict()
252
- auto_scale_lr = dict(base_batch_size=64, enable=True)
253
- default_scope = 'mmpretrain'
254
- default_hooks = dict(
255
- timer=dict(type='IterTimerHook'),
256
- logger=dict(type='LoggerHook', interval=100),
257
- param_scheduler=dict(type='ParamSchedulerHook'),
258
- checkpoint=dict(type='CheckpointHook', interval=1),
259
- sampler_seed=dict(type='DistSamplerSeedHook'),
260
- visualization=dict(type='VisualizationHook', enable=False))
261
- env_cfg = dict(
262
- cudnn_benchmark=False,
263
- mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
264
- dist_cfg=dict(backend='nccl'))
265
- vis_backends = [
266
- dict(type='LocalVisBackend'),
267
- dict(type='TensorboardVisBackend')
268
- ]
269
- visualizer = dict(
270
- type='UniversalVisualizer',
271
- vis_backends=[
272
- dict(type='LocalVisBackend'),
273
- dict(type='TensorboardVisBackend')
274
- ])
275
- log_level = 'INFO'
276
- load_from = None
277
- resume = False
278
- randomness = dict(seed=None, deterministic=False)
279
- checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-transformer/convert/swin-base_3rdparty_in21k-384px.pth'
280
- custom_imports = dict(
281
- imports=['mmpretrain_custom'], allow_failed_imports=False)
282
- launcher = 'pytorch'
283
- work_dir = './work_dirs/swin_base_b32x4-fp16_fungi+val_res_384_cb_epochs_6'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/{swinv2_base_w24_b32x4-fp16_fungi+val_res_384_cb_epochs_6.py → swinv2_base_w24_b16x4-fp16_fungi+val_res_384_cb_epochs_6.py} RENAMED
@@ -1,284 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  model = dict(
2
- type='ImageClassifier',
3
  backbone=dict(
4
- type='SwinTransformerV2',
5
  arch='base',
6
- img_size=384,
7
  drop_path_rate=0.2,
8
- window_size=[24, 24, 24, 12],
9
- pretrained_window_sizes=[12, 12, 12, 6],
10
  init_cfg=dict(
11
- type='Pretrained',
12
  checkpoint=
13
  'https://download.openmmlab.com/mmclassification/v0/swin-v2/pretrain/swinv2-base-w12_3rdparty_in21k-192px_20220803-f7dc9763.pth',
14
- prefix='backbone')),
15
- neck=dict(type='GlobalAveragePooling'),
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  head=dict(
17
- type='LinearClsHead',
18
- num_classes=1604,
19
  in_channels=1024,
20
  init_cfg=None,
21
  loss=dict(
22
- type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'),
23
- cal_acc=False),
 
24
  init_cfg=[
25
- dict(type='TruncNormal', layer='Linear', std=0.02, bias=0.0),
26
- dict(type='Constant', layer='LayerNorm', val=1.0, bias=0.0)
27
  ],
28
- train_cfg=dict())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  rand_increasing_policies = [
30
  dict(type='AutoContrast'),
31
  dict(type='Equalize'),
32
  dict(type='Invert'),
33
- dict(type='Rotate', magnitude_key='angle', magnitude_range=(0, 30)),
34
- dict(type='Posterize', magnitude_key='bits', magnitude_range=(4, 0)),
35
- dict(type='Solarize', magnitude_key='thr', magnitude_range=(256, 0)),
 
 
 
 
 
 
 
 
 
36
  dict(
37
- type='SolarizeAdd',
38
  magnitude_key='magnitude',
39
- magnitude_range=(0, 110)),
 
 
 
 
40
  dict(
41
- type='ColorTransform',
42
  magnitude_key='magnitude',
43
- magnitude_range=(0, 0.9)),
44
- dict(type='Contrast', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
45
- dict(
46
- type='Brightness', magnitude_key='magnitude',
47
- magnitude_range=(0, 0.9)),
48
  dict(
49
- type='Sharpness', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
 
 
 
50
  dict(
51
- type='Shear',
52
  magnitude_key='magnitude',
53
- magnitude_range=(0, 0.3),
54
- direction='horizontal'),
 
 
 
55
  dict(
56
- type='Shear',
57
  magnitude_key='magnitude',
58
- magnitude_range=(0, 0.3),
59
- direction='vertical'),
 
 
 
60
  dict(
61
- type='Translate',
62
  magnitude_key='magnitude',
63
- magnitude_range=(0, 0.45),
64
- direction='horizontal'),
 
 
 
65
  dict(
66
- type='Translate',
67
  magnitude_key='magnitude',
68
- magnitude_range=(0, 0.45),
69
- direction='vertical')
70
- ]
71
- dataset_type = 'Fungi'
72
- data_preprocessor = dict(
73
- num_classes=1604,
74
- mean=[123.675, 116.28, 103.53],
75
- std=[58.395, 57.12, 57.375],
76
- to_rgb=True)
77
- bgr_mean = [103.53, 116.28, 123.675]
78
- bgr_std = [57.375, 57.12, 58.395]
79
- train_pipeline = [
80
- dict(type='LoadImageFromFileFungi'),
81
- dict(
82
- type='RandomResizedCrop',
83
- scale=384,
84
- backend='pillow',
85
- interpolation='bicubic'),
86
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
87
  dict(
88
- type='RandAugment',
89
- policies='timm_increasing',
90
- num_policies=2,
91
- total_level=10,
92
- magnitude_level=9,
93
- magnitude_std=0.5,
94
- hparams=dict(pad_val=[104, 116, 124], interpolation='bicubic')),
95
  dict(
96
- type='RandomErasing',
97
- erase_prob=0.25,
98
- mode='rand',
99
- min_area_ratio=0.02,
100
- max_area_ratio=0.3333333333333333,
101
- fill_color=[103.53, 116.28, 123.675],
102
- fill_std=[57.375, 57.12, 58.395]),
103
- dict(type='PackInputs')
104
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  test_pipeline = [
106
  dict(type='LoadImageFromFileFungi'),
107
  dict(
108
- type='ResizeEdge',
109
- scale=438,
110
- edge='short',
111
  backend='pillow',
112
- interpolation='bicubic'),
113
- dict(type='CenterCrop', crop_size=384),
114
- dict(type='PackInputs')
 
 
 
115
  ]
 
116
  train_dataloader = dict(
117
- pin_memory=True,
118
- persistent_workers=True,
119
  collate_fn=dict(type='default_collate'),
120
- batch_size=32,
121
- num_workers=14,
122
  dataset=dict(
123
- type='ClassBalancedDataset',
124
- oversample_thr=0.01,
125
  dataset=dict(
126
- type='Fungi',
127
- data_root='/scratch/slurm_tmpdir/job_22252299/',
128
  ann_file='FungiCLEF2023_train_metadata_PRODUCTION.csv',
129
  data_prefix='DF20/',
 
130
  pipeline=[
131
  dict(type='LoadImageFromFileFungi'),
132
  dict(
133
- type='RandomResizedCrop',
134
- scale=384,
135
  backend='pillow',
136
- interpolation='bicubic'),
137
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
 
 
138
  dict(
139
- type='RandAugment',
140
- policies='timm_increasing',
141
- num_policies=2,
142
- total_level=10,
 
 
143
  magnitude_level=9,
144
  magnitude_std=0.5,
145
- hparams=dict(
146
- pad_val=[104, 116, 124], interpolation='bicubic')),
 
 
147
  dict(
148
- type='RandomErasing',
149
  erase_prob=0.25,
150
- mode='rand',
151
- min_area_ratio=0.02,
 
 
 
 
 
 
 
 
152
  max_area_ratio=0.3333333333333333,
153
- fill_color=[103.53, 116.28, 123.675],
154
- fill_std=[57.375, 57.12, 58.395]),
155
- dict(type='PackInputs')
156
- ])),
157
- sampler=dict(type='DefaultSampler', shuffle=True))
158
- val_dataloader = dict(
159
- pin_memory=True,
 
 
160
  persistent_workers=True,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  collate_fn=dict(type='default_collate'),
162
- batch_size=64,
163
- num_workers=12,
164
  dataset=dict(
165
- type='Fungi',
166
- data_root='/scratch/slurm_tmpdir/job_22252299/',
167
  ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
168
  data_prefix='DF21/',
 
169
  pipeline=[
170
  dict(type='LoadImageFromFileFungi'),
171
  dict(
172
- type='RandomResizedCrop',
173
- scale=384,
174
  backend='pillow',
175
- interpolation='bicubic'),
176
- dict(type='RandomFlip', prob=0.5, direction='horizontal'),
177
- dict(
178
- type='RandAugment',
179
- policies='timm_increasing',
180
- num_policies=2,
181
- total_level=10,
182
- magnitude_level=9,
183
- magnitude_std=0.5,
184
- hparams=dict(pad_val=[104, 116, 124],
185
- interpolation='bicubic')),
186
- dict(
187
- type='RandomErasing',
188
- erase_prob=0.25,
189
- mode='rand',
190
- min_area_ratio=0.02,
191
- max_area_ratio=0.3333333333333333,
192
- fill_color=[103.53, 116.28, 123.675],
193
- fill_std=[57.375, 57.12, 58.395]),
194
- dict(type='PackInputs')
195
- ]),
196
- sampler=dict(type='DefaultSampler', shuffle=False))
197
- val_evaluator = dict(
198
- type='SingleLabelMetric', items=['precision', 'recall', 'f1-score'])
199
- test_dataloader = dict(
200
- pin_memory=True,
201
- persistent_workers=True,
202
- collate_fn=dict(type='default_collate'),
203
- batch_size=64,
204
- num_workers=12,
205
- dataset=dict(
206
- type='FungiTest',
207
- data_root='data/fungi2023/',
208
- ann_file='FungiCLEF2023_public_test_metadata_PRODUCTION.csv',
209
- data_prefix='DF21/',
210
- pipeline=[
211
- dict(type='LoadImageFromFileFungi'),
212
- dict(
213
- type='ResizeEdge',
214
- scale=438,
215
  edge='short',
216
- backend='pillow',
217
- interpolation='bicubic'),
218
- dict(type='CenterCrop', crop_size=384),
219
- dict(
220
- type='Normalize',
221
- mean=[123.675, 116.28, 103.53],
222
- std=[58.395, 57.12, 57.375],
223
- to_rgb=True),
224
  dict(type='PackInputs'),
225
- ]),
226
- sampler=dict(type='DefaultSampler', shuffle=False))
227
- test_evaluator = dict(
228
- type='SingleLabelMetric', items=['precision', 'recall', 'f1-score'])
229
- optim_wrapper = dict(
230
- optimizer=dict(
231
- type='AdamW',
232
- lr=6.25e-05,
233
- weight_decay=0.05,
234
- eps=1e-08,
235
- betas=(0.9, 0.999)),
236
- paramwise_cfg=dict(
237
- norm_decay_mult=0.0,
238
- bias_decay_mult=0.0,
239
- flat_decay_mult=0.0,
240
- custom_keys=dict({
241
- '.absolute_pos_embed': dict(decay_mult=0.0),
242
- '.relative_position_bias_table': dict(decay_mult=0.0)
243
- })),
244
- clip_grad=dict(max_norm=5),
245
- type='AmpOptimWrapper')
246
- param_scheduler = [
247
- dict(type='LinearLR', start_factor=0.01, by_epoch=False, end=4200),
248
- dict(type='CosineAnnealingLR', eta_min=0, by_epoch=False, begin=4200)
249
- ]
250
- train_cfg = dict(by_epoch=True, max_epochs=6, val_interval=1)
251
- val_cfg = dict()
252
- test_cfg = dict()
253
- auto_scale_lr = dict(base_batch_size=64, enable=True)
254
- default_scope = 'mmpretrain'
255
- default_hooks = dict(
256
- timer=dict(type='IterTimerHook'),
257
- logger=dict(type='LoggerHook', interval=100),
258
- param_scheduler=dict(type='ParamSchedulerHook'),
259
- checkpoint=dict(type='CheckpointHook', interval=1),
260
- sampler_seed=dict(type='DistSamplerSeedHook'),
261
- visualization=dict(type='VisualizationHook', enable=False))
262
- env_cfg = dict(
263
- cudnn_benchmark=False,
264
- mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
265
- dist_cfg=dict(backend='nccl'))
266
  vis_backends = [
267
  dict(type='LocalVisBackend'),
268
- dict(type='TensorboardVisBackend')
269
  ]
270
  visualizer = dict(
271
  type='UniversalVisualizer',
272
  vis_backends=[
273
  dict(type='LocalVisBackend'),
274
- dict(type='TensorboardVisBackend')
275
  ])
276
- log_level = 'INFO'
277
- load_from = None
278
- resume = False
279
- randomness = dict(seed=None, deterministic=False)
280
- checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-v2/pretrain/swinv2-base-w12_3rdparty_in21k-192px_20220803-f7dc9763.pth'
281
- custom_imports = dict(
282
- imports=['mmpretrain_custom'], allow_failed_imports=False)
283
- launcher = 'pytorch'
284
- work_dir = './work_dirs/swinv2_base_w24_b32x4-fp16_fungi+val_res_384_cb_epochs_6'
 
1
+ auto_scale_lr = dict(base_batch_size=64)
2
+ bgr_mean = [
3
+ 103.53,
4
+ 116.28,
5
+ 123.675,
6
+ ]
7
+ bgr_std = [
8
+ 57.375,
9
+ 57.12,
10
+ 58.395,
11
+ ]
12
+ checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-v2/pretrain/swinv2-base-w12_3rdparty_in21k-192px_20220803-f7dc9763.pth'
13
+ custom_imports = dict(
14
+ allow_failed_imports=False, imports=[
15
+ 'mmpretrain_custom',
16
+ ])
17
+ data_preprocessor = dict(
18
+ mean=[
19
+ 123.675,
20
+ 116.28,
21
+ 103.53,
22
+ ],
23
+ num_classes=1604,
24
+ std=[
25
+ 58.395,
26
+ 57.12,
27
+ 57.375,
28
+ ],
29
+ to_rgb=True)
30
+ dataset_type = 'Fungi'
31
+ default_hooks = dict(
32
+ checkpoint=dict(interval=1, type='CheckpointHook'),
33
+ logger=dict(interval=100, type='LoggerHook'),
34
+ param_scheduler=dict(type='ParamSchedulerHook'),
35
+ sampler_seed=dict(type='DistSamplerSeedHook'),
36
+ timer=dict(type='IterTimerHook'),
37
+ visualization=dict(enable=False, type='VisualizationHook'))
38
+ default_scope = 'mmpretrain'
39
+ env_cfg = dict(
40
+ cudnn_benchmark=False,
41
+ dist_cfg=dict(backend='nccl'),
42
+ mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
43
+ launcher = 'pytorch'
44
+ load_from = None
45
+ log_level = 'INFO'
46
  model = dict(
 
47
  backbone=dict(
 
48
  arch='base',
 
49
  drop_path_rate=0.2,
50
+ img_size=384,
 
51
  init_cfg=dict(
 
52
  checkpoint=
53
  'https://download.openmmlab.com/mmclassification/v0/swin-v2/pretrain/swinv2-base-w12_3rdparty_in21k-192px_20220803-f7dc9763.pth',
54
+ prefix='backbone',
55
+ type='Pretrained'),
56
+ pretrained_window_sizes=[
57
+ 12,
58
+ 12,
59
+ 12,
60
+ 6,
61
+ ],
62
+ type='SwinTransformerV2',
63
+ window_size=[
64
+ 24,
65
+ 24,
66
+ 24,
67
+ 12,
68
+ ]),
69
  head=dict(
70
+ cal_acc=False,
 
71
  in_channels=1024,
72
  init_cfg=None,
73
  loss=dict(
74
+ label_smooth_val=0.1, mode='original', type='LabelSmoothLoss'),
75
+ num_classes=1604,
76
+ type='LinearClsHead'),
77
  init_cfg=[
78
+ dict(bias=0.0, layer='Linear', std=0.02, type='TruncNormal'),
79
+ dict(bias=0.0, layer='LayerNorm', type='Constant', val=1.0),
80
  ],
81
+ neck=dict(type='GlobalAveragePooling'),
82
+ train_cfg=dict(),
83
+ type='ImageClassifier')
84
+ optim_wrapper = dict(
85
+ clip_grad=dict(max_norm=5),
86
+ optimizer=dict(
87
+ betas=(
88
+ 0.9,
89
+ 0.999,
90
+ ),
91
+ eps=1e-08,
92
+ lr=3.125e-05,
93
+ type='AdamW',
94
+ weight_decay=0.05),
95
+ paramwise_cfg=dict(
96
+ bias_decay_mult=0.0,
97
+ custom_keys=dict({
98
+ '.absolute_pos_embed': dict(decay_mult=0.0),
99
+ '.relative_position_bias_table': dict(decay_mult=0.0)
100
+ }),
101
+ flat_decay_mult=0.0,
102
+ norm_decay_mult=0.0),
103
+ type='AmpOptimWrapper')
104
+ param_scheduler = [
105
+ dict(by_epoch=False, end=4200, start_factor=0.01, type='LinearLR'),
106
+ dict(begin=4200, by_epoch=False, eta_min=0, type='CosineAnnealingLR'),
107
+ ]
108
  rand_increasing_policies = [
109
  dict(type='AutoContrast'),
110
  dict(type='Equalize'),
111
  dict(type='Invert'),
112
+ dict(magnitude_key='angle', magnitude_range=(
113
+ 0,
114
+ 30,
115
+ ), type='Rotate'),
116
+ dict(magnitude_key='bits', magnitude_range=(
117
+ 4,
118
+ 0,
119
+ ), type='Posterize'),
120
+ dict(magnitude_key='thr', magnitude_range=(
121
+ 256,
122
+ 0,
123
+ ), type='Solarize'),
124
  dict(
 
125
  magnitude_key='magnitude',
126
+ magnitude_range=(
127
+ 0,
128
+ 110,
129
+ ),
130
+ type='SolarizeAdd'),
131
  dict(
 
132
  magnitude_key='magnitude',
133
+ magnitude_range=(
134
+ 0,
135
+ 0.9,
136
+ ),
137
+ type='ColorTransform'),
138
  dict(
139
+ magnitude_key='magnitude', magnitude_range=(
140
+ 0,
141
+ 0.9,
142
+ ), type='Contrast'),
143
  dict(
 
144
  magnitude_key='magnitude',
145
+ magnitude_range=(
146
+ 0,
147
+ 0.9,
148
+ ),
149
+ type='Brightness'),
150
  dict(
 
151
  magnitude_key='magnitude',
152
+ magnitude_range=(
153
+ 0,
154
+ 0.9,
155
+ ),
156
+ type='Sharpness'),
157
  dict(
158
+ direction='horizontal',
159
  magnitude_key='magnitude',
160
+ magnitude_range=(
161
+ 0,
162
+ 0.3,
163
+ ),
164
+ type='Shear'),
165
  dict(
166
+ direction='vertical',
167
  magnitude_key='magnitude',
168
+ magnitude_range=(
169
+ 0,
170
+ 0.3,
171
+ ),
172
+ type='Shear'),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  dict(
174
+ direction='horizontal',
175
+ magnitude_key='magnitude',
176
+ magnitude_range=(
177
+ 0,
178
+ 0.45,
179
+ ),
180
+ type='Translate'),
181
  dict(
182
+ direction='vertical',
183
+ magnitude_key='magnitude',
184
+ magnitude_range=(
185
+ 0,
186
+ 0.45,
187
+ ),
188
+ type='Translate'),
 
189
  ]
190
+ randomness = dict(deterministic=False, seed=None)
191
+ resume = False
192
+ test_cfg = dict()
193
+ test_dataloader = dict(
194
+ batch_size=64,
195
+ collate_fn=dict(type='default_collate'),
196
+ dataset=dict(
197
+ ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
198
+ data_prefix='DF21/',
199
+ data_root='data/fungi2024/',
200
+ pipeline=[
201
+ dict(type='LoadImageFromFileFungi'),
202
+ dict(
203
+ backend='pillow',
204
+ edge='short',
205
+ interpolation='bicubic',
206
+ scale=438,
207
+ type='ResizeEdge'),
208
+ dict(crop_size=384, type='CenterCrop'),
209
+ dict(type='PackInputs'),
210
+ ],
211
+ type='FungiTest'),
212
+ num_workers=8,
213
+ persistent_workers=True,
214
+ pin_memory=True,
215
+ sampler=dict(shuffle=False, type='DefaultSampler'))
216
+ test_evaluator = dict(
217
+ items=[
218
+ 'precision',
219
+ 'recall',
220
+ 'f1-score',
221
+ ], type='SingleLabelMetric')
222
  test_pipeline = [
223
  dict(type='LoadImageFromFileFungi'),
224
  dict(
 
 
 
225
  backend='pillow',
226
+ edge='short',
227
+ interpolation='bicubic',
228
+ scale=438,
229
+ type='ResizeEdge'),
230
+ dict(crop_size=384, type='CenterCrop'),
231
+ dict(type='PackInputs'),
232
  ]
233
+ train_cfg = dict(by_epoch=True, max_epochs=6, val_interval=1)
234
  train_dataloader = dict(
235
+ batch_size=16,
 
236
  collate_fn=dict(type='default_collate'),
 
 
237
  dataset=dict(
 
 
238
  dataset=dict(
 
 
239
  ann_file='FungiCLEF2023_train_metadata_PRODUCTION.csv',
240
  data_prefix='DF20/',
241
+ data_root='data/fungi2024/',
242
  pipeline=[
243
  dict(type='LoadImageFromFileFungi'),
244
  dict(
 
 
245
  backend='pillow',
246
+ interpolation='bicubic',
247
+ scale=384,
248
+ type='RandomResizedCrop'),
249
+ dict(direction='horizontal', prob=0.5, type='RandomFlip'),
250
  dict(
251
+ hparams=dict(
252
+ interpolation='bicubic', pad_val=[
253
+ 104,
254
+ 116,
255
+ 124,
256
+ ]),
257
  magnitude_level=9,
258
  magnitude_std=0.5,
259
+ num_policies=2,
260
+ policies='timm_increasing',
261
+ total_level=10,
262
+ type='RandAugment'),
263
  dict(
 
264
  erase_prob=0.25,
265
+ fill_color=[
266
+ 103.53,
267
+ 116.28,
268
+ 123.675,
269
+ ],
270
+ fill_std=[
271
+ 57.375,
272
+ 57.12,
273
+ 58.395,
274
+ ],
275
  max_area_ratio=0.3333333333333333,
276
+ min_area_ratio=0.02,
277
+ mode='rand',
278
+ type='RandomErasing'),
279
+ dict(type='PackInputs'),
280
+ ],
281
+ type='Fungi'),
282
+ oversample_thr=0.01,
283
+ type='ClassBalancedDataset'),
284
+ num_workers=14,
285
  persistent_workers=True,
286
+ pin_memory=True,
287
+ sampler=dict(shuffle=True, type='DefaultSampler'))
288
+ train_pipeline = [
289
+ dict(type='LoadImageFromFileFungi'),
290
+ dict(
291
+ backend='pillow',
292
+ interpolation='bicubic',
293
+ scale=384,
294
+ type='RandomResizedCrop'),
295
+ dict(direction='horizontal', prob=0.5, type='RandomFlip'),
296
+ dict(
297
+ hparams=dict(interpolation='bicubic', pad_val=[
298
+ 104,
299
+ 116,
300
+ 124,
301
+ ]),
302
+ magnitude_level=9,
303
+ magnitude_std=0.5,
304
+ num_policies=2,
305
+ policies='timm_increasing',
306
+ total_level=10,
307
+ type='RandAugment'),
308
+ dict(
309
+ erase_prob=0.25,
310
+ fill_color=[
311
+ 103.53,
312
+ 116.28,
313
+ 123.675,
314
+ ],
315
+ fill_std=[
316
+ 57.375,
317
+ 57.12,
318
+ 58.395,
319
+ ],
320
+ max_area_ratio=0.3333333333333333,
321
+ min_area_ratio=0.02,
322
+ mode='rand',
323
+ type='RandomErasing'),
324
+ dict(type='PackInputs'),
325
+ ]
326
+ val_cfg = dict()
327
+ val_dataloader = dict(
328
+ batch_size=16,
329
  collate_fn=dict(type='default_collate'),
 
 
330
  dataset=dict(
 
 
331
  ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
332
  data_prefix='DF21/',
333
+ data_root='data/fungi2024/',
334
  pipeline=[
335
  dict(type='LoadImageFromFileFungi'),
336
  dict(
 
 
337
  backend='pillow',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  edge='short',
339
+ interpolation='bicubic',
340
+ scale=438,
341
+ type='ResizeEdge'),
342
+ dict(crop_size=384, type='CenterCrop'),
 
 
 
 
343
  dict(type='PackInputs'),
344
+ ],
345
+ type='Fungi'),
346
+ num_workers=12,
347
+ persistent_workers=True,
348
+ pin_memory=True,
349
+ sampler=dict(shuffle=False, type='DefaultSampler'))
350
+ val_evaluator = dict(
351
+ items=[
352
+ 'precision',
353
+ 'recall',
354
+ 'f1-score',
355
+ ], type='SingleLabelMetric')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  vis_backends = [
357
  dict(type='LocalVisBackend'),
358
+ dict(type='TensorboardVisBackend'),
359
  ]
360
  visualizer = dict(
361
  type='UniversalVisualizer',
362
  vis_backends=[
363
  dict(type='LocalVisBackend'),
364
+ dict(type='TensorboardVisBackend'),
365
  ])
366
+ work_dir = './work_dirs/swinv2_base_w24_b16x4-fp16_fungi+val_res_384_cb_epochs_6'
 
 
 
 
 
 
 
 
models/{swin_base_b16x4-fp16_fungi_res_384_cb_epochs_6_20230524-8b2afc73.pth → swinv2_base_w24_b16x4-fp16_fungi+val_res_384_cb_epochs_6_epoch_6_20240514-de00365e.pth} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8b2afc73898a5b36a0c4dc1224b6309ccc187ab481e12e1c6ce65992eafb5851
3
- size 358262964
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de00365e7b99a5467cb093480337fa269a7ce814fa271f68ceb5ade913762436
3
+ size 413508870
models/swinv2_base_w24_b32x4-fp16_fungi+val_res_384_cb_epochs_6_20230524-a251a50a.pth DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a251a50a21746e66ee6e0f790cd35104296bc6838d3b1bc490d0c930a117f774
3
- size 413462721
 
 
 
 
models/swinv2_base_w24_b32x4-fp16_fungi+val_res_384_cb_epochs_9_20230525-88a0bc68.pth DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:88a0bc681d60df1eca31fc53db6595c58acfba80d3f8a0518598a01927272550
3
- size 413461441