From 3b414e76d3f259f2e480497b696b96e361161f19 Mon Sep 17 00:00:00 2001 From: Hunor Laczko Date: Fri, 3 Mar 2023 12:45:49 +0000 Subject: [PATCH] lot more training --- aaa_helpers.txt | 42 ++++ calculate_error.py | 25 ++- configs/iccv/config_abl_pyr_32.py | 4 +- configs/iccv/config_abl_pyr_32_64.py | 4 +- configs/iccv/config_abl_pyr_32_64_curv.py | 190 +++++++++++++++++ .../iccv/config_abl_pyr_32_64_curv_skirt.py | 190 +++++++++++++++++ configs/iccv/config_abl_pyr_32_64_reg.py | 190 +++++++++++++++++ .../iccv/config_abl_pyr_32_64_reg_skirt.py | 190 +++++++++++++++++ configs/iccv/config_abl_pyr_32_64_skin.py | 11 +- configs/iccv/config_abl_pyr_32_curv.py | 2 +- configs/iccv/config_abl_pyr_32_curv_skirt.py | 4 +- configs/iccv/config_abl_pyr_32_reg.py | 4 +- configs/iccv/config_abl_pyr_32_reg_skirt.py | 4 +- configs/iccv/config_abl_pyr_32_skin.py | 5 +- configs/iccv/config_abl_pyr_32_skin_skirt.py | 5 +- configs/iccv/config_abl_pyr_32_skirt.py | 5 +- configs/iccv/config_abl_pyr_64_cape_f.py | 11 +- .../iccv/config_abl_pyr_64_cape_f_03223_SL.py | 192 +++++++++++++++++ .../iccv/config_abl_pyr_64_cape_f_03223_SS.py | 192 +++++++++++++++++ configs/iccv/config_abl_pyr_64_cape_m.py | 189 +++++++++++++++++ .../iccv/config_abl_pyr_64_cape_m_00032_SL.py | 193 ++++++++++++++++++ cvae_pyramid.py | 4 +- downscale.py | 2 +- evaluate_ae_pyramid.py | 18 +- run_parallel.py | 10 +- 25 files changed, 1632 insertions(+), 54 deletions(-) create mode 100644 configs/iccv/config_abl_pyr_32_64_curv.py create mode 100644 configs/iccv/config_abl_pyr_32_64_curv_skirt.py create mode 100644 configs/iccv/config_abl_pyr_32_64_reg.py create mode 100644 configs/iccv/config_abl_pyr_32_64_reg_skirt.py create mode 100644 configs/iccv/config_abl_pyr_64_cape_f_03223_SL.py create mode 100644 configs/iccv/config_abl_pyr_64_cape_f_03223_SS.py create mode 100644 configs/iccv/config_abl_pyr_64_cape_m.py create mode 100644 configs/iccv/config_abl_pyr_64_cape_m_00032_SL.py diff --git a/aaa_helpers.txt b/aaa_helpers.txt index 139809f..8830491 100644 --- a/aaa_helpers.txt +++ b/aaa_helpers.txt @@ -72,10 +72,52 @@ nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_reg_skirt" > nohup/iccv/ nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64" > nohup/iccv/pyr/iccv_pyr_32_64.out 2>&1 & nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_skin" > nohup/iccv/pyr/iccv_pyr_32_64_skin.out 2>&1 & nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_skirt" > nohup/iccv/pyr/iccv_pyr_32_64_skirt.out 2>&1 & +nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_curv" > nohup/iccv/pyr/iccv_pyr_32_64_curv.out 2>&1 & +nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_curv_skirt" > nohup/iccv/pyr/iccv_pyr_32_64_curv_skirt.out 2>&1 & +nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_reg" > nohup/iccv/pyr/iccv_pyr_32_64_reg.out 2>&1 & +nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_reg_skirt" > nohup/iccv/pyr/iccv_pyr_32_64_reg_skirt.out 2>&1 & nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_64_cape_f" > nohup/iccv/pyr/iccv_pyr_64_cape_f.out 2>&1 & +nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_64_cape_m" > nohup/iccv/pyr/iccv_pyr_64_cape_m.out 2>&1 & +nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_64_cape_m_00032_SL" > nohup/iccv/pyr/iccv_pyr_64_cape_m_00032_SL.out 2>&1 & nohup python cvae_pyramid.py --name="lhunor_iccv_pyr_32_64_128" > nohup/iccv/pyr/iccv_pyr_32_64_128.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 & +nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32_skin > nohup/iccv/evaluate/iccv_pyr_32_skin.out 2>&1 & +nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32_skin_skirt > nohup/iccv/evaluate/iccv_pyr_32_skin_skirt.out 2>&1 & +nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32_reg > nohup/iccv/evaluate/iccv_pyr_32_reg.out 2>&1 & +nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32_reg_skirt > nohup/iccv/evaluate/iccv_pyr_32_reg_skirt.out 2>&1 & +nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32_curv > nohup/iccv/evaluate/iccv_pyr_32_curv.out 2>&1 & +nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32_curv_skirt > nohup/iccv/evaluate/iccv_pyr_32_curv_skirt.out 2>&1 & + +nohup python evaluate_ae_pyramid.py --name evaluate_ae_iccv_pyr_32_64 > nohup/iccv/evaluate/iccv_pyr_32_64.out 2>&1 & + + + + + + + + + + + + + + + + + + + + + + + + skirts!!!!iccv_pyr_32_curv_skirt pyramid next week diff --git a/calculate_error.py b/calculate_error.py index 61871d3..5dbf53f 100644 --- a/calculate_error.py +++ b/calculate_error.py @@ -1,6 +1,6 @@ import os import sys -from configs.config_abl_all_post import config +from configs.iccv.config_abl_pyr_32_curv import config os.environ["CUDA_VISIBLE_DEVICES"] = config['gpu'] # import tensorflow as tf @@ -59,21 +59,26 @@ if __name__ == '__main__': folder = config['test_dir'] checkpoint_name = config['name'] - iteration = '' + # iteration = '200000' F = np.load("custom_utils/smpl_faces" + skirt_modifier + ".npy").astype(np.int32) garment_type_table = np.load('custom_data/garment_type_table_test.npy', allow_pickle=True).item() - output_folder = '/home/workspace/data/results/post/' + checkpoint_name + '-' + iteration + output_folder = '/home/workspace/local-data/results/iccv/' + checkpoint_name + '-' + # check if there is a folder that starts with this name using glob + folders = glob.glob(output_folder + '*') + assert len(folders) == 1, 'There should be only one checkpoint that starts with this name' + output_folder = folders[0] + iteration = output_folder.split('-')[-1] - faces_folder = '/home/workspace/data/results/support/faces' + ('_skirt' if config['is_skirt'] else '') - ids = os.listdir(faces_folder) - ids = [id.split('.')[0] for id in ids] - faces = {id : np.load(faces_folder + '/' + id + '.npy') for id in ids } + # faces_folder = '/home/workspace/data/results/support/faces' + ('_skirt' if config['is_skirt'] else '') + # ids = os.listdir(faces_folder) + # ids = [id.split('.')[0] for id in ids] + # faces = {id : np.load(faces_folder + '/' + id + '.npy') for id in ids } - masks_folder = '/home/workspace/data/dataset/test' + ('_skirt' if config['is_skirt'] else '') + '_ready' + ('_2' if config['is_skirt'] else '') + '/mesh_mask' + masks_folder = '/home/workspace/local-data' + ('' if config['is_skirt'] else '_127') + '/test' + ('_skirt' if config['is_skirt'] else '') + '_ready' + ('_2' if config['is_skirt'] else '') + '/mesh_mask' ids = os.listdir(masks_folder) ids = [id.split('.')[0] for id in ids] masks = {id : np.load(masks_folder + '/' + id + '.npy') for id in ids } @@ -86,7 +91,7 @@ if __name__ == '__main__': else: gt_name = 'mesh_posed' - orig_folder = '/home/workspace/data/dataset/test' + ('_skirt' if config['is_skirt'] else '') + '_ready' + ('_2' if config['is_skirt'] else '') + '/' + gt_name + orig_folder = '/home/workspace/local-data' + ('' if config['is_skirt'] else '_127') + '/test' + ('_skirt' if config['is_skirt'] else '') + '_ready' + ('_2' if config['is_skirt'] else '') + '/' + gt_name errors = dict() if config['is_skirt']: @@ -107,7 +112,7 @@ if __name__ == '__main__': for key in per_garment_errors.keys(): print(key + ': ' + str(np.mean(per_garment_errors[key]))) - with open('/home/workspace/data/results/errors/post/' + checkpoint_name + '-' + iteration + '.csv', mode='w') as f: + with open('/home/workspace/data/results/errors/iccv/' + checkpoint_name + '-' + iteration + '.csv', mode='w') as f: file_writer = csv.writer(f, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL) for key in sorted(errors.keys()): diff --git a/configs/iccv/config_abl_pyr_32.py b/configs/iccv/config_abl_pyr_32.py index fccf0fd..858bfa4 100644 --- a/configs/iccv/config_abl_pyr_32.py +++ b/configs/iccv/config_abl_pyr_32.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '3' +config['gpu'] = '4' config['name'] = 'iccv_pyr_32' config['notes'] = '' config['tags'] = ['pyr', 'iccv'] @@ -32,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data/train' config['valid_dir'] = '/home/workspace/local-data/valid' -config['test_dir'] = '/home/workspace/data/dataset/test_ready' +config['test_dir'] = '/home/workspace/local-data_127/test_ready' config['batch_size'] = 4 config['is_skirt'] = False config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_32_64.py b/configs/iccv/config_abl_pyr_32_64.py index 43a732e..64a6e36 100644 --- a/configs/iccv/config_abl_pyr_32_64.py +++ b/configs/iccv/config_abl_pyr_32_64.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '3' +config['gpu'] = '4' config['name'] = 'iccv_pyr_32_64' config['notes'] = '' config['tags'] = ['pyr', 'iccv'] @@ -32,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data_127/train' config['valid_dir'] = '/home/workspace/local-data_127/valid' -config['test_dir'] = '/home/workspace/data/dataset/test_ready' +config['test_dir'] = '/home/workspace/local-data_127/test_ready' config['batch_size'] = 4 config['is_skirt'] = False config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_32_64_curv.py b/configs/iccv/config_abl_pyr_32_64_curv.py new file mode 100644 index 0000000..c33a985 --- /dev/null +++ b/configs/iccv/config_abl_pyr_32_64_curv.py @@ -0,0 +1,190 @@ +config = dict() + +config['gpu'] = '4' +config['name'] = 'iccv_pyr_32_64_curv' +config['notes'] = '' +config['tags'] = ['pyr', 'iccv', 'curv'] + +# DON'T FORGET TO RESET SSIM LOSS USAGE +# DON'T FORGET TO CHECK MODEL LOADING +# DON'T FORGET TO CHECK IF STORE IN MEMORY +# DON'T FORGET TO CHECK REG LOSS COEFF +# DON'T FORGET TO LOAD FINAL UPSCALER UNLESS HAVE LEVEL 512 +# DON'T FORGET TO CHECK IF SKIRT +# DON'T FORGET TO CHECK IF CAPE +# DON'T FORGET TO CHECK IF USING DOWNSCALE NONE OR _2 +# DON'T FORGET TO CHECK UPSCALING and ENCODER CHECKPOINTS + +config['use_skinning'] = True # and deshaping +config['remove_global_orientation'] = True +config['use_extra_losses'] = True # edge, collision, 3d mesh +config['use_offsets'] = False +config['use_norm_loss'] = True +config['use_curvature'] = False + +config['pretrained_model'] = '' +config['pretrained_model_iteration'] = '' + +config['pyramid'] = dict() +config['pyramid']['resolutions'] = [32, 64] +config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccv/iccv_pyr_32_curv' +config['pyramid']['pretrained_pyramid_iteration'] = '150000' +config['pyramid']['final_upscale_enhancer'] = '' + +config['train_dir'] = '/home/workspace/local-data/train' +config['valid_dir'] = '/home/workspace/local-data/valid' +config['test_dir'] = '/home/workspace/data/dataset/test_ready' +config['batch_size'] = 4 +config['is_skirt'] = False +config['is_cape'] = False + +config['dataset_in_memory'] = False +config['resolution'] = None + +config['smpl_res'] = 14475 +if config['is_cape']: + config['smpl_res'] = 3638 + +config['lr'] = 0.0001 +config['starting_balancing_coeff'] = 0.001 +config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision +config['avg_garment_path'] = '' +config['bottleneck_scale'] = 2 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'pose_shape': (72 + 11,), + 'uv_body_posed': (512, 256, 3), + 'mesh_body_posed': (config['smpl_res'], 3,), + 'mesh_posed': (config['smpl_res'], 3,), + 'mesh_unposed': (config['smpl_res'], 3,), + 'uv_unposed': (512, 256, 3), + 'uv_curvature': (512, 256, 7), + } +config['signature_static'] = { 'uv_static': (512, 256, 3), + 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + +config['pyramid']['is_label'] = False +config['pyramid']['add_noise'] = False +config['pyramid']['noise_amount'] = 0.0 + +config['pyramid']['loss_weights'] = [1,1,1,1,1] + +for res in config['pyramid']['resolutions']: + if res != 512: + res_modifier = '_' + str(res) + config['signature_dynamic']['uv_body_posed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_unposed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_curvature' + res_modifier] = (res, res//2, 7) + config['signature_static']['uv_static' + res_modifier] = (res, res//2, 3) + config['signature_static']['uv_mask' + res_modifier] = (res, res//2) + + +config['pyramid']['static_model'] = 'checkpoints/iccv/static_iccv_1' +config['pyramid']['body_model'] = 'checkpoints/iccv/body_iccv_1' +config['pyramid']['curvature_model'] = 'checkpoints/iccv/curv_iccv_1' +config['pyramid']['freeze_encoders'] = True + + +config['pyramid']['levels'] = [] +for res in config['pyramid']['resolutions']: + if res == 512: + level = dict() + level['resolution'] = 512 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 7 + level['encoder_depths'] = [3, 3, 9, 3] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (16, 8, 80) + level['decoder_depths'] = [3, 3, 9, 3] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = '' + config['pyramid']['levels'].append(level) + elif res == 256: + level = dict() + level['resolution'] = 256 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [9, 9, 9, 9] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (8, 4, 128) + level['decoder_depths'] = [9, 9, 9, 9] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_256_2'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 128: + level = dict() + level['resolution'] = 128 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [16, 9, 9, 9] + level['encoder_dims'] = [64, 128, 128, 64] + level['decoder_input'] = (4, 2, 128) + level['decoder_depths'] = [16, 9, 9, 9] + level['decoder_dims'] = [256, 128, 128, level['latent_dim']] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_128_2'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 64: + level = dict() + level['resolution'] = 64 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [9, 9] + level['encoder_dims'] = [64, level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_64_2'#checkpoints/up_3_d64_128_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 32: + level = dict() + level['resolution'] = 32 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [16] + level['encoder_dims'] = [level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_32_2'#'checkpoints/up_3_d32_64_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + else: + raise NotImplementedError + +config['cond_ae_static'] = dict() +config['cond_ae_static']['is_label'] = False +config['cond_ae_static']['kernel_size'] = 7 +config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale'] +config['cond_ae_static']['encoder_depths'] = [3, 3, 3, 27, 3] +config['cond_ae_static']['encoder_dims'] = [8, 16, 32, 64, config['cond_ae_static']['bottleneck_size']] +config['cond_ae_static']['decoder_depths'] = config['cond_ae_static']['encoder_depths'] +config['cond_ae_static']['decoder_dims'] = config['cond_ae_static']['encoder_dims'] +config['cond_ae_static']['activation'] = 'tanh' + +config['cond_ae_curv'] = dict() +config['cond_ae_curv']['is_label'] = True +config['cond_ae_curv']['kernel_size'] = 7 +config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale'] +config['cond_ae_curv']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_curv']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_curv']['bottleneck_size']] +config['cond_ae_curv']['decoder_depths'] = config['cond_ae_curv']['encoder_depths'] +config['cond_ae_curv']['decoder_dims'] = config['cond_ae_curv']['encoder_dims'] +config['cond_ae_curv']['activation'] = 'tanh' + +config['cond_ae_body'] = dict() +config['cond_ae_body']['is_label'] = False +config['cond_ae_body']['kernel_size'] = 7 +config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale'] +config['cond_ae_body']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_body']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_body']['bottleneck_size']] +config['cond_ae_body']['decoder_depths'] = config['cond_ae_body']['encoder_depths'] +config['cond_ae_body']['decoder_dims'] = config['cond_ae_body']['encoder_dims'] +config['cond_ae_body']['activation'] = 'tanh' \ No newline at end of file diff --git a/configs/iccv/config_abl_pyr_32_64_curv_skirt.py b/configs/iccv/config_abl_pyr_32_64_curv_skirt.py new file mode 100644 index 0000000..c4ec776 --- /dev/null +++ b/configs/iccv/config_abl_pyr_32_64_curv_skirt.py @@ -0,0 +1,190 @@ +config = dict() + +config['gpu'] = '6' +config['name'] = 'iccv_pyr_32_64_curv_skirt' +config['notes'] = '' +config['tags'] = ['pyr', 'iccv', 'curv', 'skirt'] + +# DON'T FORGET TO RESET SSIM LOSS USAGE +# DON'T FORGET TO CHECK MODEL LOADING +# DON'T FORGET TO CHECK IF STORE IN MEMORY +# DON'T FORGET TO CHECK REG LOSS COEFF +# DON'T FORGET TO LOAD FINAL UPSCALER UNLESS HAVE LEVEL 512 +# DON'T FORGET TO CHECK IF SKIRT +# DON'T FORGET TO CHECK IF CAPE +# DON'T FORGET TO CHECK IF USING DOWNSCALE NONE OR _2 +# DON'T FORGET TO CHECK UPSCALING and ENCODER CHECKPOINTS + +config['use_skinning'] = True # and deshaping +config['remove_global_orientation'] = True +config['use_extra_losses'] = True # edge, collision, 3d mesh +config['use_offsets'] = False +config['use_norm_loss'] = True +config['use_curvature'] = False + +config['pretrained_model'] = '' +config['pretrained_model_iteration'] = '' + +config['pyramid'] = dict() +config['pyramid']['resolutions'] = [32, 64] +config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccv/iccv_pyr_32_curv_skirt' +config['pyramid']['pretrained_pyramid_iteration'] = '225000' +config['pyramid']['final_upscale_enhancer'] = '' + +config['train_dir'] = '/home/workspace/local-data/train_skirt' +config['valid_dir'] = '/home/workspace/local-data_127/valid_skirt' +config['test_dir'] = '/home/workspace/local-data/test_skirt_ready_2' +config['batch_size'] = 4 +config['is_skirt'] = True +config['is_cape'] = False + +config['dataset_in_memory'] = False +config['resolution'] = None + +config['smpl_res'] = 14475 +if config['is_cape']: + config['smpl_res'] = 3638 + +config['lr'] = 0.0001 +config['starting_balancing_coeff'] = 0.001 +config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision +config['avg_garment_path'] = '' +config['bottleneck_scale'] = 2 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'pose_shape': (72 + 11,), + 'uv_body_posed': (512, 256, 3), + 'mesh_body_posed': (config['smpl_res'], 3,), + 'mesh_posed': (config['smpl_res'], 3,), + 'mesh_unposed': (config['smpl_res'], 3,), + 'uv_unposed': (512, 256, 3), + 'uv_curvature': (512, 256, 7), + } +config['signature_static'] = { 'uv_static': (512, 256, 3), + 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + +config['pyramid']['is_label'] = False +config['pyramid']['add_noise'] = False +config['pyramid']['noise_amount'] = 0.0 + +config['pyramid']['loss_weights'] = [1,1,1,1,1] + +for res in config['pyramid']['resolutions']: + if res != 512: + res_modifier = '_' + str(res) + config['signature_dynamic']['uv_body_posed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_unposed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_curvature' + res_modifier] = (res, res//2, 7) + config['signature_static']['uv_static' + res_modifier] = (res, res//2, 3) + config['signature_static']['uv_mask' + res_modifier] = (res, res//2) + + +config['pyramid']['static_model'] = 'checkpoints/iccv/static_iccv_1_skirt' +config['pyramid']['body_model'] = 'checkpoints/iccv/body_iccv_1_skirt' +config['pyramid']['curvature_model'] = 'checkpoints/iccv/curv_iccv_1_skirt' +config['pyramid']['freeze_encoders'] = True + + +config['pyramid']['levels'] = [] +for res in config['pyramid']['resolutions']: + if res == 512: + level = dict() + level['resolution'] = 512 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 7 + level['encoder_depths'] = [3, 3, 9, 3] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (16, 8, 80) + level['decoder_depths'] = [3, 3, 9, 3] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = '' + config['pyramid']['levels'].append(level) + elif res == 256: + level = dict() + level['resolution'] = 256 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [9, 9, 9, 9] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (8, 4, 128) + level['decoder_depths'] = [9, 9, 9, 9] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 128: + level = dict() + level['resolution'] = 128 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [16, 9, 9, 9] + level['encoder_dims'] = [64, 128, 128, 64] + level['decoder_input'] = (4, 2, 128) + level['decoder_depths'] = [16, 9, 9, 9] + level['decoder_dims'] = [256, 128, 128, level['latent_dim']] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 64: + level = dict() + level['resolution'] = 64 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [9, 9] + level['encoder_dims'] = [64, level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_64_2_skirt'#checkpoints/up_3_d64_128_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 32: + level = dict() + level['resolution'] = 32 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [16] + level['encoder_dims'] = [level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_32_2_skirt'#'checkpoints/up_3_d32_64_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + else: + raise NotImplementedError + +config['cond_ae_static'] = dict() +config['cond_ae_static']['is_label'] = False +config['cond_ae_static']['kernel_size'] = 7 +config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale'] +config['cond_ae_static']['encoder_depths'] = [3, 3, 3, 27, 3] +config['cond_ae_static']['encoder_dims'] = [8, 16, 32, 64, config['cond_ae_static']['bottleneck_size']] +config['cond_ae_static']['decoder_depths'] = config['cond_ae_static']['encoder_depths'] +config['cond_ae_static']['decoder_dims'] = config['cond_ae_static']['encoder_dims'] +config['cond_ae_static']['activation'] = 'tanh' + +config['cond_ae_curv'] = dict() +config['cond_ae_curv']['is_label'] = True +config['cond_ae_curv']['kernel_size'] = 7 +config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale'] +config['cond_ae_curv']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_curv']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_curv']['bottleneck_size']] +config['cond_ae_curv']['decoder_depths'] = config['cond_ae_curv']['encoder_depths'] +config['cond_ae_curv']['decoder_dims'] = config['cond_ae_curv']['encoder_dims'] +config['cond_ae_curv']['activation'] = 'tanh' + +config['cond_ae_body'] = dict() +config['cond_ae_body']['is_label'] = False +config['cond_ae_body']['kernel_size'] = 7 +config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale'] +config['cond_ae_body']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_body']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_body']['bottleneck_size']] +config['cond_ae_body']['decoder_depths'] = config['cond_ae_body']['encoder_depths'] +config['cond_ae_body']['decoder_dims'] = config['cond_ae_body']['encoder_dims'] +config['cond_ae_body']['activation'] = 'tanh' \ No newline at end of file diff --git a/configs/iccv/config_abl_pyr_32_64_reg.py b/configs/iccv/config_abl_pyr_32_64_reg.py new file mode 100644 index 0000000..b463fe1 --- /dev/null +++ b/configs/iccv/config_abl_pyr_32_64_reg.py @@ -0,0 +1,190 @@ +config = dict() + +config['gpu'] = '5' +config['name'] = 'iccv_pyr_32_64_reg' +config['notes'] = '' +config['tags'] = ['pyr', 'iccv', 'reg'] + +# DON'T FORGET TO RESET SSIM LOSS USAGE +# DON'T FORGET TO CHECK MODEL LOADING +# DON'T FORGET TO CHECK IF STORE IN MEMORY +# DON'T FORGET TO CHECK REG LOSS COEFF +# DON'T FORGET TO LOAD FINAL UPSCALER UNLESS HAVE LEVEL 512 +# DON'T FORGET TO CHECK IF SKIRT +# DON'T FORGET TO CHECK IF CAPE +# DON'T FORGET TO CHECK IF USING DOWNSCALE NONE OR _2 +# DON'T FORGET TO CHECK UPSCALING and ENCODER CHECKPOINTS + +config['use_skinning'] = True # and deshaping +config['remove_global_orientation'] = True +config['use_extra_losses'] = False # edge, collision, 3d mesh +config['use_offsets'] = False +config['use_norm_loss'] = False +config['use_curvature'] = True + +config['pretrained_model'] = '' +config['pretrained_model_iteration'] = '' + +config['pyramid'] = dict() +config['pyramid']['resolutions'] = [32, 64] +config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccv/iccv_pyr_32_reg/' +config['pyramid']['pretrained_pyramid_iteration'] = '150000' +config['pyramid']['final_upscale_enhancer'] = '' + +config['train_dir'] = '/home/workspace/local-data/train' +config['valid_dir'] = '/home/workspace/local-data/valid' +config['test_dir'] = '/home/workspace/local-data_127/test_ready' +config['batch_size'] = 4 +config['is_skirt'] = False +config['is_cape'] = False + +config['dataset_in_memory'] = False +config['resolution'] = None + +config['smpl_res'] = 14475 +if config['is_cape']: + config['smpl_res'] = 3638 + +config['lr'] = 0.0001 +config['starting_balancing_coeff'] = 0.001 +config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision +config['avg_garment_path'] = '' +config['bottleneck_scale'] = 2 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'pose_shape': (72 + 11,), + 'uv_body_posed': (512, 256, 3), + 'mesh_body_posed': (config['smpl_res'], 3,), + 'mesh_posed': (config['smpl_res'], 3,), + 'mesh_unposed': (config['smpl_res'], 3,), + 'uv_unposed': (512, 256, 3), + 'uv_curvature': (512, 256, 7), + } +config['signature_static'] = { 'uv_static': (512, 256, 3), + 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + +config['pyramid']['is_label'] = False +config['pyramid']['add_noise'] = False +config['pyramid']['noise_amount'] = 0.0 + +config['pyramid']['loss_weights'] = [1,1,1,1,1] + +for res in config['pyramid']['resolutions']: + if res != 512: + res_modifier = '_' + str(res) + config['signature_dynamic']['uv_body_posed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_unposed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_curvature' + res_modifier] = (res, res//2, 7) + config['signature_static']['uv_static' + res_modifier] = (res, res//2, 3) + config['signature_static']['uv_mask' + res_modifier] = (res, res//2) + + +config['pyramid']['static_model'] = 'checkpoints/iccv/static_iccv_1' +config['pyramid']['body_model'] = 'checkpoints/iccv/body_iccv_1' +config['pyramid']['curvature_model'] = 'checkpoints/iccv/curv_iccv_1' +config['pyramid']['freeze_encoders'] = True + + +config['pyramid']['levels'] = [] +for res in config['pyramid']['resolutions']: + if res == 512: + level = dict() + level['resolution'] = 512 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 7 + level['encoder_depths'] = [3, 3, 9, 3] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (16, 8, 80) + level['decoder_depths'] = [3, 3, 9, 3] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = '' + config['pyramid']['levels'].append(level) + elif res == 256: + level = dict() + level['resolution'] = 256 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [9, 9, 9, 9] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (8, 4, 128) + level['decoder_depths'] = [9, 9, 9, 9] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_256_2'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 128: + level = dict() + level['resolution'] = 128 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [16, 9, 9, 9] + level['encoder_dims'] = [64, 128, 128, 64] + level['decoder_input'] = (4, 2, 128) + level['decoder_depths'] = [16, 9, 9, 9] + level['decoder_dims'] = [256, 128, 128, level['latent_dim']] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_128_2'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 64: + level = dict() + level['resolution'] = 64 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [9, 9] + level['encoder_dims'] = [64, level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_64_2'#checkpoints/up_3_d64_128_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 32: + level = dict() + level['resolution'] = 32 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [16] + level['encoder_dims'] = [level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_32_2'#'checkpoints/up_3_d32_64_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + else: + raise NotImplementedError + +config['cond_ae_static'] = dict() +config['cond_ae_static']['is_label'] = False +config['cond_ae_static']['kernel_size'] = 7 +config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale'] +config['cond_ae_static']['encoder_depths'] = [3, 3, 3, 27, 3] +config['cond_ae_static']['encoder_dims'] = [8, 16, 32, 64, config['cond_ae_static']['bottleneck_size']] +config['cond_ae_static']['decoder_depths'] = config['cond_ae_static']['encoder_depths'] +config['cond_ae_static']['decoder_dims'] = config['cond_ae_static']['encoder_dims'] +config['cond_ae_static']['activation'] = 'tanh' + +config['cond_ae_curv'] = dict() +config['cond_ae_curv']['is_label'] = True +config['cond_ae_curv']['kernel_size'] = 7 +config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale'] +config['cond_ae_curv']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_curv']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_curv']['bottleneck_size']] +config['cond_ae_curv']['decoder_depths'] = config['cond_ae_curv']['encoder_depths'] +config['cond_ae_curv']['decoder_dims'] = config['cond_ae_curv']['encoder_dims'] +config['cond_ae_curv']['activation'] = 'tanh' + +config['cond_ae_body'] = dict() +config['cond_ae_body']['is_label'] = False +config['cond_ae_body']['kernel_size'] = 7 +config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale'] +config['cond_ae_body']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_body']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_body']['bottleneck_size']] +config['cond_ae_body']['decoder_depths'] = config['cond_ae_body']['encoder_depths'] +config['cond_ae_body']['decoder_dims'] = config['cond_ae_body']['encoder_dims'] +config['cond_ae_body']['activation'] = 'tanh' \ No newline at end of file diff --git a/configs/iccv/config_abl_pyr_32_64_reg_skirt.py b/configs/iccv/config_abl_pyr_32_64_reg_skirt.py new file mode 100644 index 0000000..27c4d0d --- /dev/null +++ b/configs/iccv/config_abl_pyr_32_64_reg_skirt.py @@ -0,0 +1,190 @@ +config = dict() + +config['gpu'] = '2' +config['name'] = 'iccv_pyr_32_64_reg_skirt' +config['notes'] = '' +config['tags'] = ['pyr', 'iccv', 'reg'] + +# DON'T FORGET TO RESET SSIM LOSS USAGE +# DON'T FORGET TO CHECK MODEL LOADING +# DON'T FORGET TO CHECK IF STORE IN MEMORY +# DON'T FORGET TO CHECK REG LOSS COEFF +# DON'T FORGET TO LOAD FINAL UPSCALER UNLESS HAVE LEVEL 512 +# DON'T FORGET TO CHECK IF SKIRT +# DON'T FORGET TO CHECK IF CAPE +# DON'T FORGET TO CHECK IF USING DOWNSCALE NONE OR _2 +# DON'T FORGET TO CHECK UPSCALING and ENCODER CHECKPOINTS + +config['use_skinning'] = True # and deshaping +config['remove_global_orientation'] = True +config['use_extra_losses'] = False # edge, collision, 3d mesh +config['use_offsets'] = False +config['use_norm_loss'] = False +config['use_curvature'] = True + +config['pretrained_model'] = '' +config['pretrained_model_iteration'] = '' + +config['pyramid'] = dict() +config['pyramid']['resolutions'] = [32, 64] +config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccv/iccv_pyr_32_curv_skirt' +config['pyramid']['pretrained_pyramid_iteration'] = '190000' +config['pyramid']['final_upscale_enhancer'] = '' + +config['train_dir'] = '/home/workspace/local-data_128/train_skirt' +config['valid_dir'] = '/home/workspace/local-data/valid_skirt' +config['test_dir'] = '/home/workspace/local-data_128/test_skirt_ready_2' +config['batch_size'] = 4 +config['is_skirt'] = True +config['is_cape'] = False + +config['dataset_in_memory'] = False +config['resolution'] = None + +config['smpl_res'] = 14475 +if config['is_cape']: + config['smpl_res'] = 3638 + +config['lr'] = 0.0001 +config['starting_balancing_coeff'] = 0.001 +config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision +config['avg_garment_path'] = '' +config['bottleneck_scale'] = 2 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'pose_shape': (72 + 11,), + 'uv_body_posed': (512, 256, 3), + 'mesh_body_posed': (config['smpl_res'], 3,), + 'mesh_posed': (config['smpl_res'], 3,), + 'mesh_unposed': (config['smpl_res'], 3,), + 'uv_unposed': (512, 256, 3), + 'uv_curvature': (512, 256, 7), + } +config['signature_static'] = { 'uv_static': (512, 256, 3), + 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + +config['pyramid']['is_label'] = False +config['pyramid']['add_noise'] = False +config['pyramid']['noise_amount'] = 0.0 + +config['pyramid']['loss_weights'] = [1,1,1,1,1] + +for res in config['pyramid']['resolutions']: + if res != 512: + res_modifier = '_' + str(res) + config['signature_dynamic']['uv_body_posed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_unposed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_curvature' + res_modifier] = (res, res//2, 7) + config['signature_static']['uv_static' + res_modifier] = (res, res//2, 3) + config['signature_static']['uv_mask' + res_modifier] = (res, res//2) + + +config['pyramid']['static_model'] = 'checkpoints/iccv/static_iccv_1_skirt' +config['pyramid']['body_model'] = 'checkpoints/iccv/body_iccv_1_skirt' +config['pyramid']['curvature_model'] = 'checkpoints/iccv/curv_iccv_1_skirt' +config['pyramid']['freeze_encoders'] = True + + +config['pyramid']['levels'] = [] +for res in config['pyramid']['resolutions']: + if res == 512: + level = dict() + level['resolution'] = 512 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 7 + level['encoder_depths'] = [3, 3, 9, 3] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (16, 8, 80) + level['decoder_depths'] = [3, 3, 9, 3] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = '' + config['pyramid']['levels'].append(level) + elif res == 256: + level = dict() + level['resolution'] = 256 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [9, 9, 9, 9] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (8, 4, 128) + level['decoder_depths'] = [9, 9, 9, 9] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 128: + level = dict() + level['resolution'] = 128 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [16, 9, 9, 9] + level['encoder_dims'] = [64, 128, 128, 64] + level['decoder_input'] = (4, 2, 128) + level['decoder_depths'] = [16, 9, 9, 9] + level['decoder_dims'] = [256, 128, 128, level['latent_dim']] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 64: + level = dict() + level['resolution'] = 64 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [9, 9] + level['encoder_dims'] = [64, level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_64_2_skirt'#checkpoints/up_3_d64_128_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 32: + level = dict() + level['resolution'] = 32 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [16] + level['encoder_dims'] = [level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_32_2_skirt'#'checkpoints/up_3_d32_64_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + else: + raise NotImplementedError + +config['cond_ae_static'] = dict() +config['cond_ae_static']['is_label'] = False +config['cond_ae_static']['kernel_size'] = 7 +config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale'] +config['cond_ae_static']['encoder_depths'] = [3, 3, 3, 27, 3] +config['cond_ae_static']['encoder_dims'] = [8, 16, 32, 64, config['cond_ae_static']['bottleneck_size']] +config['cond_ae_static']['decoder_depths'] = config['cond_ae_static']['encoder_depths'] +config['cond_ae_static']['decoder_dims'] = config['cond_ae_static']['encoder_dims'] +config['cond_ae_static']['activation'] = 'tanh' + +config['cond_ae_curv'] = dict() +config['cond_ae_curv']['is_label'] = True +config['cond_ae_curv']['kernel_size'] = 7 +config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale'] +config['cond_ae_curv']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_curv']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_curv']['bottleneck_size']] +config['cond_ae_curv']['decoder_depths'] = config['cond_ae_curv']['encoder_depths'] +config['cond_ae_curv']['decoder_dims'] = config['cond_ae_curv']['encoder_dims'] +config['cond_ae_curv']['activation'] = 'tanh' + +config['cond_ae_body'] = dict() +config['cond_ae_body']['is_label'] = False +config['cond_ae_body']['kernel_size'] = 7 +config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale'] +config['cond_ae_body']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_body']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_body']['bottleneck_size']] +config['cond_ae_body']['decoder_depths'] = config['cond_ae_body']['encoder_depths'] +config['cond_ae_body']['decoder_dims'] = config['cond_ae_body']['encoder_dims'] +config['cond_ae_body']['activation'] = 'tanh' \ No newline at end of file diff --git a/configs/iccv/config_abl_pyr_32_64_skin.py b/configs/iccv/config_abl_pyr_32_64_skin.py index a5b694b..ec77673 100644 --- a/configs/iccv/config_abl_pyr_32_64_skin.py +++ b/configs/iccv/config_abl_pyr_32_64_skin.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '4' +config['gpu'] = '1' config['name'] = 'iccv_pyr_32_64_skin' config['notes'] = '' config['tags'] = ['pyr', 'iccv'] @@ -27,12 +27,13 @@ config['pretrained_model_iteration'] = '' config['pyramid'] = dict() config['pyramid']['resolutions'] = [32, 64] -config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccv/iccv_pyr_32_skin_165k' +config['pyramid']['pretrained_pyramid'] = 'checkpoints/iccv/iccv_pyr_32_skin' +config['pyramid']['pretrained_pyramid_iteration'] = '200000' config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data_127/train' config['valid_dir'] = '/home/workspace/local-data_127/valid' -config['test_dir'] = '/home/workspace/data/dataset/test_ready' +config['test_dir'] = '/home/workspace/local-data_127/test_ready' config['batch_size'] = 4 config['is_skirt'] = False config['is_cape'] = False @@ -119,7 +120,7 @@ for res in config['pyramid']['resolutions']: level['decoder_depths'] = [9, 9, 9, 9] level['decoder_dims'] = [256, 128, 64, 16] level['avg_garment_path'] = '' - level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_256_2'#'checkpoints/up_3_d256_512_2' level['upscale_enhancer_freeze'] = True config['pyramid']['levels'].append(level) elif res == 128: @@ -133,7 +134,7 @@ for res in config['pyramid']['resolutions']: level['decoder_depths'] = [16, 9, 9, 9] level['decoder_dims'] = [256, 128, 128, level['latent_dim']] level['avg_garment_path'] = '' - level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_128_2'#'checkpoints/up_3_d128_256_2' level['upscale_enhancer_freeze'] = True config['pyramid']['levels'].append(level) elif res == 64: diff --git a/configs/iccv/config_abl_pyr_32_curv.py b/configs/iccv/config_abl_pyr_32_curv.py index f8e51e8..c6039cc 100644 --- a/configs/iccv/config_abl_pyr_32_curv.py +++ b/configs/iccv/config_abl_pyr_32_curv.py @@ -32,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data/train' config['valid_dir'] = '/home/workspace/local-data/valid' -config['test_dir'] = '/home/workspace/data/dataset/test_ready' +config['test_dir'] = '/home/workspace/local-data_127/test_ready' config['batch_size'] = 4 config['is_skirt'] = False config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_32_curv_skirt.py b/configs/iccv/config_abl_pyr_32_curv_skirt.py index 29d70d0..d292c61 100644 --- a/configs/iccv/config_abl_pyr_32_curv_skirt.py +++ b/configs/iccv/config_abl_pyr_32_curv_skirt.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '6' +config['gpu'] = '1' config['name'] = 'iccv_pyr_32_curv_skirt' config['notes'] = '' config['tags'] = ['pyr', 'iccv', 'curv', 'skirt'] @@ -32,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data/train_skirt' config['valid_dir'] = '/home/workspace/local-data_127/valid_skirt' -config['test_dir'] = '/home/workspace/data/dataset/test_skirt_ready_2' +config['test_dir'] = '/home/workspace/local-data_128/test_skirt_ready_2' config['batch_size'] = 4 config['is_skirt'] = True config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_32_reg.py b/configs/iccv/config_abl_pyr_32_reg.py index 8e9b800..69e3383 100644 --- a/configs/iccv/config_abl_pyr_32_reg.py +++ b/configs/iccv/config_abl_pyr_32_reg.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '5' +config['gpu'] = '4' config['name'] = 'iccv_pyr_32_reg' config['notes'] = '' config['tags'] = ['pyr', 'iccv', 'reg'] @@ -32,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data/train' config['valid_dir'] = '/home/workspace/local-data/valid' -config['test_dir'] = '/home/workspace/data/dataset/test_ready' +config['test_dir'] = '/home/workspace/local-data_127/test_ready' config['batch_size'] = 4 config['is_skirt'] = False config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_32_reg_skirt.py b/configs/iccv/config_abl_pyr_32_reg_skirt.py index bd65c9b..d186c33 100644 --- a/configs/iccv/config_abl_pyr_32_reg_skirt.py +++ b/configs/iccv/config_abl_pyr_32_reg_skirt.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '2' +config['gpu'] = '1' config['name'] = 'iccv_pyr_32_reg_skirt' config['notes'] = '' config['tags'] = ['pyr', 'iccv', 'reg'] @@ -32,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data_128/train_skirt' config['valid_dir'] = '/home/workspace/local-data/valid_skirt' -config['test_dir'] = '/home/workspace/data/dataset/test_skirt_ready_2' +config['test_dir'] = '/home/workspace/local-data_128/test_skirt_ready_2' config['batch_size'] = 4 config['is_skirt'] = True config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_32_skin.py b/configs/iccv/config_abl_pyr_32_skin.py index b339dc9..09ce91e 100644 --- a/configs/iccv/config_abl_pyr_32_skin.py +++ b/configs/iccv/config_abl_pyr_32_skin.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '0' +config['gpu'] = '4' config['name'] = 'iccv_pyr_32_skin' config['notes'] = '' config['tags'] = ['pyr', 'iccv'] @@ -20,6 +20,7 @@ config['remove_global_orientation'] = True config['use_extra_losses'] = True # edge, collision, 3d mesh config['use_offsets'] = False config['use_norm_loss'] = True +config['use_curvature'] = True config['pretrained_model'] = '' config['pretrained_model_iteration'] = '' @@ -31,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data/train' config['valid_dir'] = '/home/workspace/local-data/valid' -config['test_dir'] = '/home/workspace/data/dataset/test_ready' +config['test_dir'] = '/home/workspace/local-data_127/test_ready' config['batch_size'] = 4 config['is_skirt'] = False config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_32_skin_skirt.py b/configs/iccv/config_abl_pyr_32_skin_skirt.py index 38375a3..cb7c9cf 100644 --- a/configs/iccv/config_abl_pyr_32_skin_skirt.py +++ b/configs/iccv/config_abl_pyr_32_skin_skirt.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '2' +config['gpu'] = '4' config['name'] = 'iccv_pyr_32_skin_skirt' config['notes'] = '' config['tags'] = ['pyr', 'iccv'] @@ -20,6 +20,7 @@ config['remove_global_orientation'] = True config['use_extra_losses'] = True # edge, collision, 3d mesh config['use_offsets'] = False config['use_norm_loss'] = True +config['use_curvature'] = True config['pretrained_model'] = '' config['pretrained_model_iteration'] = '' @@ -31,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data_128/train_skirt' config['valid_dir'] = '/home/workspace/local-data_127/valid_skirt' -config['test_dir'] = '/home/workspace/data/dataset/test_skirt_ready_2' +config['test_dir'] = '/home/workspace/local-data/test_skirt_ready_2' config['batch_size'] = 4 config['is_skirt'] = True config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_32_skirt.py b/configs/iccv/config_abl_pyr_32_skirt.py index 308133a..722b380 100644 --- a/configs/iccv/config_abl_pyr_32_skirt.py +++ b/configs/iccv/config_abl_pyr_32_skirt.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '1' +config['gpu'] = '4' config['name'] = 'iccv_pyr_32_skirt_3' config['notes'] = '' config['tags'] = ['pyr', 'iccv'] @@ -20,6 +20,7 @@ config['remove_global_orientation'] = True config['use_extra_losses'] = True # edge, collision, 3d mesh config['use_offsets'] = False config['use_norm_loss'] = True +config['use_curvature'] = True config['pretrained_model'] = '' config['pretrained_model_iteration'] = '' @@ -31,7 +32,7 @@ config['pyramid']['final_upscale_enhancer'] = '' config['train_dir'] = '/home/workspace/local-data_128/train_skirt' config['valid_dir'] = '/home/workspace/local-data_127/valid_skirt' -config['test_dir'] = '/home/workspace/data/dataset/test_skirt_ready_2' +config['test_dir'] = '/home/workspace/local-data/test_skirt_ready_2' config['batch_size'] = 4 config['is_skirt'] = True config['is_cape'] = False diff --git a/configs/iccv/config_abl_pyr_64_cape_f.py b/configs/iccv/config_abl_pyr_64_cape_f.py index 44dbbdc..43246e4 100644 --- a/configs/iccv/config_abl_pyr_64_cape_f.py +++ b/configs/iccv/config_abl_pyr_64_cape_f.py @@ -1,6 +1,6 @@ config = dict() -config['gpu'] = '6' +config['gpu'] = '2' config['name'] = 'iccv_pyr_64_cape_f' config['notes'] = '' config['tags'] = ['pyr', 'iccv', 'cape_f'] @@ -20,8 +20,9 @@ config['remove_global_orientation'] = True config['use_extra_losses'] = True # edge, collision, 3d mesh config['use_offsets'] = False config['use_norm_loss'] = True +config['use_curvature'] = True -config['pretrained_model'] = '' +config['pretrained_model'] = 'checkpoints/iccv/iccv_pyr_64_cape_f' config['pretrained_model_iteration'] = '' config['pyramid'] = dict() @@ -29,9 +30,9 @@ config['pyramid']['resolutions'] = [64] config['pyramid']['pretrained_pyramid'] = '' config['pyramid']['final_upscale_enhancer'] = '' -config['train_dir'] = '/home/workspace/local-data/cape_processed/train/female' -config['valid_dir'] = '/home/workspace/local-data/cape_processed/test/female' -config['test_dir'] = '/home/workspace/local-data/cape_processed/test/female' +config['train_dir'] = '/home/workspace/local-data_127/cape_processed/train/female' +config['valid_dir'] = '/home/workspace/local-data_127/cape_processed/test/female' +config['test_dir'] = '/home/workspace/local-data_127/cape_processed/test/female' config['batch_size'] = 4 config['is_skirt'] = False config['is_cape'] = True diff --git a/configs/iccv/config_abl_pyr_64_cape_f_03223_SL.py b/configs/iccv/config_abl_pyr_64_cape_f_03223_SL.py new file mode 100644 index 0000000..d815a4c --- /dev/null +++ b/configs/iccv/config_abl_pyr_64_cape_f_03223_SL.py @@ -0,0 +1,192 @@ +config = dict() + +config['gpu'] = '2' +config['name'] = 'iccv_pyr_64_cape_f' +config['notes'] = '' +config['tags'] = ['pyr', 'iccv', 'cape_f'] + +# DON'T FORGET TO RESET SSIM LOSS USAGE +# DON'T FORGET TO CHECK MODEL LOADING +# DON'T FORGET TO CHECK IF STORE IN MEMORY +# DON'T FORGET TO CHECK REG LOSS COEFF +# DON'T FORGET TO LOAD FINAL UPSCALER UNLESS HAVE LEVEL 512 +# DON'T FORGET TO CHECK IF SKIRT +# DON'T FORGET TO CHECK IF CAPE +# DON'T FORGET TO CHECK IF USING DOWNSCALE NONE OR _2 +# DON'T FORGET TO CHECK UPSCALING and ENCODER CHECKPOINTS + +config['use_skinning'] = True # and deshaping +config['remove_global_orientation'] = True +config['use_extra_losses'] = True # edge, collision, 3d mesh +config['use_offsets'] = False +config['use_norm_loss'] = True +config['use_curvature'] = True + +config['pretrained_model'] = '' +config['pretrained_model_iteration'] = '' + +config['pyramid'] = dict() +config['pyramid']['resolutions'] = [64] +config['pyramid']['pretrained_pyramid'] = '' +config['pyramid']['final_upscale_enhancer'] = '' + +config['train_dir'] = '/home/workspace/local-data_127/cape_processed/train/female' +config['valid_dir'] = '/home/workspace/local-data_127/cape_processed/test/female' +config['test_dir'] = '/home/workspace/local-data_127/cape_processed/test/female' +config['batch_size'] = 4 +config['is_skirt'] = False +config['is_cape'] = True +config['frames_file'] = 'frames_03223_SL_train_2.txt' +config['frames_file_valid'] = 'frames_03223_SL_test_2.txt' +config['frames_file_test'] = 'frames_03223_SL_test_2.txt' + +config['dataset_in_memory'] = False +config['resolution'] = None + +config['smpl_res'] = 14475 +if config['is_cape']: + config['smpl_res'] = 3638 + +config['lr'] = 0.0001 +config['starting_balancing_coeff'] = 0.001 +config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision +config['avg_garment_path'] = '' +config['bottleneck_scale'] = 2 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'pose_shape': (72 + 11,), + 'uv_body_posed': (512, 256, 3), + 'mesh_body_posed': (config['smpl_res'], 3,), + 'mesh_posed': (config['smpl_res'], 3,), + 'mesh_unposed': (config['smpl_res'], 3,), + 'uv_unposed': (512, 256, 3), + 'uv_curvature': (512, 256, 7), + } +config['signature_static'] = { 'uv_static': (512, 256, 3), + 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + +config['pyramid']['is_label'] = False +config['pyramid']['add_noise'] = False +config['pyramid']['noise_amount'] = 0.0 + +config['pyramid']['loss_weights'] = [1,1,1,1,1] + +for res in config['pyramid']['resolutions']: + if res != 512: + res_modifier = '_' + str(res) + config['signature_dynamic']['uv_body_posed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_unposed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_curvature' + res_modifier] = (res, res//2, 7) + config['signature_static']['uv_static' + res_modifier] = (res, res//2, 3) + config['signature_static']['uv_mask' + res_modifier] = (res, res//2) + + +config['pyramid']['static_model'] = 'checkpoints/iccv/static_iccv_1_cape_f' +config['pyramid']['body_model'] = 'checkpoints/iccv/body_iccv_1_cape_f' +config['pyramid']['curvature_model'] = 'checkpoints/iccv/curv_iccv_1_cape_f' +config['pyramid']['freeze_encoders'] = True + + +config['pyramid']['levels'] = [] +for res in config['pyramid']['resolutions']: + if res == 512: + level = dict() + level['resolution'] = 512 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 7 + level['encoder_depths'] = [3, 3, 9, 3] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (16, 8, 80) + level['decoder_depths'] = [3, 3, 9, 3] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = '' + config['pyramid']['levels'].append(level) + elif res == 256: + level = dict() + level['resolution'] = 256 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [9, 9, 9, 9] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (8, 4, 128) + level['decoder_depths'] = [9, 9, 9, 9] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 128: + level = dict() + level['resolution'] = 128 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [16, 9, 9, 9] + level['encoder_dims'] = [64, 128, 128, 64] + level['decoder_input'] = (4, 2, 128) + level['decoder_depths'] = [16, 9, 9, 9] + level['decoder_dims'] = [256, 128, 128, level['latent_dim']] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 64: + level = dict() + level['resolution'] = 64 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [9, 9] + level['encoder_dims'] = [64, level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_64_2_cape_f'#checkpoints/up_3_d64_128_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 32: + level = dict() + level['resolution'] = 32 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [16] + level['encoder_dims'] = [level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_32_2_cape_f'#'checkpoints/up_3_d32_64_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + else: + raise NotImplementedError + +config['cond_ae_static'] = dict() +config['cond_ae_static']['is_label'] = False +config['cond_ae_static']['kernel_size'] = 7 +config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale'] +config['cond_ae_static']['encoder_depths'] = [3, 3, 3, 27, 3] +config['cond_ae_static']['encoder_dims'] = [8, 16, 32, 64, config['cond_ae_static']['bottleneck_size']] +config['cond_ae_static']['decoder_depths'] = config['cond_ae_static']['encoder_depths'] +config['cond_ae_static']['decoder_dims'] = config['cond_ae_static']['encoder_dims'] +config['cond_ae_static']['activation'] = 'tanh' + +config['cond_ae_curv'] = dict() +config['cond_ae_curv']['is_label'] = True +config['cond_ae_curv']['kernel_size'] = 7 +config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale'] +config['cond_ae_curv']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_curv']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_curv']['bottleneck_size']] +config['cond_ae_curv']['decoder_depths'] = config['cond_ae_curv']['encoder_depths'] +config['cond_ae_curv']['decoder_dims'] = config['cond_ae_curv']['encoder_dims'] +config['cond_ae_curv']['activation'] = 'tanh' + +config['cond_ae_body'] = dict() +config['cond_ae_body']['is_label'] = False +config['cond_ae_body']['kernel_size'] = 7 +config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale'] +config['cond_ae_body']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_body']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_body']['bottleneck_size']] +config['cond_ae_body']['decoder_depths'] = config['cond_ae_body']['encoder_depths'] +config['cond_ae_body']['decoder_dims'] = config['cond_ae_body']['encoder_dims'] +config['cond_ae_body']['activation'] = 'tanh' \ No newline at end of file diff --git a/configs/iccv/config_abl_pyr_64_cape_f_03223_SS.py b/configs/iccv/config_abl_pyr_64_cape_f_03223_SS.py new file mode 100644 index 0000000..d33f15c --- /dev/null +++ b/configs/iccv/config_abl_pyr_64_cape_f_03223_SS.py @@ -0,0 +1,192 @@ +config = dict() + +config['gpu'] = '2' +config['name'] = 'iccv_pyr_64_cape_f' +config['notes'] = '' +config['tags'] = ['pyr', 'iccv', 'cape_f'] + +# DON'T FORGET TO RESET SSIM LOSS USAGE +# DON'T FORGET TO CHECK MODEL LOADING +# DON'T FORGET TO CHECK IF STORE IN MEMORY +# DON'T FORGET TO CHECK REG LOSS COEFF +# DON'T FORGET TO LOAD FINAL UPSCALER UNLESS HAVE LEVEL 512 +# DON'T FORGET TO CHECK IF SKIRT +# DON'T FORGET TO CHECK IF CAPE +# DON'T FORGET TO CHECK IF USING DOWNSCALE NONE OR _2 +# DON'T FORGET TO CHECK UPSCALING and ENCODER CHECKPOINTS + +config['use_skinning'] = True # and deshaping +config['remove_global_orientation'] = True +config['use_extra_losses'] = True # edge, collision, 3d mesh +config['use_offsets'] = False +config['use_norm_loss'] = True +config['use_curvature'] = True + +config['pretrained_model'] = '' +config['pretrained_model_iteration'] = '' + +config['pyramid'] = dict() +config['pyramid']['resolutions'] = [64] +config['pyramid']['pretrained_pyramid'] = '' +config['pyramid']['final_upscale_enhancer'] = '' + +config['train_dir'] = '/home/workspace/local-data_127/cape_processed/train/female' +config['valid_dir'] = '/home/workspace/local-data_127/cape_processed/train/female' +config['test_dir'] = '/home/workspace/local-data_127/cape_processed/train/female' +config['batch_size'] = 4 +config['is_skirt'] = False +config['is_cape'] = True +config['frames_file'] = 'frames_03223_SS_train_2.txt' +config['frames_file_valid'] = 'frames_03223_SS_test_2.txt' +config['frames_file_test'] = 'frames_03223_SS_test_2.txt' + +config['dataset_in_memory'] = False +config['resolution'] = None + +config['smpl_res'] = 14475 +if config['is_cape']: + config['smpl_res'] = 3638 + +config['lr'] = 0.0001 +config['starting_balancing_coeff'] = 0.001 +config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision +config['avg_garment_path'] = '' +config['bottleneck_scale'] = 2 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'pose_shape': (72 + 11,), + 'uv_body_posed': (512, 256, 3), + 'mesh_body_posed': (config['smpl_res'], 3,), + 'mesh_posed': (config['smpl_res'], 3,), + 'mesh_unposed': (config['smpl_res'], 3,), + 'uv_unposed': (512, 256, 3), + 'uv_curvature': (512, 256, 7), + } +config['signature_static'] = { 'uv_static': (512, 256, 3), + 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + +config['pyramid']['is_label'] = False +config['pyramid']['add_noise'] = False +config['pyramid']['noise_amount'] = 0.0 + +config['pyramid']['loss_weights'] = [1,1,1,1,1] + +for res in config['pyramid']['resolutions']: + if res != 512: + res_modifier = '_' + str(res) + config['signature_dynamic']['uv_body_posed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_unposed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_curvature' + res_modifier] = (res, res//2, 7) + config['signature_static']['uv_static' + res_modifier] = (res, res//2, 3) + config['signature_static']['uv_mask' + res_modifier] = (res, res//2) + + +config['pyramid']['static_model'] = 'checkpoints/iccv/static_iccv_1_cape_f' +config['pyramid']['body_model'] = 'checkpoints/iccv/body_iccv_1_cape_f' +config['pyramid']['curvature_model'] = 'checkpoints/iccv/curv_iccv_1_cape_f' +config['pyramid']['freeze_encoders'] = True + + +config['pyramid']['levels'] = [] +for res in config['pyramid']['resolutions']: + if res == 512: + level = dict() + level['resolution'] = 512 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 7 + level['encoder_depths'] = [3, 3, 9, 3] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (16, 8, 80) + level['decoder_depths'] = [3, 3, 9, 3] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = '' + config['pyramid']['levels'].append(level) + elif res == 256: + level = dict() + level['resolution'] = 256 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [9, 9, 9, 9] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (8, 4, 128) + level['decoder_depths'] = [9, 9, 9, 9] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 128: + level = dict() + level['resolution'] = 128 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [16, 9, 9, 9] + level['encoder_dims'] = [64, 128, 128, 64] + level['decoder_input'] = (4, 2, 128) + level['decoder_depths'] = [16, 9, 9, 9] + level['decoder_dims'] = [256, 128, 128, level['latent_dim']] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 64: + level = dict() + level['resolution'] = 64 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [9, 9] + level['encoder_dims'] = [64, level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_64_2_cape_f'#checkpoints/up_3_d64_128_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 32: + level = dict() + level['resolution'] = 32 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [16] + level['encoder_dims'] = [level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_32_2_cape_f'#'checkpoints/up_3_d32_64_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + else: + raise NotImplementedError + +config['cond_ae_static'] = dict() +config['cond_ae_static']['is_label'] = False +config['cond_ae_static']['kernel_size'] = 7 +config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale'] +config['cond_ae_static']['encoder_depths'] = [3, 3, 3, 27, 3] +config['cond_ae_static']['encoder_dims'] = [8, 16, 32, 64, config['cond_ae_static']['bottleneck_size']] +config['cond_ae_static']['decoder_depths'] = config['cond_ae_static']['encoder_depths'] +config['cond_ae_static']['decoder_dims'] = config['cond_ae_static']['encoder_dims'] +config['cond_ae_static']['activation'] = 'tanh' + +config['cond_ae_curv'] = dict() +config['cond_ae_curv']['is_label'] = True +config['cond_ae_curv']['kernel_size'] = 7 +config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale'] +config['cond_ae_curv']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_curv']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_curv']['bottleneck_size']] +config['cond_ae_curv']['decoder_depths'] = config['cond_ae_curv']['encoder_depths'] +config['cond_ae_curv']['decoder_dims'] = config['cond_ae_curv']['encoder_dims'] +config['cond_ae_curv']['activation'] = 'tanh' + +config['cond_ae_body'] = dict() +config['cond_ae_body']['is_label'] = False +config['cond_ae_body']['kernel_size'] = 7 +config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale'] +config['cond_ae_body']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_body']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_body']['bottleneck_size']] +config['cond_ae_body']['decoder_depths'] = config['cond_ae_body']['encoder_depths'] +config['cond_ae_body']['decoder_dims'] = config['cond_ae_body']['encoder_dims'] +config['cond_ae_body']['activation'] = 'tanh' \ No newline at end of file diff --git a/configs/iccv/config_abl_pyr_64_cape_m.py b/configs/iccv/config_abl_pyr_64_cape_m.py new file mode 100644 index 0000000..2b70081 --- /dev/null +++ b/configs/iccv/config_abl_pyr_64_cape_m.py @@ -0,0 +1,189 @@ +config = dict() + +config['gpu'] = '4' +config['name'] = 'iccv_pyr_64_cape_m' +config['notes'] = '' +config['tags'] = ['pyr', 'iccv', 'cape_m'] + +# DON'T FORGET TO RESET SSIM LOSS USAGE +# DON'T FORGET TO CHECK MODEL LOADING +# DON'T FORGET TO CHECK IF STORE IN MEMORY +# DON'T FORGET TO CHECK REG LOSS COEFF +# DON'T FORGET TO LOAD FINAL UPSCALER UNLESS HAVE LEVEL 512 +# DON'T FORGET TO CHECK IF SKIRT +# DON'T FORGET TO CHECK IF CAPE +# DON'T FORGET TO CHECK IF USING DOWNSCALE NONE OR _2 +# DON'T FORGET TO CHECK UPSCALING and ENCODER CHECKPOINTS + +config['use_skinning'] = True # and deshaping +config['remove_global_orientation'] = True +config['use_extra_losses'] = True # edge, collision, 3d mesh +config['use_offsets'] = False +config['use_norm_loss'] = True +config['use_curvature'] = True + +config['pretrained_model'] = 'checkpoints/iccv/iccv_pyr_64_cape_m' +config['pretrained_model_iteration'] = '' + +config['pyramid'] = dict() +config['pyramid']['resolutions'] = [64] +config['pyramid']['pretrained_pyramid'] = '' +config['pyramid']['final_upscale_enhancer'] = '' + +config['train_dir'] = '/home/workspace/local-data_127/cape_processed/train/male' +config['valid_dir'] = '/home/workspace/local-data_127/cape_processed/test/male' +config['test_dir'] = '/home/workspace/local-data_127/cape_processed/test/male' +config['batch_size'] = 4 +config['is_skirt'] = False +config['is_cape'] = True + +config['dataset_in_memory'] = False +config['resolution'] = None + +config['smpl_res'] = 14475 +if config['is_cape']: + config['smpl_res'] = 3638 + +config['lr'] = 0.0001 +config['starting_balancing_coeff'] = 0.001 +config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision +config['avg_garment_path'] = '' +config['bottleneck_scale'] = 2 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'pose_shape': (72 + 11,), + 'uv_body_posed': (512, 256, 3), + 'mesh_body_posed': (config['smpl_res'], 3,), + 'mesh_posed': (config['smpl_res'], 3,), + 'mesh_unposed': (config['smpl_res'], 3,), + 'uv_unposed': (512, 256, 3), + 'uv_curvature': (512, 256, 7), + } +config['signature_static'] = { 'uv_static': (512, 256, 3), + 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + +config['pyramid']['is_label'] = False +config['pyramid']['add_noise'] = False +config['pyramid']['noise_amount'] = 0.0 + +config['pyramid']['loss_weights'] = [1,1,1,1,1] + +for res in config['pyramid']['resolutions']: + if res != 512: + res_modifier = '_' + str(res) + config['signature_dynamic']['uv_body_posed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_unposed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_curvature' + res_modifier] = (res, res//2, 7) + config['signature_static']['uv_static' + res_modifier] = (res, res//2, 3) + config['signature_static']['uv_mask' + res_modifier] = (res, res//2) + + +config['pyramid']['static_model'] = 'checkpoints/iccv/static_iccv_1_cape_m' +config['pyramid']['body_model'] = 'checkpoints/iccv/body_iccv_1_cape_m' +config['pyramid']['curvature_model'] = 'checkpoints/iccv/curv_iccv_1_cape_m' +config['pyramid']['freeze_encoders'] = True + + +config['pyramid']['levels'] = [] +for res in config['pyramid']['resolutions']: + if res == 512: + level = dict() + level['resolution'] = 512 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 7 + level['encoder_depths'] = [3, 3, 9, 3] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (16, 8, 80) + level['decoder_depths'] = [3, 3, 9, 3] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = '' + config['pyramid']['levels'].append(level) + elif res == 256: + level = dict() + level['resolution'] = 256 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [9, 9, 9, 9] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (8, 4, 128) + level['decoder_depths'] = [9, 9, 9, 9] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 128: + level = dict() + level['resolution'] = 128 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [16, 9, 9, 9] + level['encoder_dims'] = [64, 128, 128, 64] + level['decoder_input'] = (4, 2, 128) + level['decoder_depths'] = [16, 9, 9, 9] + level['decoder_dims'] = [256, 128, 128, level['latent_dim']] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 64: + level = dict() + level['resolution'] = 64 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [9, 9] + level['encoder_dims'] = [64, level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_64_2_cape_m'#checkpoints/up_3_d64_128_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 32: + level = dict() + level['resolution'] = 32 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [16] + level['encoder_dims'] = [level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_32_2_cape_m'#'checkpoints/up_3_d32_64_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + else: + raise NotImplementedError + +config['cond_ae_static'] = dict() +config['cond_ae_static']['is_label'] = False +config['cond_ae_static']['kernel_size'] = 7 +config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale'] +config['cond_ae_static']['encoder_depths'] = [3, 3, 3, 27, 3] +config['cond_ae_static']['encoder_dims'] = [8, 16, 32, 64, config['cond_ae_static']['bottleneck_size']] +config['cond_ae_static']['decoder_depths'] = config['cond_ae_static']['encoder_depths'] +config['cond_ae_static']['decoder_dims'] = config['cond_ae_static']['encoder_dims'] +config['cond_ae_static']['activation'] = 'tanh' + +config['cond_ae_curv'] = dict() +config['cond_ae_curv']['is_label'] = True +config['cond_ae_curv']['kernel_size'] = 7 +config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale'] +config['cond_ae_curv']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_curv']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_curv']['bottleneck_size']] +config['cond_ae_curv']['decoder_depths'] = config['cond_ae_curv']['encoder_depths'] +config['cond_ae_curv']['decoder_dims'] = config['cond_ae_curv']['encoder_dims'] +config['cond_ae_curv']['activation'] = 'tanh' + +config['cond_ae_body'] = dict() +config['cond_ae_body']['is_label'] = False +config['cond_ae_body']['kernel_size'] = 7 +config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale'] +config['cond_ae_body']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_body']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_body']['bottleneck_size']] +config['cond_ae_body']['decoder_depths'] = config['cond_ae_body']['encoder_depths'] +config['cond_ae_body']['decoder_dims'] = config['cond_ae_body']['encoder_dims'] +config['cond_ae_body']['activation'] = 'tanh' \ No newline at end of file diff --git a/configs/iccv/config_abl_pyr_64_cape_m_00032_SL.py b/configs/iccv/config_abl_pyr_64_cape_m_00032_SL.py new file mode 100644 index 0000000..56369c0 --- /dev/null +++ b/configs/iccv/config_abl_pyr_64_cape_m_00032_SL.py @@ -0,0 +1,193 @@ +config = dict() + +config['gpu'] = '1' +config['name'] = 'iccv_pyr_64_cape_m_00032_SL' +config['notes'] = '' +config['tags'] = ['pyr', 'iccv', 'cape_m'] + +# DON'T FORGET TO RESET SSIM LOSS USAGE +# DON'T FORGET TO CHECK MODEL LOADING +# DON'T FORGET TO CHECK IF STORE IN MEMORY +# DON'T FORGET TO CHECK REG LOSS COEFF +# DON'T FORGET TO LOAD FINAL UPSCALER UNLESS HAVE LEVEL 512 +# DON'T FORGET TO CHECK IF SKIRT +# DON'T FORGET TO CHECK IF CAPE +# DON'T FORGET TO CHECK IF USING DOWNSCALE NONE OR _2 +# DON'T FORGET TO CHECK UPSCALING and ENCODER CHECKPOINTS + +config['use_skinning'] = True # and deshaping +config['remove_global_orientation'] = True +config['use_extra_losses'] = True # edge, collision, 3d mesh +config['use_offsets'] = False +config['use_norm_loss'] = True +config['use_curvature'] = True + +config['pretrained_model'] = '' +config['pretrained_model_iteration'] = '' + +config['pyramid'] = dict() +config['pyramid']['resolutions'] = [64] +config['pyramid']['pretrained_pyramid'] = '' +config['pyramid']['final_upscale_enhancer'] = '' + +config['train_dir'] = '/home/workspace/local-data_127/cape_processed/train/male' +config['valid_dir'] = '/home/workspace/local-data_127/cape_processed/train/male' +config['test_dir'] = '/home/workspace/local-data_127/cape_processed/train/male' +config['batch_size'] = 4 +config['is_skirt'] = False +config['is_cape'] = True + +config['frames_file'] = 'frames_00032_SL_train_2.txt' +config['frames_file_valid'] = 'frames_00032_SL_test_2.txt' +config['frames_file_test'] = 'frames_00032_SL_test_2.txt' + +config['dataset_in_memory'] = False +config['resolution'] = None + +config['smpl_res'] = 14475 +if config['is_cape']: + config['smpl_res'] = 3638 + +config['lr'] = 0.0001 +config['starting_balancing_coeff'] = 0.001 +config['reg_loss_coeff'] = 0.1 # set to 0 if don't want to use edge+collision +config['avg_garment_path'] = '' +config['bottleneck_scale'] = 2 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'pose_shape': (72 + 11,), + 'uv_body_posed': (512, 256, 3), + 'mesh_body_posed': (config['smpl_res'], 3,), + 'mesh_posed': (config['smpl_res'], 3,), + 'mesh_unposed': (config['smpl_res'], 3,), + 'uv_unposed': (512, 256, 3), + 'uv_curvature': (512, 256, 7), + } +config['signature_static'] = { 'uv_static': (512, 256, 3), + 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + +config['pyramid']['is_label'] = False +config['pyramid']['add_noise'] = False +config['pyramid']['noise_amount'] = 0.0 + +config['pyramid']['loss_weights'] = [1,1,1,1,1] + +for res in config['pyramid']['resolutions']: + if res != 512: + res_modifier = '_' + str(res) + config['signature_dynamic']['uv_body_posed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_unposed' + res_modifier] = (res, res//2, 3) + config['signature_dynamic']['uv_curvature' + res_modifier] = (res, res//2, 7) + config['signature_static']['uv_static' + res_modifier] = (res, res//2, 3) + config['signature_static']['uv_mask' + res_modifier] = (res, res//2) + + +config['pyramid']['static_model'] = 'checkpoints/iccv/static_iccv_1_cape_m' +config['pyramid']['body_model'] = 'checkpoints/iccv/body_iccv_1_cape_m' +config['pyramid']['curvature_model'] = 'checkpoints/iccv/curv_iccv_1_cape_m' +config['pyramid']['freeze_encoders'] = True + + +config['pyramid']['levels'] = [] +for res in config['pyramid']['resolutions']: + if res == 512: + level = dict() + level['resolution'] = 512 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 7 + level['encoder_depths'] = [3, 3, 9, 3] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (16, 8, 80) + level['decoder_depths'] = [3, 3, 9, 3] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = '' + config['pyramid']['levels'].append(level) + elif res == 256: + level = dict() + level['resolution'] = 256 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [9, 9, 9, 9] + level['encoder_dims'] = [32, 64, 128, level['latent_dim']] + level['decoder_input'] = (8, 4, 128) + level['decoder_depths'] = [9, 9, 9, 9] + level['decoder_dims'] = [256, 128, 64, 16] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d256_512_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 128: + level = dict() + level['resolution'] = 128 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 5 + level['encoder_depths'] = [16, 9, 9, 9] + level['encoder_dims'] = [64, 128, 128, 64] + level['decoder_input'] = (4, 2, 128) + level['decoder_depths'] = [16, 9, 9, 9] + level['decoder_dims'] = [256, 128, 128, level['latent_dim']] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_'#'checkpoints/up_3_d128_256_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 64: + level = dict() + level['resolution'] = 64 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [9, 9] + level['encoder_dims'] = [64, level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_64_2_cape_m'#checkpoints/up_3_d64_128_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + elif res == 32: + level = dict() + level['resolution'] = 32 + level['latent_dim'] = 64 * config['bottleneck_scale'] + level['kernel_size'] = 3 + level['encoder_depths'] = [16] + level['encoder_dims'] = [level['latent_dim']] + level['decoder_depths'] = level['encoder_depths'] + level['decoder_dims'] = level['encoder_dims'] + level['avg_garment_path'] = '' + level['upscale_enhancer'] = 'checkpoints/iccv/iccv_32_2_cape_m'#'checkpoints/up_3_d32_64_2' + level['upscale_enhancer_freeze'] = True + config['pyramid']['levels'].append(level) + else: + raise NotImplementedError + +config['cond_ae_static'] = dict() +config['cond_ae_static']['is_label'] = False +config['cond_ae_static']['kernel_size'] = 7 +config['cond_ae_static']['bottleneck_size'] = 8 * config['bottleneck_scale'] +config['cond_ae_static']['encoder_depths'] = [3, 3, 3, 27, 3] +config['cond_ae_static']['encoder_dims'] = [8, 16, 32, 64, config['cond_ae_static']['bottleneck_size']] +config['cond_ae_static']['decoder_depths'] = config['cond_ae_static']['encoder_depths'] +config['cond_ae_static']['decoder_dims'] = config['cond_ae_static']['encoder_dims'] +config['cond_ae_static']['activation'] = 'tanh' + +config['cond_ae_curv'] = dict() +config['cond_ae_curv']['is_label'] = True +config['cond_ae_curv']['kernel_size'] = 7 +config['cond_ae_curv']['bottleneck_size'] = 40 * config['bottleneck_scale'] +config['cond_ae_curv']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_curv']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_curv']['bottleneck_size']] +config['cond_ae_curv']['decoder_depths'] = config['cond_ae_curv']['encoder_depths'] +config['cond_ae_curv']['decoder_dims'] = config['cond_ae_curv']['encoder_dims'] +config['cond_ae_curv']['activation'] = 'tanh' + +config['cond_ae_body'] = dict() +config['cond_ae_body']['is_label'] = False +config['cond_ae_body']['kernel_size'] = 7 +config['cond_ae_body']['bottleneck_size'] = 16 * config['bottleneck_scale'] +config['cond_ae_body']['encoder_depths'] = [3, 3, 9, 9, 3] +config['cond_ae_body']['encoder_dims'] = [16, 32, 64, 128, config['cond_ae_body']['bottleneck_size']] +config['cond_ae_body']['decoder_depths'] = config['cond_ae_body']['encoder_depths'] +config['cond_ae_body']['decoder_dims'] = config['cond_ae_body']['encoder_dims'] +config['cond_ae_body']['activation'] = 'tanh' \ No newline at end of file diff --git a/cvae_pyramid.py b/cvae_pyramid.py index 6675d67..0e3ecab 100644 --- a/cvae_pyramid.py +++ b/cvae_pyramid.py @@ -1,6 +1,6 @@ import os import sys -from configs.iccv.config_abl_pyr_32_64_128 import config +from configs.iccv.config_abl_pyr_32_64_reg_skirt import config os.environ["CUDA_VISIBLE_DEVICES"] = config['gpu'] import tensorflow as tf @@ -212,7 +212,7 @@ def plot_3d(mesh_gt, mesh_pred_unposed_levels, faces, mesh_posed, collision, col return fig -# @tf.function +@tf.function def train_step(batch): levels_input, conds = group_inputs_for_levels(batch, config) diff --git a/downscale.py b/downscale.py index cc966ef..66c07ea 100644 --- a/downscale.py +++ b/downscale.py @@ -194,7 +194,7 @@ if __name__ == '__main__': args = parser.parse_args() # sizes = [32, 64, 128, 256] - sizes = [64, 128, 256] + sizes = [32, 64, 128, 256] folder = args.folder is_skirt = True diff --git a/evaluate_ae_pyramid.py b/evaluate_ae_pyramid.py index 730e000..ed30571 100644 --- a/evaluate_ae_pyramid.py +++ b/evaluate_ae_pyramid.py @@ -1,6 +1,6 @@ import os import sys -from configs.config_abl_2_pyr_32_64_128_256_512 import config +from configs.iccv.config_abl_pyr_32_reg_skirt import config os.environ["CUDA_VISIBLE_DEVICES"] = config['gpu'] import tensorflow as tf @@ -27,7 +27,7 @@ import numpy as np import plotly.graph_objects as go import plotly.express as ex from PIL import Image -from models.pyramid_model_optimized import Pyramid +from models.pyramid_model_optimized import PyramidNew as Pyramid from postprocessing import fix_collision if config['is_skirt']: @@ -97,12 +97,12 @@ if __name__ == '__main__': ids = [id.split('_')[0] for id in ids] ids = set(ids) - iteration = '50000' + iteration = '190000' - load_model(model, 'checkpoints/' + checkpoint_name, iteration=iteration) + load_model(model, 'checkpoints/iccv/' + checkpoint_name, iteration=iteration) # load_model(model, 'checkpoints/' + 'abl_all_120k') - output_folder = '/home/workspace/data/results/' + checkpoint_name + '-' + iteration + output_folder = '/home/workspace/local-data_128/results/iccv/' + checkpoint_name + '-' + iteration os.makedirs(output_folder, exist_ok=True) @@ -128,10 +128,10 @@ if __name__ == '__main__': resolutions=dataset_resolutions, in_memory=True) - faces_folder = '/home/workspace/data/results/support/faces' + ('_skirt' if config['is_skirt'] else '') - ids = os.listdir(faces_folder) - ids = [id.split('.')[0] for id in ids] - faces = {id : np.load(faces_folder + '/' + id + '.npy') for id in ids } + # faces_folder = '/home/workspace/local-data_128/results/support/faces' + ('_skirt' if config['is_skirt'] else '') + # ids = os.listdir(faces_folder) + # ids = [id.split('.')[0] for id in ids] + # faces = {id : np.load(faces_folder + '/' + id + '.npy') for id in ids } for batch in tqdm.tqdm(dataset_test): batch = static_dataset_test.expand_batch(batch_to_dict(batch, config['signature_dynamic'])) diff --git a/run_parallel.py b/run_parallel.py index 053641c..3fff046 100644 --- a/run_parallel.py +++ b/run_parallel.py @@ -6,24 +6,24 @@ if __name__ == '__main__': # folder = '/home/workspace/data/dataset/test_skirt_ready_2' # folder = '/home/workspace/local-data/cape_processed/train/male' - folder = '/home/workspace/local-data/train_skirt' + folder = '/home/workspace/local-data/train' # folder = '/home/workspace/local-data/valid' # ids = os.listdir(folder) ids = os.listdir(folder + '/mesh_posed_no_orient')#[280000:] skirt = 0 - count = 0 - step = 20000 + count = 200000 + step = 10000 # !!!!!!! change skirt parameter in script - while count < 200000: + while count < 300000: # os.system('nohup python convert_to_uv_cape.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'to_uv_2_cape_train_male_' + str(count) + '_' + str(count+step) + ' > nohup/to_uv_2_cape_train_male_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &') # os.system('nohup python convert_to_uv.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'to_uv_train_unposed_onehot_' + str(count) + '_' + str(count+step) + ' > nohup/to_uv_train_unposed_onehot_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &') # os.system('nohup python convert_to_uv_local.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'to_uv_train_local_unposed_onehot_' + str(count) + '_' + str(count+step) + ' > nohup/to_uv_train_local_unposed_onehot_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &') # os.system('nohup python convert_to_uv_local_single.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'to_uv_posed_no_orient_test_skirt_ready_' + str(count) + '_' + str(count+step) + ' > nohup/to_uv_posed_no_orient_test_skirt_ready_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &') # os.system('nohup python convert_to_uv_local_single.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'to_uv_train_skirt_local_unposed_onehot_3_' + str(count) + '_' + str(count+step) + ' > nohup/to_uv_train_skirt_local_unposed_onehot_3_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &') # os.system('nohup python convert_to_uv_local_single.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'to_uv_valid_skirt_local_unposed_onehot_3_' + str(count) + '_' + str(count+step) + ' > nohup/to_uv_valid_skirt_local_unposed_onehot_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &') - os.system('nohup python downscale.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'downscale_train_skirt_posed_no_orient_' + str(count) + '_' + str(count+step) + ' > nohup/downscale_train_skirt_posed_no_orient_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &') + os.system('nohup python downscale.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'downscale_train_posed_no_orient_' + str(count) + '_' + str(count+step) + ' > nohup/downscale_train_posed_no_orient_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &') # os.system('python Data/convert_to_uv.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + '') count += step