save progress

This commit is contained in:
2023-02-15 16:21:14 +00:00
parent d67865e7cd
commit a94be773d3
12 changed files with 656 additions and 74 deletions
+5 -6
View File
@@ -244,14 +244,13 @@ def read_posed_garment_frame(folder, id, garment, frame, map=None, mask=None, sh
# can i cache map?
# NOT WORKING WELL
def read_posed_garment(folder, id, garment, map=None, mask=None, shape=None, shapedirs=None, poses=None, unshape=False, deorient=False):
# body_posed = readPC2(os.path.join(folder, id, 'Body_posed.pc16'), True)['V']
# offsets = readPC2(os.path.join(folder, id, garment + '_offsets_dynamic.pc16'), True)['V']
# verts = (body_posed + offsets) * mask[:, None]
pc16_path = os.path.join(folder, id, garment + '.pc16')
info = loadInfo(os.path.join(folder, id, 'info.mat'))
verts = np.stack([readPC2Frame(pc16_path, frame, True) for frame in range(info['poses'].shape[1])])
# info = loadInfo(os.path.join(folder, id, 'info.mat'))
verts = readPC2(pc16_path, True)['V']
if map is None:
map = sio.loadmat(os.path.join(folder, id, garment + '_map.mat'))['map'].reshape((-1))
verts = verts[:, map, :]
@@ -298,7 +297,7 @@ def read_posed_body_frame(folder, id, frame, pose=None, deorient=False):
def read_posed_body(folder, id, poses=None, deorient=False):
pc16_path = os.path.join(folder, id, 'Body_posed.pc16')
verts = readPC2(pc16_path, True)
verts = readPC2(pc16_path, True)['V']
if deorient:
for i in range(verts.shape[0]):
@@ -309,8 +308,8 @@ def read_posed_body(folder, id, poses=None, deorient=False):
return verts
def read_curvatures(h5file, id, frames, neighbourhood=None):
frames_filtered = [frame for frame in frames if frame.split()[0] == id]
def read_curvatures(h5file, id, garment, frames, neighbourhood=None):
frames_filtered = [frame for frame in frames if (frame.split()[0] == id and frame.split()[2] == garment)]
garment = frames_filtered[0].split()[2]
curvatures_all = []
for frame_nr in range(len(frames_filtered)):