-
-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding more fitting python bindings #354
Adding more fitting python bindings #354
Conversation
Hi Omar, I've pushed a slight tweak to About the
You mean in the Python bindings, correct? If yes, then yes we could add that for the other Also it would be nice if we could set the default values of these arguments, I think should work. But: Also I think the default arguments ( Well... maybe you could play around with it a bit, but if you get stuck, let me know and I can try it too. Actually, having written all this now, I'm fairly convinced that the way you're doing it now in this PR is probably the best and (almost) only way to do it, so it's probably not worth spending much more time on it. Let me know your thoughts. |
Hi Patrik, I saw your commits. I was experimenting with the parameters and it looks like I forgot to make the function parameter mandatory. For the As for my note, yes I was referring to the python bindings. I did some experimenting when I initially made that change. From what I understand, by default pybind doesn't pass the Python params by reference. Instead it instantiates a C++ version of those parameter. Any updates to those parameters are then not passed back to python. Here's a stackflow discussion that I found that explains it a bit better: https://stackoverflow.com/questions/72885134/pybind11-pointer-reference. I am not very knowledgeable with C++ so feel free to correct if I am wrong but I think my solution gets around this issue. |
Hi Patrik, I was checking out the In the fitting functions, we check if the landmark definitions are not This seems quite limiting. I don't think it is what we want right? |
Hi Omar,
You're completely right, very well spotted. Actually in your original PR you were passing an I'll have a more close look at your other message above from 14 Apr but I've had a quick look back then and I think I pretty much agree with your assessment! |
Great! Yeah adding |
Hi @omar-h-omar, I just had a final look at this PR. Could I just confirm with you - above we said we want to leave the current fit_shape_and_pose overloads, and add an overload that takes the landmarks & LandmarkMapper, and calls the existing function. I think as far as I can see, this change is not in the PR yet, and the current PR changes the old functions. Do you concur with that? Other than that, it looks all good to me and happy to merge it. If you're busy, let me know, and I can make the change on the weekend as well. Best wishes, |
Hi @patrikhuber Sorry about that. Looks like I forgot to add new overloads instead of modifying the old ones. I've added them now and updated the params in the overload briefs. It should be ready to merge now :) All the best |
Looks great now @omar-h-omar, thank you very much! |
Added set_landmark_definitions and altered fit_shape_and_pose to allow fitting without contour.
Note: for the modified fit_shape_and_pose, I allowed users to also pass in pca_coeffs and blendshape_coeffs. This makes it easier to control what is being fitted. I can do the same for the other bindings if you're happy with the approach.