forked from open-mmlab/mmagic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylegan3-r_cvt-official-rgb_8xb4x8_afhqv2-512x512.py
executable file
·53 lines (46 loc) · 1.47 KB
/
stylegan3-r_cvt-official-rgb_8xb4x8_afhqv2-512x512.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
_base_ = [
'../_base_/models/base_styleganv3.py', '../_base_/gen_default_runtime.py',
'../_base_/datasets/unconditional_imgs_flip_512x512.py'
]
synthesis_cfg = {
'type': 'SynthesisNetwork',
'channel_base': 65536,
'channel_max': 1024,
'magnitude_ema_beta': 0.999,
'conv_kernel': 1,
'use_radial_filters': True
}
model = dict(
generator=dict(
type='StyleGANv3Generator',
noise_size=512,
style_channels=512,
out_size=512,
img_channels=3,
rgb2bgr=True,
synthesis_cfg=synthesis_cfg),
discriminator=dict(type='StyleGAN2Discriminator', in_size=512))
batch_size = 4
data_root = 'data/afhqv2/'
train_dataloader = dict(
batch_size=batch_size, dataset=dict(data_root=data_root))
val_dataloader = dict(batch_size=batch_size, dataset=dict(data_root=data_root))
test_dataloader = dict(
batch_size=batch_size, dataset=dict(data_root=data_root))
train_cfg = train_dataloader = optim_wrapper = None
metrics = [
dict(
type='FrechetInceptionDistance',
prefix='FID-Full-50k',
fake_nums=50000,
inception_style='StyleGAN',
sample_model='ema')
]
# NOTE: config for save multi best checkpoints
# default_hooks = dict(
# checkpoint=dict(
# save_best=['FID-Full-50k/fid', 'IS-50k/is'],
# rule=['less', 'greater']))
default_hooks = dict(checkpoint=dict(save_best='FID-Full-50k/fid'))
val_evaluator = dict(metrics=metrics)
test_evaluator = dict(metrics=metrics)