Skip to content

Commit 0c5643e

Browse files
authored
Merge pull request #277 from plyfager/s3-readme
[Feature] update s3 with training results
2 parents b460940 + 8261516 commit 0c5643e

File tree

5 files changed

+167
-10
lines changed

5 files changed

+167
-10
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
dataset_type = 'UnconditionalImageDataset'
2+
3+
train_pipeline = [
4+
dict(type='LoadImageFromFile', key='real_img'),
5+
dict(
6+
type='Resize',
7+
keys=['real_img'],
8+
scale=(256, 256),
9+
interpolation='lanczos',
10+
backend='pillow'),
11+
dict(type='Flip', keys=['real_img'], direction='horizontal'),
12+
dict(
13+
type='Normalize',
14+
keys=['real_img'],
15+
mean=[127.5] * 3,
16+
std=[127.5] * 3,
17+
to_rgb=False),
18+
dict(type='ImageToTensor', keys=['real_img']),
19+
dict(type='Collect', keys=['real_img'], meta_keys=['real_img_path'])
20+
]
21+
22+
# `samples_per_gpu` and `imgs_root` need to be set.
23+
data = dict(
24+
samples_per_gpu=None,
25+
workers_per_gpu=4,
26+
train=dict(
27+
type='RepeatDataset',
28+
times=100,
29+
dataset=dict(
30+
type=dataset_type, imgs_root=None, pipeline=train_pipeline)),
31+
val=dict(type=dataset_type, imgs_root=None, pipeline=train_pipeline))

configs/styleganv3/README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,31 @@ results pave the way for generative models better suited for video and animation
3232
<img src="https://user-images.githubusercontent.com/22982797/150450502-c182834f-796f-4397-bd38-df1efe4a8a47.png" width="800"/>
3333
</div>
3434

