anibali / margipose

3D monocular human pose estimation
Apache License 2.0
98 stars 20 forks source link

About loss function #17

Closed www516717402 closed 4 years ago

www516717402 commented 4 years ago

Hello.

Hope your help. Thank you again.

anibali commented 4 years ago
  1. The loss actually is computed at each stage output: https://github.com/anibali/margipose/blob/56c7b48454ace5660393899893e3fea8ae9e20f7/src/margipose/models/margipose_model.py#L224-L237 Each iteration of the for loop is for a different stage.

  2. The 2D loss is used for examples which do not have ground truth z annotations (depth). It is not used in addition to the 3D loss, it is used instead of it when the 3D loss cannot be calculated. The calculation is quite similar to the 3D loss calculation, and is defined here: https://github.com/anibali/margipose/blob/56c7b48454ace5660393899893e3fea8ae9e20f7/src/margipose/models/margipose_model.py#L214-L222

www516717402 commented 4 years ago

@anibali Thank your for reply. About second question. 3D loss include 2D loss, Why 2D and 3D coexist ? https://github.com/anibali/margipose/blob/56c7b48454ace5660393899893e3fea8ae9e20f7/src/margipose/bin/train_3d.py#L134-L142

anibali commented 4 years ago

One of the datasets that can be used to provide extra data while training is the MPII Human Pose dataset. This dataset has 2D annotations only, and therefore it is not possible to use the 3D loss function (the z coordinate simply does not exist). So for examples which come from the MPII Human Pose dataset the 2D loss is used instead.

www516717402 commented 4 years ago

Great, I see. Multi dataset used in Train step. Thank your for help.