File size: 3,021 Bytes
94ada0b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# @package _group_
name: stylenerf_ffhq

G_kwargs:
    class_name: "training.networks.Generator"
    z_dim: 512
    w_dim: 512

    mapping_kwargs:
        num_layers: ${spec.map}

    synthesis_kwargs:
        # global settings
        num_fp16_res: ${num_fp16_res}
        channel_base: 1
        channel_max: 1024
        conv_clamp: 256
        kernel_size: 1
        architecture: skip
        upsample_mode: "nn_cat"

        z_dim: 0
        resolution_vol: 128
        resolution_start: 128
        rgb_out_dim: 32

        use_noise: False
        module_name: "training.stylenerf.NeRFSynthesisNetwork"
        no_bbox: True
        margin: 0
        magnitude_ema_beta: 0.999

        camera_kwargs:
            range_v: [1.4157963267948965, 1.7257963267948966]
            range_u: [-0.3, 0.3]
            range_radius:  [1.0, 1.0]
            depth_range: [0.88, 1.12]
            fov: 12
            gaussian_camera: True
            angular_camera: True
            depth_transform: ~
            dists_normalized: True
            ray_align_corner: False
            bg_start: 0.5
        
        renderer_kwargs:
            n_ray_samples: 32
            abs_sigma: False
            hierarchical: True
            no_background: True
            
        foreground_kwargs:
            downscale_p_by: 1
            use_style: "StyleGAN2"
            predict_rgb: False
            use_viewdirs: False
            add_rgb: True
            n_blocks: 0

        input_kwargs:
            output_mode: 'tri_plane_reshape'
            input_mode: 'random'
            in_res:  4
            out_res: 256
            out_dim: 32

        upsampler_kwargs:
            no_2d_renderer: False
            no_residual_img: False
            block_reses: ~
            shared_rgb_style: False
            upsample_type: "bilinear"
        
        progressive: True

        # reuglarization
        n_reg_samples: 0
        reg_full: False

    encoder_kwargs:
        class_name: "training.stylenerf.Encoder"
        num_fp16_res: ${num_fp16_res}
        channel_base: ${spec.fmaps}
        channel_max: 512
        conv_clamp: 256
        architecture: skip
        progressive: ${..synthesis_kwargs.progressive}
        lowres_head: ${..synthesis_kwargs.resolution_start}
        upsample_type: "bilinear"
        model_kwargs:
            output_mode: "W+"
            predict_camera: False

D_kwargs:
    class_name: "training.stylenerf.Discriminator"
    epilogue_kwargs:
        mbstd_group_size: ${spec.mbstd}

    num_fp16_res: ${num_fp16_res}
    channel_base: ${spec.fmaps}
    channel_max: 512
    conv_clamp: 256
    architecture: skip
    
    predict_camera: True

    progressive: ${model.G_kwargs.synthesis_kwargs.progressive}
    lowres_head: ${model.G_kwargs.synthesis_kwargs.resolution_start}
    upsample_type: "bilinear"
    resize_real_early: True

# loss kwargs
loss_kwargs:
    pl_batch_shrink: 2
    pl_decay: 0.01
    pl_weight: 2
    style_mixing_prob: 0.9
    curriculum: [500,5000]