zju3dv / EasyMocap

Make human motion capture easier.
Other
3.71k stars 457 forks source link

Change in Limb Function for Motion Capture #329

Closed Dipankar1997161 closed 1 year ago

Dipankar1997161 commented 1 year ago

hello @chingswy

I saw this loss function which is constructing the final smpl skeleton and then mesh.

  Loss functions:
    - limb           : 1000.0, Limb of: [8,1],[2,5],[2,3],[5,6],[3,4],[6,7],[2,3],[5,6],[3,4],[6,7],[2,3],[5,6],[3,4],[6,7],[1,0],[9,12],[9,10],[10,11],[12,13],[13,14]
    - regshape       : 0.002, Loss for shapes

The limbs look similar to body25 with 15 joints (body15) config. Where is this loss function defined ?

Is there a way to use some other loss function here? and use some other lets say h36m config or something.

chingswy commented 1 year ago

Hello, this loss is defined as the limb length of body 25 config. The [8,1] is the connection of body25.

Dipankar1997161 commented 1 year ago

Hello, this loss is defined as the limb length of body 25 config. The [8,1] is the connection of body25.

Is there a way to call any other config here, let's say h36m[0,1] config instead of body25[8,1]

chingswy commented 1 year ago

You can directly edit this loss config. But maybe still some bugs..

Dipankar1997161 commented 1 year ago

@chingswy

I read this config and I think it might be possible for human3.6m to bypass and fit the body25 format. Do let me know if I am correct.

'joint_names': [
    "Nose", "Neck", "RShoulder", "RElbow", "RWrist", "LShoulder", "LElbow", "LWrist", "MidHip", "RHip","RKnee","RAnkle","LHip","LKnee","LAnkle","REye","LEye","REar","LEar","LBigToe","LSmallToe","LHeel","RBigToe","RSmallToe","RHeel"]}
CONFIG['body25']['kintree_order'] = [
[1, 8], # 躯干放在最前面
[1, 2],
[2, 3],
[3, 4],
[1, 5],

When we run "extract_keypoints.py" the json file is created as per openpose format even if we use HRNET since it's adjusted to openpose. Which means the 8th index is hip joint as shown here.

Now for human3.6m dataset the 0th index is hip joint. And since I am Parsing the files myself and providing the json files here, I can change the index location inside the json file

What if I create the 2d keypoints dataset in the format of Body25 I.e. instead of placing hip at 0th index, I place hip at 8th index and Nose/head at 0th index and so on ( like hip-centering)

I believe this can actually work, since body25 limb function is taking [1,8] I.e. joint at index 8th and 1st.

That was I won't have to change any Loss function and avoid complications.

Do let me know on this. @chingswy thanks