From 632d8db815cf2fd41d41be87c6b8fcdc461da934 Mon Sep 17 00:00:00 2001 From: Hunor Laczko Date: Sat, 28 Jan 2023 16:18:29 +0000 Subject: [PATCH] generate raw curv values for test set --- curvature_label_parallel.py | 8 ++++---- curvature_labels.py | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/curvature_label_parallel.py b/curvature_label_parallel.py index d2567cf..b1da0a5 100644 --- a/curvature_label_parallel.py +++ b/curvature_label_parallel.py @@ -4,16 +4,16 @@ import os if __name__ == '__main__': - folder = '/home/workspace/data/dataset/local-cache/train_skirt' + folder = '/home/workspace/data/dataset/test_skirt_ready_2' out_folder = '/home/workspace/local-data/valid_skirt' ids = os.listdir(folder + '/mesh_posed') count = 0 step = 5000 - # while count < len(ids): - while count < 30000: + while count < len(ids): + # while count < 30000: # 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_train_skirt_' + str(count) + '_' + str(count+step) + ' > nohup/curv_gen_10_train_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_10_test_skirt_' + str(count) + '_' + str(count+step) + ' > nohup/curv_gen_10_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 diff --git a/curvature_labels.py b/curvature_labels.py index 7f9893b..7b4b58d 100644 --- a/curvature_labels.py +++ b/curvature_labels.py @@ -251,9 +251,9 @@ 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/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("-f", "--folder", help = "process the given folder", default=r'/home/workspace/data/dataset/test_skirt_ready_2') + parser.add_argument("-s", "--start", help = "start of range", default=5000) + parser.add_argument("-e", "--end", help = "end of range", default=10000) parser.add_argument("-n", "--name", help = "end of range", default="lhunor") args = parser.parse_args() @@ -275,20 +275,20 @@ if __name__ == '__main__': print('SKIRT' if is_skirt else 'NOT SKIRT') - # frames = sorted(os.listdir(os.path.join(folder, 'mesh_posed')))[int(args.start):int(args.end)] + frames = sorted(os.listdir(os.path.join(folder, 'mesh_posed')))[int(args.start):int(args.end)] - frames = [] - with open(os.path.join(folder, frames_file), 'r') as f: - lines = f.readlines() - lines = [line.strip() for line in lines] - frames = lines[int(args.start):int(args.end)] + # frames = [] + # with open(os.path.join(folder, frames_file), 'r') as f: + # lines = f.readlines() + # 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) + # bins = np.load('custom_data/train_bins_skirt.npy') + # generate_curvature_labels(folder, bins, curvatures, frames, neighbourhood) # visualize_curvature_labels(folder) pass \ No newline at end of file