patrikhuber / eos

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

when using custom pca model, raise error #213

Open junhwanjang opened 6 years ago

junhwanjang commented 6 years ago

libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: The model file you are trying to load is in an old format. Please download the most recent model files.

I trained new custom pca model!(different vertices) but it didn't work on eos-model viewer... When loading model in python, successful. I don't know why it does..

patrikhuber commented 6 years ago

Hi, You need to use the same eos version to create the model and when using the model viewer. I suspect in your case the version difference is too large. A few months ago I updated the eos version of the model viewer in this branch: https://github.com/patrikhuber/eos-model-viewer/tree/update-eos-and-igl If you have any further issues pertaining the model viewer please open an issue in the respective repository. As mentioned in the model-viewer readme, the model-viewer is quite experimental, not very polished code, and "you're on your own" using it. (It works just fine for us overall though, with the occasional hiccup.)

KangolHsu commented 5 years ago

I use eos-py1.0.1 python convert bfm2009 .mat file to bin flie the same error occurs.

junhwanjang commented 5 years ago

eos version 0.15.1 would be a solution.

patrikhuber commented 5 years ago

@KangolHsu I'm not 100% sure I understand what you're doing, as your description is not quite clear. Do you get that error while converting the bfm2009?

If the error occurs in the eos-model-viewer, you can always build the model viewer with the latest eos version? And if it's an issue with the model-viewer, open an issue in that repo?

KangolHsu commented 5 years ago

@patrikhuber I use the eos-py1.0.1 to convert 01_MorphableModel.mat to the .bin file which eso can be used by eos ,but it is still this error : "The model file you are trying to load is in an old format. Please download the most recent model files." When I use old version eos-py0.14.0 to convert it ,it works fine.

KangolHsu commented 5 years ago

when i converted 01_MorphableModel.mat done with eos-py0.14.0 when fit-model-simple.cpp run into this line https://github.com/patrikhuber/eos/blob/f8b235bf8da1eef947a62dc09e23ecde2c9c0f3b/include/eos/render/render_affine.hpp#L102 it occurs a read error,because mesh.texcoords is empty ,this is caused by convert script https://github.com/patrikhuber/eos/blob/f8b235bf8da1eef947a62dc09e23ecde2c9c0f3b/share/scripts/convert-bfm2009-to-eos.py#L51 "texture_coordinates=[]" where can i find the texture_coordinates of BFM2009? thanks.

KangolHsu commented 5 years ago

I solved this by adding texture_coordinates data from the UV coords [here](https://github.com/anilbas/3DMMasSTN/blob/master/util/BFM_UV.mat)

patrikhuber commented 5 years ago

I think maybe the bfm2009 python converter script needs to be updated slightly to pass an empty set of texture coordinates? I'll re-open this, in case something needs updating.