TimoBolkart / TF_FLAME

Tensorflow framework for the FLAME 3D head model. The code demonstrates how to sample 3D heads from the model, fit the model to 2D or 3D keypoints, and how to generate textured head meshes from Images.
http://flame.is.tue.mpg.de/
444 stars 78 forks source link

Easy to fit to a strange shape with 2d landmark. #37

Closed Guocode closed 3 years ago

Guocode commented 4 years ago

When I try to fit my 2d landmark, I find it's easy to get a extremely distorted shape. How can I keep the a normal shape as well as minimize the fitted 2d projection feature loss?

TimoBolkart commented 4 years ago

For correct landmarks this should not happen. Maybe check your landmark labels that they correspond with the FLAME landmarks. Once you are sure that everything is correct with the landmarks and you still get extremely distorted shapes, you can choose a higher weight in the code for the different priors (i.e. shape, pose, expression). Increasing these prior weights will regularize the parameters more and therefore constrain the shapes that you will get. Does this help you?

Guocode commented 4 years ago

@TimoBolkart In fact, in large pose or some cases that is difficult to annotate, there is a gap between the annotated landmarks and the flame-defined landmark, so I think maybe the loss function should be modified to overcome the gap,for example using exponent function instead of l1 when loss is small, so that it will be tolerant for the annotation deviation. I have tried higher weight for priors you mention, which will lead to a more stable result but larger fitted landmark projection distance. The better solution is always adding more constraint like Ringnet.

TimoBolkart commented 4 years ago

You are absolutely right in cases of wrong or noisy landmarks, one could use some robustifier function before applying the loss, if some keypoints are not well fitted, one could either use a different loss (e.g. some exponential function) or weight some landmarks higher before summing the losses up. Other constraints like multi-person or multi-view information of course can also help to get better results.

TimoBolkart commented 3 years ago

Did you manage to solve your problem?