commit all

This commit is contained in:
2023-01-25 12:25:59 +00:00
parent 1bf224841f
commit 7470ca9fb6
139 changed files with 82069 additions and 811 deletions
+19 -11
View File
@@ -181,7 +181,7 @@ if __name__ == '__main__':
# body_static = sio.loadmat(os.path.join(garment_dir, 'info_body.mat'))['B']
# mask = np.squeeze(sio.loadmat(os.path.join(garment_dir, garment + '_mask.mat'))['mask'].astype(bool))
# verts_static = (body_static + offsets_static) * mask[:, np.newaxis]
# dfassert verts_static.min() > -1 and verts_static.max() < 1
# # dfassert verts_static.min() > -1 and verts_static.max() < 1
# os.makedirs(os.path.join(output_folder, 'mesh_static'), exist_ok=True)
@@ -204,7 +204,7 @@ if __name__ == '__main__':
# np.savez_compressed(os.path.join(output_folder, 'mesh_posed', id + '_' + str(i) + '.npz'), mesh_posed=garment_posed[i,:,:] * mask[:, np.newaxis])
# os.makedirs(os.path.join(output_folder, 'mesh_body_posed'), exist_ok=True)
body_posed = readPC2(os.path.join(garment_dir, 'Body_posed.pc16'), True)['V']
# body_posed = readPC2(os.path.join(garment_dir, 'Body_posed.pc16'), True)['V']
# for i in range(body_posed.shape[0]):
# np.save(os.path.join(output_folder, 'mesh_body_posed', id + '_' + str(i) + '.npy'), body_posed[i,:,:])
@@ -217,8 +217,8 @@ if __name__ == '__main__':
# shutil.copyfile(os.path.join(garment_folder_body, garment + '_' + str(i) + '.npz'), os.path.join(output_folder, 'uv_body_posed', id + '_' + str(i) + '.npz'))
# os.makedirs(os.path.join(output_folder, 'pose_shape'), exist_ok=True)
# info = sio.loadmat(os.path.join(garment_dir, 'info.mat'))
# pose, shape, gender = info['poses'], info['shape'], info['gender']
info = sio.loadmat(os.path.join(garment_dir, 'info.mat'))
pose, shape, gender = info['poses'], info['shape'], info['gender']
# shape = np.squeeze(np.concatenate((shape, gender), axis=1))
# for i in range(body_posed.shape[0]):
# np.save(os.path.join(output_folder, 'pose_shape', id + '_' + str(i) + '.npy'), np.concatenate((pose[:, i], shape), axis=-1))
@@ -240,30 +240,38 @@ if __name__ == '__main__':
# os.makedirs(os.path.join(output_folder, 'mesh_unposed_no_shape'), exist_ok=True)
# for i in range(body_posed.shape[0]):
# shutil.copyfile(os.path.join(garment_dir, 'mesh_unposed_no_shape', id + '_' + str(i) + '.npz'), os.path.join(output_folder, 'mesh_unposed_no_shape', id + '_' + str(i) + '.npz'))
# os.makedirs(os.path.join(output_folder, 'mesh_unposed_no_shape_one_hot'), exist_ok=True)
# for i in range(pose.shape[1]):
# shutil.copyfile(os.path.join(garment_dir, 'mesh_unposed_no_shape_one_hot', id + '_' + str(i) + '.npz'), os.path.join(output_folder, 'mesh_unposed_no_shape_one_hot', id + '_' + str(i) + '.npz'))
# os.makedirs(os.path.join(output_folder, 'uv_unposed_no_shape'), exist_ok=True)
# for i in range(body_posed.shape[0]):
# shutil.copyfile(os.path.join(garment_dir, 'uv_unposed_no_shape', garment + '_' + str(i) + '.npz'), os.path.join(output_folder, 'uv_unposed_no_shape', id + '_' + str(i) + '.npz'))
# os.makedirs(os.path.join(output_folder, 'uv_unposed_no_shape_one_hot'), exist_ok=True)
# for i in range(body_posed.shape[0]):
# shutil.copyfile(os.path.join(garment_dir, 'uv_unposed_no_shape_one_hot', garment + '_' + str(i) + '.npz'), os.path.join(output_folder, 'uv_unposed_no_shape_one_hot', id + '_' + str(i) + '.npz'))
os.makedirs(os.path.join(output_folder, 'uv_curvature'), exist_ok=True)
for i in range(body_posed.shape[0]):
shutil.copyfile(os.path.join(garment_dir, 'curvature_uv', garment + '_' + str(i) + '.npz'), os.path.join(output_folder, 'uv_curvature', id + '_' + str(i) + '.npz'))
# os.makedirs(os.path.join(output_folder, 'uv_curvature'), exist_ok=True)
# for i in range(body_posed.shape[0]):
# shutil.copyfile(os.path.join(garment_dir, 'curvature_uv', garment + '_' + str(i) + '.npz'), os.path.join(output_folder, 'uv_curvature', id + '_' + str(i) + '.npz'))
os.makedirs(os.path.join(output_folder, 'mesh_curvature'), exist_ok=True)
mesh_curvature = np.load(os.path.join(garment_dir, 'curvature_label_6_25.npy'))
for i in range(body_posed.shape[0]):
for i in range(pose.shape[1]):
np.savez_compressed(os.path.join(output_folder, 'mesh_curvature', id + '_' + str(i) + '.npz'), mesh_curvature=mesh_curvature[i])
# shutil.copyfile(os.path.join(folder, id, 'uv_shaped_body.npz'), os.path.join(output_folder, 'uv_shaped_body', id + '.npz'))
# os.makedirs(os.path.join(output_folder, 'uv_posed_body_no_orient'), exist_ok=True)
# for i in range(body_posed.shape[0]):
# shutil.copyfile(os.path.join(garment_dir, 'uv_posed_body_no_orient', garment + '_' + str(i) + '.npz'), os.path.join(output_folder, 'uv_posed_body_no_orient', id + '_' + str(i) + '.npz'))
# shutil.copyfile(os.path.join(garment_dir, 'uv_posed_body_no_orient', garment + '_' + str(i) + '.npz'), os.path.join(output_folder, 'uv_posed_body_no_orient_2', id + '_' + str(i) + '.npz'))
# os.makedirs(os.path.join(output_folder, 'mesh_posed_body_no_orient'), exist_ok=True)
# for i in range(body_posed.shape[0]):
# shutil.copyfile(os.path.join(garment_dir, 'mesh_posed_body_no_orient', id + '_' + str(i) + '.npz'), os.path.join(output_folder, 'mesh_posed_body_no_orient', id + '_' + str(i) + '.npz'))
# shutil.copyfile(os.path.join(folder, id, 'uv_shaped_body.npz'), os.path.join(output_folder, 'uv_shaped_body', id + '.npz'))
pass