eos: `fit-model-simple` gets Segmentation fault when using BFM2017 model in Ubuntu 16

When I run this command, I met Segmentation fault.

$ ./fit-model-simple \
    -m ../../share/bfm2017-1_bfm_nomouth.bin \
     -p ../../share/ibug_to_bfm2017-1_bfm_nomouth.txt \
     -i ../../examples/data/image_0010.png \
     -l ../../examples/data/image_0010.pts
Segmentation fault (core dumped)

When I analyze core file with gdb, the result is below.

$ gdb fit-model-simple core.fit-model-simpl.15555
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from fit-model-simple...(no debugging symbols found)...done.

warning: core file may not match specified executable file.
[New LWP 15555]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./fit-model-simple -m ../../share/bfm2017-1_bfm_nomouth.bin -p ../../share/ibug'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000419014 in eos::render::render_affine(eos::core::Mesh const&, Eigen::Matrix<float, 3, 4, 0, 3, 4>, int, int, bool) ()
(gdb)
(gdb)
(gdb)

The fit-model-simple run well with using sfm model. But when using BFM model, it gets seg fault.

./fit-model-simple \
	-m ../../share/sfm_shape_3448.bin \
	-p ../../share/ibug_to_sfm.txt \
	-i ../../examples/data/image_0010.png \
	-l ../../examples/data/image_0010.pts

I generated bfm2017-1_bfm_nomouth.bin from model2017-1_bfm_nomouth.h5, is downloaed from this url.

python ./share/scripts/convert-bfm2017-to-eos.py 

Please let me know if you have any solution.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 25 (13 by maintainers)

Most upvoted comments

@kidapu Yes, of course you can’t combine the blendshapes from the SFM with the BFM, as they would have a completely different topology/number of vertices.

If you’re using the BFM2009, then I believe there’s an expression model “out there on the internet”, made from the FaceWarehouse data, available for academic use I think. I think it’s originally from the 3DDFA paper and the one we also used for our 3DMMasSTN work, where you can find a link. People have also discussed this already in other eos issues, try searching through them.

If you’re using the BFM2017, it already includes an expression PCA model, so you can skip loading any separate blendshapes.

@kidapu Oh okay I see what’s going on. fit-model-simple does not fit expressions at all actually. As you correctly posted, it calls fitting::fit_shape_to_landmarks_linear(...) and that fits only the (identity) shape. You can easily tell by the fact that that function only returns one vector of coefficients. Actually the README documents this too, it says:

If you are just getting started, it is recommended to have a look at fit-model-simple too, as it requires much fewer input, and only fits pose and shape, without any blendshapes or edge-fitting.

What you probably want is to use fit_shape_and_pose(...), which fits pose, shape and expressions in an iterative way (and has a regularisation parameter for both identity and expressions). (Or if you don’t want the additional complexity of contour fitting, just have a look at how that function works and use it without contour fitting).