MyGit

v1.0.0rc6

open-mmlab/mmagic

版本发布时间: 2023-03-03 15:44:03

open-mmlab/mmagic最新发布版本:v1.2.0(2023-12-18 21:52:42)

Highlights

We are excited to announce the release of MMEditing 1.0.0rc6. This release supports 50+ models, 222+ configs and 209+ checkpoints in MMGeneration and MMEditing. We highlight the following new features

Backwards Incompatible changes

  1. GenValLoop and MultiValLoop has been merged to EditValLoop, GenTestLoop and MultiTestLoop has been merged to EditTestLoop. Use case:
    Case 1: metrics on a single dataset

    >>> # add the following lines in your config
    >>> # 1. use `EditValLoop` instead of `ValLoop` in MMEngine
    >>> val_cfg = dict(type='EditValLoop')
    >>> # 2. specific EditEvaluator instead of Evaluator in MMEngine
    >>> val_evaluator = dict(
    >>>     type='EditEvaluator',
    >>>     metrics=[
    >>>         dict(type='PSNR', crop_border=2, prefix='Set5'),
    >>>         dict(type='SSIM', crop_border=2, prefix='Set5'),
    >>>     ])
    >>> # 3. define dataloader
    >>> val_dataloader = dict(...)

    Case 2: different metrics on different datasets

    >>> # add the following lines in your config
    >>> # 1. use `EditValLoop` instead of `ValLoop` in MMEngine
    >>> val_cfg = dict(type='EditValLoop')
    >>> # 2. specific a list EditEvaluator
    >>> # do not forget to add prefix for each metric group
    >>> div2k_evaluator = dict(
    >>>     type='EditEvaluator',
    >>>     metrics=dict(type='SSIM', crop_border=2, prefix='DIV2K'))
    >>> set5_evaluator = dict(
    >>>     type='EditEvaluator',
    >>>     metrics=[
    >>>         dict(type='PSNR', crop_border=2, prefix='Set5'),
    >>>         dict(type='SSIM', crop_border=2, prefix='Set5'),
    >>>     ])
    >>> # define evaluator config
    >>> val_evaluator = [div2k_evaluator, set5_evaluator]
    >>> # 3. specific a list dataloader for each metric groups
    >>> div2k_dataloader = dict(...)
    >>> set5_dataloader = dict(...)
    >>> # define dataloader config
    >>> val_dataloader = [div2k_dataloader, set5_dataloader]
  1. Support stack and split for EditDataSample, Use case:
# Example for `split`
gen_sample = EditDataSample()
gen_sample.fake_img = outputs  # tensor
gen_sample.noise = noise  # tensor
gen_sample.sample_kwargs = deepcopy(sample_kwargs)  # dict
gen_sample.sample_model = sample_model  # string
# set allow_nonseq_value as True to copy non-sequential data (sample_kwargs and sample_model for this example)
batch_sample_list = gen_sample.split(allow_nonseq_value=True)  

# Example for `stack`
data_sample1 = EditDataSample()
data_sample1.set_gt_label(1)
data_sample1.set_tensor_data({'img': torch.randn(3, 4, 5)})
data_sample1.set_data({'mode': 'a'})
data_sample1.set_metainfo({
    'channel_order': 'rgb',
    'color_flag': 'color'
})
data_sample2 = EditDataSample()
data_sample2.set_gt_label(2)
data_sample2.set_tensor_data({'img': torch.randn(3, 4, 5)})
data_sample2.set_data({'mode': 'b'})
data_sample2.set_metainfo({
    'channel_order': 'rgb',
    'color_flag': 'color'
})
data_sample_merged = EditDataSample.stack([data_sample1, data_sample2])
  1. GenDataPreprocessor has been merged into EditDataPreprocessor,

    • No changes are required other than changing the type field in config.
    • Users do not need to define input_view and output_view since we will infer the shape of mean automatically.
    • In evaluation stage, all tensors will be converted to BGR (for three-channel images) and [0, 255].
  2. PixelData has been removed.

  3. For BaseGAN/CondGAN models, real images are passed from data_samples.gt_img instead of inputs['img'].

New Features & Improvements

Bug Fixes

Contributors

A total of 17 developers contributed to this release. Thanks @plyfager, @LeoXing1996, @Z-Fran, @zengyh1900, @VongolaWu, @liuwenran, @austinmw, @dienachtderwelt, @liangzelong, @i-aki-y, @xiaomile, @Li-Qingyun, @vansin, @Luo-Yihang, @ydengbi, @ruoningYu, @triple-Mu

New Contributors

Full Changelog: https://github.com/open-mmlab/mmediting/compare/v1.0.0rc5...v1.0.0rc6

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-03-03发行的版本