KyanChen commited on
Commit
f549064
1 Parent(s): b1c0434
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. .gitignore +5 -0
  3. README.md +1 -1
  4. configs/_base_/datasets/cifar100_bs16.py +45 -0
  5. configs/_base_/datasets/cifar10_bs16.py +45 -0
  6. configs/_base_/datasets/cityscapes_detection.py +66 -0
  7. configs/_base_/datasets/cityscapes_instance.py +96 -0
  8. configs/_base_/datasets/coco_detection.py +85 -0
  9. configs/_base_/datasets/coco_instance.py +85 -0
  10. configs/_base_/datasets/coco_instance_semantic.py +68 -0
  11. configs/_base_/datasets/coco_panoptic.py +86 -0
  12. configs/_base_/datasets/cub_bs8_384.py +51 -0
  13. configs/_base_/datasets/cub_bs8_448.py +50 -0
  14. configs/_base_/datasets/deepfashion.py +83 -0
  15. configs/_base_/datasets/imagenet21k_bs128.py +53 -0
  16. configs/_base_/datasets/imagenet_bs128_mbv3.py +68 -0
  17. configs/_base_/datasets/imagenet_bs128_poolformer_medium_224.py +82 -0
  18. configs/_base_/datasets/imagenet_bs128_poolformer_small_224.py +82 -0
  19. configs/_base_/datasets/imagenet_bs128_revvit_224.py +85 -0
  20. configs/_base_/datasets/imagenet_bs16_eva_196.py +62 -0
  21. configs/_base_/datasets/imagenet_bs16_eva_336.py +62 -0
  22. configs/_base_/datasets/imagenet_bs16_eva_560.py +62 -0
  23. configs/_base_/datasets/imagenet_bs16_pil_bicubic_384.py +55 -0
  24. configs/_base_/datasets/imagenet_bs256_davit_224.py +82 -0
  25. configs/_base_/datasets/imagenet_bs256_rsb_a12.py +74 -0
  26. configs/_base_/datasets/imagenet_bs256_rsb_a3.py +74 -0
  27. configs/_base_/datasets/imagenet_bs32.py +53 -0
  28. configs/_base_/datasets/imagenet_bs32_pil_bicubic.py +62 -0
  29. configs/_base_/datasets/imagenet_bs32_pil_resize.py +53 -0
  30. configs/_base_/datasets/imagenet_bs64.py +53 -0
  31. configs/_base_/datasets/imagenet_bs64_autoaug.py +61 -0
  32. configs/_base_/datasets/imagenet_bs64_clip_224.py +72 -0
  33. configs/_base_/datasets/imagenet_bs64_clip_384.py +72 -0
  34. configs/_base_/datasets/imagenet_bs64_clip_448.py +73 -0
  35. configs/_base_/datasets/imagenet_bs64_convmixer_224.py +82 -0
  36. configs/_base_/datasets/imagenet_bs64_deit3_224.py +82 -0
  37. configs/_base_/datasets/imagenet_bs64_deit3_384.py +62 -0
  38. configs/_base_/datasets/imagenet_bs64_edgenext_256.py +82 -0
  39. configs/_base_/datasets/imagenet_bs64_mixer_224.py +54 -0
  40. configs/_base_/datasets/imagenet_bs64_pil_resize.py +53 -0
  41. configs/_base_/datasets/imagenet_bs64_pil_resize_autoaug.py +70 -0
  42. configs/_base_/datasets/imagenet_bs64_swin_224.py +82 -0
  43. configs/_base_/datasets/imagenet_bs64_swin_256.py +82 -0
  44. configs/_base_/datasets/imagenet_bs64_swin_384.py +56 -0
  45. configs/_base_/datasets/imagenet_bs64_t2t_224.py +82 -0
  46. configs/_base_/datasets/imagenet_bs8_pil_bicubic_320.py +61 -0
  47. configs/_base_/datasets/lvis_v0.5_instance.py +69 -0
  48. configs/_base_/datasets/lvis_v1_instance.py +22 -0
  49. configs/_base_/datasets/objects365v1_detection.py +64 -0
  50. configs/_base_/datasets/objects365v2_detection.py +63 -0
.gitattributes CHANGED
@@ -32,3 +32,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ images/wallaby.png filter=lfs diff=lfs merge=lfs -text
36
+ images/zebra.jpg filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ mmclassification
2
+ mmdetection
3
+ mmsegmentation
4
+ .idea
5
+ .DS_Store
README.md CHANGED
@@ -5,7 +5,7 @@ colorFrom: gray
5
  colorTo: purple
6
  sdk: streamlit
7
  sdk_version: 1.17.0
8
- app_file: app.py
9
  pinned: false
10
  ---
11
 
 
5
  colorTo: purple
6
  sdk: streamlit
7
  sdk_version: 1.17.0
8
+ app_file: main_page.py
9
  pinned: false
10
  ---
11
 
