BrianG13 / FLEX

FLEX: Parameter-free Multi-view 3D Human Motion Reconstruction
47 stars 3 forks source link

Base Skeleton in FK Module #16

Closed anas-zafar closed 1 year ago

anas-zafar commented 1 year ago

Thank you for the amazing work! I observed the base skeleton that was created in the FK module was different then the T pose that is normally created but I also saw in the else condition that a different base skeleton was there which resembled the T pose but it was not being used as it did not get in the else condition, can you shed some light upon it and if we were to use a custom dataset how are we to incorporate a base skeleton for it. Thanks @BrianG13

` if start_position_as_totem == True:
            skel_in[:, 1, 0] = -unnorm_bones[:, 0, 0]
            skel_in[:, 4, 0] = unnorm_bones[:, 0, 0]
            skel_in[:, 2, 1] = -unnorm_bones[:, 0, 1]
            skel_in[:, 5, 1] = -unnorm_bones[:, 0, 1]
            skel_in[:, 3, 1] = -unnorm_bones[:, 0, 2]
            skel_in[:, 6, 1] = -unnorm_bones[:, 0, 2]
            skel_in[:, 8, 1] = unnorm_bones[:, 0, 3]
            skel_in[:, 9, 1] = unnorm_bones[:, 0, 4]
            skel_in[:, 12, 1] = unnorm_bones[:, 0, 4]
            skel_in[:, 16, 1] = unnorm_bones[:, 0, 4]
            skel_in[:, 10, 1] = unnorm_bones[:, 0, 5]
            skel_in[:, 11, 1] = unnorm_bones[:, 0, 6]
            skel_in[:, 13, 1] = unnorm_bones[:, 0, 7]
            skel_in[:, 14, 1] = unnorm_bones[:, 0, 8]
            skel_in[:, 15, 1] = unnorm_bones[:, 0, 9]
            skel_in[:, 17, 1] = unnorm_bones[:, 0, 7]
            skel_in[:, 18, 1] = unnorm_bones[:, 0, 8]
            skel_in[:, 19, 1] = unnorm_bones[:, 0, 9]
else:
            skel_in[:, 1, 0] = -unnorm_bones[:, 0, 0]
            skel_in[:, 4, 0] = unnorm_bones[:, 0, 0]
            skel_in[:, 2, 1] = -unnorm_bones[:, 0, 1]
            skel_in[:, 5, 1] = -unnorm_bones[:, 0, 1]
            skel_in[:, 3, 1] = -unnorm_bones[:, 0, 2]
            skel_in[:, 6, 1] = -unnorm_bones[:, 0, 2]
            skel_in[:, 8, 1] = unnorm_bones[:, 0, 3]
            skel_in[:, 9, 1] = unnorm_bones[:, 0, 4]
            skel_in[:, 12, 1] = unnorm_bones[:, 0, 4]
            skel_in[:, 16, 1] = unnorm_bones[:, 0, 4]
            skel_in[:, 10, 1] = unnorm_bones[:, 0, 5]
            skel_in[:, 11, 1] = unnorm_bones[:, 0, 6]
            skel_in[:, 13, 0] = unnorm_bones[:, 0, 7]
            skel_in[:, 14, 0] = unnorm_bones[:, 0, 8]
            skel_in[:, 15, 0] = unnorm_bones[:, 0, 9]
            skel_in[:, 17, 0] = -unnorm_bones[:, 0, 7]
            skel_in[:, 18, 0] = -unnorm_bones[:, 0, 8]
            skel_in[:, 19, 0] = -unnorm_bones[:, 0, 9]`
BrianG13 commented 1 year ago

Hi @anas-zafar thanks for your interest.

You are right this "if" condition controls on the starting position of the skeleton, start as a Totem or T-Pose. T-Pose:

image

Totem:

image

Why to use the Totem option? The H36M Dataset ground-truth joint rotation angles are based on the "totem" initial position, no "t-pose". We want to compare our predicted joint rotations to the H36M ground-truth and in order to do so we need to start with the same skeleton initial position.

Actually, it doesn't really matter the initial position, if you have a custom dataset, the network should be able to learn from any initial skeleton position (Of course, the initial position should be the same for all the frames and training data in order to be consistent).

So, for your custom dataset I will try both options, but my guess is that there will be no big differences between both