35+
We perform experiments on StyleGANv3 paper settings and also experimental settings.
36+
For user convenience, we also offer the converted version of official weights.
37+
38+
### Paper Settings
39+
| Model | Dataset | Iter |FID50k | Config | Log | Download |
40+
| :---------------------------------: | :-------------: | :-----------: | :-----------: |:---------------------------------------------------------------------------------------------------------------------------: | :-------------: |:--------------------------------------------------------------------------------------------------------------------------------------: |
41+
| stylegan3-t | ffhq 1024x1024 | 490000 | 3.37<sup>*</sup>| [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/styleganv3/stylegan3_t_noaug_fp16_gamma32.8_ffhq_1024_b4x8.py) | [log](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_noaug_fp16_gamma32.8_ffhq_1024_b4x8_20220322_090417.log.json) |[model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_noaug_fp16_gamma32.8_ffhq_1024_b4x8_best_fid_iter_490000_20220401_120733-4ff83434.pth) |
42+
| stylegan3-t-ada | metface 1024x1024 | 130000 | 15.09 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/styleganv3/stylegan3_t_ada_fp16_gamma6.6_metfaces_1024_b4x8.py) | [log](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_ada_fp16_gamma6.6_metfaces_1024_b4x8_20220328_142211.log.json) |[model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_ada_fp16_gamma6.6_metfaces_1024_b4x8_best_fid_iter_130000_20220401_115101-f2ef498e.pth) |
43+
44+
Note<sup>*</sup>: This setting still needs a few days to run through, we put out currently the best checkpoint, and we will update the results the first time on the end of the experiment.
45+
46+
### Experimental Settings
47+
| Model | Dataset |Iter | FID50k | Config | Log | Download |
48+
| :---------------------------------: | :-------------: |:-----------: | :-----------: |:---------------------------------------------------------------------------------------------------------------------------: | :-------------: |:--------------------------------------------------------------------------------------------------------------------------------------: |
49+
| stylegan3-t | ffhq 256x256 | 740000 |7.65 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/styleganv3/stylegan3_t_noaug_fp16_gamma2.0_ffhq_256_b4x8.py) | [log](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_noaug_fp16_gamma2.0_ffhq_256_b4x8_20220323_144815.log.json) |[model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_noaug_fp16_gamma2.0_ffhq_256_b4x8_best_fid_iter_740000_20220401_122456-730e1fba.pth) |
50+
51+
### Converted Weights
3552
| Model | Dataset | Comment | FID50k | EQ-T | EQ-R | Config | Download |
3653
| :---------------------------------: | :-------------: |:-------------: | :----: | :-----------: | :-----------: |:---------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------: |
37-
| stylegan3_config-T | ffhqu 256x256|official weight | 4.62 | 63.01 | 13.12 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_t_ffhqu_256_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_ffhqu_256_b4x8_cvt_official_rgb_20220329_235046-153df4c8.pth) |
38-
| stylegan3_config-T |afhqv2 512x512 |official weight | 4.04 | 60.15 | 13.51 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_t_afhqv2_512_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_afhqv2_512_b4x8_cvt_official_rgb_20220329_235017-ee6b037a.pth) |
39-
| stylegan3_config-T |ffhq 1024x1024 |official weight | 2.79 | 61.21 | 13.82 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_t_ffhq_1024_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_ffhq_1024_b4x8_cvt_official_rgb_20220329_235113-db6c6580.pth) |
40-
| stylegan3_config-R | ffhqu 256x256 |official weight | 4.50| 66.65 | 40.48 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_r_ffhqu_256_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_r_ffhqu_256_b4x8_cvt_official_rgb_20220329_234909-4521d963.pth) |
41-
| stylegan3_config-R | afhqv2 512x512 |official weight |4.40 |64.89 | 40.34 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_r_afhqv2_512_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_r_afhqv2_512_b4x8_cvt_official_rgb_20220329_234829-f2eaca72.pth) |
42-
| stylegan3_config-R |ffhq 1024x1024 |official weight |3.07 | 64.76 | 46.62 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_r_ffhq_1024_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_r_ffhq_1024_b4x8_cvt_official_rgb_20220329_234933-ac0500a1.pth) |
54+
| stylegan3-t | ffhqu 256x256|official weight | 4.62 | 63.01 | 13.12 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_t_ffhqu_256_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_ffhqu_256_b4x8_cvt_official_rgb_20220329_235046-153df4c8.pth) |
55+
| stylegan3-t |afhqv2 512x512 |official weight | 4.04 | 60.15 | 13.51 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_t_afhqv2_512_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_afhqv2_512_b4x8_cvt_official_rgb_20220329_235017-ee6b037a.pth) |
56+
| stylegan3-t |ffhq 1024x1024 |official weight | 2.79 | 61.21 | 13.82 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_t_ffhq_1024_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_ffhq_1024_b4x8_cvt_official_rgb_20220329_235113-db6c6580.pth) |
57+
| stylegan3-r | ffhqu 256x256 |official weight | 4.50| 66.65 | 40.48 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_r_ffhqu_256_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_r_ffhqu_256_b4x8_cvt_official_rgb_20220329_234909-4521d963.pth) |
58+
| stylegan3-r | afhqv2 512x512 |official weight |4.40 |64.89 | 40.34 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_r_afhqv2_512_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_r_afhqv2_512_b4x8_cvt_official_rgb_20220329_234829-f2eaca72.pth) |
59+
| stylegan3-r |ffhq 1024x1024 |official weight |3.07 | 64.76 | 46.62 | [config](https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_r_ffhq_1024_b4x8_cvt_official_rgb.py) | [model](https://download.openmmlab.com/mmgen/stylegan3/stylegan3_r_ffhq_1024_b4x8_cvt_official_rgb_20220329_234933-ac0500a1.pth) |
4360

4461

4562

@@ -73,7 +90,7 @@ https://user-images.githubusercontent.com/22982797/151504973-b96e1639-861d-434b-
7390

7491
https://user-images.githubusercontent.com/22982797/151505099-cde4999e-aab1-42d4-a458-3bb069db3d32.mp4
7592

76-
If you want to EQ-Metric for StyleGAN3, just add following codes into config.
93+
If you want to get EQ-Metric for StyleGAN3, just add following codes into config.
7794
```python
7895
metrics = dict(
7996
eqv=dict(

configs/styleganv3/metafile.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,45 @@ Collections:
77
- https://nvlabs-fi-cdn.nvidia.com/stylegan3/stylegan3-paper.pdf
88
README: configs/styleganv3/README.md
99
Models:
10+
- Config: https://github.com/open-mmlab/mmgeneration/tree/master/configs/styleganv3/stylegan3_t_noaug_fp16_gamma32.8_ffhq_1024_b4x8.py
11+
In Collection: StyleGANv3
12+
Metadata:
13+
Training Data: FFHQ
14+
Name: stylegan3_gamma32.8
15+
Results:
16+
- Dataset: FFHQ
17+
Metrics:
18+
FID50k: 3.37<sup></sup>
19+
Iter: 490000.0
20+
Log: '[log]'
21+
Task: Unconditional GANs
22+
Weights: https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_noaug_fp16_gamma32.8_ffhq_1024_b4x8_best_fid_iter_490000_20220401_120733-4ff83434.pth
23+
- Config: https://github.com/open-mmlab/mmgeneration/tree/master/configs/styleganv3/stylegan3_t_ada_fp16_gamma6.6_metfaces_1024_b4x8.py
24+
In Collection: StyleGANv3
25+
Metadata:
26+
Training Data: Others
27+
Name: stylegan3_t_ada_fp16_gamma6.6_metfaces_1024_b4x8
28+
Results:
29+
- Dataset: Others
30+
Metrics:
31+
FID50k: 15.09
32+
Iter: 130000.0
33+
Log: '[log]'
34+
Task: Unconditional GANs
35+
Weights: https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_ada_fp16_gamma6.6_metfaces_1024_b4x8_best_fid_iter_130000_20220401_115101-f2ef498e.pth
36+
- Config: https://github.com/open-mmlab/mmgeneration/tree/master/configs/styleganv3/stylegan3_t_noaug_fp16_gamma2.0_ffhq_256_b4x8.py
37+
In Collection: StyleGANv3
38+
Metadata:
39+
Training Data: FFHQ
40+
Name: stylegan3_gamma2.0
41+
Results:
42+
- Dataset: FFHQ
43+
Metrics:
44+
FID50k: 7.65
45+
Iter: 740000.0
46+
Log: '[log]'
47+
Task: Unconditional GANs
48+
Weights: https://download.openmmlab.com/mmgen/stylegan3/stylegan3_t_noaug_fp16_gamma2.0_ffhq_256_b4x8_best_fid_iter_740000_20220401_122456-730e1fba.pth
1049
- Config: https://github.com/open-mmlab/mmgeneration/tree/master/configs/_base_/models/stylegan/stylegan3_t_ffhqu_256_b4x8_cvt_official_rgb.py
1150
In Collection: StyleGANv3
1251
Metadata:
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
_base_ = [
2+
'../_base_/models/stylegan/stylegan3_base.py',
3+
'../_base_/datasets/unconditional_imgs_flip_lanczos_resize_256x256.py',
4+
'../_base_/default_runtime.py'
5+
]
6+
7+
synthesis_cfg = {
8+
'type': 'SynthesisNetwork',
9+
'channel_base': 16384,
10+
'channel_max': 512,
11+
'magnitude_ema_beta': 0.999
12+
}
13+
r1_gamma = 2. # set by user
14+
d_reg_interval = 16
15+
16+
model = dict(
17+
type='StaticUnconditionalGAN',
18+
generator=dict(out_size=256, img_channels=3, synthesis_cfg=synthesis_cfg),
19+
discriminator=dict(in_size=256, channel_multiplier=1),
20+
gan_loss=dict(type='GANLoss', gan_type='wgan-logistic-ns'),
21+
disc_auxiliary_loss=dict(loss_weight=r1_gamma / 2.0 * d_reg_interval))
22+
23+
imgs_root = 'data/ffhq/images'
24+
data = dict(
25+
samples_per_gpu=4,
26+
train=dict(dataset=dict(imgs_root=imgs_root)),
27+
val=dict(imgs_root=imgs_root))
28+
29+
ema_half_life = 10. # G_smoothing_kimg
30+
custom_hooks = [
31+
dict(
32+
type='VisualizeUnconditionalSamples',
33+
output_dir='training_samples',
34+
interval=5000),
35+
dict(
36+
type='ExponentialMovingAverageHook',
37+
module_keys=('generator_ema', ),
38+
interp_mode='lerp',
39+
interval=1,
40+
start_iter=0,
41+
momentum_policy='rampup',
42+
momentum_cfg=dict(
43+
ema_kimg=10, ema_rampup=0.05, batch_size=32, eps=1e-8),
44+
priority='VERY_HIGH')
45+
]
46+
47+
inception_pkl = 'work_dirs/inception_pkl/ffhq-lanczos-256x256.pkl'
48+
metrics = dict(
49+
fid50k=dict(
50+
type='FID',
51+
num_images=50000,
52+
inception_pkl=inception_pkl,
53+
inception_args=dict(type='StyleGAN'),
54+
bgr2rgb=True))
55+
56+
inception_path = None
57+
evaluation = dict(
58+
type='GenerativeEvalHook',
59+
interval=10000,
60+
metrics=dict(
61+
type='FID',
62+
num_images=50000,
63+
inception_pkl=inception_pkl,
64+
inception_args=dict(type='StyleGAN', inception_path=inception_path),
65+
bgr2rgb=True),
66+
sample_kwargs=dict(sample_model='ema'))
67+
68+
checkpoint_config = dict(interval=10000, by_epoch=False, max_keep_ckpts=30)
69+
70+
lr_config = None
71+
72+
total_iters = 800002

configs/styleganv3/stylegan3_t_noaug_fp16_gamma32.8_ffhq_1024_b4x8.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
inception_args=dict(type='StyleGAN'),
5757
bgr2rgb=True))
5858

59-
inception_path = '/mnt/lustre/yangyifei1/repos/fix-s3/work_dirs/cache/inception-2015-12-05.pt' # noqa
59+
inception_path = None
6060
evaluation = dict(
6161
type='GenerativeEvalHook',
6262
interval=10000,
@@ -72,5 +72,3 @@
7272
lr_config = None
7373

7474
total_iters = 800002
75-
76-
allow_tf32 = False

0 commit comments

Comments
 (0)