configs/_base_/datasets/cifar100_bs16.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CIFAR100'
3
+ data_preprocessor = dict(
4
+ num_classes=100,
5
+ # RGB format normalization parameters
6
+ mean=[129.304, 124.070, 112.434],
7
+ std=[68.170, 65.392, 70.418],
8
+ # loaded images are already RGB format
9
+ to_rgb=False)
10
+
11
+ train_pipeline = [
12
+ dict(type='RandomCrop', crop_size=32, padding=4),
13
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
14
+ dict(type='PackClsInputs'),
15
+ ]
16
+
17
+ test_pipeline = [
18
+ dict(type='PackClsInputs'),
19
+ ]
20
+
21
+ train_dataloader = dict(
22
+ batch_size=16,
23
+ num_workers=2,
24
+ dataset=dict(
25
+ type=dataset_type,
26
+ data_prefix='data/cifar100',
27
+ test_mode=False,
28
+ pipeline=train_pipeline),
29
+ sampler=dict(type='DefaultSampler', shuffle=True),
30
+ )
31
+
32
+ val_dataloader = dict(
33
+ batch_size=16,
34
+ num_workers=2,
35
+ dataset=dict(
36
+ type=dataset_type,
37
+ data_prefix='data/cifar100/',
38
+ test_mode=True,
39
+ pipeline=test_pipeline),
40
+ sampler=dict(type='DefaultSampler', shuffle=False),
41
+ )
42
+ val_evaluator = dict(type='Accuracy', topk=(1, ))
43
+
44
+ test_dataloader = val_dataloader
45
+ test_evaluator = val_evaluator
configs/_base_/datasets/cifar10_bs16.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CIFAR10'
3
+ data_preprocessor = dict(
4
+ num_classes=10,
5
+ # RGB format normalization parameters
6
+ mean=[125.307, 122.961, 113.8575],
7
+ std=[51.5865, 50.847, 51.255],
8
+ # loaded images are already RGB format
9
+ to_rgb=False)
10
+
11
+ train_pipeline = [
12
+ dict(type='RandomCrop', crop_size=32, padding=4),
13
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
14
+ dict(type='PackClsInputs'),
15
+ ]
16
+
17
+ test_pipeline = [
18
+ dict(type='PackClsInputs'),
19
+ ]
20
+
21
+ train_dataloader = dict(
22
+ batch_size=16,
23
+ num_workers=2,
24
+ dataset=dict(
25
+ type=dataset_type,
26
+ data_prefix='data/cifar10',
27
+ test_mode=False,
28
+ pipeline=train_pipeline),
29
+ sampler=dict(type='DefaultSampler', shuffle=True),
30
+ )
31
+
32
+ val_dataloader = dict(
33
+ batch_size=16,
34
+ num_workers=2,
35
+ dataset=dict(
36
+ type=dataset_type,
37
+ data_prefix='data/cifar10/',
38
+ test_mode=True,
39
+ pipeline=test_pipeline),
40
+ sampler=dict(type='DefaultSampler', shuffle=False),
41
+ )
42
+ val_evaluator = dict(type='Accuracy', topk=(1, ))
43
+
44
+ test_dataloader = val_dataloader
45
+ test_evaluator = val_evaluator
configs/_base_/datasets/cityscapes_detection.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CityscapesDataset'
3
+ data_root = 'data/cityscapes/'
4
+
5
+ train_pipeline = [
6
+ dict(type='LoadImageFromFile'),
7
+ dict(type='LoadAnnotations', with_bbox=True),
8
+ dict(
9
+ type='RandomResize',
10
+ scale=[(2048, 800), (2048, 1024)],
11
+ keep_ratio=True),
12
+ dict(type='RandomFlip', prob=0.5),
13
+ dict(type='PackDetInputs')
14
+ ]
15
+
16
+ test_pipeline = [
17
+ dict(type='LoadImageFromFile'),
18
+ dict(type='Resize', scale=(2048, 1024), keep_ratio=True),
19
+ # If you don't have a gt annotation, delete the pipeline
20
+ dict(type='LoadAnnotations', with_bbox=True),
21
+ dict(
22
+ type='PackDetInputs',
23
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
24
+ 'scale_factor'))
25
+ ]
26
+
27
+ train_dataloader = dict(
28
+ batch_size=1,
29
+ num_workers=2,
30
+ persistent_workers=True,
31
+ sampler=dict(type='DefaultSampler', shuffle=True),
32
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
33
+ dataset=dict(
34
+ type='RepeatDataset',
35
+ times=8,
36
+ dataset=dict(
37
+ type=dataset_type,
38
+ data_root=data_root,
39
+ ann_file='annotations/instancesonly_filtered_gtFine_train.json',
40
+ data_prefix=dict(img='leftImg8bit/train/'),
41
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
42
+ pipeline=train_pipeline)))
43
+
44
+ val_dataloader = dict(
45
+ batch_size=1,
46
+ num_workers=2,
47
+ persistent_workers=True,
48
+ drop_last=False,
49
+ sampler=dict(type='DefaultSampler', shuffle=False),
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root=data_root,
53
+ ann_file='annotations/instancesonly_filtered_gtFine_val.json',
54
+ data_prefix=dict(img='leftImg8bit/val/'),
55
+ test_mode=True,
56
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
57
+ pipeline=test_pipeline))
58
+
59
+ test_dataloader = val_dataloader
60
+
61
+ val_evaluator = dict(
62
+ type='CocoMetric',
63
+ ann_file=data_root + 'annotations/instancesonly_filtered_gtFine_val.json',
64
+ metric='bbox')
65
+
66
+ test_evaluator = val_evaluator
configs/_base_/datasets/cityscapes_instance.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CityscapesDataset'
3
+ data_root = 'data/cityscapes/'
4
+
5
+ train_pipeline = [
6
+ dict(type='LoadImageFromFile'),
7
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
8
+ dict(
9
+ type='RandomResize',
10
+ scale=[(2048, 800), (2048, 1024)],
11
+ keep_ratio=True),
12
+ dict(type='RandomFlip', prob=0.5),
13
+ dict(type='PackDetInputs')
14
+ ]
15
+
16
+ test_pipeline = [
17
+ dict(type='LoadImageFromFile'),
18
+ dict(type='Resize', scale=(2048, 1024), keep_ratio=True),
19
+ # If you don't have a gt annotation, delete the pipeline
20
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
21
+ dict(
22
+ type='PackDetInputs',
23
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
24
+ 'scale_factor'))
25
+ ]
26
+
27
+ train_dataloader = dict(
28
+ batch_size=1,
29
+ num_workers=2,
30
+ persistent_workers=True,
31
+ sampler=dict(type='DefaultSampler', shuffle=True),
32
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
33
+ dataset=dict(
34
+ type='RepeatDataset',
35
+ times=8,
36
+ dataset=dict(
37
+ type=dataset_type,
38
+ data_root=data_root,
39
+ ann_file='annotations/instancesonly_filtered_gtFine_train.json',
40
+ data_prefix=dict(img='leftImg8bit/train/'),
41
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
42
+ pipeline=train_pipeline)))
43
+
44
+ val_dataloader = dict(
45
+ batch_size=1,
46
+ num_workers=2,
47
+ persistent_workers=True,
48
+ drop_last=False,
49
+ sampler=dict(type='DefaultSampler', shuffle=False),
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root=data_root,
53
+ ann_file='annotations/instancesonly_filtered_gtFine_val.json',
54
+ data_prefix=dict(img='leftImg8bit/val/'),
55
+ test_mode=True,
56
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
57
+ pipeline=test_pipeline))
58
+
59
+ test_dataloader = val_dataloader
60
+
61
+ val_evaluator = [
62
+ dict(
63
+ type='CocoMetric',
64
+ ann_file=data_root +
65
+ 'annotations/instancesonly_filtered_gtFine_val.json',
66
+ metric=['bbox', 'segm']),
67
+ dict(
68
+ type='CityScapesMetric',
69
+ ann_file=data_root +
70
+ 'annotations/instancesonly_filtered_gtFine_val.json',
71
+ seg_prefix=data_root + '/gtFine/val',
72
+ outfile_prefix='./work_dirs/cityscapes_metric/instance')
73
+ ]
74
+
75
+ test_evaluator = val_evaluator
76
+
77
+ # inference on test dataset and
78
+ # format the output results for submission.
79
+ # test_dataloader = dict(
80
+ # batch_size=1,
81
+ # num_workers=2,
82
+ # persistent_workers=True,
83
+ # drop_last=False,
84
+ # sampler=dict(type='DefaultSampler', shuffle=False),
85
+ # dataset=dict(
86
+ # type=dataset_type,
87
+ # data_root=data_root,
88
+ # ann_file='annotations/instancesonly_filtered_gtFine_test.json',
89
+ # data_prefix=dict(img='leftImg8bit/test/'),
90
+ # test_mode=True,
91
+ # filter_cfg=dict(filter_empty_gt=True, min_size=32),
92
+ # pipeline=test_pipeline))
93
+ # test_evaluator = dict(
94
+ # type='CityScapesMetric',
95
+ # format_only=True,
96
+ # outfile_prefix='./work_dirs/cityscapes_metric/test')
configs/_base_/datasets/coco_detection.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CocoDataset'
3
+ data_root = 'data/coco/'
4
+
5
+ # file_client_args = dict(
6
+ # backend='petrel',
7
+ # path_mapping=dict({
8
+ # './data/': 's3://openmmlab/datasets/detection/',
9
+ # 'data/': 's3://openmmlab/datasets/detection/'
10
+ # }))
11
+ file_client_args = dict(backend='disk')
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
15
+ dict(type='LoadAnnotations', with_bbox=True),
16
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
17
+ dict(type='RandomFlip', prob=0.5),
18
+ dict(type='PackDetInputs')
19
+ ]
20
+ test_pipeline = [
21
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
22
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
23
+ # If you don't have a gt annotation, delete the pipeline
24
+ dict(type='LoadAnnotations', with_bbox=True),
25
+ dict(
26
+ type='PackDetInputs',
27
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
28
+ 'scale_factor'))
29
+ ]
30
+ train_dataloader = dict(
31
+ batch_size=2,
32
+ num_workers=2,
33
+ persistent_workers=True,
34
+ sampler=dict(type='DefaultSampler', shuffle=True),
35
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
36
+ dataset=dict(
37
+ type=dataset_type,
38
+ data_root=data_root,
39
+ ann_file='annotations/instances_train2017.json',
40
+ data_prefix=dict(img='train2017/'),
41
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
42
+ pipeline=train_pipeline))
43
+ val_dataloader = dict(
44
+ batch_size=1,
45
+ num_workers=2,
46
+ persistent_workers=True,
47
+ drop_last=False,
48
+ sampler=dict(type='DefaultSampler', shuffle=False),
49
+ dataset=dict(
50
+ type=dataset_type,
51
+ data_root=data_root,
52
+ ann_file='annotations/instances_val2017.json',
53
+ data_prefix=dict(img='val2017/'),
54
+ test_mode=True,
55
+ pipeline=test_pipeline))
56
+ test_dataloader = val_dataloader
57
+
58
+ val_evaluator = dict(
59
+ type='CocoMetric',
60
+ ann_file=data_root + 'annotations/instances_val2017.json',
61
+ metric='bbox',
62
+ format_only=False)
63
+ test_evaluator = val_evaluator
64
+
65
+ # inference on test dataset and
66
+ # format the output results for submission.
67
+ # test_dataloader = dict(
68
+ # batch_size=1,
69
+ # num_workers=2,
70
+ # persistent_workers=True,
71
+ # drop_last=False,
72
+ # sampler=dict(type='DefaultSampler', shuffle=False),
73
+ # dataset=dict(
74
+ # type=dataset_type,
75
+ # data_root=data_root,
76
+ # ann_file=data_root + 'annotations/image_info_test-dev2017.json',
77
+ # data_prefix=dict(img='test2017/'),
78
+ # test_mode=True,
79
+ # pipeline=test_pipeline))
80
+ # test_evaluator = dict(
81
+ # type='CocoMetric',
82
+ # metric='bbox',
83
+ # format_only=True,
84
+ # ann_file=data_root + 'annotations/image_info_test-dev2017.json',
85
+ # outfile_prefix='./work_dirs/coco_detection/test')
configs/_base_/datasets/coco_instance.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CocoDataset'
3
+ data_root = 'data/coco/'
4
+
5
+ # file_client_args = dict(
6
+ # backend='petrel',
7
+ # path_mapping=dict({
8
+ # './data/': 's3://openmmlab/datasets/detection/',
9
+ # 'data/': 's3://openmmlab/datasets/detection/'
10
+ # }))
11
+ file_client_args = dict(backend='disk')
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
15
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
16
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
17
+ dict(type='RandomFlip', prob=0.5),
18
+ dict(type='PackDetInputs')
19
+ ]
20
+ test_pipeline = [
21
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
22
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
23
+ # If you don't have a gt annotation, delete the pipeline
24
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
25
+ dict(
26
+ type='PackDetInputs',
27
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
28
+ 'scale_factor'))
29
+ ]
30
+ train_dataloader = dict(
31
+ batch_size=2,
32
+ num_workers=2,
33
+ persistent_workers=True,
34
+ sampler=dict(type='DefaultSampler', shuffle=True),
35
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
36
+ dataset=dict(
37
+ type=dataset_type,
38
+ data_root=data_root,
39
+ ann_file='annotations/instances_train2017.json',
40
+ data_prefix=dict(img='train2017/'),
41
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
42
+ pipeline=train_pipeline))
43
+ val_dataloader = dict(
44
+ batch_size=1,
45
+ num_workers=2,
46
+ persistent_workers=True,
47
+ drop_last=False,
48
+ sampler=dict(type='DefaultSampler', shuffle=False),
49
+ dataset=dict(
50
+ type=dataset_type,
51
+ data_root=data_root,
52
+ ann_file='annotations/instances_val2017.json',
53
+ data_prefix=dict(img='val2017/'),
54
+ test_mode=True,
55
+ pipeline=test_pipeline))
56
+ test_dataloader = val_dataloader
57
+
58
+ val_evaluator = dict(
59
+ type='CocoMetric',
60
+ ann_file=data_root + 'annotations/instances_val2017.json',
61
+ metric=['bbox', 'segm'],
62
+ format_only=False)
63
+ test_evaluator = val_evaluator
64
+
65
+ # inference on test dataset and
66
+ # format the output results for submission.
67
+ # test_dataloader = dict(
68
+ # batch_size=1,
69
+ # num_workers=2,
70
+ # persistent_workers=True,
71
+ # drop_last=False,
72
+ # sampler=dict(type='DefaultSampler', shuffle=False),
73
+ # dataset=dict(
74
+ # type=dataset_type,
75
+ # data_root=data_root,
76
+ # ann_file=data_root + 'annotations/image_info_test-dev2017.json',
77
+ # data_prefix=dict(img='test2017/'),
78
+ # test_mode=True,
79
+ # pipeline=test_pipeline))
80
+ # test_evaluator = dict(
81
+ # type='CocoMetric',
82
+ # metric=['bbox', 'segm'],
83
+ # format_only=True,
84
+ # ann_file=data_root + 'annotations/image_info_test-dev2017.json',
85
+ # outfile_prefix='./work_dirs/coco_instance/test')
configs/_base_/datasets/coco_instance_semantic.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CocoDataset'
3
+ data_root = 'data/coco/'
4
+
5
+ # file_client_args = dict(
6
+ # backend='petrel',
7
+ # path_mapping=dict({
8
+ # './data/': 's3://openmmlab/datasets/detection/',
9
+ # 'data/': 's3://openmmlab/datasets/detection/'
10
+ # }))
11
+ file_client_args = dict(backend='disk')
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
15
+ dict(
16
+ type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=True),
17
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
18
+ dict(type='RandomFlip', prob=0.5),
19
+ dict(type='PackDetInputs')
20
+ ]
21
+ test_pipeline = [
22
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
23
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
24
+ # If you don't have a gt annotation, delete the pipeline
25
+ dict(
26
+ type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=True),
27
+ dict(
28
+ type='PackDetInputs',
29
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
30
+ 'scale_factor'))
31
+ ]
32
+
33
+ train_dataloader = dict(
34
+ batch_size=2,
35
+ num_workers=2,
36
+ persistent_workers=True,
37
+ sampler=dict(type='DefaultSampler', shuffle=True),
38
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
39
+ dataset=dict(
40
+ type=dataset_type,
41
+ data_root=data_root,
42
+ ann_file='annotations/instances_train2017.json',
43
+ data_prefix=dict(img='train2017/', seg='stuffthingmaps/train2017/'),
44
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
45
+ pipeline=train_pipeline))
46
+
47
+ val_dataloader = dict(
48
+ batch_size=1,
49
+ num_workers=2,
50
+ persistent_workers=True,
51
+ drop_last=False,
52
+ sampler=dict(type='DefaultSampler', shuffle=False),
53
+ dataset=dict(
54
+ type=dataset_type,
55
+ data_root=data_root,
56
+ ann_file='annotations/instances_val2017.json',
57
+ data_prefix=dict(img='val2017/'),
58
+ test_mode=True,
59
+ pipeline=test_pipeline))
60
+
61
+ test_dataloader = val_dataloader
62
+
63
+ val_evaluator = dict(
64
+ type='CocoMetric',
65
+ ann_file=data_root + 'annotations/instances_val2017.json',
66
+ metric=['bbox', 'segm'],
67
+ format_only=False)
68
+ test_evaluator = val_evaluator
configs/_base_/datasets/coco_panoptic.py ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CocoPanopticDataset'
3
+ data_root = 'data/coco/'
4
+
5
+ # file_client_args = dict(
6
+ # backend='petrel',
7
+ # path_mapping=dict({
8
+ # './data/': 's3://openmmlab/datasets/detection/',
9
+ # 'data/': 's3://openmmlab/datasets/detection/'
10
+ # }))
11
+ file_client_args = dict(backend='disk')
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
15
+ dict(type='LoadPanopticAnnotations', file_client_args=file_client_args),
16
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
17
+ dict(type='RandomFlip', prob=0.5),
18
+ dict(type='PackDetInputs')
19
+ ]
20
+ test_pipeline = [
21
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
22
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
23
+ dict(type='LoadPanopticAnnotations', file_client_args=file_client_args),
24
+ dict(
25
+ type='PackDetInputs',
26
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
27
+ 'scale_factor'))
28
+ ]
29
+
30
+ train_dataloader = dict(
31
+ batch_size=2,
32
+ num_workers=2,
33
+ persistent_workers=True,
34
+ sampler=dict(type='DefaultSampler', shuffle=True),
35
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
36
+ dataset=dict(
37
+ type=dataset_type,
38
+ data_root=data_root,
39
+ ann_file='annotations/panoptic_train2017.json',
40
+ data_prefix=dict(
41
+ img='train2017/', seg='annotations/panoptic_train2017/'),
42
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
43
+ pipeline=train_pipeline))
44
+ val_dataloader = dict(
45
+ batch_size=1,
46
+ num_workers=2,
47
+ persistent_workers=True,
48
+ drop_last=False,
49
+ sampler=dict(type='DefaultSampler', shuffle=False),
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root=data_root,
53
+ ann_file='annotations/panoptic_val2017.json',
54
+ data_prefix=dict(img='val2017/', seg='annotations/panoptic_val2017/'),
55
+ test_mode=True,
56
+ pipeline=test_pipeline))
57
+ test_dataloader = val_dataloader
58
+
59
+ val_evaluator = dict(
60
+ type='CocoPanopticMetric',
61
+ ann_file=data_root + 'annotations/panoptic_val2017.json',
62
+ seg_prefix=data_root + 'annotations/panoptic_val2017/',
63
+ file_client_args=file_client_args,
64
+ )
65
+ test_evaluator = val_evaluator
66
+
67
+ # inference on test dataset and
68
+ # format the output results for submission.
69
+ # test_dataloader = dict(
70
+ # batch_size=1,
71
+ # num_workers=1,
72
+ # persistent_workers=True,
73
+ # drop_last=False,
74
+ # sampler=dict(type='DefaultSampler', shuffle=False),
75
+ # dataset=dict(
76
+ # type=dataset_type,
77
+ # data_root=data_root,
78
+ # ann_file='annotations/panoptic_image_info_test-dev2017.json',
79
+ # data_prefix=dict(img='test2017/'),
80
+ # test_mode=True,
81
+ # pipeline=test_pipeline))
82
+ # test_evaluator = dict(
83
+ # type='CocoPanopticMetric',
84
+ # format_only=True,
85
+ # ann_file=data_root + 'annotations/panoptic_image_info_test-dev2017.json',
86
+ # outfile_prefix='./work_dirs/coco_panoptic/test')
configs/_base_/datasets/cub_bs8_384.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CUB'
3
+ data_preprocessor = dict(
4
+ num_classes=200,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(type='Resize', scale=510),
15
+ dict(type='RandomCrop', crop_size=384),
16
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
17
+ dict(type='PackClsInputs'),
18
+ ]
19
+
20
+ test_pipeline = [
21
+ dict(type='LoadImageFromFile'),
22
+ dict(type='Resize', scale=510),
23
+ dict(type='CenterCrop', crop_size=384),
24
+ dict(type='PackClsInputs'),
25
+ ]
26
+
27
+ train_dataloader = dict(
28
+ batch_size=8,
29
+ num_workers=2,
30
+ dataset=dict(
31
+ type=dataset_type,
32
+ data_root='data/CUB_200_2011',
33
+ test_mode=False,
34
+ pipeline=train_pipeline),
35
+ sampler=dict(type='DefaultSampler', shuffle=True),
36
+ )
37
+
38
+ val_dataloader = dict(
39
+ batch_size=8,
40
+ num_workers=2,
41
+ dataset=dict(
42
+ type=dataset_type,
43
+ data_root='data/CUB_200_2011',
44
+ test_mode=True,
45
+ pipeline=test_pipeline),
46
+ sampler=dict(type='DefaultSampler', shuffle=False),
47
+ )
48
+ val_evaluator = dict(type='Accuracy', topk=(1, ))
49
+
50
+ test_dataloader = val_dataloader
51
+ test_evaluator = val_evaluator
configs/_base_/datasets/cub_bs8_448.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'CUB'
3
+ data_preprocessor = dict(
4
+ num_classes=200,
5
+ mean=[123.675, 116.28, 103.53],
6
+ std=[58.395, 57.12, 57.375],
7
+ # convert image from BGR to RGB
8
+ to_rgb=True,
9
+ )
10
+
11
+ train_pipeline = [
12
+ dict(type='LoadImageFromFile'),
13
+ dict(type='Resize', scale=600),
14
+ dict(type='RandomCrop', crop_size=448),
15
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
16
+ dict(type='PackClsInputs'),
17
+ ]
18
+
19
+ test_pipeline = [
20
+ dict(type='LoadImageFromFile'),
21
+ dict(type='Resize', scale=600),
22
+ dict(type='CenterCrop', crop_size=448),
23
+ dict(type='PackClsInputs'),
24
+ ]
25
+
26
+ train_dataloader = dict(
27
+ batch_size=8,
28
+ num_workers=2,
29
+ dataset=dict(
30
+ type=dataset_type,
31
+ data_root='data/CUB_200_2011',
32
+ test_mode=False,
33
+ pipeline=train_pipeline),
34
+ sampler=dict(type='DefaultSampler', shuffle=True),
35
+ )
36
+
37
+ val_dataloader = dict(
38
+ batch_size=8,
39
+ num_workers=2,
40
+ dataset=dict(
41
+ type=dataset_type,
42
+ data_root='data/CUB_200_2011',
43
+ test_mode=True,
44
+ pipeline=test_pipeline),
45
+ sampler=dict(type='DefaultSampler', shuffle=False),
46
+ )
47
+ val_evaluator = dict(type='Accuracy', topk=(1, ))
48
+
49
+ test_dataloader = val_dataloader
50
+ test_evaluator = val_evaluator
configs/_base_/datasets/deepfashion.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'DeepFashionDataset'
3
+ data_root = 'data/DeepFashion/In-shop/'
4
+
5
+ # file_client_args = dict(
6
+ # backend='petrel',
7
+ # path_mapping=dict({
8
+ # './data/': 's3://openmmlab/datasets/detection/',
9
+ # 'data/': 's3://openmmlab/datasets/detection/'
10
+ # }))
11
+ file_client_args = dict(backend='disk')
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
15
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
16
+ dict(type='Resize', scale=(750, 1101), keep_ratio=True),
17
+ dict(type='RandomFlip', prob=0.5),
18
+ dict(type='PackDetInputs')
19
+ ]
20
+ test_pipeline = [
21
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
22
+ dict(type='Resize', scale=(750, 1101), keep_ratio=True),
23
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
24
+ dict(
25
+ type='PackDetInputs',
26
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
27
+ 'scale_factor'))
28
+ ]
29
+ train_dataloader = dict(
30
+ batch_size=2,
31
+ num_workers=2,
32
+ persistent_workers=True,
33
+ sampler=dict(type='DefaultSampler', shuffle=True),
34
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
35
+ dataset=dict(
36
+ type='RepeatDataset',
37
+ times=2,
38
+ dataset=dict(
39
+ type=dataset_type,
40
+ data_root=data_root,
41
+ ann_file='Anno/segmentation/DeepFashion_segmentation_train.json',
42
+ data_prefix=dict(img='Img/'),
43
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
44
+ pipeline=train_pipeline)))
45
+ val_dataloader = dict(
46
+ batch_size=1,
47
+ num_workers=2,
48
+ persistent_workers=True,
49
+ drop_last=False,
50
+ sampler=dict(type='DefaultSampler', shuffle=False),
51
+ dataset=dict(
52
+ type=dataset_type,
53
+ data_root=data_root,
54
+ ann_file='Anno/segmentation/DeepFashion_segmentation_query.json',
55
+ data_prefix=dict(img='Img/'),
56
+ test_mode=True,
57
+ pipeline=test_pipeline))
58
+ test_dataloader = dict(
59
+ batch_size=1,
60
+ num_workers=2,
61
+ persistent_workers=True,
62
+ drop_last=False,
63
+ sampler=dict(type='DefaultSampler', shuffle=False),
64
+ dataset=dict(
65
+ type=dataset_type,
66
+ data_root=data_root,
67
+ ann_file='Anno/segmentation/DeepFashion_segmentation_gallery.json',
68
+ data_prefix=dict(img='Img/'),
69
+ test_mode=True,
70
+ pipeline=test_pipeline))
71
+
72
+ val_evaluator = dict(
73
+ type='CocoMetric',
74
+ ann_file=data_root +
75
+ 'Anno/segmentation/DeepFashion_segmentation_query.json',
76
+ metric=['bbox', 'segm'],
77
+ format_only=False)
78
+ test_evaluator = dict(
79
+ type='CocoMetric',
80
+ ann_file=data_root +
81
+ 'Anno/segmentation/DeepFashion_segmentation_gallery.json',
82
+ metric=['bbox', 'segm'],
83
+ format_only=False)
configs/_base_/datasets/imagenet21k_bs128.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet21k'
3
+ data_preprocessor = dict(
4
+ num_classes=21842,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(type='RandomResizedCrop', scale=224),
15
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
16
+ dict(type='PackClsInputs'),
17
+ ]
18
+
19
+ test_pipeline = [
20
+ dict(type='LoadImageFromFile'),
21
+ dict(type='ResizeEdge', scale=256, edge='short'),
22
+ dict(type='CenterCrop', crop_size=224),
23
+ dict(type='PackClsInputs'),
24
+ ]
25
+
26
+ train_dataloader = dict(
27
+ batch_size=128,
28
+ num_workers=5,
29
+ dataset=dict(
30
+ type=dataset_type,
31
+ data_root='data/imagenet21k',
32
+ ann_file='meta/train.txt',
33
+ data_prefix='train',
34
+ pipeline=train_pipeline),
35
+ sampler=dict(type='DefaultSampler', shuffle=True),
36
+ )
37
+
38
+ val_dataloader = dict(
39
+ batch_size=128,
40
+ num_workers=5,
41
+ dataset=dict(
42
+ type=dataset_type,
43
+ data_root='data/imagenet21k',
44
+ ann_file='meta/val.txt',
45
+ data_prefix='val',
46
+ pipeline=test_pipeline),
47
+ sampler=dict(type='DefaultSampler', shuffle=False),
48
+ )
49
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
50
+
51
+ # If you want standard test, please manually configure the test dataset
52
+ test_dataloader = val_dataloader
53
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs128_mbv3.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(type='RandomResizedCrop', scale=224, backend='pillow'),
18
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
19
+ dict(
20
+ type='AutoAugment',
21
+ policies='imagenet',
22
+ hparams=dict(pad_val=[round(x) for x in bgr_mean])),
23
+ dict(
24
+ type='RandomErasing',
25
+ erase_prob=0.2,
26
+ mode='rand',
27
+ min_area_ratio=0.02,
28
+ max_area_ratio=1 / 3,
29
+ fill_color=bgr_mean,
30
+ fill_std=bgr_std),
31
+ dict(type='PackClsInputs'),
32
+ ]
33
+
34
+ test_pipeline = [
35
+ dict(type='LoadImageFromFile'),
36
+ dict(type='ResizeEdge', scale=256, edge='short', backend='pillow'),
37
+ dict(type='CenterCrop', crop_size=224),
38
+ dict(type='PackClsInputs'),
39
+ ]
40
+
41
+ train_dataloader = dict(
42
+ batch_size=128,
43
+ num_workers=5,
44
+ dataset=dict(
45
+ type=dataset_type,
46
+ data_root='data/imagenet',
47
+ ann_file='meta/train.txt',
48
+ data_prefix='train',
49
+ pipeline=train_pipeline),
50
+ sampler=dict(type='DefaultSampler', shuffle=True),
51
+ )
52
+
53
+ val_dataloader = dict(
54
+ batch_size=128,
55
+ num_workers=5,
56
+ dataset=dict(
57
+ type=dataset_type,
58
+ data_root='data/imagenet',
59
+ ann_file='meta/val.txt',
60
+ data_prefix='val',
61
+ pipeline=test_pipeline),
62
+ sampler=dict(type='DefaultSampler', shuffle=False),
63
+ )
64
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
65
+
66
+ # If you want standard test, please manually configure the test dataset
67
+ test_dataloader = val_dataloader
68
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs128_poolformer_medium_224.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=236,
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=224),
52
+ dict(type='PackClsInputs'),
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=128,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=128,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs128_poolformer_small_224.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=248,
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=224),
52
+ dict(type='PackClsInputs'),
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=128,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=128,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs128_revvit_224.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=7,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(type='ColorJitter', brightness=0.4, contrast=0.4, saturation=0.4),
33
+ dict(
34
+ type='RandomErasing',
35
+ erase_prob=0.25,
36
+ mode='rand', # should be 'pixel', but currently not supported
37
+ min_area_ratio=0.02,
38
+ max_area_ratio=1 / 3,
39
+ fill_color=bgr_mean,
40
+ fill_std=bgr_std),
41
+ dict(type='PackClsInputs'),
42
+ ]
43
+
44
+ test_pipeline = [
45
+ dict(type='LoadImageFromFile'),
46
+ dict(
47
+ type='ResizeEdge',
48
+ scale=256,
49
+ edge='short',
50
+ backend='pillow',
51
+ interpolation='bicubic'),
52
+ dict(type='CenterCrop', crop_size=224),
53
+ dict(type='PackClsInputs'),
54
+ ]
55
+
56
+ train_dataloader = dict(
57
+ batch_size=256,
58
+ num_workers=5,
59
+ dataset=dict(
60
+ type=dataset_type,
61
+ data_root='data/imagenet',
62
+ ann_file='meta/train.txt',
63
+ data_prefix='train',
64
+ pipeline=train_pipeline),
65
+ sampler=dict(type='DefaultSampler', shuffle=True),
66
+ persistent_workers=True,
67
+ )
68
+
69
+ val_dataloader = dict(
70
+ batch_size=64,
71
+ num_workers=5,
72
+ dataset=dict(
73
+ type=dataset_type,
74
+ data_root='data/imagenet',
75
+ # ann_file='meta/val.txt',
76
+ data_prefix='val',
77
+ pipeline=test_pipeline),
78
+ sampler=dict(type='DefaultSampler', shuffle=False),
79
+ persistent_workers=True,
80
+ )
81
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
82
+
83
+ # If you want standard test, please manually configure the test dataset
84
+ test_dataloader = val_dataloader
85
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs16_eva_196.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[0.48145466 * 255, 0.4578275 * 255, 0.40821073 * 255],
7
+ std=[0.26862954 * 255, 0.26130258 * 255, 0.27577711 * 255],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(
15
+ type='RandomResizedCrop',
16
+ scale=196,
17
+ backend='pillow',
18
+ interpolation='bicubic'),
19
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
20
+ dict(type='PackClsInputs'),
21
+ ]
22
+
23
+ test_pipeline = [
24
+ dict(type='LoadImageFromFile'),
25
+ dict(
26
+ type='ResizeEdge',
27
+ scale=196,
28
+ edge='short',
29
+ backend='pillow',
30
+ interpolation='bicubic'),
31
+ dict(type='CenterCrop', crop_size=196),
32
+ dict(type='PackClsInputs'),
33
+ ]
34
+
35
+ train_dataloader = dict(
36
+ batch_size=16,
37
+ num_workers=5,
38
+ dataset=dict(
39
+ type=dataset_type,
40
+ data_root='data/imagenet',
41
+ ann_file='meta/train.txt',
42
+ data_prefix='train',
43
+ pipeline=train_pipeline),
44
+ sampler=dict(type='DefaultSampler', shuffle=True),
45
+ )
46
+
47
+ val_dataloader = dict(
48
+ batch_size=16,
49
+ num_workers=5,
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root='data/imagenet',
53
+ ann_file='meta/val.txt',
54
+ data_prefix='val',
55
+ pipeline=test_pipeline),
56
+ sampler=dict(type='DefaultSampler', shuffle=False),
57
+ )
58
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
59
+
60
+ # If you want standard test, please manually configure the test dataset
61
+ test_dataloader = val_dataloader
62
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs16_eva_336.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[0.48145466 * 255, 0.4578275 * 255, 0.40821073 * 255],
7
+ std=[0.26862954 * 255, 0.26130258 * 255, 0.27577711 * 255],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(
15
+ type='RandomResizedCrop',
16
+ scale=336,
17
+ backend='pillow',
18
+ interpolation='bicubic'),
19
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
20
+ dict(type='PackClsInputs'),
21
+ ]
22
+
23
+ test_pipeline = [
24
+ dict(type='LoadImageFromFile'),
25
+ dict(
26
+ type='ResizeEdge',
27
+ scale=336,
28
+ edge='short',
29
+ backend='pillow',
30
+ interpolation='bicubic'),
31
+ dict(type='CenterCrop', crop_size=336),
32
+ dict(type='PackClsInputs'),
33
+ ]
34
+
35
+ train_dataloader = dict(
36
+ batch_size=16,
37
+ num_workers=5,
38
+ dataset=dict(
39
+ type=dataset_type,
40
+ data_root='data/imagenet',
41
+ ann_file='meta/train.txt',
42
+ data_prefix='train',
43
+ pipeline=train_pipeline),
44
+ sampler=dict(type='DefaultSampler', shuffle=True),
45
+ )
46
+
47
+ val_dataloader = dict(
48
+ batch_size=16,
49
+ num_workers=5,
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root='data/imagenet',
53
+ ann_file='meta/val.txt',
54
+ data_prefix='val',
55
+ pipeline=test_pipeline),
56
+ sampler=dict(type='DefaultSampler', shuffle=False),
57
+ )
58
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
59
+
60
+ # If you want standard test, please manually configure the test dataset
61
+ test_dataloader = val_dataloader
62
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs16_eva_560.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[0.48145466 * 255, 0.4578275 * 255, 0.40821073 * 255],
7
+ std=[0.26862954 * 255, 0.26130258 * 255, 0.27577711 * 255],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(
15
+ type='RandomResizedCrop',
16
+ scale=560,
17
+ backend='pillow',
18
+ interpolation='bicubic'),
19
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
20
+ dict(type='PackClsInputs'),
21
+ ]
22
+
23
+ test_pipeline = [
24
+ dict(type='LoadImageFromFile'),
25
+ dict(
26
+ type='ResizeEdge',
27
+ scale=560,
28
+ edge='short',
29
+ backend='pillow',
30
+ interpolation='bicubic'),
31
+ dict(type='CenterCrop', crop_size=560),
32
+ dict(type='PackClsInputs'),
33
+ ]
34
+
35
+ train_dataloader = dict(
36
+ batch_size=16,
37
+ num_workers=5,
38
+ dataset=dict(
39
+ type=dataset_type,
40
+ data_root='data/imagenet',
41
+ ann_file='meta/train.txt',
42
+ data_prefix='train',
43
+ pipeline=train_pipeline),
44
+ sampler=dict(type='DefaultSampler', shuffle=True),
45
+ )
46
+
47
+ val_dataloader = dict(
48
+ batch_size=16,
49
+ num_workers=5,
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root='data/imagenet',
53
+ ann_file='meta/val.txt',
54
+ data_prefix='val',
55
+ pipeline=test_pipeline),
56
+ sampler=dict(type='DefaultSampler', shuffle=False),
57
+ )
58
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
59
+
60
+ # If you want standard test, please manually configure the test dataset
61
+ test_dataloader = val_dataloader
62
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs16_pil_bicubic_384.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ # RGB format normalization parameters
5
+ mean=[123.675, 116.28, 103.53],
6
+ std=[58.395, 57.12, 57.375],
7
+ # convert image from BGR to RGB
8
+ to_rgb=True,
9
+ )
10
+
11
+ train_pipeline = [
12
+ dict(type='LoadImageFromFile'),
13
+ dict(
14
+ type='RandomResizedCrop',
15
+ scale=384,
16
+ backend='pillow',
17
+ interpolation='bicubic'),
18
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
19
+ dict(type='PackClsInputs'),
20
+ ]
21
+
22
+ test_pipeline = [
23
+ dict(type='LoadImageFromFile'),
24
+ dict(type='Resize', scale=384, backend='pillow', interpolation='bicubic'),
25
+ dict(type='PackClsInputs'),
26
+ ]
27
+
28
+ train_dataloader = dict(
29
+ batch_size=16,
30
+ num_workers=5,
31
+ dataset=dict(
32
+ type=dataset_type,
33
+ data_root='data/imagenet',
34
+ ann_file='meta/train.txt',
35
+ data_prefix='train',
36
+ pipeline=train_pipeline),
37
+ sampler=dict(type='DefaultSampler', shuffle=True),
38
+ )
39
+
40
+ val_dataloader = dict(
41
+ batch_size=16,
42
+ num_workers=5,
43
+ dataset=dict(
44
+ type=dataset_type,
45
+ data_root='data/imagenet',
46
+ ann_file='meta/val.txt',
47
+ data_prefix='val',
48
+ pipeline=test_pipeline),
49
+ sampler=dict(type='DefaultSampler', shuffle=False),
50
+ )
51
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
52
+
53
+ # If you want standard test, please manually configure the test dataset
54
+ test_dataloader = val_dataloader
55
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs256_davit_224.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=236,
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=224),
52
+ dict(type='PackClsInputs'),
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=64,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=64,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs256_rsb_a12.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=7,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(type='PackClsInputs'),
33
+ ]
34
+
35
+ test_pipeline = [
36
+ dict(type='LoadImageFromFile'),
37
+ dict(
38
+ type='ResizeEdge',
39
+ scale=236,
40
+ edge='short',
41
+ backend='pillow',
42
+ interpolation='bicubic'),
43
+ dict(type='CenterCrop', crop_size=224),
44
+ dict(type='PackClsInputs')
45
+ ]
46
+
47
+ train_dataloader = dict(
48
+ batch_size=256,
49
+ num_workers=5,
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root='data/imagenet',
53
+ ann_file='meta/train.txt',
54
+ data_prefix='train',
55
+ pipeline=train_pipeline),
56
+ sampler=dict(type='DefaultSampler', shuffle=True),
57
+ )
58
+
59
+ val_dataloader = dict(
60
+ batch_size=256,
61
+ num_workers=5,
62
+ dataset=dict(
63
+ type=dataset_type,
64
+ data_root='data/imagenet',
65
+ ann_file='meta/val.txt',
66
+ data_prefix='val',
67
+ pipeline=test_pipeline),
68
+ sampler=dict(type='DefaultSampler', shuffle=False),
69
+ )
70
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
71
+
72
+ # If you want standard test, please manually configure the test dataset
73
+ test_dataloader = val_dataloader
74
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs256_rsb_a3.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=6,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(type='PackClsInputs'),
33
+ ]
34
+
35
+ test_pipeline = [
36
+ dict(type='LoadImageFromFile'),
37
+ dict(
38
+ type='ResizeEdge',
39
+ scale=236,
40
+ edge='short',
41
+ backend='pillow',
42
+ interpolation='bicubic'),
43
+ dict(type='CenterCrop', crop_size=224),
44
+ dict(type='PackClsInputs')
45
+ ]
46
+
47
+ train_dataloader = dict(
48
+ batch_size=256,
49
+ num_workers=5,
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root='data/imagenet',
53
+ ann_file='meta/train.txt',
54
+ data_prefix='train',
55
+ pipeline=train_pipeline),
56
+ sampler=dict(type='DefaultSampler', shuffle=True),
57
+ )
58
+
59
+ val_dataloader = dict(
60
+ batch_size=256,
61
+ num_workers=5,
62
+ dataset=dict(
63
+ type=dataset_type,
64
+ data_root='data/imagenet',
65
+ ann_file='meta/val.txt',
66
+ data_prefix='val',
67
+ pipeline=test_pipeline),
68
+ sampler=dict(type='DefaultSampler', shuffle=False),
69
+ )
70
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
71
+
72
+ # If you want standard test, please manually configure the test dataset
73
+ test_dataloader = val_dataloader
74
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs32.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(type='RandomResizedCrop', scale=224),
15
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
16
+ dict(type='PackClsInputs'),
17
+ ]
18
+
19
+ test_pipeline = [
20
+ dict(type='LoadImageFromFile'),
21
+ dict(type='ResizeEdge', scale=256, edge='short'),
22
+ dict(type='CenterCrop', crop_size=224),
23
+ dict(type='PackClsInputs'),
24
+ ]
25
+
26
+ train_dataloader = dict(
27
+ batch_size=32,
28
+ num_workers=5,
29
+ dataset=dict(
30
+ type=dataset_type,
31
+ data_root='data/imagenet',
32
+ ann_file='meta/train.txt',
33
+ data_prefix='train',
34
+ pipeline=train_pipeline),
35
+ sampler=dict(type='DefaultSampler', shuffle=True),
36
+ )
37
+
38
+ val_dataloader = dict(
39
+ batch_size=32,
40
+ num_workers=5,
41
+ dataset=dict(
42
+ type=dataset_type,
43
+ data_root='data/imagenet',
44
+ ann_file='meta/val.txt',
45
+ data_prefix='val',
46
+ pipeline=test_pipeline),
47
+ sampler=dict(type='DefaultSampler', shuffle=False),
48
+ )
49
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
50
+
51
+ # If you want standard test, please manually configure the test dataset
52
+ test_dataloader = val_dataloader
53
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs32_pil_bicubic.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(
15
+ type='RandomResizedCrop',
16
+ scale=224,
17
+ backend='pillow',
18
+ interpolation='bicubic'),
19
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
20
+ dict(type='PackClsInputs'),
21
+ ]
22
+
23
+ test_pipeline = [
24
+ dict(type='LoadImageFromFile'),
25
+ dict(
26
+ type='ResizeEdge',
27
+ scale=256,
28
+ edge='short',
29
+ backend='pillow',
30
+ interpolation='bicubic'),
31
+ dict(type='CenterCrop', crop_size=224),
32
+ dict(type='PackClsInputs'),
33
+ ]
34
+
35
+ train_dataloader = dict(
36
+ batch_size=32,
37
+ num_workers=5,
38
+ dataset=dict(
39
+ type=dataset_type,
40
+ data_root='data/imagenet',
41
+ ann_file='meta/train.txt',
42
+ data_prefix='train',
43
+ pipeline=train_pipeline),
44
+ sampler=dict(type='DefaultSampler', shuffle=True),
45
+ )
46
+
47
+ val_dataloader = dict(
48
+ batch_size=32,
49
+ num_workers=5,
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root='data/imagenet',
53
+ ann_file='meta/val.txt',
54
+ data_prefix='val',
55
+ pipeline=test_pipeline),
56
+ sampler=dict(type='DefaultSampler', shuffle=False),
57
+ )
58
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
59
+
60
+ # If you want standard test, please manually configure the test dataset
61
+ test_dataloader = val_dataloader
62
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs32_pil_resize.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(type='RandomResizedCrop', scale=224, backend='pillow'),
15
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
16
+ dict(type='PackClsInputs'),
17
+ ]
18
+
19
+ test_pipeline = [
20
+ dict(type='LoadImageFromFile'),
21
+ dict(type='ResizeEdge', scale=256, edge='short', backend='pillow'),
22
+ dict(type='CenterCrop', crop_size=224),
23
+ dict(type='PackClsInputs'),
24
+ ]
25
+
26
+ train_dataloader = dict(
27
+ batch_size=32,
28
+ num_workers=5,
29
+ dataset=dict(
30
+ type=dataset_type,
31
+ data_root='data/imagenet',
32
+ ann_file='meta/train.txt',
33
+ data_prefix='train',
34
+ pipeline=train_pipeline),
35
+ sampler=dict(type='DefaultSampler', shuffle=True),
36
+ )
37
+
38
+ val_dataloader = dict(
39
+ batch_size=32,
40
+ num_workers=5,
41
+ dataset=dict(
42
+ type=dataset_type,
43
+ data_root='data/imagenet',
44
+ ann_file='meta/val.txt',
45
+ data_prefix='val',
46
+ pipeline=test_pipeline),
47
+ sampler=dict(type='DefaultSampler', shuffle=False),
48
+ )
49
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
50
+
51
+ # If you want standard test, please manually configure the test dataset
52
+ test_dataloader = val_dataloader
53
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(type='RandomResizedCrop', scale=224),
15
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
16
+ dict(type='PackClsInputs'),
17
+ ]
18
+
19
+ test_pipeline = [
20
+ dict(type='LoadImageFromFile'),
21
+ dict(type='ResizeEdge', scale=256, edge='short'),
22
+ dict(type='CenterCrop', crop_size=224),
23
+ dict(type='PackClsInputs'),
24
+ ]
25
+
26
+ train_dataloader = dict(
27
+ batch_size=64,
28
+ num_workers=5,
29
+ dataset=dict(
30
+ type=dataset_type,
31
+ data_root='data/imagenet',
32
+ ann_file='meta/train.txt',
33
+ data_prefix='train',
34
+ pipeline=train_pipeline),
35
+ sampler=dict(type='DefaultSampler', shuffle=True),
36
+ )
37
+
38
+ val_dataloader = dict(
39
+ batch_size=64,
40
+ num_workers=5,
41
+ dataset=dict(
42
+ type=dataset_type,
43
+ data_root='data/imagenet',
44
+ ann_file='meta/val.txt',
45
+ data_prefix='val',
46
+ pipeline=test_pipeline),
47
+ sampler=dict(type='DefaultSampler', shuffle=False),
48
+ )
49
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
50
+
51
+ # If you want standard test, please manually configure the test dataset
52
+ test_dataloader = val_dataloader
53
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_autoaug.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(type='RandomResizedCrop', scale=224),
18
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
19
+ dict(
20
+ type='AutoAugment',
21
+ policies='imagenet',
22
+ hparams=dict(
23
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
24
+ dict(type='PackClsInputs'),
25
+ ]
26
+
27
+ test_pipeline = [
28
+ dict(type='LoadImageFromFile'),
29
+ dict(type='ResizeEdge', scale=256, edge='short'),
30
+ dict(type='CenterCrop', crop_size=224),
31
+ dict(type='PackClsInputs'),
32
+ ]
33
+
34
+ train_dataloader = dict(
35
+ batch_size=64,
36
+ num_workers=5,
37
+ dataset=dict(
38
+ type=dataset_type,
39
+ data_root='data/imagenet',
40
+ ann_file='meta/train.txt',
41
+ data_prefix='train',
42
+ pipeline=train_pipeline),
43
+ sampler=dict(type='DefaultSampler', shuffle=True),
44
+ )
45
+
46
+ val_dataloader = dict(
47
+ batch_size=64,
48
+ num_workers=5,
49
+ dataset=dict(
50
+ type=dataset_type,
51
+ data_root='data/imagenet',
52
+ ann_file='meta/val.txt',
53
+ data_prefix='val',
54
+ pipeline=test_pipeline),
55
+ sampler=dict(type='DefaultSampler', shuffle=False),
56
+ )
57
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
58
+
59
+ # If you want standard test, please manually configure the test dataset
60
+ test_dataloader = val_dataloader
61
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_clip_224.py ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ img_norm_cfg = dict(
4
+ mean=[0.48145466 * 255, 0.4578275 * 255, 0.40821073 * 255],
5
+ std=[0.26862954 * 255, 0.26130258 * 255, 0.27577711 * 255],
6
+ to_rgb=True)
7
+ image_size = 224
8
+ train_pipeline = [
9
+ dict(type='LoadImageFromFile'),
10
+ dict(
11
+ type='RandomResizedCrop',
12
+ size=image_size,
13
+ backend='pillow',
14
+ interpolation='bicubic'),
15
+ dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'),
16
+ # dict(
17
+ # type='RandAugment',
18
+ # policies={{_base_.rand_increasing_policies}},
19
+ # num_policies=2,
20
+ # total_level=10,
21
+ # magnitude_level=9,
22
+ # magnitude_std=0.5,
23
+ # hparams=dict(
24
+ # pad_val=[round(x) for x in img_norm_cfg['mean'][::-1]],
25
+ # interpolation='bicubic')),
26
+ dict(
27
+ type='RandomErasing',
28
+ erase_prob=0.25,
29
+ mode='rand',
30
+ min_area_ratio=0.02,
31
+ max_area_ratio=1 / 3,
32
+ fill_color=img_norm_cfg['mean'][::-1],
33
+ fill_std=img_norm_cfg['std'][::-1]),
34
+ dict(type='Normalize', **img_norm_cfg),
35
+ dict(type='ImageToTensor', keys=['img']),
36
+ dict(type='ToTensor', keys=['gt_label']),
37
+ dict(type='Collect', keys=['img', 'gt_label'])
38
+ ]
39
+
40
+ test_pipeline = [
41
+ dict(type='LoadImageFromFile'),
42
+ dict(
43
+ type='Resize',
44
+ size=(image_size, -1),
45
+ backend='pillow',
46
+ interpolation='bicubic'),
47
+ dict(type='CenterCrop', crop_size=image_size),
48
+ dict(type='Normalize', **img_norm_cfg),
49
+ dict(type='ImageToTensor', keys=['img']),
50
+ dict(type='Collect', keys=['img'])
51
+ ]
52
+
53
+ data = dict(
54
+ samples_per_gpu=64,
55
+ workers_per_gpu=8,
56
+ train=dict(
57
+ type=dataset_type,
58
+ data_prefix='data/imagenet/train',
59
+ pipeline=train_pipeline),
60
+ val=dict(
61
+ type=dataset_type,
62
+ data_prefix='data/imagenet/val',
63
+ ann_file='data/imagenet/meta/val.txt',
64
+ pipeline=test_pipeline),
65
+ test=dict(
66
+ # replace `data/val` with `data/test` for standard test
67
+ type=dataset_type,
68
+ data_prefix='data/imagenet/val',
69
+ ann_file='data/imagenet/meta/val.txt',
70
+ pipeline=test_pipeline))
71
+
72
+ evaluation = dict(interval=10, metric='accuracy')
configs/_base_/datasets/imagenet_bs64_clip_384.py ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ img_norm_cfg = dict(
4
+ mean=[0.48145466 * 255, 0.4578275 * 255, 0.40821073 * 255],
5
+ std=[0.26862954 * 255, 0.26130258 * 255, 0.27577711 * 255],
6
+ to_rgb=True)
7
+ image_size = 384
8
+ train_pipeline = [
9
+ dict(type='LoadImageFromFile'),
10
+ dict(
11
+ type='RandomResizedCrop',
12
+ size=image_size,
13
+ backend='pillow',
14
+ interpolation='bicubic'),
15
+ dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'),
16
+ # dict(
17
+ # type='RandAugment',
18
+ # policies={{_base_.rand_increasing_policies}},
19
+ # num_policies=2,
20
+ # total_level=10,
21
+ # magnitude_level=9,
22
+ # magnitude_std=0.5,
23
+ # hparams=dict(
24
+ # pad_val=[round(x) for x in img_norm_cfg['mean'][::-1]],
25
+ # interpolation='bicubic')),
26
+ dict(
27
+ type='RandomErasing',
28
+ erase_prob=0.25,
29
+ mode='rand',
30
+ min_area_ratio=0.02,
31
+ max_area_ratio=1 / 3,
32
+ fill_color=img_norm_cfg['mean'][::-1],
33
+ fill_std=img_norm_cfg['std'][::-1]),
34
+ dict(type='Normalize', **img_norm_cfg),
35
+ dict(type='ImageToTensor', keys=['img']),
36
+ dict(type='ToTensor', keys=['gt_label']),
37
+ dict(type='Collect', keys=['img', 'gt_label'])
38
+ ]
39
+
40
+ test_pipeline = [
41
+ dict(type='LoadImageFromFile'),
42
+ dict(
43
+ type='Resize',
44
+ size=(image_size, -1),
45
+ backend='pillow',
46
+ interpolation='bicubic'),
47
+ dict(type='CenterCrop', crop_size=image_size),
48
+ dict(type='Normalize', **img_norm_cfg),
49
+ dict(type='ImageToTensor', keys=['img']),
50
+ dict(type='Collect', keys=['img'])
51
+ ]
52
+
53
+ data = dict(
54
+ samples_per_gpu=64,
55
+ workers_per_gpu=8,
56
+ train=dict(
57
+ type=dataset_type,
58
+ data_prefix='data/imagenet/train',
59
+ pipeline=train_pipeline),
60
+ val=dict(
61
+ type=dataset_type,
62
+ data_prefix='data/imagenet/val',
63
+ ann_file='data/imagenet/meta/val.txt',
64
+ pipeline=test_pipeline),
65
+ test=dict(
66
+ # replace `data/val` with `data/test` for standard test
67
+ type=dataset_type,
68
+ data_prefix='data/imagenet/val',
69
+ ann_file='data/imagenet/meta/val.txt',
70
+ pipeline=test_pipeline))
71
+
72
+ evaluation = dict(interval=10, metric='accuracy')
configs/_base_/datasets/imagenet_bs64_clip_448.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ img_norm_cfg = dict(
4
+ mean=[0.48145466 * 255, 0.4578275 * 255, 0.40821073 * 255],
5
+ std=[0.26862954 * 255, 0.26130258 * 255, 0.27577711 * 255],
6
+ to_rgb=True)
7
+ image_size = 448
8
+
9
+ train_pipeline = [
10
+ dict(type='LoadImageFromFile'),
11
+ dict(
12
+ type='RandomResizedCrop',
13
+ size=image_size,
14
+ backend='pillow',
15
+ interpolation='bicubic'),
16
+ dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'),
17
+ # dict(
18
+ # type='RandAugment',
19
+ # policies={{_base_.rand_increasing_policies}},
20
+ # num_policies=2,
21
+ # total_level=10,
22
+ # magnitude_level=9,
23
+ # magnitude_std=0.5,
24
+ # hparams=dict(
25
+ # pad_val=[round(x) for x in img_norm_cfg['mean'][::-1]],
26
+ # interpolation='bicubic')),
27
+ dict(
28
+ type='RandomErasing',
29
+ erase_prob=0.25,
30
+ mode='rand',
31
+ min_area_ratio=0.02,
32
+ max_area_ratio=1 / 3,
33
+ fill_color=img_norm_cfg['mean'][::-1],
34
+ fill_std=img_norm_cfg['std'][::-1]),
35
+ dict(type='Normalize', **img_norm_cfg),
36
+ dict(type='ImageToTensor', keys=['img']),
37
+ dict(type='ToTensor', keys=['gt_label']),
38
+ dict(type='Collect', keys=['img', 'gt_label'])
39
+ ]
40
+
41
+ test_pipeline = [
42
+ dict(type='LoadImageFromFile'),
43
+ dict(
44
+ type='Resize',
45
+ size=(image_size, -1),
46
+ backend='pillow',
47
+ interpolation='bicubic'),
48
+ dict(type='CenterCrop', crop_size=image_size),
49
+ dict(type='Normalize', **img_norm_cfg),
50
+ dict(type='ImageToTensor', keys=['img']),
51
+ dict(type='Collect', keys=['img'])
52
+ ]
53
+
54
+ data = dict(
55
+ samples_per_gpu=64,
56
+ workers_per_gpu=8,
57
+ train=dict(
58
+ type=dataset_type,
59
+ data_prefix='data/imagenet/train',
60
+ pipeline=train_pipeline),
61
+ val=dict(
62
+ type=dataset_type,
63
+ data_prefix='data/imagenet/val',
64
+ ann_file='data/imagenet/meta/val.txt',
65
+ pipeline=test_pipeline),
66
+ test=dict(
67
+ # replace `data/val` with `data/test` for standard test
68
+ type=dataset_type,
69
+ data_prefix='data/imagenet/val',
70
+ ann_file='data/imagenet/meta/val.txt',
71
+ pipeline=test_pipeline))
72
+
73
+ evaluation = dict(interval=10, metric='accuracy')
configs/_base_/datasets/imagenet_bs64_convmixer_224.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs')
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=233,
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=224),
52
+ dict(type='PackClsInputs')
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=64,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=64,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_deit3_224.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=224,
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=224),
52
+ dict(type='PackClsInputs'),
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=64,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=64,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_deit3_384.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(
15
+ type='RandomResizedCrop',
16
+ scale=384,
17
+ backend='pillow',
18
+ interpolation='bicubic'),
19
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
20
+ dict(type='PackClsInputs'),
21
+ ]
22
+
23
+ test_pipeline = [
24
+ dict(type='LoadImageFromFile'),
25
+ dict(
26
+ type='ResizeEdge',
27
+ scale=384,
28
+ edge='short',
29
+ backend='pillow',
30
+ interpolation='bicubic'),
31
+ dict(type='CenterCrop', crop_size=384),
32
+ dict(type='PackClsInputs'),
33
+ ]
34
+
35
+ train_dataloader = dict(
36
+ batch_size=64,
37
+ num_workers=5,
38
+ dataset=dict(
39
+ type=dataset_type,
40
+ data_root='data/imagenet',
41
+ ann_file='meta/train.txt',
42
+ data_prefix='train',
43
+ pipeline=train_pipeline),
44
+ sampler=dict(type='DefaultSampler', shuffle=True),
45
+ )
46
+
47
+ val_dataloader = dict(
48
+ batch_size=64,
49
+ num_workers=5,
50
+ dataset=dict(
51
+ type=dataset_type,
52
+ data_root='data/imagenet',
53
+ ann_file='meta/val.txt',
54
+ data_prefix='val',
55
+ pipeline=test_pipeline),
56
+ sampler=dict(type='DefaultSampler', shuffle=False),
57
+ )
58
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
59
+
60
+ # If you want standard test, please manually configure the test dataset
61
+ test_dataloader = val_dataloader
62
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_edgenext_256.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=256,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=292,
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=256),
52
+ dict(type='PackClsInputs')
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=64,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=64,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_mixer_224.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+
4
+ # Google research usually use the below normalization setting.
5
+ data_preprocessor = dict(
6
+ num_classes=1000,
7
+ mean=[127.5, 127.5, 127.5],
8
+ std=[127.5, 127.5, 127.5],
9
+ # convert image from BGR to RGB
10
+ to_rgb=True,
11
+ )
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile'),
15
+ dict(type='RandomResizedCrop', scale=224),
16
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
17
+ dict(type='PackClsInputs'),
18
+ ]
19
+
20
+ test_pipeline = [
21
+ dict(type='LoadImageFromFile'),
22
+ dict(type='ResizeEdge', scale=256, edge='short', interpolation='bicubic'),
23
+ dict(type='CenterCrop', crop_size=224),
24
+ dict(type='PackClsInputs'),
25
+ ]
26
+
27
+ train_dataloader = dict(
28
+ batch_size=64,
29
+ num_workers=5,
30
+ dataset=dict(
31
+ type=dataset_type,
32
+ data_root='data/imagenet',
33
+ ann_file='meta/train.txt',
34
+ data_prefix='train',
35
+ pipeline=train_pipeline),
36
+ sampler=dict(type='DefaultSampler', shuffle=True),
37
+ )
38
+
39
+ val_dataloader = dict(
40
+ batch_size=64,
41
+ num_workers=5,
42
+ dataset=dict(
43
+ type=dataset_type,
44
+ data_root='data/imagenet',
45
+ ann_file='meta/val.txt',
46
+ data_prefix='val',
47
+ pipeline=test_pipeline),
48
+ sampler=dict(type='DefaultSampler', shuffle=False),
49
+ )
50
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
51
+
52
+ # If you want standard test, please manually configure the test dataset
53
+ test_dataloader = val_dataloader
54
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_pil_resize.py ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(type='RandomResizedCrop', scale=224, backend='pillow'),
15
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
16
+ dict(type='PackClsInputs'),
17
+ ]
18
+
19
+ test_pipeline = [
20
+ dict(type='LoadImageFromFile'),
21
+ dict(type='ResizeEdge', scale=256, edge='short', backend='pillow'),
22
+ dict(type='CenterCrop', crop_size=224),
23
+ dict(type='PackClsInputs'),
24
+ ]
25
+
26
+ train_dataloader = dict(
27
+ batch_size=64,
28
+ num_workers=5,
29
+ dataset=dict(
30
+ type=dataset_type,
31
+ data_root='data/imagenet',
32
+ ann_file='meta/train.txt',
33
+ data_prefix='train',
34
+ pipeline=train_pipeline),
35
+ sampler=dict(type='DefaultSampler', shuffle=True),
36
+ )
37
+
38
+ val_dataloader = dict(
39
+ batch_size=64,
40
+ num_workers=5,
41
+ dataset=dict(
42
+ type=dataset_type,
43
+ data_root='data/imagenet',
44
+ ann_file='meta/val.txt',
45
+ data_prefix='val',
46
+ pipeline=test_pipeline),
47
+ sampler=dict(type='DefaultSampler', shuffle=False),
48
+ )
49
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
50
+
51
+ # If you want standard test, please manually configure the test dataset
52
+ test_dataloader = val_dataloader
53
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_pil_resize_autoaug.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='AutoAugment',
25
+ policies='imagenet',
26
+ hparams=dict(
27
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
28
+ dict(type='PackClsInputs'),
29
+ ]
30
+
31
+ test_pipeline = [
32
+ dict(type='LoadImageFromFile'),
33
+ dict(
34
+ type='ResizeEdge',
35
+ scale=256,
36
+ edge='short',
37
+ backend='pillow',
38
+ interpolation='bicubic'),
39
+ dict(type='CenterCrop', crop_size=224),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ train_dataloader = dict(
44
+ batch_size=64,
45
+ num_workers=5,
46
+ dataset=dict(
47
+ type=dataset_type,
48
+ data_root='data/imagenet',
49
+ ann_file='meta/train.txt',
50
+ data_prefix='train',
51
+ pipeline=train_pipeline),
52
+ sampler=dict(type='DefaultSampler', shuffle=True),
53
+ )
54
+
55
+ val_dataloader = dict(
56
+ batch_size=64,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/val.txt',
62
+ data_prefix='val',
63
+ pipeline=test_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=False),
65
+ )
66
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
67
+
68
+ # If you want standard test, please manually configure the test dataset
69
+ test_dataloader = val_dataloader
70
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_swin_224.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=256,
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=224),
52
+ dict(type='PackClsInputs'),
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=64,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=64,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_swin_256.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=256,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=292, # ( 256 / 224 * 256 )
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=256),
52
+ dict(type='PackClsInputs'),
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=64,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=64,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_swin_384.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ train_pipeline = [
13
+ dict(type='LoadImageFromFile'),
14
+ dict(
15
+ type='RandomResizedCrop',
16
+ scale=384,
17
+ backend='pillow',
18
+ interpolation='bicubic'),
19
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
20
+ dict(type='PackClsInputs'),
21
+ ]
22
+
23
+ test_pipeline = [
24
+ dict(type='LoadImageFromFile'),
25
+ dict(type='Resize', scale=384, backend='pillow', interpolation='bicubic'),
26
+ dict(type='PackClsInputs'),
27
+ ]
28
+
29
+ train_dataloader = dict(
30
+ batch_size=64,
31
+ num_workers=5,
32
+ dataset=dict(
33
+ type=dataset_type,
34
+ data_root='data/imagenet',
35
+ ann_file='meta/train.txt',
36
+ data_prefix='train',
37
+ pipeline=train_pipeline),
38
+ sampler=dict(type='DefaultSampler', shuffle=True),
39
+ )
40
+
41
+ val_dataloader = dict(
42
+ batch_size=64,
43
+ num_workers=5,
44
+ dataset=dict(
45
+ type=dataset_type,
46
+ data_root='data/imagenet',
47
+ ann_file='meta/val.txt',
48
+ data_prefix='val',
49
+ pipeline=test_pipeline),
50
+ sampler=dict(type='DefaultSampler', shuffle=False),
51
+ )
52
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
53
+
54
+ # If you want standard test, please manually configure the test dataset
55
+ test_dataloader = val_dataloader
56
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs64_t2t_224.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ num_classes=1000,
5
+ # RGB format normalization parameters
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ # convert image from BGR to RGB
9
+ to_rgb=True,
10
+ )
11
+
12
+ bgr_mean = data_preprocessor['mean'][::-1]
13
+ bgr_std = data_preprocessor['std'][::-1]
14
+
15
+ train_pipeline = [
16
+ dict(type='LoadImageFromFile'),
17
+ dict(
18
+ type='RandomResizedCrop',
19
+ scale=224,
20
+ backend='pillow',
21
+ interpolation='bicubic'),
22
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
23
+ dict(
24
+ type='RandAugment',
25
+ policies='timm_increasing',
26
+ num_policies=2,
27
+ total_level=10,
28
+ magnitude_level=9,
29
+ magnitude_std=0.5,
30
+ hparams=dict(
31
+ pad_val=[round(x) for x in bgr_mean], interpolation='bicubic')),
32
+ dict(
33
+ type='RandomErasing',
34
+ erase_prob=0.25,
35
+ mode='rand',
36
+ min_area_ratio=0.02,
37
+ max_area_ratio=1 / 3,
38
+ fill_color=bgr_mean,
39
+ fill_std=bgr_std),
40
+ dict(type='PackClsInputs'),
41
+ ]
42
+
43
+ test_pipeline = [
44
+ dict(type='LoadImageFromFile'),
45
+ dict(
46
+ type='ResizeEdge',
47
+ scale=248,
48
+ edge='short',
49
+ backend='pillow',
50
+ interpolation='bicubic'),
51
+ dict(type='CenterCrop', crop_size=224),
52
+ dict(type='PackClsInputs'),
53
+ ]
54
+
55
+ train_dataloader = dict(
56
+ batch_size=64,
57
+ num_workers=5,
58
+ dataset=dict(
59
+ type=dataset_type,
60
+ data_root='data/imagenet',
61
+ ann_file='meta/train.txt',
62
+ data_prefix='train',
63
+ pipeline=train_pipeline),
64
+ sampler=dict(type='DefaultSampler', shuffle=True),
65
+ )
66
+
67
+ val_dataloader = dict(
68
+ batch_size=64,
69
+ num_workers=5,
70
+ dataset=dict(
71
+ type=dataset_type,
72
+ data_root='data/imagenet',
73
+ ann_file='meta/val.txt',
74
+ data_prefix='val',
75
+ pipeline=test_pipeline),
76
+ sampler=dict(type='DefaultSampler', shuffle=False),
77
+ )
78
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
79
+
80
+ # If you want standard test, please manually configure the test dataset
81
+ test_dataloader = val_dataloader
82
+ test_evaluator = val_evaluator
configs/_base_/datasets/imagenet_bs8_pil_bicubic_320.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'ImageNet'
3
+ data_preprocessor = dict(
4
+ # RGB format normalization parameters
5
+ mean=[122.5, 122.5, 122.5],
6
+ std=[122.5, 122.5, 122.5],
7
+ # convert image from BGR to RGB
8
+ to_rgb=True,
9
+ )
10
+
11
+ train_pipeline = [
12
+ dict(type='LoadImageFromFile'),
13
+ dict(
14
+ type='RandomResizedCrop',
15
+ scale=320,
16
+ backend='pillow',
17
+ interpolation='bicubic'),
18
+ dict(type='RandomFlip', prob=0.5, direction='horizontal'),
19
+ dict(type='PackClsInputs'),
20
+ ]
21
+
22
+ test_pipeline = [
23
+ dict(type='LoadImageFromFile'),
24
+ dict(
25
+ type='ResizeEdge',
26
+ scale=int(320 / 224 * 256),
27
+ edge='short',
28
+ backend='pillow',
29
+ interpolation='bicubic'),
30
+ dict(type='CenterCrop', crop_size=320),
31
+ dict(type='PackClsInputs'),
32
+ ]
33
+
34
+ train_dataloader = dict(
35
+ batch_size=8,
36
+ num_workers=5,
37
+ dataset=dict(
38
+ type=dataset_type,
39
+ data_root='data/imagenet',
40
+ ann_file='meta/train.txt',
41
+ data_prefix='train',
42
+ pipeline=train_pipeline),
43
+ sampler=dict(type='DefaultSampler', shuffle=True),
44
+ )
45
+
46
+ val_dataloader = dict(
47
+ batch_size=8,
48
+ num_workers=5,
49
+ dataset=dict(
50
+ type=dataset_type,
51
+ data_root='data/imagenet',
52
+ ann_file='meta/val.txt',
53
+ data_prefix='val',
54
+ pipeline=test_pipeline),
55
+ sampler=dict(type='DefaultSampler', shuffle=False),
56
+ )
57
+ val_evaluator = dict(type='Accuracy', topk=(1, 5))
58
+
59
+ # If you want standard test, please manually configure the test dataset
60
+ test_dataloader = val_dataloader
61
+ test_evaluator = val_evaluator
configs/_base_/datasets/lvis_v0.5_instance.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'LVISV05Dataset'
3
+ data_root = 'data/lvis_v0.5/'
4
+
5
+ # file_client_args = dict(
6
+ # backend='petrel',
7
+ # path_mapping=dict({
8
+ # './data/': 's3://openmmlab/datasets/detection/',
9
+ # 'data/': 's3://openmmlab/datasets/detection/'
10
+ # }))
11
+ file_client_args = dict(backend='disk')
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
15
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
16
+ dict(
17
+ type='RandomChoiceResize',
18
+ scales=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
19
+ (1333, 768), (1333, 800)],
20
+ keep_ratio=True),
21
+ dict(type='RandomFlip', prob=0.5),
22
+ dict(type='PackDetInputs')
23
+ ]
24
+ test_pipeline = [
25
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
26
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
27
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
28
+ dict(
29
+ type='PackDetInputs',
30
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
31
+ 'scale_factor'))
32
+ ]
33
+
34
+ train_dataloader = dict(
35
+ batch_size=2,
36
+ num_workers=2,
37
+ persistent_workers=True,
38
+ sampler=dict(type='DefaultSampler', shuffle=True),
39
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
40
+ dataset=dict(
41
+ type='ClassBalancedDataset',
42
+ oversample_thr=1e-3,
43
+ dataset=dict(
44
+ type=dataset_type,
45
+ data_root=data_root,
46
+ ann_file='annotations/lvis_v0.5_train.json',
47
+ data_prefix=dict(img='train2017/'),
48
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
49
+ pipeline=train_pipeline)))
50
+ val_dataloader = dict(
51
+ batch_size=1,
52
+ num_workers=2,
53
+ persistent_workers=True,
54
+ drop_last=False,
55
+ sampler=dict(type='DefaultSampler', shuffle=False),
56
+ dataset=dict(
57
+ type=dataset_type,
58
+ data_root=data_root,
59
+ ann_file='annotations/lvis_v0.5_val.json',
60
+ data_prefix=dict(img='val2017/'),
61
+ test_mode=True,
62
+ pipeline=test_pipeline))
63
+ test_dataloader = val_dataloader
64
+
65
+ val_evaluator = dict(
66
+ type='LVISMetric',
67
+ ann_file=data_root + 'annotations/lvis_v0.5_val.json',
68
+ metric=['bbox', 'segm'])
69
+ test_evaluator = val_evaluator
configs/_base_/datasets/lvis_v1_instance.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ _base_ = 'lvis_v0.5_instance.py'
3
+ dataset_type = 'LVISV1Dataset'
4
+ data_root = 'data/lvis_v1/'
5
+
6
+ train_dataloader = dict(
7
+ dataset=dict(
8
+ dataset=dict(
9
+ type=dataset_type,
10
+ data_root=data_root,
11
+ ann_file='annotations/lvis_v1_train.json',
12
+ data_prefix=dict(img=''))))
13
+ val_dataloader = dict(
14
+ dataset=dict(
15
+ type=dataset_type,
16
+ data_root=data_root,
17
+ ann_file='annotations/lvis_v1_val.json',
18
+ data_prefix=dict(img='')))
19
+ test_dataloader = val_dataloader
20
+
21
+ val_evaluator = dict(ann_file=data_root + 'annotations/lvis_v1_val.json')
22
+ test_evaluator = val_evaluator
configs/_base_/datasets/objects365v1_detection.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'Objects365V1Dataset'
3
+ data_root = 'data/Objects365/Obj365_v1/'
4
+
5
+ # file_client_args = dict(
6
+ # backend='petrel',
7
+ # path_mapping=dict({
8
+ # './data/': 's3://openmmlab/datasets/detection/',
9
+ # 'data/': 's3://openmmlab/datasets/detection/'
10
+ # }))
11
+ file_client_args = dict(backend='disk')
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
15
+ dict(type='LoadAnnotations', with_bbox=True),
16
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
17
+ dict(type='RandomFlip', prob=0.5),
18
+ dict(type='PackDetInputs')
19
+ ]
20
+ test_pipeline = [
21
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
22
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
23
+ # If you don't have a gt annotation, delete the pipeline
24
+ dict(type='LoadAnnotations', with_bbox=True),
25
+ dict(
26
+ type='PackDetInputs',
27
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
28
+ 'scale_factor'))
29
+ ]
30
+ train_dataloader = dict(
31
+ batch_size=2,
32
+ num_workers=2,
33
+ persistent_workers=True,
34
+ sampler=dict(type='DefaultSampler', shuffle=True),
35
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
36
+ dataset=dict(
37
+ type=dataset_type,
38
+ data_root=data_root,
39
+ ann_file='annotations/objects365_train.json',
40
+ data_prefix=dict(img='train/'),
41
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
42
+ pipeline=train_pipeline))
43
+ val_dataloader = dict(
44
+ batch_size=1,
45
+ num_workers=2,
46
+ persistent_workers=True,
47
+ drop_last=False,
48
+ sampler=dict(type='DefaultSampler', shuffle=False),
49
+ dataset=dict(
50
+ type=dataset_type,
51
+ data_root=data_root,
52
+ ann_file='annotations/objects365_val.json',
53
+ data_prefix=dict(img='val/'),
54
+ test_mode=True,
55
+ pipeline=test_pipeline))
56
+ test_dataloader = val_dataloader
57
+
58
+ val_evaluator = dict(
59
+ type='CocoMetric',
60
+ ann_file=data_root + 'annotations/objects365_val.json',
61
+ metric='bbox',
62
+ sort_categories=True,
63
+ format_only=False)
64
+ test_evaluator = val_evaluator
configs/_base_/datasets/objects365v2_detection.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dataset settings
2
+ dataset_type = 'Objects365V2Dataset'
3
+ data_root = 'data/Objects365/Obj365_v2/'
4
+
5
+ # file_client_args = dict(
6
+ # backend='petrel',
7
+ # path_mapping=dict({
8
+ # './data/': 's3://openmmlab/datasets/detection/',
9
+ # 'data/': 's3://openmmlab/datasets/detection/'
10
+ # }))
11
+ file_client_args = dict(backend='disk')
12
+
13
+ train_pipeline = [
14
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
15
+ dict(type='LoadAnnotations', with_bbox=True),
16
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
17
+ dict(type='RandomFlip', prob=0.5),
18
+ dict(type='PackDetInputs')
19
+ ]
20
+ test_pipeline = [
21
+ dict(type='LoadImageFromFile', file_client_args=file_client_args),
22
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
23
+ # If you don't have a gt annotation, delete the pipeline
24
+ dict(type='LoadAnnotations', with_bbox=True),
25
+ dict(
26
+ type='PackDetInputs',
27
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
28
+ 'scale_factor'))
29
+ ]
30
+ train_dataloader = dict(
31
+ batch_size=2,
32
+ num_workers=2,
33
+ persistent_workers=True,
34
+ sampler=dict(type='DefaultSampler', shuffle=True),
35
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
36
+ dataset=dict(
37
+ type=dataset_type,
38
+ data_root=data_root,
39
+ ann_file='annotations/zhiyuan_objv2_train.json',
40
+ data_prefix=dict(img='train/'),
41
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
42
+ pipeline=train_pipeline))
43
+ val_dataloader = dict(
44
+ batch_size=1,
45
+ num_workers=2,
46
+ persistent_workers=True,
47
+ drop_last=False,
48
+ sampler=dict(type='DefaultSampler', shuffle=False),
49
+ dataset=dict(
50
+ type=dataset_type,
51
+ data_root=data_root,
52
+ ann_file='annotations/zhiyuan_objv2_val.json',
53
+ data_prefix=dict(img='val/'),
54
+ test_mode=True,
55
+ pipeline=test_pipeline))
56
+ test_dataloader = val_dataloader
57
+
58
+ val_evaluator = dict(
59
+ type='CocoMetric',
60
+ ann_file=data_root + 'annotations/zhiyuan_objv2_val.json',
61
+ metric='bbox',
62
+ format_only=False)
63
+ test_evaluator = val_evaluator