Skip to content
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

Setting expression in Python #266

Open
Fivetuple opened this issue Jul 5, 2019 · 4 comments
Open

Setting expression in Python #266

Fivetuple opened this issue Jul 5, 2019 · 4 comments
Labels

Comments

@Fivetuple
Copy link

Hi,

How do I set the facial expression using Python if the fit_shape_and_pose function does not have a blendshape_coefficients argument?

The following argument types are supported:
1. (morphable_model: eos.morphablemodel.MorphableModel, landmarks: List[eos.core.Landmark], landmark_mapper: eos.core.LandmarkMapper, image_width: int, image_height: int, edge_topology: eos.morphablemodel.EdgeTopology, contour_landmarks: eos.fitting.ContourLandmarks, model_contour: eos.fitting.ModelContour, num_iterations: int = 5, num_shape_coefficients_to_fit: Optional[int] = None, lambda_identity: float = 30.0, num_expression_coefficients_to_fit: Optional[int] = None, lambda_expressions: Optional[float] = 30.0) -> Tuple[eos.core.Mesh, eos.fitting.RenderingParameters, List[float], List[float]]

@patrikhuber
Copy link
Owner

patrikhuber commented Jul 5, 2019

Hi,

fit_shape_and_pose(...) estimates face shape (identity & expression), so you can't set it there. The expression coefficients are a return parameter of that function.

@ArisTing
Copy link

Hi,
I want to use starting values of expression coefficients in fitting. So can I overload the fit_shape_and_pose(...) function to set starting values for them? But how to overload in Python?

@patrikhuber
Copy link
Owner

Hi @ArisTing,

I would suggest that you have a look at pybind11's documentation. It should be easy to add the function to the Python bindings with the parameters that you need. Pybind11 also supports optional and default arguments.

@kanonet
Copy link
Contributor

kanonet commented Jan 5, 2020

Hi @ArisTing,
what you asked was added to my fork of eos, see the py_bindings branch: https://github.com/kanonet/eos/tree/py_bindings maybe you can use this changes for your project?
Once @patrikhuber reviews my other PRs I plan to also suggest my pybind additions to get accepted here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants