add posed mesh, metrics, tanh, l1 with gt

This commit is contained in:
2022-06-17 19:41:16 +00:00
parent cf1c536260
commit a14acceeb6
5 changed files with 87 additions and 33 deletions
+7 -2
View File
@@ -3,7 +3,7 @@ import tensorflow as tf
from stylegan2.layers.modulated_conv2d import ModulatedConv2D
from stylegan2.layers.bias_act import BiasAct
from stylegan2.layers.noise import Noise
from stylegan2.layers.to_rgb import ToRGB
from stylegan2.layers.to_rgb import ToRGB, ToRGBLast
from stylegan2.layers.cuda.upfirdn_2d_v2 import upsample_2d, compute_paddings
@@ -120,12 +120,17 @@ class Synthesis(tf.keras.layers.Layer):
prev_n_f = n_f
self.blocks = list()
self.torgbs = list()
for res, n_f in zip(self.resolutions[1:], self.featuremaps[1:]):
for res, n_f in zip(self.resolutions[1:-1], self.featuremaps[1:-1]):
self.blocks.append(SynthesisBlock(in_ch=prev_n_f, fmaps=n_f, res=res,
name='{:d}x{:d}/block'.format(res, res)))
self.torgbs.append(ToRGB(in_ch=n_f, res=res * 2, name='{:d}x{:d}/ToRGB'.format(res, res)))
prev_n_f = n_f
res, n_f = self.resolutions[-1], self.featuremaps[-1]
self.blocks.append(SynthesisBlock(in_ch=prev_n_f, fmaps=n_f, res=res,
name='{:d}x{:d}/block'.format(res, res)))
self.torgbs.append(ToRGBLast(in_ch=n_f, res=res * 2, name='{:d}x{:d}/ToRGB'.format(res, res)))
def call(self, inputs, training=None, mask=None):
w_broadcasted = inputs