Skip to content

Commit

Permalink
Merge branch 'mmagic' into sd-inferencer
Browse files Browse the repository at this point in the history
Conflicts:
	tests/test_mmagic.py
  • Loading branch information
liuwenran committed Apr 24, 2023
2 parents 2c0aa63 + babe8ff commit c063cb9
Show file tree
Hide file tree
Showing 170 changed files with 382 additions and 416 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ python -c "import mmagic; print(mmagic.__version__)"
```

**Getting Started**

Please see [quick run](docs/en/get_started/quick_run.md) and [inference](docs/en/user_guides/inference.md) for the basic usage of MMagic.

**Install MMagic from source**

You can also experiment on the latest developed version rather than the stable release by installing MMagic from source with the following commands:

```shell
Expand Down Expand Up @@ -395,7 +397,7 @@ If MMagic is helpful to your research, please cite it as below.

```bibtex
@misc{mmagic2023,
title = {{MMagic}: {OpenMMLab} Image and Video Editing Toolbox},
title = {{MMagic}: {OpenMMLab} Multimodal Advanced, Generative, and Intelligent Creation Toolbox},
author = {{MMagic Contributors}},
howpublished = {\url{https://github.com/open-mmlab/mmagic}},
year = {2023}
Expand Down
5 changes: 3 additions & 2 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
- 支持本地可视化以及使用 tensorboard 或 wandb的可视化.
- 支持 33+ 算法 Pytorch 2.0 加速.

**MMagic** 已经支持了[MMEditing](https://github.com/open-mmlab/mmediting) and [MMGeneration](https://github.com/open-mmlab/mmgeneration)[MMGeneration](https://github.com/open-mmlab/mmgeneration)中的全量任务、模型、优化函数和评价指标 ,并基于[MMEngine](https://github.com/open-mmlab/mmengine)统一了各组件接口 😍。
**MMagic** 已经支持了[MMEditing](https://github.com/open-mmlab/mmediting)[MMGeneration](https://github.com/open-mmlab/mmgeneration)中的全量任务、模型、优化函数和评价指标 ,并基于[MMEngine](https://github.com/open-mmlab/mmengine)统一了各组件接口 😍。

如果想了解更多版本更新细节和历史信息,请阅读[更新日志](docs/zh_cn/changelog.md)。如果想从[旧版本](https://github.com/open-mmlab/mmagic/tree/master) MMEditing 0.x 迁移到新版本 MMagic 1.x,请阅读[迁移文档](docs/zh_cn/migration/overview.md)

Expand Down Expand Up @@ -190,6 +190,7 @@ python -c "import mmagic; print(mmagic.__version__)"
请参考[快速运行](docs/zh_cn/get_started/quick_run.md)[推理演示](docs/zh_cn/user_guides/inference.md)获取 MMagic 的基本用法。

**从源码安装 MMagic**

使用以下命令从源码安装 MMagic,你可以选择不使用已发布的稳定版本,而在最新开发的版本上进行实验。

```
Expand Down Expand Up @@ -391,7 +392,7 @@ MMagic 是一款由不同学校和公司共同贡献的开源项目。我们感

