From 664b59c4525a57d64edd26264df3036c918ae1be Mon Sep 17 00:00:00 2001 From: Hunor Laczko Date: Sat, 28 Jan 2023 23:57:13 +0000 Subject: [PATCH] rerun curv encoder training with new curvs --- aaa_helpers.txt | 1 + auto_encoder_curv.py | 2 +- ...config_ae_curv_1_orig_curv_100_10p_r2_2.py | 30 +++++++++++++++++++ .../config_ae_curv_1_orig_curv_10_10p_r2_2.py | 30 +++++++++++++++++++ dataset.py | 6 ++-- 5 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 configs/config_ae_curv_1_orig_curv_100_10p_r2_2.py create mode 100644 configs/config_ae_curv_1_orig_curv_10_10p_r2_2.py diff --git a/aaa_helpers.txt b/aaa_helpers.txt index cd8ac9c..eab40df 100644 --- a/aaa_helpers.txt +++ b/aaa_helpers.txt @@ -1,6 +1,7 @@ nohup python cvae.py --name="lhunor_abl_all_10p_curv_10_r2" > nohup/review/abl_all_10p_curv_10_r2.out 2>&1 & nohup python auto_encoder_curv.py --name="lhunor_ae_curv_1_orig_curv_10_10p_r2" > nohup/review/curv_1_orig_curv_10_10p_r2.out 2>&1 & nohup python auto_encoder_curv.py --name="lhunor_ae_curv_1_orig_curv_25_10p_r2" > nohup/review/curv_1_orig_curv_25_10p_r2.out 2>&1 & +nohup python auto_encoder_curv.py --name="lhunor_ae_curv_1_orig_curv_100_10p_r2_2" > nohup/review/curv_1_orig_curv_100_10p_r2_2.out 2>&1 & one final convolutional layer for smoothing, on the final coordinates diff --git a/auto_encoder_curv.py b/auto_encoder_curv.py index 7548d45..fdf258c 100644 --- a/auto_encoder_curv.py +++ b/auto_encoder_curv.py @@ -1,6 +1,6 @@ import os import sys -from configs.config_ae_curv_1_orig_curv_100_10p_r2 import config +from configs.config_ae_curv_1_orig_curv_10_10p_r2_2 import config os.environ["CUDA_VISIBLE_DEVICES"] = config['gpu'] import tensorflow as tf diff --git a/configs/config_ae_curv_1_orig_curv_100_10p_r2_2.py b/configs/config_ae_curv_1_orig_curv_100_10p_r2_2.py new file mode 100644 index 0000000..b9b5bee --- /dev/null +++ b/configs/config_ae_curv_1_orig_curv_100_10p_r2_2.py @@ -0,0 +1,30 @@ +from configs.config_base import config + +config['gpu'] = '1' +config['lr'] = 0.001 +config['name'] = 'curv_1_orig_curv_100_10p_r2_2' #'ae_curv_9' +config['notes'] = 'convnext + convnext, 16*8*32, ce loss. flattened latent dim of 128. trained on 100 garments. switched back to sparse CCE, normal one was giving NaN | \ +| \ + ' +config['tags'] = ['review_2'] +config['remove_global_orientation'] = True +config['dataset_in_memory'] = True + +config['cond_ae']['is_label'] = True +config['is_skirt'] = True + +config['train_dir'] = '/home/workspace/data/dataset/local-cache/train_skirt' +config['valid_dir'] = '/home/workspace/local-data/valid_skirt' +config['test_dir'] = '/home/workspace/data/dataset/test_skirt_ready_2' +config['frames_file'] = 'frames_skirt_10p.txt' +config['frames_file_valid'] = 'frames_skirt_10p.txt' +config['curv_neighbourhood'] = 100 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'uv_curvature': (512, 256, 7), + 'mesh_curvature': (config['smpl_res']) + } +config['signature_static'] = { 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + diff --git a/configs/config_ae_curv_1_orig_curv_10_10p_r2_2.py b/configs/config_ae_curv_1_orig_curv_10_10p_r2_2.py new file mode 100644 index 0000000..bea3a1b --- /dev/null +++ b/configs/config_ae_curv_1_orig_curv_10_10p_r2_2.py @@ -0,0 +1,30 @@ +from configs.config_base import config + +config['gpu'] = '4' +config['lr'] = 0.001 +config['name'] = 'curv_1_orig_curv_10_10p_r2_2' #'ae_curv_9' +config['notes'] = 'convnext + convnext, 16*8*32, ce loss. flattened latent dim of 128. trained on 100 garments. switched back to sparse CCE, normal one was giving NaN | \ +| \ + ' +config['tags'] = ['review_2'] +config['remove_global_orientation'] = True +config['dataset_in_memory'] = True + +config['cond_ae']['is_label'] = True +config['is_skirt'] = True + +config['train_dir'] = '/home/workspace/data/dataset/local-cache/train_skirt' +config['valid_dir'] = '/home/workspace/local-data/valid_skirt' +config['test_dir'] = '/home/workspace/data/dataset/test_skirt_ready_2' +config['frames_file'] = 'frames_skirt_10p.txt' +config['frames_file_valid'] = 'frames_skirt_10p.txt' +config['curv_neighbourhood'] = 10 + +config['signature_dynamic'] = { 'id': (), 'frame_nr': (), + 'uv_curvature': (512, 256, 7), + 'mesh_curvature': (config['smpl_res']) + } +config['signature_static'] = { 'mesh_mask': (config['smpl_res'],), + 'uv_mask': (512, 256,), + } + diff --git a/dataset.py b/dataset.py index 26f6624..66f3601 100644 --- a/dataset.py +++ b/dataset.py @@ -261,7 +261,7 @@ class DatasetFactory(): if 'mesh_curvature' in signature.keys(): - mesh_curvature = np.load(os.path.join(folder, f'mesh_curvature_{curv_neighbourhood}' if curv_neighbourhood != 25 else 'mesh_curvature', id + separator + frame_nr + '.npz')); mesh_curvature = mesh_curvature['mesh_curvature'] + mesh_curvature = np.load(os.path.join(folder, f'mesh_curvature_{curv_neighbourhood}_2' if curv_neighbourhood != 25 else 'mesh_curvature', id + separator + frame_nr + '.npz')); mesh_curvature = mesh_curvature['mesh_curvature'] item['mesh_curvature'] = mesh_curvature.astype(np.int32) @@ -271,8 +271,8 @@ class DatasetFactory(): res_string = '_' + str(res) if 'uv_curvature' + res_string in signature.keys(): - print(os.path.join(folder, (f'uv_curvature_{curv_neighbourhood}' if curv_neighbourhood != 25 else 'uv_curvature')+ res_string, id + separator + frame_nr + '.npz')) - uv_curvature = np.load(os.path.join(folder, (f'uv_curvature_{curv_neighbourhood}' if curv_neighbourhood != 25 else 'uv_curvature')+ res_string, id + separator + frame_nr + '.npz')); + # print(os.path.join(folder, (f'uv_curvature_{curv_neighbourhood}_2' if curv_neighbourhood != 25 else 'uv_curvature')+ res_string, id + separator + frame_nr + '.npz')) + uv_curvature = np.load(os.path.join(folder, (f'uv_curvature_{curv_neighbourhood}_2' if curv_neighbourhood != 25 else 'uv_curvature')+ res_string, id + separator + frame_nr + '.npz')); if res_string != '': uv_curvature = uv_curvature['uv_curvature'] else: