Skip to content

Commit

Permalink
Bump version to v0.2.6 #20
Browse files Browse the repository at this point in the history
  • Loading branch information
Lupin1998 committed Sep 14, 2022
1 parent ab97e2a commit 7785c01
Show file tree
Hide file tree
Showing 83 changed files with 4,584 additions and 68 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ The main branch works with **PyTorch 1.8** (required by some self-supervised met

## What's New

[2020-08-19] Weights and logs for mixup benchmarks are released.

[2020-07-30] `OpenMixup` v0.2.5 is released (issue [#10](https://github.com/Westlake-AI/openmixup/issues/10)).
[2020-09-14] `OpenMixup` v0.2.6 is released (issue [#20](https://github.com/Westlake-AI/openmixup/issues/20)).

## Installation

Expand Down Expand Up @@ -91,6 +89,7 @@ Please refer to [Model Zoos](docs/en/model_zoos) for various backbones, mixup me
- [x] [ResNeXt](https://arxiv.org/abs/1611.05431) (CVPR'2017) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/resnet/)]
- [x] [SE-ResNet](https://arxiv.org/abs/1709.01507) (CVPR'2018) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/resnet/)]
- [x] [SE-ResNeXt](https://arxiv.org/abs/1709.01507) (CVPR'2018) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/resnet/)]
- [x] [ShuffleNetV1](https://arxiv.org/abs/1807.11164) (CVPR'2018)
- [x] [ShuffleNetV2](https://arxiv.org/abs/1807.11164) (ECCV'2018) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/shufflenet/)]
- [x] [MobileNetV2](https://arxiv.org/abs/1801.04381) (CVPR'2018) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/mobilenet_v2/)]
- [x] [MobileNetV3](https://arxiv.org/abs/1905.02244) (ICCV'2019)
Expand All @@ -104,8 +103,12 @@ Please refer to [Model Zoos](docs/en/model_zoos) for various backbones, mixup me
- [x] [UniFormer](https://arxiv.org/abs/2201.09450) (ICLR'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/uniformer/)]
- [x] [PoolFormer](https://arxiv.org/abs/2111.11418) (CVPR'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/poolformer/)]
- [x] [ConvNeXt](https://arxiv.org/abs/2201.03545) (CVPR'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/convnext/)]
- [x] [MViTV2](https://arxiv.org/abs/2112.01526) (CVPR'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/mvit/)]
- [x] [VAN](https://arxiv.org/abs/2202.09741) (ArXiv'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/van/)]
- [x] [LITv2](https://arxiv.org/abs/2205.13213) (ArXiv'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/lit_v2/)]
- [x] [HorNet](https://arxiv.org/abs/2207.14284) (ECCV'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/hornet/)]
- [x] [EdgeNeXt](https://arxiv.org/abs/2206.10589) (ECCVW'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/edgenext/)]
- [x] [EfficientFormer](https://arxiv.org/abs/2206.01191) (ArXiv'2022) [[config](https://github.com/Westlake-AI/openmixup/tree/main/configs/classification/imagenet/efficientformer/)]
</details>

* Mixup methods for supervised image classification.
Expand Down Expand Up @@ -182,22 +185,32 @@ This project is released under the [Apache 2.0 license](LICENSE).

## Citation

If you find this project useful in your research, please consider cite our repo:
If you find this project useful in your research, please consider cite our repo and tech report:

```BibTeX
@misc{2022openmixup,
title={{OpenMixup}: Open Mixup Toolbox and Benchmark for Visual Representation Learning},
author={Li, Siyuan and Liu, Zicheng and Wu, Di and Stan Z. Li},
author={Li, Siyuan and Liu, Zicheng and Wang, Zedong and Wu, Di and Stan Z. Li},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/Westlake-AI/openmixup}},
year={2022}
}
```
```BibTeX
@misc{li2022openmixup,
title={OpenMixup: Open Mixup Toolbox and Benchmark for Visual Representation Learning},
author={Li, Siyuan and Wang, Zedong and Liu, Zicheng and Wu, Di and Stan Z. Li},
year={2022},
eprint={2209.04851},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
```

## Contributors

For now, the direct contributors include: Siyuan Li ([@Lupin1998](https://github.com/Lupin1998)), Zicheng Liu ([@pone7](https://github.com/pone7)), Zedong Wang ([@Jacky1128](https://github.com/Jacky1128)), and Di Wu ([@wudi-bu](https://github.com/wudi-bu)). We thank contributors from MMSelfSup and MMClassification.
For now, the direct contributors include: Siyuan Li ([@Lupin1998](https://github.com/Lupin1998)), Zicheng Liu ([@pone7](https://github.com/pone7)), Zedong Wang ([@Jacky1128](https://github.com/Jacky1128)), and Di Wu ([@wudi-bu](https://github.com/wudi-bu)). We thank contributors from MMSelfSup and MMClassification and all public contributors!

## Contact

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Refers to `_RAND_INCREASING_TRANSFORMS` in pytorch-image-models
rand_increasing_policies = [
dict(type='AutoContrast'),
dict(type='Equalize'),
dict(type='Invert'),
dict(type='Rotate', magnitude_key='angle', magnitude_range=(0, 30)),
dict(type='Posterize', magnitude_key='bits', magnitude_range=(4, 0)),
dict(type='Solarize', magnitude_key='thr', magnitude_range=(256, 0)),
dict(type='SolarizeAdd', magnitude_key='magnitude', magnitude_range=(0, 110)),
dict(type='ColorTransform', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
dict(type='Contrast', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
dict(type='Brightness', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
dict(type='Sharpness', magnitude_key='magnitude', magnitude_range=(0, 0.9)),
dict(type='Shear',
magnitude_key='magnitude', magnitude_range=(0, 0.3), direction='horizontal'),
dict(type='Shear',
magnitude_key='magnitude', magnitude_range=(0, 0.3), direction='vertical'),
dict(type='Translate',
magnitude_key='magnitude', magnitude_range=(0, 0.45), direction='horizontal'),
dict(type='Translate',
magnitude_key='magnitude', magnitude_range=(0, 0.45), direction='vertical'),
]

# dataset settings
data_source_cfg = dict(type='ImageNet')
# ImageNet dataset
data_train_list = 'data/meta/ImageNet/train_labeled_full.txt'
data_train_root = 'data/ImageNet/train'
data_test_list = 'data/meta/ImageNet/val_labeled.txt'
data_test_root = 'data/ImageNet/val/'

dataset_type = 'ClassificationDataset'
img_norm_cfg = dict(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
train_pipeline = [
dict(type='RandomResizedCrop', size=256, interpolation=3), # bicubic
dict(type='RandomHorizontalFlip'),
dict(type='RandAugment',
policies=rand_increasing_policies,
num_policies=2, total_level=10,
magnitude_level=9, magnitude_std=0.5,
hparams=dict(
pad_val=[104, 116, 124], interpolation='bicubic')),
dict(type='ColorJitter', brightness=0.4, contrast=0.4, saturation=0.4),
dict(
type='RandomErasing_numpy', # before ToTensor and Normalize
erase_prob=0.25,
mode='rand', min_area_ratio=0.02, max_area_ratio=1 / 3,
fill_color=[104, 116, 124], fill_std=[58, 57, 57]), # RGB
]
test_pipeline = [
dict(type='Resize', size=292, interpolation=3), # 0.875
dict(type='CenterCrop', size=256),
dict(type='ToTensor'),
dict(type='Normalize', **img_norm_cfg),
]
# prefetch
prefetch = True
if not prefetch:
train_pipeline.extend([dict(type='ToTensor'), dict(type='Normalize', **img_norm_cfg)])

data = dict(
imgs_per_gpu=128,
workers_per_gpu=8,
train=dict(
type=dataset_type,
data_source=dict(
list_file=data_train_list, root=data_train_root,
**data_source_cfg),
pipeline=train_pipeline,
prefetch=prefetch,
),
val=dict(
type=dataset_type,
data_source=dict(
list_file=data_test_list, root=data_test_root, **data_source_cfg),
pipeline=test_pipeline,
prefetch=False,
))

# validation hook
evaluation = dict(
initial=False,
interval=1,
imgs_per_gpu=128,
workers_per_gpu=4,
eval_param=dict(topk=(1, 5)))

# checkpoint
checkpoint_config = dict(interval=1, max_keep_ckpts=1)
25 changes: 25 additions & 0 deletions configs/classification/_base_/models/edgenext/edgenext-base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='EdgeNeXt',
arch='base',
out_indices=(3, ),
drop_path_rate=0.1,
gap_before_final_norm=True,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=584, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Conv2d', 'Linear'], std=0.02, bias=0.),
dict(type='Constant', layer='BatchNorm', val=1., bias=0.)
],
)
25 changes: 25 additions & 0 deletions configs/classification/_base_/models/edgenext/edgenext-small.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='EdgeNeXt',
arch='small',
out_indices=(3, ),
drop_path_rate=0.1,
gap_before_final_norm=True,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=304, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Conv2d', 'Linear'], std=0.02, bias=0.),
dict(type='Constant', layer='BatchNorm', val=1., bias=0.)
],
)
25 changes: 25 additions & 0 deletions configs/classification/_base_/models/edgenext/edgenext-xsmall.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='EdgeNeXt',
arch='xsmall',
out_indices=(3, ),
drop_path_rate=0.1,
gap_before_final_norm=True,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=192, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Conv2d', 'Linear'], std=0.02, bias=0.),
dict(type='Constant', layer='BatchNorm', val=1., bias=0.)
],
)
25 changes: 25 additions & 0 deletions configs/classification/_base_/models/edgenext/edgenext-xxsmall.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='EdgeNeXt',
arch='xxsmall',
out_indices=(3, ),
drop_path_rate=0.1,
gap_before_final_norm=True,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=168, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Conv2d', 'Linear'], std=0.02, bias=0.),
dict(type='Constant', layer='BatchNorm', val=1., bias=0.)
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='EfficientFormer',
arch='l1',
drop_path_rate=0.,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=448, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Conv2d', 'Linear'], std=0.02, bias=0.),
dict(type='Constant', layer=['BatchNorm', 'LayerNorm'], val=1., bias=0.),
dict(type='Constant', layer=['LayerScale'], val=1e-5),
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='EfficientFormer',
arch='l3',
drop_path_rate=0.,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=512, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Conv2d', 'Linear'], std=0.02, bias=0.),
dict(type='Constant', layer=['BatchNorm', 'LayerNorm'], val=1., bias=0.),
dict(type='Constant', layer=['LayerScale'], val=1e-5),
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='EfficientFormer',
arch='l7',
drop_path_rate=0.,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=768, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Conv2d', 'Linear'], std=0.02, bias=0.),
dict(type='Constant', layer=['BatchNorm', 'LayerNorm'], val=1., bias=0.),
dict(type='Constant', layer=['LayerScale'], val=1e-5),
],
)
24 changes: 24 additions & 0 deletions configs/classification/_base_/models/hornet/hornet_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='HorNet',
arch='base',
drop_path_rate=0.5,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=1024, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Linear'], std=0.02, bias=0.),
dict(type='Constant', layer='LayerNorm', val=1., bias=0.),
dict(type='Constant', layer=['LayerScale'], val=1e-6),
],
)
24 changes: 24 additions & 0 deletions configs/classification/_base_/models/hornet/hornet_large.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# model settings
model = dict(
type='MixUpClassification',
pretrained=None,
alpha=[0.8, 1.0,],
mix_mode=["mixup", "cutmix",],
mix_args=dict(),
backbone=dict(
type='HorNet',
arch='large',
drop_path_rate=0.2,
),
head=dict(
type='ClsMixupHead', # mixup CE + label smooth
loss=dict(type='LabelSmoothLoss',
label_smooth_val=0.1, num_classes=1000, mode='original', loss_weight=1.0),
with_avg_pool=True,
in_channels=1536, num_classes=1000),
init_cfg=[
dict(type='TruncNormal', layer=['Linear'], std=0.02, bias=0.),
dict(type='Constant', layer='LayerNorm', val=1., bias=0.),
dict(type='Constant', layer=['LayerScale'], val=1e-6),
],
)
Loading

0 comments on commit 7785c01

Please sign in to comment.