Complextext2animation
Complextext2animation copied to clipboard
fke2rifke slicing in data.py
Hello,
In data.py
line 381, you define rifke_dict
which seems to give correspondances between "part of the body" and indices.
Line 164-166, 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 176-177, 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 182:
feet_l_x = (positions[1:, fid_l, 0] - positions[:-1, fid_l, 0])**2
Or line 205-209:
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]
What do you think of it?
Thanks
As this part of the code is borrowed from language2pose repository, I duplicate the issue there: https://github.com/chahuja/language2pose/issues/22
I think they calculated the index in rifke_dict
after adding reference
.
So we don't need to modify it I think. :)
As fid_l
and fid_r
are used before (line 164) and after shifting the indexes (line 182), one or the other should be wrong I think.
As
fid_l
andfid_r
are used before (line 164) and after shifting the indexes (line 182), one or the other should be wrong I think.
I didn't find the one used earlier, are you referring to line 163 comments?
I didn't find the one used earlier, are you referring to line 163 comments?
I was refering to line 166 https://github.com/anindita127/Complextext2animation/blob/d89730c17580c5b9ccb767d55257f6781eec062a/src/data.py#L166
Then, the shifting on indexes in line 177 https://github.com/anindita127/Complextext2animation/blob/d89730c17580c5b9ccb767d55257f6781eec062a/src/data.py#L177
Then the reindexing line 182 https://github.com/anindita127/Complextext2animation/blob/d89730c17580c5b9ccb767d55257f6781eec062a/src/data.py#L182