FACEGOOD / FACEGOOD-Audio2Face

http://www.facegood.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

question about the implemtation of motion loss

qhanson opened this issue · comments

split_y = tf.split(y,2,0) #参数分别为:tensor,拆分数,维度
split_y_ = tf.split(y_,2,0) #参数分别为:tensor,拆分数,维度
# print(10)
y0 = split_y[0]
y1 = split_y[1]
y_0 = split_y_[0]
y_1 = split_y_[1]
loss_M = 2 * tf.reduce_mean(tf.square(y0 - y1 -y_0 + y_1))

Currenly, the motion loss is not caculated on the adjacent frames. tf.split() only split the tensor to parts greedily.

y0 = y[::2, ...]
y1 = y[1::2, ...]
y_0 = y_[::2, ...]
y_1 = y_[1::2, ...]

This array slice with step 2 can generate adjancet frames.