diff --git a/curvature_label_parallel.py b/curvature_label_parallel.py index d426f07..d2567cf 100644 --- a/curvature_label_parallel.py +++ b/curvature_label_parallel.py @@ -4,8 +4,8 @@ import os if __name__ == '__main__': - folder = '/home/workspace/local-data/train' - out_folder = '/home/workspace/local-data/train' + folder = '/home/workspace/data/dataset/local-cache/train_skirt' + out_folder = '/home/workspace/local-data/valid_skirt' ids = os.listdir(folder + '/mesh_posed') count = 0 @@ -14,6 +14,6 @@ if __name__ == '__main__': # 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_50_train_' + str(count) + '_' + str(count+step) + ' > nohup/curv_gen_50_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('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 73035c1..d3e6854 100644 --- a/curvature_labels.py +++ b/curvature_labels.py @@ -114,7 +114,7 @@ def generate_curvatures(folder, neighbourhood, frames): # bodies = readPC2(os.path.join(folder, id, 'Body_posed.pc16'), True)['V'] # offsetss = readPC2(os.path.join(folder, id, garment + '_registered.pc16'), True)['V'] mask = np.load(os.path.join(folder, 'mesh_mask', f'{id}.npy')).astype(bool) - faces = np.load(os.path.join(folder, 'faces', f'{id}.npy')) + _, faces = _maskFaces(np.zeros((14475,3)), F, mask) #np.load(os.path.join(folder, 'faces', f'{id}.npy')) v = np.load(os.path.join(folder, 'mesh_posed', f'{id}_{frame_nr}.npz'))['mesh_posed'][mask,:] m = tm.Trimesh(v, faces, process=False, validate=False) @@ -283,13 +283,13 @@ def read_raw_curvatures(folder): if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument("-f", "--folder", help = "process the given folder", default=r'/home/workspace/local-data/train') + parser.add_argument("-f", "--folder", help = "process the given folder", default=r'/home/workspace/local-data/valid_skirt') parser.add_argument("-s", "--start", help = "start of range", default=0) parser.add_argument("-e", "--end", help = "end of range", default=10) parser.add_argument("-n", "--name", help = "end of range", default="lhunor") args = parser.parse_args() - is_skirt = False + is_skirt = True skirt_modifier = '_skirt' if is_skirt else '' F = np.load("custom_utils/smpl_faces" + skirt_modifier + ".npy").astype(np.int32) # k_neighbours(k=25) @@ -298,7 +298,7 @@ if __name__ == '__main__': frames_file = 'frames' + skirt_modifier + '_10p.txt' nr_of_labels = 6 - neighbourhood = 50 + neighbourhood = 10 temp_file = '/home/workspace/local-data/temp/' + ''.join(random.choice(string.ascii_lowercase) for i in range(10)) + '.ply' if not is_skirt: dist = np.load('custom_data/dijkstra.npy')