papagina / HairNet_DataSetGeneration

The programs for generating the 40k hair dataset in HairNet: Single-View Hair Reconstruction using Convolutional Neural Networks https://arxiv.org/abs/1806.07467
Other
130 stars 34 forks source link

Is another version of OpenMesh used? #8

Open yosun opened 2 years ago

yosun commented 2 years ago

Hi - I downloaded OpenMesh 6.3 but this error occurs when I run make:

/home/ubuntu/c/HairNet_DataSetGeneration/Hair_generate_convdata_and_imgs/HairHelper.h:15:38: fatal error: OpenMesh/Core/IO/MeshIO.hh: No such file or directory

HairNet_DataSetGeneration/Hair_generate_convdata_and_imgs/build$ cmake ..
-- Found OpenCV: /usr/local (found version "4.2.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/c/HairNet_DataSetGeneration/Hair_generate_convdata_and_imgs/build
ubuntu@ip-172-31-28-83:~/c/HairNet_DataSetGeneration/Hair_generate_convdata_and_imgs/build$ make
[ 20%] Building CXX object CMakeFiles/Hair_generate_convdata_and_imgs.dir/main.cpp.o
In file included from /home/ubuntu/c/HairNet_DataSetGeneration/Hair_generate_convdata_and_imgs/TrainingDataGenerator.h:15:0,
                 from /home/ubuntu/c/HairNet_DataSetGeneration/Hair_generate_convdata_and_imgs/main.cpp:14:
/home/ubuntu/c/HairNet_DataSetGeneration/Hair_generate_convdata_and_imgs/HairHelper.h:15:38: fatal error: OpenMesh/Core/IO/MeshIO.hh: No such file or directory
compilation terminated.
CMakeFiles/Hair_generate_convdata_and_imgs.dir/build.make:75: recipe for target 'CMakeFiles/Hair_generate_convdata_and_imgs.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/Hair_generate_convdata_and_imgs.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/Hair_generate_convdata_and_imgs.dir/all' failed
make[1]: *** [CMakeFiles/Hair_generate_convdata_and_imgs.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
catid commented 2 years ago

Build instructions that worked for me on Ubuntu 20:

sudo apt install freeglut3-dev libglew-dev libglfw3-dev libopencv-dev libglm-dev

OpenMesh docs:

https://www.graphics.rwth-aachen.de/media/openmesh_static/Daily-Builds/Doc/a05901.html

OpenMesh install:

git clone --recursive https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/OpenMesh.git

cd OpenMesh
mkdir build
cd build
cmake ..
make -j8
sudo make install

Should install to /usr/local/lib/

Fixes for HairNet_DataSetGeneration:

Renderer.h: Add #include <random>

CMakeLists.txt:
Replace "/home/yi/OpenMesh-6.3/build/Build/lib/libOpenMeshCore.so" with "/usr/local/lib/libOpenMeshCore.a"
Replace "/home/yi/OpenMesh-6.3/build/Build/lib/libOpenMeshTools.so" with "/usr/local/lib/libOpenMeshTools.a"
Replace "${GLFW3_LIBRARY}" with "glfw"
Replace "${GLEW_LIBRARY}" with "${GLEW_LIBRARIES}"
yosun commented 2 years ago

~/HairNet_DataSetGeneration/HairNet_DataSetGeneration/Hair_generate_convdata_and_imgs/build$ make -j8 [ 20%] Linking CXX executable Hair_generate_convdata_and_imgs CMakeFiles/Hair_generate_convdata_and_imgs.dir/main.cpp.o: In function visualize_and_save_hair_orient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)': main.cpp:(.text+0x93a): undefined reference toglfwInit' main.cpp:(.text+0x949): undefined reference to glfwWindowHint' main.cpp:(.text+0x958): undefined reference toglfwWindowHint' main.cpp:(.text+0x967): undefined reference to glfwWindowHint' main.cpp:(.text+0x976): undefined reference toglfwWindowHint' main.cpp:(.text+0x985): undefined reference to glfwWindowHint' main.cpp:(.text+0x9a4): undefined reference toglfwCreateWindow' main.cpp:(.text+0x9ba): undefined reference to glfwMakeContextCurrent' main.cpp:(.text+0x1035): undefined reference toglfwSwapBuffers' main.cpp:(.text+0x168e): undefined reference to glfwPollEvents' main.cpp:(.text+0x1a64): undefined reference toglfwTerminate' collect2: error: ld returned 1 exit status CMakeFiles/Hair_generate_convdata_and_imgs.dir/build.make:164: recipe for target 'Hair_generate_convdata_and_imgs' failed make[2]: [Hair_generate_convdata_and_imgs] Error 1 CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/Hair_generate_convdata_and_imgs.dir/all' failed make[1]: [CMakeFiles/Hair_generate_convdata_and_imgs.dir/all] Error 2 Makefile:90: recipe for target 'all' failed make: *** [all] Error 2