Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion of data for .pkl file for 'softcat477/SMPL-to-FBX/' #15

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions visualize/vis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,28 @@ def save_npy(self, save_path):
'length': self.real_num_frames,
}
np.save(save_path, data_dict)

# Conversion of data for .pkl file for 'softcat477/SMPL-to-FBX/'
# Change 'FbxTime.eFrames60's in SMPL-to-FBX/FbxReadWriter.py to 'FbxTime.eFrames30'
# Known issues: Glitches below 30 fps exports in 'softcat477/SMPL-to-FBX/' (20 fps expected)

jaykup1 marked this conversation as resolved.
Show resolved Hide resolved
i = range(self.real_num_frames)
poses_raw = []
latest = None
for idx, x in np.ndenumerate(torch.flatten(geometry.matrix_to_axis_angle(geometry.rotation_6d_to_matrix(torch.tensor(self.motions['motion'][0, :-1, :, i]))))):
poses_raw.append(x)
latest = x
smpl_poses = np.array(poses_raw).reshape(self.real_num_frames, 72)
trans_raw = []
latest = None
for idx, x in np.ndenumerate(self.motions['motion'][0, -1, :3, i]):
trans_raw.append(x)
latest = x
smpl_trans = np.array(trans_raw).reshape(self.real_num_frames, 3)*np.array([100, 1, 100])

data_dict2 = {'smpl_poses': smpl_poses,'smpl_trans': smpl_trans,}

with open(save_path +".pkl", 'wb') as pickle_file:
pickle.dump(data_dict2, pickle_file)
# End of Conversion of data for .pkl file for 'softcat477/SMPL-to-FBX/'