berksaribas / face-reconstruction

3D Face Reconstruction using a single 2D image.
MIT License
46 stars 5 forks source link

BFM.h5 convert to binary #5

Open hujunh opened 1 year ago

hujunh commented 1 year ago

Hi, would you able to provide the convert tool to convert the data tables or how do you convert it?

hujunh commented 1 year ago

After I use h5py to convert the data tables to binary, I got the following issues:

In file included from /media/neuralimage5/WorkSpcae/face-reconstruction/src/DenseOptimizer.h:4, from /media/neuralimage5/WorkSpcae/face-reconstruction/src/DenseOptimizer.cpp:1: /media/neuralimage5/WorkSpcae/face-reconstruction/src/BFM.h: In function ‘void load_binary_data(const char)’: /media/neuralimage5/WorkSpcae/face-reconstruction/src/BFM.h:74:17: error: aggregate ‘load_binary_data(const char)::stat sb’ has incomplete type and cannot be defined struct stat sb; ^~ /media/neuralimage5/WorkSpcae/face-reconstruction/src/BFM.h:75:27: error: invalid use of incomplete type ‘struct load_binary_data(const char)::stat’ if (stat(filename, &sb) == -1) { ^ /media/neuralimage5/WorkSpcae/face-reconstruction/src/BFM.h:74:12: note: forward declaration of ‘struct load_binary_data(const char*)::stat’ struct stat sb; ^~~~ In file included from /media/neuralimage5/WorkSpcae/face-reconstruction/src/BFM.h:9, from /media/neuralimage5/WorkSpcae/face-reconstruction/src/DenseOptimizer.h:4, from /media/neuralimage5/WorkSpcae/face-reconstruction/src/DenseOptimizer.cpp:1: /media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h: In instantiation of ‘Eigen::Matrix<T, 4, 4> calculate_transformation_matrix(Eigen::Matrix<_Scalar, 3, 1>, Eigen::Matrix<_Scalar, 3, 3>) [with T = double]’: /media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:47:46: required from ‘Eigen::Matrix<T, 4, 4> calculate_transformation_matrix(Eigen::Matrix<_Scalar, 3, 1>, Eigen::Quaternion<_Scalar>) [with T = double]’ /media/neuralimage5/WorkSpcae/face-reconstruction/src/DenseOptimizer.cpp:104:90: required from here /media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:39:25: error: invalid operands of types ‘’ and ‘int’ to binary ‘operator<’ transformation.block<3, 3>(0, 0) = rotation;


/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:39:38: error: lvalue required as left operand of assignment
     transformation.block<3, 3>(0, 0) = rotation;
                             ~~~~~~~~~^~~~~~~~~~
/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:40:25: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator<’
     transformation.block<3, 1>(0, 3) = translation;
     ~~~~~~~~~~~~~~~~~~~~^~
/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:40:38: error: lvalue required as left operand of assignment
     transformation.block<3, 1>(0, 3) = translation;
                             ~~~~~~~~~^~~~~~~~~~~~~
/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h: In instantiation of ‘Eigen::Matrix<T, 4, 4> calculate_transformation_matrix(Eigen::Matrix<_Scalar, 3, 1>, Eigen::Matrix<_Scalar, 3, 3>) [with T = ceres::Jet<double, 306>]’:
/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:47:46:   required from ‘Eigen::Matrix<T, 4, 4> calculate_transformation_matrix(Eigen::Matrix<_Scalar, 3, 1>, Eigen::Quaternion<_Scalar>) [with T = ceres::Jet<double, 306>]’
/media/neuralimage5/WorkSpcae/face-reconstruction/src/DenseOptimizer.h:52:66:   required from ‘bool SparseCost::operator()(const T*, const T*, const T*, const T*, const T*, T*) const [with T = ceres::Jet<double, 306>]’
/usr/include/ceres/internal/variadic_evaluate.h:133:19:   required from ‘static bool ceres::internal::VariadicEvaluate<Functor, T, N0, N1, N2, N3, N4, 0, 0, 0, 0, 0>::Call(const Functor&, const T* const*, T*) [with Functor = SparseCost; T = ceres::Jet<double, 306>; int N0 = 4; int N1 = 3; int N2 = 1; int N3 = 199; int N4 = 99]’
/usr/include/ceres/internal/autodiff.h:289:72:   required from ‘static bool ceres::internal::AutoDiff<Functor, T, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9>::Differentiate(const Functor&, const T* const*, int, T*, T**) [with Functor = SparseCost; T = double; int N0 = 4; int N1 = 3; int N2 = 1; int N3 = 199; int N4 = 99; int N5 = 0; int N6 = 0; int N7 = 0; int N8 = 0; int N9 = 0]’
/usr/include/ceres/autodiff_cost_function.h:211:66:   required from ‘bool ceres::AutoDiffCostFunction<CostFunctor, kNumResiduals, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9>::Evaluate(const double* const*, double*, double**) const [with CostFunctor = SparseCost; int kNumResiduals = 2; int N0 = 4; int N1 = 3; int N2 = 1; int N3 = 199; int N4 = 99; int N5 = 0; int N6 = 0; int N7 = 0; int N8 = 0; int N9 = 0]’
/usr/include/ceres/autodiff_cost_function.h:202:16:   required from here
/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:39:25: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator<’
     transformation.block<3, 3>(0, 0) = rotation;
     ~~~~~~~~~~~~~~~~~~~~^~
/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:39:38: error: lvalue required as left operand of assignment
     transformation.block<3, 3>(0, 0) = rotation;
                             ~~~~~~~~~^~~~~~~~~~
/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:40:25: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator<’
     transformation.block<3, 1>(0, 3) = translation;
     ~~~~~~~~~~~~~~~~~~~~^~
/media/neuralimage5/WorkSpcae/face-reconstruction/src/Renderer.h:40:38: error: lvalue required as left operand of assignment
     transformation.block<3, 1>(0, 3) = translation;
                             ~~~~~~~~~^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/face_reconstruction.dir/build.make:89: CMakeFiles/face_reconstruction.dir/DenseOptimizer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/face_reconstruction.dir/all] Error 2
make: *** [Makefile:84: all] Error 2