ViewCrafter代码仓库链接:
ViewCrafterhttps://github.com/Drexubery/ViewCrafter?tab=readme-ov-file
预备环境:
实验平台:AutoDL(云服务器租赁平台) + 4090 + Cuda 11.6 + Ubuntu 20.04
环境配置:
首先克隆代码到本地:
git clone https://github.com/Drexubery/ViewCrafter.git
cd ViewCrafter
安装虚拟环境:
conda create -n viewcrafter python=3.9.16
source activate
conda activate viewcrafter
然后安装pytroch
参考网站:
Previous PyTorch Versions | PyTorch
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
将requirements.txt 文件进行适当注释,防止与torch的版本冲突。(PS:这一步非常关键!!!)
有两个地方需要特别注意:
1. xformers的安装
具体安装版本可以参考此博客:xformers版本与其依赖pytorch版本的对应关系_xformers对应torch版本-优快云博客
而我的torch版本是torch==2.0.0故安装的版本为0.0.19
pip install xformers==0.0.19
2. pytorch-lightning的安装
具体安装版本可以参考此网站:
Versioning Policy — PyTorch Lightning 2.5.1rc2 documentation
pip install pytorch-lightning==2.0
接着安装 PyTorch3D:
具体安装版本可以参考此网站:
conda install https://anaconda.org/pytorch3d/pytorch3d/0.7.5/download/linux-64/pytorch3d-0.7.5-py39_cu118_pyt200.tar.bz2
最后下载Dust3R预训练模型 + ViewCrafter的模型权重model.ckpt:
mkdir -p checkpoints/
wget https://download.europe.naverlabs.com/ComputerVision/DUSt3R/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth -P checkpoints/
wget https://huggingface.co/Drexubery/ViewCrafter_25/resolve/main/model.ckpt -P checkpoints/
实验测试:
运行代码 + 运行截图
sh run.sh