当前位置: 首页> 财经> 股票 > 手把手安装3DGS(linux)

手把手安装3DGS(linux)

时间:2025/7/15 0:15:28来源:https://blog.csdn.net/wqthaha/article/details/141883838 浏览次数:0次

目录

  • 前言
  • 一、安装cuda
  • 二 安装CUDNN
  • 安装Talking-gaussian工程
    • 安装准备文件
  • 测试TalkingGaussian
    • Video Dataset
      • Pre-processing Training Video
  • 总结


前言

该教程是记录如何一步步安装linux下的3DGS环境。走过的路,会有起起伏伏的;那些踩过的坑,记录下来,并提供一个可成功的路线,供参考。


一、安装cuda

参考博客:
参考1 参考2

官方说we used 11.8, known issues with 11.6。因此需要确保CUDA版本高于11.8

CUDA官网链接:https://developer.nvidia.com/cuda-toolkit-archive
在这里插入图片描述

#下载run文件
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run#给下载好的文件加权限
sudo chmod +x cuda_11.8.0_520.61.05_linux.run#运行这个cuda文件
sudo sh cuda_11.8.0_520.61.05_linux.run

在这里插入图片描述把这个驱动包的驱动按空格取消安装,即用本来安装好的显卡驱动。然后选install,出现下面的画面
在这里插入图片描述
注意这里的安装目录是“/usr/local/cuda-11.8/”

安装完成后,配置并更新环境变量:

#打开环境变量编辑
gedit ~/.bashrc#添加路径(此处展示的是默认路径,根据自己的路径来)
# cuda11.8
export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda-11.8#激活环境变量
source ~/.bashrc #使用下面的命令查看你的CUDA版本:
nvcc -V

在这里插入图片描述
结果是11.8,代表切换成功了。

二 安装CUDNN

下载的链接:https://developer.nvidia.com/rdp/cudnn-archive
推荐中文链接:https://developer.nvidia.cn/rdp/cudnn-archive
这里我选择的是cudnn8.9.7 for cuda 11.x的tar版本

在这里插入图片描述
需要登陆nvidia账户,才能下载;下载完后进行解压:并且将对应的库和头文件移到cuda11.8目录中,反正需要注意的就是cuda11.8的路径。

tar -xvf cudnn-linux-x86_64-8.x.x.x_cudaX.Y-archive.tar.xz
sudo cp cudnn-*-archive/include/cudnn*.h /usr/local/cuda-11.8/include 
sudo cp -P cudnn-*-archive/lib/libcudnn* /usr/local/cuda-11.8/lib64 
sudo chmod a+r /usr/local/cuda-11.8/include/cudnn*.h /usr/local/cuda-11.8/lib64/libcudnn*

检查cudnn

cat /usr/local/cuda-11.8/include/cudnn_version.h | grep CUDNN_MAJOR -A 2 

在这里插入图片描述

安装Talking-gaussian工程

github: https://github.com/Fictionarry/TalkingGaussian

环境说明:Tested on Ubuntu 20.04, CUDA 11.8(通过run文件安装), PyTorch 1.12.1

git clone git@github.com:Fictionarry/TalkingGaussian.git --recursiveconda env create --file environment.yml
conda activate talking_gaussian

安装3DGS过程如下:

pip install ./submodules/diff-gaussian-rasterization

在这里插入图片描述

pip install ./submodules/simple-knn

在这里插入图片描述

pip install ./gridencoder
pip install "git+https://github.com/facebookresearch/pytorch3d.git"

在这里插入图片描述

pip install tensorflow-gpu==2.8.0

安装准备文件

Prepare face-parsing model and the 3DMM model for head pose estimation.

bash scripts/prepare.sh

在这里插入图片描述
Download 3DMM model from Basel Face Model 2009:

# 1. copy 01_MorphableModel.mat to data_util/face_tracking/3DMM/
# 2. run following
cd data_utils/face_tracking
python convert_BFM.py

01_MorphableModel.mat 的下载地址如下:

https://github.com/jadewu/3D-Human-Face-Reconstruction-with-3DMM-face-model-from-RGB-image/blob/main/BFM/01_MorphableModel.mat

Prepare the environment for EasyPortrait:

# prepare mmcv
conda activate talking_gaussian
pip install -U openmim
mim install mmcv-full==1.7.1# download model weight
cd data_utils/easyportrait
wget "https://n-ws-620xz-pd11.s3pd11.sbercloud.ru/b-ws-620xz-pd11-jux/easyportrait/experiments/models/fpn-fp-512.pth"

在这里插入图片描述

测试TalkingGaussian

Video Dataset

Here we provide two video clips used in our experiments, which are captured from YouTube. Please respect the original content creators’ rights and comply with YouTube’s copyright policies in the usage.

video 地址:https://drive.google.com/drive/folders/1E_8W805lioIznqbkvTQHWWi5IFXUG7Er

Other used videos can be found from GeneFace and AD-NeRF.

Pre-processing Training Video

  • Put training video under data/may/may.mp4.

The video must be 25FPS, with all frames containing the talking person. The resolution should be about 512x512, and duration about 1-5 min.

  • Run script to process the video.
python data_utils/process.py data/may/may.mp4

运行过程会下载一些文件,运行时间会稍微有点久。
在这里插入图片描述
这是运行结束的结果,时间花费有点久;
在这里插入图片描述

---------------------我们走到这一步了,剩下的步骤由学生***完成---------------------------------------

  • Obtain Action Units

Run FeatureExtraction in OpenFace, rename and move the output CSV file to data//au.csv.

  • Generate tooth masks

export PYTHONPATH=./data_utils/easyportrait
python ./data_utils/easyportrait/create_teeth_mask.py ./data/may


总结

这篇文章主要贡献有:
1、手把手指导如何安装3DGS
2、实现https://github.com/Fictionarry/TalkingGaussian的安装指导

踩过的坑,把它展示出来,以避免

关键字:手把手安装3DGS(linux)

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: