diff --git a/.dev_scripts/README.md b/.dev_scripts/README.md index 44d1591e56..db0b9ac724 100644 --- a/.dev_scripts/README.md +++ b/.dev_scripts/README.md @@ -13,6 +13,7 @@ - [8. Deterministic training](#8-deterministic-training) - [9. Automatically check links](#9-automatically-check-links) - [10. Calculate flops](#10-calculate-flops) +- [11. Update model idnex](#11-update-model-index) ## 1. Check UT @@ -237,10 +238,18 @@ You can specify the `--target` by a file or a directory. **Notes:** DO NOT use it in CI, because requiring too many http requirements by CI will cause 503 and CI will propabaly fail. -10. Calculate flops +## 10. Calculate flops To summarize the flops of different models, you can run the following commands: ```bash python .dev_scripts/benchmark_valid_flop.py --flops --flops-str ``` + +## 11. Update model index + +To update model-index according to `README.md`, please run the following commands, + +```bash +python .dev_scripts/update_model_index.py +``` diff --git a/.dev_scripts/update_model_index.py b/.dev_scripts/update_model_index.py index 271d58e474..ecf655104e 100755 --- a/.dev_scripts/update_model_index.py +++ b/.dev_scripts/update_model_index.py @@ -41,7 +41,7 @@ def dump_yaml_and_check_difference(obj, file): if osp.isfile(file): file_exists = True - print(f' exist {file}') + # print(f' exist {file}') with open(file, 'r', encoding='utf-8') as f: str_orig = f.read() else: @@ -181,6 +181,7 @@ def parse_md(md_file): f'line {i+1} in {md_file}') i += 1 continue + if 'Method' in cols: config_idx = cols.index('Method') elif 'Config' in cols: @@ -188,6 +189,7 @@ def parse_md(md_file): else: print(cols) raise ValueError('Cannot find config Table.') + checkpoint_idx = cols.index('Download') try: flops_idx = cols.index('FLOPs') @@ -318,7 +320,7 @@ def parse_md(md_file): i += 1 if len(models) == 0: - warnings.warn('no model is found in this md file') + warnings.warn(f'no model is found in {md_file}') result = {'Collections': [collection], 'Models': models} yml_file = md_file.replace('README.md', 'metafile.yml') @@ -366,9 +368,11 @@ def update_model_index(): sys.exit(0) file_modified = False + # pbar = tqdm.tqdm(range(len(file_list)), initial=0, dynamic_ncols=True) for fn in file_list: - print(f'process {fn}') file_modified |= parse_md(fn) + # pbar.update(1) + # pbar.set_description(f'processing {fn}') file_modified |= update_model_index() diff --git a/configs/basicvsr_pp/README.md b/configs/basicvsr_pp/README.md index b81707f718..95b6894346 100644 --- a/configs/basicvsr_pp/README.md +++ b/configs/basicvsr_pp/README.md @@ -39,29 +39,12 @@ The pretrained weights of SPyNet can be found [here](https://download.openmmlab. Note that the following models are finetuned from smaller models. The training schemes of these models will be released when MMEditing reaches 5k stars. We provide the pre-trained models here. -**NTIRE 2021 Video Super-Resolution** - -[basicvsr-pp_c128n25_600k_ntire-vsr](./basicvsr-pp_c128n25_600k_ntire-vsr.py) - -[model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_vsr_20210311-1ff35292.pth) - -**NTIRE 2021 Quality Enhancement of Compressed Video - Track 1** - -[basicvsr-pp_c128n25_600k_ntire-decompress-track1](./basicvsr-pp_c128n25_600k_ntire-decompress-track1.py) - -[model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track1_20210223-7b2eba02.pth) - -**NTIRE 2021 Quality Enhancement of Compressed Video - Track 2** - -[basicvsr-pp_c128n25_600k_ntire-decompress-track2](./basicvsr-pp_c128n25_600k_ntire-decompress-track2.py) - -[model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track2_20210314-eeae05e6.pth) - -**NTIRE 2021 Quality Enhancement of Compressed Video - Track 3** - -[basicvsr-pp_c128n25_600k_ntire-decompress-track3](./basicvsr-pp_c128n25_600k_ntire-decompress-track3.py) - -[model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track3_20210304-6daf4a40.pth) +| Method | Download | Track | +| :-------------------------------------------------------------------: | :---------------------------------------------------------------------: | :----------------------------------------------------------: | +| [basicvsr-pp_c128n25_600k_ntire-vsr](./basicvsr-pp_c128n25_600k_ntire-vsr.py) | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_vsr_20210311-1ff35292.pth) | NTIRE 2021 Video Super-Resolution | +| [basicvsr-pp_c128n25_600k_ntire-decompress-track1](./basicvsr-pp_c128n25_600k_ntire-decompress-track1.py) | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track1_20210223-7b2eba02.pth) | NTIRE 2021 Quality Enhancement of Compressed Video - Track 1 | +| [basicvsr-pp_c128n25_600k_ntire-decompress-track2](./basicvsr-pp_c128n25_600k_ntire-decompress-track2.py) | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track2_20210314-eeae05e6.pth) | NTIRE 2021 Quality Enhancement of Compressed Video - Track 2 | +| [basicvsr-pp_c128n25_600k_ntire-decompress-track3](./basicvsr-pp_c128n25_600k_ntire-decompress-track3.py) | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track3_20210304-6daf4a40.pth) | NTIRE 2021 Quality Enhancement of Compressed Video - Track 3 | diff --git a/configs/basicvsr_pp/README_zh-CN.md b/configs/basicvsr_pp/README_zh-CN.md index 0c4810d3fd..3048631f78 100644 --- a/configs/basicvsr_pp/README_zh-CN.md +++ b/configs/basicvsr_pp/README_zh-CN.md @@ -31,13 +31,12 @@ SPyNet 的 预训练权重在[这里](https://download.openmmlab.com/mmediting/r 请注意,以下模型是从较小的模型中微调而来的。 这些模型的训练方案将在 MMEditing 达到 5k star 时发布。 我们在这里提供预训练的模型。 -[NTIRE 2021 Video Super-Resolution](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_vsr_20210311-1ff35292.pth) - -[NTIRE 2021 Quality Enhancement of Compressed Video - Track 1](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track1_20210223-7b2eba02.pth) - -[NTIRE 2021 Quality Enhancement of Compressed Video - Track 2](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track2_20210314-eeae05e6.pth) - -[NTIRE 2021 Quality Enhancement of Compressed Video - Track 3](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track3_20210304-6daf4a40.pth) +| 算法 | 模型 | 赛道 | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------ | +| [basicvsr-pp_c128n25_600k_ntire-vsr](./basicvsr-pp_c128n25_600k_ntire-vsr.py) | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_vsr_20210311-1ff35292.pth) | NTIRE 2021 Video Super-Resolution | +| [basicvsr-pp_c128n25_600k_ntire-decompress-track1](./basicvsr-pp_c128n25_600k_ntire-decompress-track1.py) | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track1_20210223-7b2eba02.pth) | NTIRE 2021 Quality Enhancement of Compressed Video - Track 1 | +| [basicvsr-pp_c128n25_600k_ntire-decompress-track2](./basicvsr-pp_c128n25_600k_ntire-decompress-track2.py) | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track2_20210314-eeae05e6.pth) | NTIRE 2021 Quality Enhancement of Compressed Video - Track 2 | +| [basicvsr-pp_c128n25_600k_ntire-decompress-track3](./basicvsr-pp_c128n25_600k_ntire-decompress-track3.py) | [model](https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track3_20210304-6daf4a40.pth) | NTIRE 2021 Quality Enhancement of Compressed Video - Track 3 | ``` diff --git a/configs/basicvsr_pp/metafile.yml b/configs/basicvsr_pp/metafile.yml index c974808abc..281df9e87a 100644 --- a/configs/basicvsr_pp/metafile.yml +++ b/configs/basicvsr_pp/metafile.yml @@ -109,3 +109,43 @@ Models: Vimeo-90K-T (BIx4) SSIM (Y): 0.9351 Task: Video Super-Resolution Weights: https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c64n7_8x1_300k_vimeo90k_bd_20210305-ab315ab1.pth +- Config: configs/basicvsr_pp/basicvsr-pp_c128n25_600k_ntire-vsr.py + In Collection: BasicVSR++ + Metadata: + Training Data: Others + Name: basicvsr-pp_c128n25_600k_ntire-vsr + Results: + - Dataset: Others + Metrics: {} + Task: Video Super-Resolution + Weights: https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_vsr_20210311-1ff35292.pth +- Config: configs/basicvsr_pp/basicvsr-pp_c128n25_600k_ntire-decompress-track1.py + In Collection: BasicVSR++ + Metadata: + Training Data: Others + Name: basicvsr-pp_c128n25_600k_ntire-decompress-track1 + Results: + - Dataset: Others + Metrics: {} + Task: Video Super-Resolution + Weights: https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track1_20210223-7b2eba02.pth +- Config: configs/basicvsr_pp/basicvsr-pp_c128n25_600k_ntire-decompress-track2.py + In Collection: BasicVSR++ + Metadata: + Training Data: Others + Name: basicvsr-pp_c128n25_600k_ntire-decompress-track2 + Results: + - Dataset: Others + Metrics: {} + Task: Video Super-Resolution + Weights: https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track2_20210314-eeae05e6.pth +- Config: configs/basicvsr_pp/basicvsr-pp_c128n25_600k_ntire-decompress-track3.py + In Collection: BasicVSR++ + Metadata: + Training Data: Others + Name: basicvsr-pp_c128n25_600k_ntire-decompress-track3 + Results: + - Dataset: Others + Metrics: {} + Task: Video Super-Resolution + Weights: https://download.openmmlab.com/mmediting/restorers/basicvsr_plusplus/basicvsr_plusplus_c128n25_ntire_decompress_track3_20210304-6daf4a40.pth diff --git a/configs/biggan/biggan_torch-sn_8xb32-1500kiters_imagenet1k-128x128.py b/configs/biggan/biggan_torch-sn_8xb32-1500kiters_imagenet1k-128x128.py deleted file mode 100644 index 3839c81a7d..0000000000 --- a/configs/biggan/biggan_torch-sn_8xb32-1500kiters_imagenet1k-128x128.py +++ /dev/null @@ -1,70 +0,0 @@ -_base_ = [ - '../_base_/models/biggan/base_biggan_128x128.py', - '../_base_/datasets/imagenet_noaug_128.py', - '../_base_/gen_default_runtime.py', -] - -# define model -ema_config = dict( - type='ExponentialMovingAverage', - interval=1, - momentum=0.9999, - update_buffers=True, - start_iter=20000) - -model = dict( - generator=dict(sn_style='torch'), - discriminator=dict(sn_style='torch'), - ema_config=ema_config) - -# define dataset -train_dataloader = dict( - batch_size=32, num_workers=8, dataset=dict(data_root='data/imagenet')) - -# define optimizer -optim_wrapper = dict( - generator=dict( - accumulative_counts=8, - optimizer=dict(type='Adam', lr=0.0001, betas=(0.0, 0.999), eps=1e-6)), - discriminator=dict( - accumulative_counts=8, - optimizer=dict(type='Adam', lr=0.0004, betas=(0.0, 0.999), eps=1e-6))) - -# VIS_HOOK -custom_hooks = [ - dict( - type='GenVisualizationHook', - interval=10000, - fixed_input=True, - # vis ema and orig at the same time - vis_kwargs_list=dict( - type='Noise', - name='fake_img', - sample_model='ema/orig', - target_keys=['ema', 'orig'])), -] - -# Traning sets' datasize 1,281,167 -train_cfg = dict(max_iters=1500000) - -metrics = [ - dict( - type='FrechetInceptionDistance', - prefix='FID-Full-50k', - fake_nums=50000, - inception_style='StyleGAN', - sample_model='ema'), - dict( - type='IS', - prefix='IS-50k', - fake_nums=50000, - inception_style='StyleGAN', - sample_model='ema') -] -# save multi best checkpoints -default_hooks = dict( - checkpoint=dict( - save_best=['FID-Full-50k/fid', 'IS-50k/is'], rule=['less', 'greater'])) - -val_evaluator = dict(metrics=metrics) -test_evaluator = dict(metrics=metrics) diff --git a/configs/cyclegan/README.md b/configs/cyclegan/README.md index dd408b0d1b..be402efad9 100644 --- a/configs/cyclegan/README.md +++ b/configs/cyclegan/README.md @@ -45,6 +45,8 @@ https://download.openmmlab.com/mmediting/cyclegan/refactor/cyclegan_in_1x1_80k_f `FID` comparison with official: + + | Dataset | facades | facades-id0 | summer2winter | summer2winter-id0 | winter2summer | winter2summer-id0 | horse2zebra | horse2zebra-id0 | zebra2horse | zebra2horse-id0 | average | | :------: | :---------: | :---------: | :-----------: | :---------------: | :-----------: | :---------------: | :---------: | :-------------: | :---------: | :-------------: | :--------: | | official | **123.626** | **119.726** | **77.342** | **76.773** | **72.631** | 74.239 | **62.111** | 77.202 | **138.646** | **137.050** | **95.935** | @@ -52,6 +54,8 @@ https://download.openmmlab.com/mmediting/cyclegan/refactor/cyclegan_in_1x1_80k_f `IS` comparison with evaluation: + + | Dataset | facades | facades-id0 | summer2winter | summer2winter-id0 | winter2summer | winter2summer-id0 | horse2zebra | horse2zebra-id0 | zebra2horse | zebra2horse-id0 | average | | :------: | :-------: | :---------: | :-----------: | :---------------: | :-----------: | :---------------: | :---------: | :-------------: | :---------: | :-------------: | :-------: | | official | 1.638 | 1.697 | 2.762 | **2.750** | **3.293** | **3.110** | 1.375 | **1.584** | **3.186** | 3.047 | 2.444 | diff --git a/configs/dim/README.md b/configs/dim/README.md index 283ceef496..9106ec9ac5 100644 --- a/configs/dim/README.md +++ b/configs/dim/README.md @@ -20,13 +20,14 @@ Image matting is a fundamental computer vision problem and has many applications ## Results and models -| Method | SAD | MSE | GRAD | CONN | GPU Info | Download | -| :-------------------------------------------------------: | :------: | :-------: | :------: | :------: | :------: | :----------------------------------------------------------------------------------------------------: | -| stage1 (paper) | 54.6 | 0.017 | 36.7 | 55.3 | - | - | -| stage3 (paper) | **50.4** | **0.014** | 31.0 | 50.8 | - | - | -| [stage1 (our)](./dim_stage1-v16_1xb1-1000k_comp1k.py) | 53.8 | 0.017 | 32.7 | 54.5 | 1 | [model](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage1_v16_1x1_1000k_comp1k_SAD-53.8_20200605_140257-979a420f.pth) \| [log](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage1_v16_1x1_1000k_comp1k_20200605_140257.log.json) | -| [stage2 (our)](./dim_stage2-v16-pln_1xb1-1000k_comp1k.py) | 52.3 | 0.016 | 29.4 | 52.4 | 1 | [model](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage2_v16_pln_1x1_1000k_comp1k_SAD-52.3_20200607_171909-d83c4775.pth) \| [log](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage2_v16_pln_1x1_1000k_comp1k_20200607_171909.log.json) | -| [stage3 (our)](./dim_stage3-v16-pln_1xb1-1000k_comp1k.py) | 50.6 | 0.015 | **29.0** | **50.7** | 1 | [model](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_SAD-50.6_20200609_111851-647f24b6.pth) \| [log](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_20200609_111851.log.json) | +| Method | SAD | MSE | GRAD | CONN | GPU Info | Download | +| :-------------------------------------------------------------------------: | :------: | :-------: | :------: | :------: | :------: | :----------------------------------------------------------------------------------: | +| stage1 (paper) | 54.6 | 0.017 | 36.7 | 55.3 | - | - | +| stage3 (paper) | **50.4** | **0.014** | 31.0 | 50.8 | - | - | +| [stage1 (our)](./dim_stage1-v16_1xb1-1000k_comp1k.py) | 53.8 | 0.017 | 32.7 | 54.5 | 1 | [model](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage1_v16_1x1_1000k_comp1k_SAD-53.8_20200605_140257-979a420f.pth) \| [log](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage1_v16_1x1_1000k_comp1k_20200605_140257.log.json) | +| [stage2 (our)](./dim_stage2-v16-pln_1xb1-1000k_comp1k.py) | 52.3 | 0.016 | 29.4 | 52.4 | 1 | [model](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage2_v16_pln_1x1_1000k_comp1k_SAD-52.3_20200607_171909-d83c4775.pth) \| [log](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage2_v16_pln_1x1_1000k_comp1k_20200607_171909.log.json) | +| [stage3 (our)](./dim_stage3-v16-pln_1xb1-1000k_comp1k.py) | 50.6 | 0.015 | **29.0** | **50.7** | 1 | [model](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_SAD-50.6_20200609_111851-647f24b6.pth) \| [log](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_20200609_111851.log.json) | +| [stage1 (online merge)](./dim_stage1-v16_1xb1-1000k_comp1k_online-merge.py) | - | - | - | - | - | - | **NOTE** diff --git a/configs/dim/README_zh-CN.md b/configs/dim/README_zh-CN.md index 681b592b66..518dd5f49b 100644 --- a/configs/dim/README_zh-CN.md +++ b/configs/dim/README_zh-CN.md @@ -21,13 +21,14 @@
-| 算法 | SAD | MSE | GRAD | CONN | GPU 信息 | 下载 | -| :----------------------------------------------------------: | :------: | :-------: | :------: | :------: | :------: | :-------------------------------------------------------------------------------------------------: | -| 第一阶段 (原文) | 54.6 | 0.017 | 36.7 | 55.3 | - | - | -| 第三阶段 (原文) | **50.4** | **0.014** | 31.0 | 50.8 | - | - | -| [第一阶段 (复现)](./dim_stage1-v16_1xb1-1000k_comp1k.py) | 53.8 | 0.017 | 32.7 | 54.5 | 1 | [模型](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage1_v16_1x1_1000k_comp1k_SAD-53.8_20200605_140257-979a420f.pth) \| [日志](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage1_v16_1x1_1000k_comp1k_20200605_140257.log.json) | -| [第二阶段 (复现)](./dim_stage2-v16-pln_1xb1-1000k_comp1k.py) | 52.3 | 0.016 | 29.4 | 52.4 | 1 | [模型](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage2_v16_pln_1x1_1000k_comp1k_SAD-52.3_20200607_171909-d83c4775.pth) \| [日志](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage2_v16_pln_1x1_1000k_comp1k_20200607_171909.log.json) | -| [第三阶段 (复现)](./dim_stage3-v16-pln_1xb1-1000k_comp1k.py) | 50.6 | 0.015 | **29.0** | **50.7** | 1 | [模型](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_SAD-50.6_20200609_111851-647f24b6.pth) \| [日志](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_20200609_111851.log.json) | +| 算法 | SAD | MSE | GRAD | CONN | GPU 信息 | 下载 | +| :---------------------------------------------------------------------------: | :------: | :-------: | :------: | :------: | :------: | :--------------------------------------------------------------------------------: | +| 第一阶段 (原文) | 54.6 | 0.017 | 36.7 | 55.3 | - | - | +| 第三阶段 (原文) | **50.4** | **0.014** | 31.0 | 50.8 | - | - | +| [第一阶段 (复现)](./dim_stage1-v16_1xb1-1000k_comp1k.py) | 53.8 | 0.017 | 32.7 | 54.5 | 1 | [模型](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage1_v16_1x1_1000k_comp1k_SAD-53.8_20200605_140257-979a420f.pth) \| [日志](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage1_v16_1x1_1000k_comp1k_20200605_140257.log.json) | +| [第二阶段 (复现)](./dim_stage2-v16-pln_1xb1-1000k_comp1k.py) | 52.3 | 0.016 | 29.4 | 52.4 | 1 | [模型](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage2_v16_pln_1x1_1000k_comp1k_SAD-52.3_20200607_171909-d83c4775.pth) \| [日志](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage2_v16_pln_1x1_1000k_comp1k_20200607_171909.log.json) | +| [第三阶段 (复现)](./dim_stage3-v16-pln_1xb1-1000k_comp1k.py) | 50.6 | 0.015 | **29.0** | **50.7** | 1 | [模型](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_SAD-50.6_20200609_111851-647f24b6.pth) \| [日志](https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_20200609_111851.log.json) | +| [第一阶段 (online merge)](./dim_stage1-v16_1xb1-1000k_comp1k_online-merge.py) | - | - | - | - | - | - | **注** diff --git a/configs/dim/metafile.yml b/configs/dim/metafile.yml index 83293d2c9c..a158b7a1a9 100644 --- a/configs/dim/metafile.yml +++ b/configs/dim/metafile.yml @@ -52,3 +52,14 @@ Models: SAD: 50.6 Task: Matting Weights: https://download.openmmlab.com/mmediting/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k_SAD-50.6_20200609_111851-647f24b6.pth +- Config: configs/dim/dim_stage1-v16_1xb1-1000k_comp1k_online-merge.py + In Collection: DIM + Metadata: + GPUs: '-' + Training Data: COMP1K + Name: dim_stage1-v16_1xb1-1000k_comp1k_online-merge + Results: + - Dataset: COMP1K + Metrics: {} + Task: Matting + Weights: '' diff --git a/configs/ggan/README.md b/configs/ggan/README.md index f09f6062ab..f4dfda02c7 100644 --- a/configs/ggan/README.md +++ b/configs/ggan/README.md @@ -35,6 +35,8 @@ Generative Adversarial Nets (GANs) represent an important milestone for effectiv Note: In the original implementation of [GGAN](https://github.com/lim0606/pytorch-geometric-gan), they set `G_iters` to 10. However our framework does not support `G_iters` currently, so we dropped the settings in the original implementation and conducted several experiments with our own settings. We have shown above the experiment results with the lowest `fid` score. \ Original settings and our settings: + + | Models | Dataset | Architecture | optimizer | lr_G | lr_D | G_iters | D_iters | | :----------------: | :------------: | :----------: | :-------: | :----: | :----: | :-----: | :-----: | | GGAN(origin) 64x64 | CelebA-Cropped | dcgan-archi | RMSprop | 0.0002 | 0.0002 | 10 | 1 | diff --git a/configs/guided_diffusion/README.md b/configs/guided_diffusion/README.md index f21407d179..0f107cc1a7 100644 --- a/configs/guided_diffusion/README.md +++ b/configs/guided_diffusion/README.md @@ -22,10 +22,11 @@ We show that diffusion models can achieve image sample quality superior to the c **ImageNet** -| Method | Resolution | Config | Weights | -| ------ | ---------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -| adm-u | 64x64 | [config](./adm-u_8xb32_imagenet-64x64.py) | [model](https://download.openmmlab.com/mmediting/guided_diffusion/adm-u-cvt-rgb_8xb32_imagenet-64x64-7ff0080b.pth) | -| adm-u | 512x512 | [config](./adm-u_8xb32_imagenet-512x512.py) | [model](https://download.openmmlab.com/mmediting/guided_diffusion/adm-u_8xb32_imagenet-512x512-60b381cb.pth) | +| Model | Resolution | Config | Download | +| :---: | :--------: | :-------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------: | +| adm-u | 64x64 | [config](./adm-u_8xb32_imagenet-64x64.py) | [model](https://download.openmmlab.com/mmediting/guided_diffusion/adm-u-cvt-rgb_8xb32_imagenet-64x64-7ff0080b.pth) | +| adm-u | 512x512 | [config](./adm-u_8xb32_imagenet-512x512.py) | [model](https://download.openmmlab.com/mmediting/guided_diffusion/adm-u_8xb32_imagenet-512x512-60b381cb.pth) | +| adm-u | 512x512 | [config](./adm-u_ddim250_8xb32_imagenet-512x512.py) | [model](<>) | **Note** To support disco diffusion, we support guided diffusion briefly. Complete support of guided diffusion with metrics and test/train logs will come soom! diff --git a/configs/guided_diffusion/metafile.yml b/configs/guided_diffusion/metafile.yml index 1eedef6e1a..8d8713eebb 100644 --- a/configs/guided_diffusion/metafile.yml +++ b/configs/guided_diffusion/metafile.yml @@ -6,4 +6,34 @@ Collections: Paper: - https://papers.nips.cc/paper/2021/file/49ad23d1ec9fa4bd8d77d02681df5cfa-Paper.pdf README: configs/guided_diffusion/README.md -Models: [] +Models: +- Config: configs/guided_diffusion/adm-u_8xb32_imagenet-64x64.py + In Collection: Guided Diffusion + Metadata: + Training Data: Others + Name: adm-u_8xb32_imagenet-64x64 + Results: + - Dataset: Others + Metrics: {} + Task: Image Generation + Weights: https://download.openmmlab.com/mmediting/guided_diffusion/adm-u-cvt-rgb_8xb32_imagenet-64x64-7ff0080b.pth +- Config: configs/guided_diffusion/adm-u_8xb32_imagenet-512x512.py + In Collection: Guided Diffusion + Metadata: + Training Data: Others + Name: adm-u_8xb32_imagenet-512x512 + Results: + - Dataset: Others + Metrics: {} + Task: Image Generation + Weights: https://download.openmmlab.com/mmediting/guided_diffusion/adm-u_8xb32_imagenet-512x512-60b381cb.pth +- Config: configs/guided_diffusion/adm-u_ddim250_8xb32_imagenet-512x512.py + In Collection: Guided Diffusion + Metadata: + Training Data: Others + Name: adm-u_ddim250_8xb32_imagenet-512x512 + Results: + - Dataset: Others + Metrics: {} + Task: Image Generation + Weights: <> diff --git a/configs/pix2pix/README.md b/configs/pix2pix/README.md index 3d0d7b4f5a..2ec6d0457a 100644 --- a/configs/pix2pix/README.md +++ b/configs/pix2pix/README.md @@ -36,6 +36,8 @@ We use `FID` and `IS` metrics to evaluate the generation performance of pix2pix. `FID` comparison with official: + + | Dataset | facades | aerial2maps | maps2aerial | edges2shoes | average | | :------: | :---------: | :----------: | :---------: | :---------: | :----------: | | official | **119.135** | 149.731 | 102.072 | **75.774** | 111.678 | @@ -43,6 +45,8 @@ We use `FID` and `IS` metrics to evaluate the generation performance of pix2pix. `IS` comparison with official: + + | Dataset | facades | aerial2maps | maps2aerial | edges2shoes | average | | :------: | :-------: | :---------: | :---------: | :---------: | :--------: | | official | **1.650** | 2.529 | **3.552** | 2.766 | 2.624 | diff --git a/configs/styleganv2/README.md b/configs/styleganv2/README.md index 37a45a7d8a..22edb54cb4 100644 --- a/configs/styleganv2/README.md +++ b/configs/styleganv2/README.md @@ -60,16 +60,6 @@ As shown in the figure, we provide **3** ways to do mixed-precision training for | stylegan2_c2_fp16-globalG-partialD_PL-R1-no-scaler_ffhq_256_b4x8_800k | the whole G in fp16 | FFHQ256 | 4.362 | [stylegan2_c2-PL-R1_8xb4-fp16-globalG-partialD-no-scaler-800kiters_ffhq-256x256](./stylegan2_c2-PL-R1_8xb4-fp16-globalG-partialD-no-scaler-800kiters_ffhq-256x256.py) | [ckpt](https://download.openmmlab.com/mmediting/stylegan2/stylegan2_c2_fp16-globalG-partialD_PL-R1-no-scaler_ffhq_256_b4x8_800k_20210508_114930-ef8270d4.pth) | | stylegan2_c2_apex_fp16_PL-R1-no-scaler_ffhq_256_b4x8_800k | the whole G&D in fp16 + two loss scaler | FFHQ256 | 4.614 | [stylegan2_c2-PL-R1_8xb4-apex-fp16-no-scaler-800kiters_ffhq-256x256](./stylegan2_c2-PL-R1_8xb4-apex-fp16-no-scaler-800kiters_ffhq-256x256.py) | [ckpt](https://download.openmmlab.com/mmediting/stylegan2/stylegan2_c2_apex_fp16_PL-R1-no-scaler_ffhq_256_b4x8_800k_20210508_114701-c2bb8afd.pth) | -In addition, we also provide `QuickTestImageDataset` to users for quickly checking whether the code can be run correctly. It's more important for FP16 experiments, because some cuda operations may no support mixed precision training. Esepcially for `APEX`, you can use [this config](./stylegan2_c2_8xb4-apex-fp16-800kiters_quicktest-ffhq-256x256.py) in your local machine by running: - -```bash -bash tools/dist_train.sh \ - configs/styleganv2/stylegan2_c2_8xb4-apex-fp16-800kiters_quicktest-ffhq-256x256.py 1 \ - --work-dir ./work_dirs/quick-test -``` - -With a similar way, users can switch to [config for partial-GD](./stylegan2_c2_8xb4-fp16-800kiters_quicktest-ffhq-256x256.py) and [config for globalG-partialD](./stylegan2_c2_8xb4-fp16-global-800kiters_quicktest-ffhq-256x256.py) to test the other two mixed precision training configuration. - *Note that to use the [APEX](https://github.com/NVIDIA/apex) toolkit, you have to installed it following the official guidance. (APEX is not included in our requirements.) If you are using GPUs without tensor core, you would better to switch to the newer PyTorch version (>= 1.7,0). Otherwise, the APEX installation or running may meet several bugs.* ## About Different Implementations of FID Metric @@ -90,11 +80,11 @@ More precalculated inception pickle files are listed here: ## About Different Implementation and Setting of PR Metric -| Model | P&R Details | Precision | Recall | -| :--------------------------------------------: | :------------------------------: | :-------: | :----: | -| stylegan2_config-f_ffhq_1024 (official weight) | use Tero's VGG16, P&R50k_full | 67.876 | 49.299 | -| stylegan2_config-f_ffhq_1024 (official weight) | use Tero's VGG16, P&R50k | 62.856 | 49.400 | -| stylegan2_config-f_ffhq_1024 (official weight) | use PyTorch's VGG16, P&R50k_full | 67.662 | 55.460 | +| Model | Config | Download | P&R Details | Precision | Recall | +| :--------------------------------------------: | :--------------------------------------------------: | :-----------------------------------------------------: | :------------------------------: | :-------: | :----: | +| stylegan2_config-f_ffhq_1024 (official weight) | [stylegan2_c2_8xb4_ffhq-1024x1024](./stylegan2_c2_8xb4_ffhq-1024x1024.py) | [model](https://download.openmmlab.com/mmediting/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth) | use Tero's VGG16, P&R50k_full | 67.876 | 49.299 | +| stylegan2_config-f_ffhq_1024 (official weight) | [stylegan2_c2_8xb4_ffhq-1024x1024](./stylegan2_c2_8xb4_ffhq-1024x1024.py) | [model](https://download.openmmlab.com/mmediting/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth) | use Tero's VGG16, P&R50k | 62.856 | 49.400 | +| stylegan2_config-f_ffhq_1024 (official weight) | [stylegan2_c2_8xb4_ffhq-1024x1024](./stylegan2_c2_8xb4_ffhq-1024x1024.py) | [model](https://download.openmmlab.com/mmediting/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth) | use PyTorch's VGG16, P&R50k_full | 67.662 | 55.460 | As shown in this table, `P&R50k_full` is the metric used in StyleGANv1 and StyleGANv2. `full` indicates that we use the whole dataset for extracting the real distribution, e.g., 70000 images in FFHQ dataset. However, adopting the VGG16 provided from [Tero](https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/metrics/vgg16.pt) requires that your PyTorch version must fulfill `>=1.6.0`. Be careful about using the PyTorch's VGG16 to extract features, which will cause higher precision and recall. diff --git a/configs/styleganv2/metafile.yml b/configs/styleganv2/metafile.yml index 88d6b0e23e..2badbaec55 100644 --- a/configs/styleganv2/metafile.yml +++ b/configs/styleganv2/metafile.yml @@ -190,3 +190,39 @@ Models: FID50k: 2.8185 Task: Unconditional GANs Weights: https://download.openmmlab.com/mmediting/stylegan2/stylegan2_c2_ffhq_1024_b4x8_20210407_150045-618c9024.pth +- Config: configs/styleganv2/stylegan2_c2_8xb4_ffhq-1024x1024.py + In Collection: StyleGANv2 + Metadata: + Training Data: FFHQ + Name: stylegan2_c2_8xb4_ffhq-1024x1024 + Results: + - Dataset: FFHQ + Metrics: + Precision: 67.876 + Recall: 49.299 + Task: Unconditional GANs + Weights: https://download.openmmlab.com/mmediting/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth +- Config: configs/styleganv2/stylegan2_c2_8xb4_ffhq-1024x1024.py + In Collection: StyleGANv2 + Metadata: + Training Data: FFHQ + Name: stylegan2_c2_8xb4_ffhq-1024x1024 + Results: + - Dataset: FFHQ + Metrics: + Precision: 62.856 + Recall: 49.4 + Task: Unconditional GANs + Weights: https://download.openmmlab.com/mmediting/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth +- Config: configs/styleganv2/stylegan2_c2_8xb4_ffhq-1024x1024.py + In Collection: StyleGANv2 + Metadata: + Training Data: FFHQ + Name: stylegan2_c2_8xb4_ffhq-1024x1024 + Results: + - Dataset: FFHQ + Metrics: + Precision: 67.662 + Recall: 55.46 + Task: Unconditional GANs + Weights: https://download.openmmlab.com/mmediting/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth diff --git a/configs/styleganv2/stylegan2_c2_8xb4-apex-fp16-800kiters_quicktest-ffhq-256x256.py b/configs/styleganv2/stylegan2_c2_8xb4-apex-fp16-800kiters_quicktest-ffhq-256x256.py deleted file mode 100644 index 021613a3f8..0000000000 --- a/configs/styleganv2/stylegan2_c2_8xb4-apex-fp16-800kiters_quicktest-ffhq-256x256.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Config for the `config-f` setting in StyleGAN2.""" - -_base_ = ['./stylegan2_c2_8xb4-800kiters_ffhq-256x256.py'] - -model = dict( - generator=dict(out_size=256), - discriminator=dict(in_size=256, convert_input_fp32=False), -) - -# remain to be refactored -apex_amp = dict( - mode='gan', init_args=dict(opt_level='O1', num_losses=2, loss_scale=512.)) - -train_cfg = dict(max_iters=800002) - -batch_size = 2 -dataset_type = 'QuickTestImageDataset' - -train_dataloader = dict(batch_size=batch_size, dataset=dict(type=dataset_type)) - -val_dataloader = dict(batch_size=batch_size, dataset=dict(type=dataset_type)) - -test_dataloader = dict( - batch_size=batch_size, dataset=dict(dataset_type=dataset_type)) - -default_hooks = dict(logger=dict(type='LoggerHook', interval=1)) - -# METRICS -metrics = [ - dict( - type='FrechetInceptionDistance', - prefix='FID-Full-50k', - fake_nums=50000, - inception_style='StyleGAN', - sample_model='ema') -] - -val_evaluator = dict(metrics=metrics) -test_evaluator = dict(metrics=metrics) diff --git a/configs/styleganv2/stylegan2_c2_8xb4-fp16-800kiters_quicktest-ffhq-256x256.py b/configs/styleganv2/stylegan2_c2_8xb4-fp16-800kiters_quicktest-ffhq-256x256.py deleted file mode 100644 index da117af082..0000000000 --- a/configs/styleganv2/stylegan2_c2_8xb4-fp16-800kiters_quicktest-ffhq-256x256.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Config for the `config-f` setting in StyleGAN2.""" - -_base_ = ['./stylegan2_c2_8xb4-800kiters_ffhq-256x256.py'] - -model = dict( - generator=dict(out_size=256, num_fp16_scales=4), - discriminator=dict(in_size=256, num_fp16_scales=4), - disc_auxiliary_loss=dict(data_info=dict(loss_scaler='loss_scaler')), - # gen_auxiliary_loss=dict(data_info=dict(loss_scaler='loss_scaler')), -) - -batch_size = 2 -dataset_type = 'QuickTestImageDataset' - -train_dataloader = dict(batch_size=batch_size, dataset=dict(type=dataset_type)) - -val_dataloader = dict(batch_size=batch_size, dataset=dict(type=dataset_type)) - -test_dataloader = dict( - batch_size=batch_size, dataset=dict(dataset_type=dataset_type)) - -default_hooks = dict(logger=dict(type='LoggerHook', interval=1)) - -train_cfg = dict(max_iters=800002) - -optim_wrapper = dict( - generator=dict(type='AmpOptimWrapper', loss_scale=512), - discriminator=dict(type='AmpOptimWrapper', loss_scale=512)) - -# METRICS -metrics = [ - dict( - type='FrechetInceptionDistance', - prefix='FID-Full-50k', - fake_nums=50000, - inception_style='StyleGAN', - sample_model='ema') -] - -val_evaluator = dict(metrics=metrics) -test_evaluator = dict(metrics=metrics) diff --git a/configs/styleganv2/stylegan2_c2_8xb4-fp16-global-800kiters_quicktest-ffhq-256x256.py b/configs/styleganv2/stylegan2_c2_8xb4-fp16-global-800kiters_quicktest-ffhq-256x256.py deleted file mode 100644 index a053408f29..0000000000 --- a/configs/styleganv2/stylegan2_c2_8xb4-fp16-global-800kiters_quicktest-ffhq-256x256.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Config for the `config-f` setting in StyleGAN2.""" - -_base_ = ['./stylegan2_c2_8xb4-800kiters_ffhq-256x256.py'] - -model = dict( - generator=dict(out_size=256, fp16_enabled=True), - discriminator=dict(in_size=256, fp16_enabled=True), - disc_auxiliary_loss=dict(data_info=dict(loss_scaler='loss_scaler')), - # gen_auxiliary_loss=dict(data_info=dict(loss_scaler='loss_scaler')), -) - -batch_size = 2 -dataset_type = 'QuickTestImageDataset' - -train_dataloader = dict(batch_size=batch_size, dataset=dict(type=dataset_type)) - -val_dataloader = dict(batch_size=batch_size, dataset=dict(type=dataset_type)) - -test_dataloader = dict( - batch_size=batch_size, dataset=dict(dataset_type=dataset_type)) - -default_hooks = dict(logger=dict(type='LoggerHook', interval=1)) - -train_cfg = dict(max_iters=800002) - -optim_wrapper = dict( - generator=dict(type='AmpOptimWrapper', loss_scale=512), - discriminator=dict(type='AmpOptimWrapper', loss_scale=512)) - -# METRICS -metrics = [ - dict( - type='FrechetInceptionDistance', - prefix='FID-Full-50k', - fake_nums=50000, - inception_style='StyleGAN', - sample_model='ema') -] - -val_evaluator = dict(metrics=metrics) -test_evaluator = dict(metrics=metrics) diff --git a/docs/en/.dev_scripts/update_model_zoo.py b/docs/en/.dev_scripts/update_model_zoo.py index 2025223cf3..2aa53298ee 100755 --- a/docs/en/.dev_scripts/update_model_zoo.py +++ b/docs/en/.dev_scripts/update_model_zoo.py @@ -6,13 +6,17 @@ import os import os.path as osp import re +from collections import OrderedDict from os.path import basename, dirname +from pathlib import Path -import numpy as np +# import numpy as np import titlecase +from modelindex.load_model_index import load from tqdm import tqdm github_link = 'https://github.com/open-mmlab/mmediting/blob/1.x/' +MMEDIT_ROOT = Path(__file__).absolute().parents[3] def anchor(name): @@ -28,6 +32,10 @@ def summarize(stats, name): [c for _, c, _, _, _, _, _ in stats]) allckpts = func.reduce(lambda a, b: a.union(b), [c for _, _, c, _, _, _, _ in stats]) + + for c in allpapers: + print('paper: ', c) + print(len(allpapers)) alltasks = func.reduce(lambda a, b: a.union(b), [t for _, _, _, t, _, _, _ in stats]) task_desc = '\n'.join([ @@ -36,10 +44,6 @@ def summarize(stats, name): ]) # Overview - papertypes, papercounts = np.unique([t for t, _ in allpapers], - return_counts=True) - countstr = '\n'.join( - [f' - {t}: {c}' for t, c in zip(papertypes, papercounts)]) countstr = '\n'.join([f' - ALGORITHM: {len(stats)}']) summary = f"""# {name} @@ -65,13 +69,19 @@ def summarize(stats, name): return summary -# Count algorithms def update_model_zoo(): + # target docs target_dir = 'model_zoo' - os.makedirs(target_dir, exist_ok=True) + # parse model-index.yml + model_index_file = MMEDIT_ROOT / 'model-index.yml' + model_index = load(str(model_index_file)) + model_index.build_models_with_collections() + models = OrderedDict({model.name: model for model in model_index.models}) + print(len(models.keys())) + root_dir = dirname(dirname(dirname(dirname(osp.abspath(__file__))))) files = sorted(glob.glob(osp.join(root_dir, 'configs/*/README.md'))) stats = [] @@ -110,7 +120,9 @@ def update_model_zoo(): # count configs configs = set(x.lower().strip() - for x in re.findall(r'/configs/.*?\.py', content)) + for x in re.findall(r'\(.*\.py\)', content)) + for c in list(configs): + print(c) # count ckpts ckpts = list(