create raw curvature uvs
This commit is contained in:
+12
-12
@@ -416,7 +416,7 @@ def test(verts, faces, values):
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-f", "--folder", help = "end of range", default='/home/workspace/data/dataset/train')
|
||||
parser.add_argument("-f", "--folder", help = "end of range", default='/home/workspace/local-data/train')
|
||||
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')
|
||||
@@ -499,15 +499,15 @@ if __name__ == '__main__':
|
||||
mask = np.load(os.path.join(local_folder, 'mesh_mask', id + '.npy')).astype(bool)
|
||||
# body = readPC2(os.path.join(folder, id, 'Body_posed.pc16'), True)['V']
|
||||
# gt = readPC2(os.path.join(folder, id, garment + '_registered.pc16'), True)['V']
|
||||
# curvature = np.load(os.path.join(folder, id, 'curvature_label_' + curvature_label_type + '.npy'))
|
||||
curvature = np.load(os.path.join(folder, id, 'curvature_raw.npy'))
|
||||
# mesh_unposed = [np.load(os.path.join(folder, id, 'mesh_unposed', id + '_' + str(i) + '.npz')) for i in range(gt.shape[0])]
|
||||
# mesh_unposed = np.stack([mesh_unposed[i]['mesh_unposed'] for i in range(gt.shape[0])])
|
||||
# mesh_unposed_no_shape = [np.load(os.path.join(folder, id, 'mesh_unposed_no_shape', id + '_' + str(i) + '.npz')) for i in range(gt.shape[0])]
|
||||
# mesh_unposed_no_shape = np.stack([mesh_unposed_no_shape[i]['mesh_unposed_no_shape'] for i in range(gt.shape[0])])
|
||||
# body_no_orient = [np.load(os.path.join(folder, id, 'mesh_posed_body_no_orient', id + '_' + str(i) + '.npz')) for i in range(gt.shape[0])]
|
||||
# body_no_orient = np.stack([body_no_orient[i]['mesh_posed_body_no_orient'] for i in range(gt.shape[0])])
|
||||
mesh_unposed_no_shape_one_hot = [np.load(os.path.join(local_folder, 'mesh_unposed_no_shape_one_hot', id + '_' + str(i) + '.npz')) for i in range(frames)]
|
||||
mesh_unposed_no_shape_one_hot = np.stack([mesh_unposed_no_shape_one_hot[i]['mesh_unposed_no_shape'] for i in range(frames)])
|
||||
# mesh_unposed_no_shape_one_hot = [np.load(os.path.join(local_folder, 'mesh_unposed_no_shape_one_hot', id + '_' + str(i) + '.npz')) for i in range(frames)]
|
||||
# mesh_unposed_no_shape_one_hot = np.stack([mesh_unposed_no_shape_one_hot[i]['mesh_unposed_no_shape'] for i in range(frames)])
|
||||
|
||||
|
||||
# verts_dynamic = gt
|
||||
@@ -561,10 +561,10 @@ if __name__ == '__main__':
|
||||
# uv_body = convert_to_uv_batch(uv_res, m2uv, uv_map, body[:, :, :], neighbours=3, mask=None, method='rbf', garment_uv_mask=None, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
# uv_posed_body_no_orient = convert_to_uv_batch(uv_res, m2uv, uv_map, body_no_orient[:, :, :], neighbours=3, mask=None, method='rbf', garment_uv_mask=None, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
# uv_gt = convert_to_uv_batch(uv_res, m2uv, uv_map, gt[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=garment_uv_mask, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
# uv_curvature = convert_to_uv_batch_label(uv_res, m2uv, uv_map, curvature[:, :], neighbours=3, mask=mask, method='nearest', garment_uv_mask=garment_uv_mask, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
uv_curvature_raw = convert_to_uv_batch_label(uv_res, m2uv, uv_map, curvature[:, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=garment_uv_mask, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
# uv_unposed = convert_to_uv_batch(uv_res, m2uv, uv_map, mesh_unposed[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=garment_uv_mask, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
# uv_unposed_no_shape = convert_to_uv_batch(uv_res, m2uv, uv_map, mesh_unposed_no_shape[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=garment_uv_mask, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
uv_unposed_no_shape_one_hot = convert_to_uv_batch(uv_res, m2uv, uv_map, mesh_unposed_no_shape_one_hot[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=garment_uv_mask, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
# uv_unposed_no_shape_one_hot = convert_to_uv_batch(uv_res, m2uv, uv_map, mesh_unposed_no_shape_one_hot[:, :, :], neighbours=3, mask=mask, method='rbf', garment_uv_mask=garment_uv_mask, garment_uv_mask_border=garment_uv_mask_border).astype(np.float32)
|
||||
# uv_shaped_body = convert_to_uv(uv_res, m2uv, uv_map, shaped_body, neighbours=3, mask=None, method='rbf', garment_uv_mask=None).astype(np.float32)
|
||||
print(time.perf_counter() - start)
|
||||
|
||||
@@ -585,9 +585,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, id, 'curvature_uv'), exist_ok=True)
|
||||
# for i in range(uv_curvature.shape[0]):
|
||||
# np.savez_compressed(os.path.join(folder, id, 'curvature_uv', garment + '_' + str(i) + '.npz'), curvature_uv=uv_curvature[i, :, :])
|
||||
os.makedirs(os.path.join(folder, id, 'curvature_uv_raw'), exist_ok=True)
|
||||
for i in range(uv_curvature_raw.shape[0]):
|
||||
np.savez_compressed(os.path.join(folder, id, 'curvature_uv_raw', garment + '_' + str(i) + '.npz'), curvature_uv_raw=uv_curvature_raw[i, :, :])
|
||||
|
||||
# os.makedirs(os.path.join(folder, id, 'uv_unposed'), exist_ok=True)
|
||||
# for i in range(uv_unposed.shape[0]):
|
||||
@@ -597,9 +597,9 @@ if __name__ == '__main__':
|
||||
# for i in range(uv_unposed_no_shape.shape[0]):
|
||||
# np.savez_compressed(os.path.join(folder, id, 'uv_unposed_no_shape', garment + '_' + str(i) + '.npz'), uv_unposed_no_shape=uv_unposed_no_shape[i, :, :, :])
|
||||
|
||||
os.makedirs(os.path.join(folder, id, 'uv_unposed_no_shape_one_hot'), exist_ok=True)
|
||||
for i in range(uv_unposed_no_shape_one_hot.shape[0]):
|
||||
np.savez_compressed(os.path.join(folder, id, 'uv_unposed_no_shape_one_hot', garment + '_' + str(i) + '.npz'), uv_unposed_no_shape=uv_unposed_no_shape_one_hot[i, :, :, :])
|
||||
# os.makedirs(os.path.join(folder, id, 'uv_unposed_no_shape_one_hot'), exist_ok=True)
|
||||
# for i in range(uv_unposed_no_shape_one_hot.shape[0]):
|
||||
# np.savez_compressed(os.path.join(folder, id, 'uv_unposed_no_shape_one_hot', garment + '_' + str(i) + '.npz'), uv_unposed_no_shape=uv_unposed_no_shape_one_hot[i, :, :, :])
|
||||
|
||||
# os.makedirs(os.path.join(folder, id, 'uv_shaped_body'), exist_ok=True)
|
||||
# np.savez_compressed(os.path.join(folder, id, 'uv_shaped_body.npz'), uv_shaped_body=uv_shaped_body)
|
||||
|
||||
Reference in New Issue
Block a user