根据官方 github 教程: https://github.com/facebookresearch/DeepSDF
下面详细讲解下列Dependencies的配置:
git clone https://github.com/CLIUtils/CLI11.git
修改DeepSDF/CMakeLists.txt添加:
# find_package(CLI11 CONFIG REQUIRED)
set(CLI11_DIR "/home/xxx//libraries/CLI11/")
include_directories(${CLI11_DIR}/include)
注意需要修改当前CLI11的clone目录。
sudo apt install libeigen3-dev
git clone https://github.com/jlblancoc/nanoflann.git
修改路径
mkdir -p include/nanoflann
mv include/nanoflann.hpp include/nanoflann/
修改DeepSDF/CMakeLists.txt
# find_package(nanoflann REQUIRED)
set(nanoflann_DIR "/home/xxx/workspace/object/xxx/DeepSDF/libraries/nanoflann)
include_directories(${nanoflann_DIR}/include)
注意需要 0.6 版本 Pangolin
重点: 若在没有显示器的情况下使用远程服务器,需要考虑 headless mode 做 preprocessing.
git clone https://github.com/stevenlovegrove/Pangolin.git
git checkout v0.6
根据 DeepSDF 介绍
The preprocessing script requires an OpenGL context, and to acquire one it will open a (small) window for each shape using Pangolin. If Pangolin has been compiled with EGL support, you can use the "headless" rendering mode to avoid the windows stealing focus. Pangolin's headless mode can be enabled by setting the PANGOLIN_WINDOW_URI environment variable as follows:
调查如何使用 headless 编译 Pangolin
Wayland
* pkg-config: sudo apt install pkg-config
* Wayland and EGL:sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
EGL 安装完毕似乎就自动检查了
-- Checking for module 'wayland-egl'
-- Found wayland-egl, version 18.1.0
DeepSDF/CMakeLists.txt中修改无需要的 CLI, Nano Link libraries,将出现的下列两项删除:
nanoflann::nanoflann
CLI11::CLI11
--
mkdir build
cd build
cmake ..
make -j
编译成功。
--
export PANGOLIN_WINDOW_URI=headless://
python preprocess_data.py --data_dir data --source /home/xxx/ShapeNetCore.v2/ --name ShapeNetV2 --split examples/splits/sv2_chairs_test.json --skip
成功了!!!