Dou-Yiming / Pose_to_SMPL

A tool to fit SMPL parameters from 3D-pose datasets that contain key-points of human body.
GNU General Public License v3.0
107 stars 13 forks source link

Shape_params values are ZERO #3

Closed Dipankar1997161 closed 7 months ago

Dipankar1997161 commented 1 year ago

Hello,

Are running the code for CMU_mocap and Human3.6M dataset on the 3d joints, I got the pose_params values, but the shape_params are 0 all the way,

Why could this be the case? Can you provide any insights onto this?

is this because of early stop? since not a single-time, the model was trained till 1000 epochs as stated in the json files.

Dou-Yiming commented 1 year ago

Hi! The reason is that the shape_params are not updated by default. Line 26 of fit/tools/train.py sets the requires_grad parameter of shape_params: params["shape_params"].requires_grad = bool(cfg.TRAIN.OPTIMIZE_SHAPE) You may change this in config file: fit/configs/CMU_Mocap.json However sometimes the SMPL body may ends up being very strange if we update shape_params values.

Dipankar1997161 commented 1 year ago

@Dou-Yiming,

thank you for the response, after changing the Shape optimize to true, I got the results.

I have a second question: For mapping human3.6m dataset to SMPL, which joints are considered.

h36m has 32 joints but smpl requires 24, so could you provide me information on this???

It would be really helpful, I tried on the web, couldn't get the answer i needed.

Thank you in advance

Dou-Yiming commented 1 year ago

Yes, the joint mapping is the key design of this tool. For example, if h36m has 32 joints, and SMPL has 24 joints, we simply consider the intersections of these joints (e.g., when both datasets contains joint "head", then it is added, otherwise the joint is discarded). I manually set the joint mapping in "DATA_MAP" of fit/configs/Human3.6M.json. You may refer to line 37 of fit/tools/train.py for more details of how this config is used.

Dipankar1997161 commented 1 year ago

Hello @Dou-Yiming, I added few more mapping from my end to sit all the 24 joints into the smpl. As you mentioned, I need to pass in the Config "OPTIMIZE_SHAPE: 1"

I did, but the results are still 0, only the scale is getting optimized

"TRAIN": {
        "LEARNING_RATE": 3e-4,
        "MAX_EPOCH": 1000,
        "WRITE": 1,
        "OPTIMIZE_SCALE":1,
        "OPTIMIZE_SHAPE":1
    },
    "USE_GPU": 0,
    "DATASET": {
        "NAME": "Human3.6M",
        "PATH": "/home/ndip/THESIS/keypoints3d/3D_mono_universal/cam_58860488/",
        "TARGET_PATH": "",

Another question, The smpl is generated but its not accurate as the video of h36m is. So i was wondering, which h36m file to use for smpl usually

  1. The world coordinate system keypoints
  2. The camera coordinate system keypoints

Do let me know.

Dou-Yiming commented 1 year ago

The shape params should be optimized if you set OPTIMIZE_SHAPE to 1, so there might be some strange errors, may be try debugging it by printing out whether params["shape_params"].requires_grad is True. However, the fitted SMPL body may be super strange if you set OPTIMIZE_SHAPE to 1, so I suggest that you only optimize the pose params. For the coordinate system, I think the world coordinate should be okay. You may try both to check if it's working.

Dipankar1997161 commented 1 year ago

The shape params should be optimized if you set OPTIMIZE_SHAPE to 1, so there might be some strange errors, may be try debugging it by printing out whether params["shape_params"].requires_grad is True. However, the fitted SMPL body may be super strange if you set OPTIMIZE_SHAPE to 1, so I suggest that you only optimize the pose params. For the coordinate system, I think the world coordinate should be okay. You may try both to check if it's working.

The shapes parameters is useful for reconstruction, without that how can I approach further. I domt think it's possible with just poses parameters.

What u think

Dou-Yiming commented 1 year ago

In my experiments, we were just using the pose params, so the shape params are not optimized