patrikhuber / eos

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

draw_sample(...) should throw an error for "invalid" input arguments #293

Open patrikhuber opened 4 years ago

patrikhuber commented 4 years ago

Currently, the following code (in Python) produces a "faulty" mesh:

mesh_sample = morphable_model.draw_sample(shape_coefficients=[0.5, -0.5], expression_coefficients=[0.5, 0], color_coefficients=[0, 0.5])

Because expression_coefficients needs to be a complete vector:

blendshape_coeffs = np.zeros(len(morphable_model.get_expression_model()))
blendshape_coeffs[0] = 0.6  # Raise left mouth corner
mesh_sample = morphable_model.draw_sample(shape_coefficients=[0.5, -0.5], expression_coefficients=blendshape_coeffs, color_coefficients=[0, 0.5])

We should check the input arguments more rigorously.