language2pose
language2pose copied to clipboard
fke2rifke slicing in data.py
Hello,
First of all, thanks for releasing your work/code. I might found an issue in the code, tell me what you think.
In data/data.pyline 327, you define rifke_dict which seems to give correspondances between "part of the body" and indices.
Line 148-150, you are using some of the indexes, to extract the feet positions.
fid_l, fid_r = self.rifke_dict['fid_l'], self.rifke_dict['fid_r']
foot_heights = np.minimum(positions[:,fid_l,1], positions[:,fid_r,1]).min(axis=1)
floor_height = softmin(foot_heights, softness=0.5, axis=0)
If I understand correctly, the shape of positions is [number_of_frames, number_of_joints, 3].
Line 158, you are adding the "reference joint" by concatenating it in the "joints" axis at the beginning:
positions = np.concatenate([reference[:,np.newaxis], positions], axis=1)
From now on, I think the indices are shifted (by 1). So when you use again the correspondance table rifke_dict, the indexes doesn't match the part of the body.
Line 163-166:
feet_l_x = (positions[1:,fid_l,0] - positions[:-1,fid_l,0])**2
...
Or line 184-187:
sdr_l, sdr_r, hip_l, hip_r = self.rifke_dict['sdr_l'], self.rifke_dict['sdr_r'], self.rifke_dict['hip_l'], self.rifke_dict['hip_r']
across1 = positions[:,hip_l] - positions[:,hip_r]
across0 = positions[:,sdr_l] - positions[:,sdr_r]
Thanks.