use unregistered input
This commit is contained in:
+1
-1
@@ -80,7 +80,7 @@ class DataReader:
|
|||||||
"""
|
"""
|
||||||
def read_garment_vertices(self, sample, garment, frame, trans, zrot):
|
def read_garment_vertices(self, sample, garment, frame, trans, zrot):
|
||||||
# Read garment vertices (relative to root joint)
|
# Read garment vertices (relative to root joint)
|
||||||
pc16_path = os.path.join(self.SRC, sample, garment + '_registered.pc16')
|
pc16_path = os.path.join(self.SRC, sample, garment + '.pc16')
|
||||||
V = readPC2Frame(pc16_path, frame, True)
|
V = readPC2Frame(pc16_path, frame, True)
|
||||||
# Read sample data
|
# Read sample data
|
||||||
if trans is not None:
|
if trans is not None:
|
||||||
|
|||||||
+1
-1
@@ -104,7 +104,7 @@ class Dataset(Dataset):
|
|||||||
else:
|
else:
|
||||||
view = torch.eye(3, device=self.device)
|
view = torch.eye(3, device=self.device)
|
||||||
|
|
||||||
combined = torch.concat((body, mesh_posed[mesh_mask, :]))
|
combined = torch.concat((body, mesh_posed))
|
||||||
# combined_no_trans = torch.concat((body_no_trans, mesh_posed_no_trans[mesh_mask, :]))
|
# combined_no_trans = torch.concat((body_no_trans, mesh_posed_no_trans[mesh_mask, :]))
|
||||||
combined_faces = torch.Tensor(np.concatenate((body_faces, faces + body.shape[0]))).to(self.device)
|
combined_faces = torch.Tensor(np.concatenate((body_faces, faces + body.shape[0]))).to(self.device)
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -30,12 +30,11 @@ def generate_frames_file(folder, file_name):
|
|||||||
garment_dir = os.path.join(folder, id)
|
garment_dir = os.path.join(folder, id)
|
||||||
if not os.path.isdir(garment_dir):
|
if not os.path.isdir(garment_dir):
|
||||||
continue
|
continue
|
||||||
garments = [f.replace('_registered.pc16','') for f in os.listdir(garment_dir) if f.endswith('_registered.pc16') and not f.startswith('Combined')]
|
garments = [f.replace('.obj','') for f in os.listdir(garment_dir) if f.endswith('.obj')]
|
||||||
assert len(garments) == 1
|
info = loadInfo(os.path.join(garment_dir, 'info'))
|
||||||
garment = garments[0]
|
garments_str = ' '.join(garments)
|
||||||
verts = readPC2(os.path.join(garment_dir, garment + '_registered.pc16'), True)['V']
|
for i in range(info['poses'].shape[1]):
|
||||||
for i in range(verts.shape[0]):
|
frames.append(Frame(id, i, garments_str))
|
||||||
frames.append(Frame(id, i, garment))
|
|
||||||
|
|
||||||
with open(os.path.join(folder, file_name), 'w') as f:
|
with open(os.path.join(folder, file_name), 'w') as f:
|
||||||
for i, frame in enumerate(frames):
|
for i, frame in enumerate(frames):
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ def plot3d_with_mesh(depth, mesh, info, root_dist, scale, mask, root_joint_pixel
|
|||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
pc = cameras.unproject_points(depth)
|
# pc = cameras.unproject_points(depth)
|
||||||
mask = restore(mask[:,None,:,:], scale, root_joint_pixel).to(torch.bool)
|
mask = restore(mask[:,None,:,:], scale, root_joint_pixel).to(torch.bool)
|
||||||
depth = restore(depth, scale, root_joint_pixel, root_dist) * mask
|
depth = restore(depth, scale, root_joint_pixel, root_dist) * mask
|
||||||
pc = kornia.geometry.depth.depth_to_3d(depth, K, normalize_points=True)
|
pc = kornia.geometry.depth.depth_to_3d(depth, K, normalize_points=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user