patrikhuber / eos

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

Error in fit-model-simple for BFM model #329

Closed lyyiangang closed 2 years ago

lyyiangang commented 3 years ago

when I try to fit BFM by using following command.

./fit-model-simple -i data/image_0010.png -l data/image_0010.pts  -m ../share/bfm2009.bin -p ../share/ibug_to_bfm2009.txt

I get following error message:

eos/include/eos/render/texture_extraction.hpp:82: eos::core::Image4u eos::render::extract_texture(const eos::core::Mesh&, glm::mat4x4, glm::mat4x4, eos::render::ProjectionType, const Image4u&, int): Assertion `mesh.vertices.size() == mesh.texcoords.size() || !mesh.tti.empty()' failed.
[1]    12381 abort (core dumped)  ./fit-model-simple -i data/image_0010.png -l data/image_0010.pts -m  -p

I am using share/scripts/convert-bfm2009-to-eos.py to generate my own bfm2009.bin model. Could you please help me figure out the error?

patrikhuber commented 2 years ago

Hi, sorry for the late reply. I suspect this is no longer a current question, but in any case: If you inspect the error message, this is because the BFM doesn't come with any texture coordinates. If you want to use texture extraction, you'll need to create / inject some texture coordinates into the BFM. This has been asked a few times before in the issues here, you can find more information for example here https://github.com/patrikhuber/eos/issues/260.