Compare commits
3
Commits
seq_pyr
...
seq_pyr_fine
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19e868f271 | ||
|
|
1620f98d28 | ||
|
|
319dc9372b |
+2
-1
@@ -127,13 +127,14 @@ nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_skin" > nohup
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_curv" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_curv.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_curv_skirt" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_curv_skirt.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_reg" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_reg.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_seq" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_seq.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_seq_2_fine" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_seq_2_fine.out 2>&1 &
|
||||
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_512" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_512.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_512_skirt" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_512_skirt.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_512_skin" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_512_skin.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_512_curv" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_512_curv.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_512_reg" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_512_reg.out 2>&1 &
|
||||
nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128_256_512_fine" > nohup/iccv/pyr/iccv_pyr_32_64_128_256_512_fine.out 2>&1 &
|
||||
|
||||
nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32 > nohup/iccv/evaluate/iccv_pyr_32.out 2>&1 &
|
||||
nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32_skirt > nohup/iccv/evaluate/iccv_pyr_32_skirt.out 2>&1 &
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
config = dict()
|
||||
|
||||
config['gpu'] = '3'
|
||||
config['name'] = 'iccv_pyr_32_64_128_256_seq_2'
|
||||
config['gpu'] = '1'
|
||||
config['name'] = 'iccv_pyr_32_64_128_256_seq_2_fine'
|
||||
config['notes'] = ''
|
||||
config['tags'] = ['pyr', 'iccv']
|
||||
|
||||
@@ -22,12 +22,12 @@ config['use_offsets'] = False
|
||||
config['use_norm_loss'] = True
|
||||
config['use_curvature'] = True
|
||||
|
||||
config['pretrained_model'] = ''
|
||||
config['pretrained_model'] = 'checkpoints/iccv/iccv_pyr_32_64_128_256_seq_2'
|
||||
config['pretrained_model_iteration'] = ''
|
||||
|
||||
config['pyramid'] = dict()
|
||||
config['pyramid']['resolutions'] = [32, 64, 128, 256]
|
||||
config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccv/iccv_pyr_32_64_128_seq_2'
|
||||
config['pyramid']['pretrained_pyramid'] = ''
|
||||
config['pyramid']['final_upscale_enhancer'] = ''
|
||||
|
||||
config['train_dir'] = '/home/workspace/local-data/train'
|
||||
|
||||
+29
-19
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import sys
|
||||
from configs.iccv.config_abl_pyr_32_tshirt import config
|
||||
from configs.iccv.config_abl_pyr_32_64_128_256_seq import config
|
||||
|
||||
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = config['gpu']
|
||||
@@ -221,20 +221,25 @@ def train_step(batch):
|
||||
out_levels = model([levels_input, conds], training=True)
|
||||
|
||||
if config['use_skinning']:
|
||||
mesh_orig, uv_orig = batch['mesh_unposed'], batch['uv_unposed']
|
||||
mesh_orig = batch['mesh_unposed']
|
||||
else:
|
||||
mesh_orig, uv_orig = batch['mesh_posed'], batch['uv_posed']
|
||||
mesh_orig = batch['mesh_posed']
|
||||
|
||||
output = dict()
|
||||
reconstr_loss_total = 0
|
||||
kl_total = 0
|
||||
|
||||
#for i, res in enumerate(config['pyramid']['resolutions']):
|
||||
i = -1
|
||||
res = config['pyramid']['resolutions'][-1]
|
||||
for i, res in enumerate(config['pyramid']['resolutions']):
|
||||
# i = -1
|
||||
res = config['pyramid']['resolutions'][i] if i != len(config['pyramid']['resolutions']) - 1 else 512
|
||||
res_modifier = '_' + str(res) if res != 512 else ''
|
||||
pred, mean, logvar = out_levels[i]
|
||||
|
||||
if config['use_skinning']:
|
||||
uv_orig = batch['uv_unposed' + res_modifier]
|
||||
else:
|
||||
uv_orig = batch['uv_posed' + res_modifier]
|
||||
|
||||
mesh_pred = uv2mesh(pred)
|
||||
|
||||
if config['use_skinning']:
|
||||
@@ -252,7 +257,7 @@ def train_step(batch):
|
||||
e_loss = tf.reduce_mean(edge_loss(mesh_pred, mesh_orig, batch['mesh_mask']))
|
||||
c_loss, c_ratio = collision_penalty(mesh_pred_posed, batch['mesh_body_posed'], batch['mesh_mask'])
|
||||
c_loss, c_ratio = tf.reduce_mean(c_loss), tf.reduce_mean(c_ratio)
|
||||
l2_loss = tf.reduce_mean(1e3 * tf.reduce_mean(tf.reduce_sum(((uv_orig - pred) ** 2), axis=-1), axis=[1, 2]))
|
||||
l2_loss = tf.reduce_mean(1e3 * tf.reduce_mean(tf.reduce_sum(((uv_orig - pred) ** 2), axis=-1) * batch['uv_mask' + res_modifier], axis=[1, 2]))
|
||||
# ms_ssim = tf.reduce_mean(tf.image.ssim_multiscale(pred + 5, batch['uv_unposed'] + 5, max_val=10, power_factors=(0.5, 0.2, 0.1, 0.1, 0.1)))
|
||||
# ms_ssim = tf.reduce_mean(tf.image.ssim(pred + 1, batch['uv_unposed'] + 1, max_val=3))
|
||||
l2_mesh_loss = tf.reduce_mean(1e3 * tf.reduce_mean(tf.reduce_sum(batch['mesh_mask'][:,:,tf.newaxis] * (batch['mesh_posed'] - mesh_pred_posed) ** 2, axis=-1), axis=-1))
|
||||
@@ -278,8 +283,8 @@ def train_step(batch):
|
||||
|
||||
output = { **output, **{ 'train/edge_loss' + res_modifier: e_loss, 'train/collision_loss' + res_modifier: c_loss,'train/euclid_error' + res_modifier: metric,
|
||||
'train/mean' + res_modifier: mean, 'train/logvar' + res_modifier: logvar, 'train/kl_loss' + res_modifier: kl,
|
||||
'train/var' + res_modifier: np.e ** logvar, 'train/l2_loss' + res_modifier: l2_loss, 'train/normal_loss': n_loss,
|
||||
'train/euclid_error': metric, 'train/l2_mesh_loss': l2_mesh_loss } } # 'train/ms_ssim' + res_modifier: ms_ssim,
|
||||
'train/var' + res_modifier: np.e ** logvar, 'train/l2_loss' + res_modifier: l2_loss, 'train/normal_loss' + res_modifier: n_loss,
|
||||
'train/euclid_error' + res_modifier: metric, 'train/l2_mesh_loss' + res_modifier: l2_mesh_loss } } # 'train/ms_ssim' + res_modifier: ms_ssim,
|
||||
|
||||
loss = reconstr_loss_total + balancing_coeff * kl_total
|
||||
|
||||
@@ -295,20 +300,25 @@ def valid_step(batch):
|
||||
|
||||
|
||||
if config['use_skinning']:
|
||||
mesh_orig, uv_orig = batch['mesh_unposed'], batch['uv_unposed']
|
||||
mesh_orig = batch['mesh_unposed']
|
||||
else:
|
||||
mesh_orig, uv_orig = batch['mesh_posed'], batch['uv_posed']
|
||||
mesh_orig = batch['mesh_posed']
|
||||
|
||||
output = dict()
|
||||
reconstr_loss_total = 0
|
||||
kl_total = 0
|
||||
|
||||
#for i, res in enumerate(config['pyramid']['resolutions']):
|
||||
i = -1
|
||||
res = config['pyramid']['resolutions'][-1]
|
||||
for i, res in enumerate(config['pyramid']['resolutions']):
|
||||
# i = -1
|
||||
res = config['pyramid']['resolutions'][i] if i != len(config['pyramid']['resolutions']) - 1 else 512
|
||||
res_modifier = '_' + str(res) if res != 512 else ''
|
||||
pred, mean, logvar = out_levels[i]
|
||||
|
||||
if config['use_skinning']:
|
||||
uv_orig = batch['uv_unposed' + res_modifier]
|
||||
else:
|
||||
uv_orig = batch['uv_posed' + res_modifier]
|
||||
|
||||
mesh_pred = uv2mesh(pred)
|
||||
|
||||
if config['use_skinning']:
|
||||
@@ -325,7 +335,7 @@ def valid_step(batch):
|
||||
e_loss = tf.reduce_mean(edge_loss(mesh_pred, mesh_orig, batch['mesh_mask']))
|
||||
c_loss, c_ratio = collision_penalty(mesh_pred_posed, batch['mesh_body_posed'], batch['mesh_mask'])
|
||||
c_loss, c_ratio = tf.reduce_mean(c_loss), tf.reduce_mean(c_ratio)
|
||||
l2_loss = tf.reduce_mean(1e3 * tf.reduce_mean(tf.reduce_sum(((uv_orig - pred) ** 2), axis=-1), axis=[1, 2]))
|
||||
l2_loss = tf.reduce_mean(1e3 * tf.reduce_mean(tf.reduce_sum(((uv_orig - pred) ** 2), axis=-1) * batch['uv_mask' + res_modifier], axis=[1, 2]))
|
||||
# ms_ssim = tf.reduce_mean(tf.image.ssim_multiscale(pred + 5, batch['uv_unposed'] + 5, max_val=10, power_factors=(0.5, 0.2, 0.1, 0.1, 0.1)))
|
||||
# ms_ssim = tf.reduce_mean(tf.image.ssim(pred + 1, batch['uv_unposed'] + 1, max_val=3))
|
||||
l2_mesh_loss = tf.reduce_mean(1e3 * tf.reduce_mean(tf.reduce_sum(batch['mesh_mask'][:,:,tf.newaxis] * (batch['mesh_posed'] - mesh_pred_posed) ** 2, axis=-1), axis=-1))
|
||||
@@ -351,8 +361,8 @@ def valid_step(batch):
|
||||
|
||||
output = { **output, **{ 'valid/edge_loss' + res_modifier: e_loss, 'valid/collision_loss' + res_modifier: c_loss,'valid/euclid_error' + res_modifier: metric,
|
||||
'valid/mean' + res_modifier: mean, 'valid/logvar' + res_modifier: logvar, 'valid/kl_loss' + res_modifier: kl,
|
||||
'valid/var' + res_modifier: np.e ** logvar, 'valid/l2_loss' + res_modifier: l2_loss, 'valid/normal_loss': n_loss,
|
||||
'valid/euclid_error': metric, 'valid/l2_mesh_loss': l2_mesh_loss } } # 'valid/ms_ssim' + res_modifier: ms_ssim,
|
||||
'valid/var' + res_modifier: np.e ** logvar, 'valid/l2_loss' + res_modifier: l2_loss, 'valid/normal_loss' + res_modifier: n_loss,
|
||||
'valid/euclid_error' + res_modifier: metric, 'valid/l2_mesh_loss' + res_modifier: l2_mesh_loss } } # 'valid/ms_ssim' + res_modifier: ms_ssim,
|
||||
|
||||
loss = reconstr_loss_total + balancing_coeff * kl_total
|
||||
|
||||
@@ -852,8 +862,8 @@ if __name__ == '__main__':
|
||||
# load_model(model.upscale_enhancer, config['pyramid']['final_upscale_enhancer'])
|
||||
# model.upscale_enhancer.trainable = False
|
||||
|
||||
for i in range(len(model.levels)-1):
|
||||
model.levels[i].trainable = False
|
||||
# for i in range(len(model.levels)-1):
|
||||
# model.levels[i].trainable = False
|
||||
|
||||
# load_model(model.cond_encoder, config['pyramid']['pretrained_pyramid'])
|
||||
# load_model(model.levels[0], config['pyramid']['pretrained_pyramid'])
|
||||
|
||||
@@ -163,8 +163,8 @@ class PyramidNew(tf.keras.Model):
|
||||
pred = pred + levels_input[0][2] # uv_body_posed_32
|
||||
if 1 != len(self.levels):
|
||||
pred = self.levels[0].enhance(pred, levels_input[0][-2], training=training) # levels_input[i][-2]=uv_mask_res
|
||||
pred = tf.image.resize(pred, (self.levels[1].size, self.levels[1].size//2), tf.image.ResizeMethod.BILINEAR)
|
||||
out_levels.append([pred, mean, logvar])
|
||||
pred = tf.image.resize(pred, (self.levels[1].size, self.levels[1].size//2), tf.image.ResizeMethod.BILINEAR)
|
||||
pred = pred * levels_input[1][-2][:,:,:,tf.newaxis]
|
||||
else:
|
||||
# pred = self.enhance(pred, levels_input[0][-2], training=training)
|
||||
|
||||
Reference in New Issue
Block a user