```bibtex
@misc{mmagic2023,
title = {{MMagic}: {OpenMMLab} Image and Video Editing Toolbox},
title = {{MMagic}: {OpenMMLab} Multimodal Advanced, Generative, and Intelligent Creation Toolbox},
author = {{MMagic Contributors}},
howpublished = {\url{https://github.com/open-mmlab/mmagic}},
year = {2023}
Expand Down
8 changes: 4 additions & 4 deletions configs/_base_/datasets/basicvsr_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dict(type='GenerateSegmentIndices', interval_list=[1]),
dict(type='LoadImageFromFile', key='img', channel_order='rgb'),
dict(type='LoadImageFromFile', key='gt', channel_order='rgb'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

reds_dataloader = dict(
Expand Down Expand Up @@ -39,7 +39,7 @@
dict(type='LoadImageFromFile', key='img', channel_order='rgb'),
dict(type='LoadImageFromFile', key='gt', channel_order='rgb'),
dict(type='MirrorSequence', keys=['img']),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

vimeo_90k_bd_dataloader = dict(
Expand Down Expand Up @@ -96,7 +96,7 @@
filename_tmpl='{:04d}.png'),
dict(type='LoadImageFromFile', key='img', channel_order='rgb'),
dict(type='LoadImageFromFile', key='gt', channel_order='rgb'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

udm10_dataloader = dict(
Expand All @@ -123,7 +123,7 @@
dict(type='GenerateSegmentIndices', interval_list=[1]),
dict(type='LoadImageFromFile', key='img', channel_order='rgb'),
dict(type='LoadImageFromFile', key='gt', channel_order='rgb'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]
vid4_bd_dataloader = dict(
num_workers=1,
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/cifar10_noaug.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cifar_pipeline = [dict(type='PackEditInputs')]
cifar_pipeline = [dict(type='PackInputs')]
cifar_dataset = dict(
type='CIFAR10',
data_root='./data',
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/cifar10_nopad.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cifar_pipeline = [
dict(type='Flip', keys=['gt'], flip_ratio=0.5, direction='horizontal'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]
cifar_dataset = dict(
type='CIFAR10',
Expand All @@ -10,7 +10,7 @@
pipeline=cifar_pipeline)

# test dataset do not use flip
cifar_pipeline_test = [dict(type='PackEditInputs')]
cifar_pipeline_test = [dict(type='PackInputs')]
cifar_dataset_test = dict(
type='CIFAR10',
data_root='./data',
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/deblurring-defocus_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

dpdd_data_root = 'data/DPDD'
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/deblurring-motion_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

gopro_data_root = 'data/GoPro'
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/decompression_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
params=dict(quality=[quality, quality]),
bgr2rgb=True,
keys=['img']),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

classic5_data_root = 'data/Classic5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
gaussian_sigma=[sigma, sigma],
gaussian_gray_noise_prob=0),
keys=['img']),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

data_root = 'data/denoising_gaussian_test'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
gaussian_sigma=[sigma, sigma],
gaussian_gray_noise_prob=1),
keys=['img']),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

data_root = 'data/denoising_gaussian_test'
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/denoising-real_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

sidd_data_root = 'data/SIDD'
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/deraining_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

rain100h_data_root = 'data/Rain100H'
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/ffhq_flip.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
train_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='Flip', keys=['gt'], direction='horizontal'),
dict(type='PackEditInputs', keys='gt')
dict(type='PackInputs', keys='gt')
]

val_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='PackEditInputs', keys=['gt'])
dict(type='PackInputs', keys=['gt'])
]

# `batch_size` and `data_root` need to be set.
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/grow_scale_imgs_ffhq_styleganv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='Flip', keys='gt', direction='horizontal'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

train_dataloader = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/imagenet_128.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
dict(type='RandomCropLongEdge', keys='gt'),
dict(type='Resize', scale=(128, 128), keys='gt', backend='pillow'),
dict(type='Flip', keys='gt', flip_ratio=0.5, direction='horizontal'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

test_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='CenterCropLongEdge', keys='gt'),
dict(type='Resize', scale=(128, 128), keys='gt', backend='pillow'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

train_dataloader = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/imagenet_256.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
dict(type='RandomCropLongEdge', keys=['img']),
dict(type='Resize', scale=(256, 256), keys=['img'], backend='pillow'),
dict(type='Flip', keys=['img'], flip_ratio=0.5, direction='horizontal'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

test_pipeline = [
dict(type='LoadImageFromFile', key='img'),
dict(type='CenterCropLongEdge', keys=['img']),
dict(type='Resize', scale=(256, 256), backend='pillow'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

train_dataloader = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/imagenet_512.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
dict(type='RandomCropLongEdge', keys='gt'),
dict(type='Resize', scale=(512, 512), keys='gt', backend='pillow'),
dict(type='Flip', keys='gt', flip_ratio=0.5, direction='horizontal'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

test_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='CenterCropLongEdge', keys='gt'),
dict(type='Resize', scale=(512, 512), keys='gt', backend='pillow'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

train_dataloader = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/imagenet_64.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
dict(type='RandomCropLongEdge', keys='gt'),
dict(type='Resize', scale=(64, 64), keys='gt', backend='pillow'),
dict(type='Flip', keys='gt', flip_ratio=0.5, direction='horizontal'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

test_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='CenterCropLongEdge', keys='gt'),
dict(type='Resize', scale=(64, 64), keys='gt', backend='pillow'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

train_dataloader = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/imagenet_noaug_128.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
dict(type='LoadImageFromFile', key='img'),
dict(type='CenterCropLongEdge'),
dict(type='Resize', scale=(128, 128), backend='pillow'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

test_pipeline = [
dict(type='LoadImageFromFile', key='img'),
dict(type='CenterCropLongEdge'),
dict(type='Resize', scale=(128, 128), backend='pillow'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

train_dataloader = dict(
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/liif_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
dict(
type='RandomDownSampling', scale_min=scale_test, scale_max=scale_test),
dict(type='GenerateCoordinateAndCell', scale=scale_test, reshape_gt=False),
dict(type='PackEditInputs')
dict(type='PackInputs')
] for scale_test in scale_test_list]

# test config for Set5
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/lsun_stylegan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

train_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

val_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

# `batch_size` and `data_root` need to be set.
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/paired_imgs_256x256_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# f'img_{domain_b}': f'img_{domain_b}'
# }),
# dict(
# type='PackEditInputs',
# type='PackInputs',
# keys=[f'img_{domain_a}', f'img_{domain_b}'],
# data_keys=[f'img_{domain_a}', f'img_{domain_b}'])
]
Expand Down Expand Up @@ -64,7 +64,7 @@
# f'img_{domain_b}': f'img_{domain_b}'
# }),
# dict(
# type='PackEditInputs',
# type='PackInputs',
# keys=[f'img_{domain_a}', f'img_{domain_b}'],
# data_keys=[f'img_{domain_a}', f'img_{domain_b}'])
]
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/sisr_x2_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

# test config for Set5
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/sisr_x3_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

# test config for Set5
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/sisr_x4_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

# test config for Set5
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/datasets/tdan_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dict(type='GenerateFrameIndiceswithPadding', padding='reflection'),
dict(type='LoadImageFromFile', key='img', channel_order='rgb'),
dict(type='LoadImageFromFile', key='gt', channel_order='rgb'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

SPMC_bd_dataloader = dict(
Expand Down Expand Up @@ -63,7 +63,7 @@
dict(type='GenerateFrameIndiceswithPadding', padding='reflection'),
dict(type='LoadImageFromFile', key='img', channel_order='rgb'),
dict(type='LoadImageFromFile', key='gt', channel_order='rgb'),
dict(type='PackEditInputs')
dict(type='PackInputs')
]
vid4_bd_dataloader = dict(
num_workers=1,
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/unconditional_imgs_128x128.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
train_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='Resize', keys='gt', scale=(128, 128)),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

# `batch_size` and `data_root` need to be set.
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/unconditional_imgs_64x64.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
train_pipeline = [
dict(type='LoadImageFromFile', key='gt'),
dict(type='Resize', keys='gt', scale=(64, 64)),
dict(type='PackEditInputs')
dict(type='PackInputs')
]

# `batch_size` and `data_root` need to be set.
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/unconditional_imgs_flip_512x512.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dict(type='LoadImageFromFile', key='gt'),
dict(type='Resize', keys='gt', scale=(512, 512)),
dict(type='Flip', keys=['gt'], direction='horizontal'), # TODO:
dict(type='PackEditInputs')
dict(type='PackInputs')
]

# `batch_size` and `data_root` need to be set.
Expand Down
Loading

0 comments on commit c063cb9

Please sign in to comment.