项目路径:(官网提供的是tensorflow版本)GitHub - laughtervv/DISN: DISN: Deep Implicit Surface Network for High-quality Single-view 3D Reconstruction
论文地址:https://arxiv.org/abs/1905.10711
---------------------------------------------------------------------------------------------------------------------------------
1.将项目克隆到所需的设备上(这里以pytorch为例,本人太菜tensorflow框架看不明白)
git clone https://github.com/cs674/pytorch-DISN.git
2.
# 正常创建环境,pip install安装所需的包即可
conda create -n DISN python=3.8
# 本人使用的torch1.12.0,
# 大家可以根据自己的设备,去官网选择合适的安装https://pytorch.org/get-started/previous-versions/
pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
pip install h5py
pip install pymcubes
.....
3. 这里涉及到pymesh库,切记不要用pip安装,这里使用源码进行安装
# pymesh会有第三方依赖库
git clone --recurse-submodules https://github.com/PyMesh/PyMesh.git
# 切记如何网络克隆不下来,一定要手动下载
# 第三方库位置:PyMesh/third_party
4. 整个项目clone好了,接下来开始安装
# 1.
cd PyMesh/third_party
build.py all
# 2.
cd ..
mkdir build
cd build
cmake ..
# 3.
make
make tests
# 4.
./setup.py build
./setup.py install
上述过程均在pymesh的github的readme中,本人在安装过程中没有任何错误,唯一就是编译速度慢了点。大家在安装过程中有任何错误可以私信留言,本人会完善该博客。
5. 运行preprocessing/create_point_sdf_grid.py会出先很多c++的错误,下面只对几个过分难安装的进行说明:
1. libtbb_preview.so.2
针对上述c++包,大家可以去下面地址进行下载,并上传到DISN项目下即可
https://github.com/ecrc/bemfmm/blob/master/TBB/lib/libtbb_preview.so.2
2. libpng12-0
sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0
本人第一行代码不太实用,大家如果遇到不适用的可以运行下面代码:
sudo nano /etc/apt/sources.list
# 在文件末尾添加你想要添加的 PPA 存储库的源
deb http://ppa.launchpad.net/linuxuprising/libpng12/ubuntu focal main
deb-src http://ppa.launchpad.net/linuxuprising/libpng12/ubuntu focal main
# 在 Nano 编辑器中,你可以按下 Ctrl + O 来保存,然后按下 Enter,最后按下 Ctrl + X 来退出
# 导入公钥
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EA8CACC073C3DB2A
sudo apt update
sudo apt install libpng12-0
剩下的c++依赖,一般从gpt和谷歌上就可以找到对应解决方法
1. Could NOT find GMP (missing: GMP_LIBRARIES GMP_INCLUDE_DIR)
sudo apt-get update
sudo apt-get install libgmp-dev
2. Could NOT find MPFR (missing: MPFR_LIBRARIES MPFR_INCLUDE_DIR)
sudo apt-get update
sudo apt-get install libmpfr-dev
3. Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at least version "1.48")
sudo apt-get update
sudo apt-get install libboost-all-dev
------------------------------------------------------------------------------------------------------------------------------
2024/5/10