regenerate curv based on new binning

This commit is contained in:
2023-01-28 23:37:08 +00:00
parent feadeb3b5a
commit 6bfd18f3c7
7 changed files with 24 additions and 21 deletions
+5 -3
View File
@@ -1,5 +1,7 @@
nohup python curvature_labels.py > nohup/curv_labels_test_skirt_0k_30k.out 2>&1 &
nohup python curvature_labels.py > nohup/curv_labels_valid_skirt_label_0k_30k.out 2>&1 &
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" > nohup/review/curv_1_orig_curv_100_10p_r2.out 2>&1 &
one final convolutional layer for smoothing, on the final coordinates
@@ -7,7 +9,7 @@ skirts!!!!
pyramid next week
basic final, basic final skirts,
basic pyramid
basic pyramid
removing curvatures test in ablation
+2 -2
View File
@@ -533,9 +533,9 @@ if __name__ == '__main__':
# for i in range(uv_gt.shape[0]):
# np.savez_compressed(os.path.join(folder, id, 'gt_uv', garment + '_' + str(i) + '.npz'), uv_gt=uv_gt[i, :, :, :])
os.makedirs(os.path.join(folder, f'uv_curvature_{neighbourhood}'), exist_ok=True)
os.makedirs(os.path.join(folder, f'uv_curvature_{neighbourhood}_2'), exist_ok=True)
for i in range(uv_curvature.shape[0]):
np.savez_compressed(os.path.join(folder, f'uv_curvature_{neighbourhood}', id + '_' + str(i) + '.npz'), curvature_uv=uv_curvature[i, :, :])
np.savez_compressed(os.path.join(folder, f'uv_curvature_{neighbourhood}_2', id + '_' + str(i) + '.npz'), curvature_uv=uv_curvature[i, :, :])
# os.makedirs(os.path.join(folder, id, 'uv_unposed'), exist_ok=True)
# for i in range(uv_unposed.shape[0]):
+5 -4
View File
@@ -5,15 +5,16 @@ import os
if __name__ == '__main__':
folder = '/home/workspace/data/dataset/test_skirt_ready_2'
out_folder = '/home/workspace/local-data/valid_skirt'
# folder = '/home/workspace/data/dataset/local-cache/train_skirt'
# folder = '/home/workspace/local-data/valid_skirt'
ids = os.listdir(folder + '/mesh_posed')
count = 0
step = 5000
step = 2500
while count < len(ids):
# while count < 30000:
# while count < 10000:
# os.system('nohup python MeshUtils/curvature_labels.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'curv_train_' + str(count) + '_' + str(count+step) + ' > curv_train_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &')
os.system('nohup python curvature_labels.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'curv_gen_10_label_test_skirt_' + str(count) + '_' + str(count+step) + ' > nohup/curv_gen_10_label_test_skirt_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &')
os.system('nohup python curvature_labels.py -f ' + folder + ' -s ' + str(count) + ' -e ' + str(count + step) + ' -n ' + 'curv_gen_2_100_label_test_skirt_' + str(count) + '_' + str(count+step) + ' > nohup/curv_gen_2_100_label_test_skirt_' + 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
+8 -8
View File
@@ -155,7 +155,7 @@ def get_bins(values, nr_of_bins):
def generate_curvature_labels(folder, bins, curvatures, frames, neighbourhood):
os.makedirs(os.path.join(folder, f'mesh_curvature_{neighbourhood}'), exist_ok=True)
os.makedirs(os.path.join(folder, f'mesh_curvature_{neighbourhood}_2'), exist_ok=True)
labels = np.linspace(0, bins.shape[0] - 2, bins.shape[0] - 1)
for i, frame in enumerate(tqdm.tqdm(frames)):
@@ -169,7 +169,7 @@ def generate_curvature_labels(folder, bins, curvatures, frames, neighbourhood):
frame_labels[(curvature >= bins[j]) * (curvature < bins[j+1])] = labels[j]
frame_labels[curvature >= bins[-2]] = labels[-1]
np.savez_compressed(os.path.join(folder, f'mesh_curvature_{neighbourhood}', f'{frame}.npz'), mesh_curvature=frame_labels)
np.savez_compressed(os.path.join(folder, f'mesh_curvature_{neighbourhood}_2', f'{frame}.npz'), mesh_curvature=frame_labels)
# writePC2(os.path.join(garment_dir, "curvature_label_" + str(nr_of_labels) + "_" + str(neighbourhood) + ".pc16"), unmasked_label, True)
@@ -251,7 +251,7 @@ def read_raw_curvatures(folder, frames, neighbourhood):
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--folder", help = "process the given folder", default=r'/home/workspace/data/dataset/test_skirt_ready_2')
parser.add_argument("-f", "--folder", help = "process the given folder", default=r'/home/workspace/data/dataset/local-cache/train_skirt')
parser.add_argument("-s", "--start", help = "start of range", default=0)
parser.add_argument("-e", "--end", help = "end of range", default=30000)
parser.add_argument("-n", "--name", help = "end of range", default="lhunor")
@@ -285,12 +285,12 @@ if __name__ == '__main__':
# lines = [line.strip() for line in lines]
# frames = lines[int(args.start):int(args.end)]
generate_curvatures(folder, neighbourhood, frames)
# curvatures = read_raw_curvatures(folder, frames, neighbourhood)
# generate_curvatures(folder, neighbourhood, frames)
curvatures = read_raw_curvatures(folder, frames, neighbourhood)
# bins = get_bins(curvatures, nr_of_labels)
# np.save('train_bins_skirt.npy', bins)
# bins = np.load('custom_data/train_bins_skirt.npy')
# generate_curvature_labels(folder, bins, curvatures, frames, neighbourhood)
# np.save(f'custom_data/train_bins_skirt_{neighbourhood}.npy', bins)
bins = np.load(f'custom_data/train_bins_skirt_{neighbourhood}.npy')
generate_curvature_labels(folder, bins, curvatures, frames, neighbourhood)
# visualize_curvature_labels(folder)
pass
Binary file not shown.
Binary file not shown.
+4 -4
View File
@@ -4,9 +4,9 @@ import os
if __name__ == '__main__':
# folder = '/home/workspace/data/dataset/local-cache/train_skirt'
folder = '/home/workspace/data/dataset/local-cache/train_skirt'
# folder = '/home/workspace/data/dataset/test_skirt_ready_2'
folder = '/home/workspace/local-data/valid_skirt'
# folder = '/home/workspace/local-data/valid_skirt'
# folder = '/home/workspace/local-data/cape_processed/train/male'
# folder = '/home/workspace/local-data/valid_skirt'
# folder = '/home/workspace/local-data/valid'
@@ -19,11 +19,11 @@ if __name__ == '__main__':
# !!!!!!! change skirt parameter in script
while count < 100:
while count < 80:
# 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_curv_100_valid_skirt_' + str(count) + '_' + str(count+step) + ' > nohup/to_uv_curv_100_valid_skirt_' + 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_curv_2_100_train_skirt_' + str(count) + '_' + str(count+step) + ' > nohup/to_uv_curv_2_100_train_skirt_' + 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_valid_posed_no_orient_' + str(count) + '_' + str(count+step) + ' > nohup/downscale_valid_posed_no_orient_' + str(count) + '_' + str(count+step) + '.out' + ' 2>&1 &')