patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.92k stars 598 forks source link

adding more python bindings for the fitting module #347

Closed omar-h-omar closed 1 year ago

patrikhuber commented 1 year ago

Hi @omar-h-omar,

Thank you, that looks great!

I've just pushed a few minor edits to your branch. Could you give them a quick spin and if all is still well on your end, I'll merge them?

In fit_shape_to_landmarks_linear(), I've added py::arg("base_face") = Eigen::VectorXf(), to be consistent with the C++ API. I hope that doesn't break anything.

For get_3x4_affine_camera_matrix(), because there are already bindings for all the parameters that the function takes, we don't need a lambda and can just do &fitting::get_3x4_affine_camera_matrix and we're done! I think the only reason that this wouldn't work for the other bindings where I did use a lambda, is that there isn't a binding for eos::cpp17::optional.

omar-h-omar commented 1 year ago

Hi @patrikhuber,

Glad you like the changes!

I see what you mean in terms of consistency. I've tested the changes you made locally and everything still works as expected. I think we can merge this now :)

patrikhuber commented 1 year ago

Great @omar-h-omar, that's all merged, thank you!