-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
252 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,52 @@ | ||
@REM 编辑为你的 GPU 对应架构 | ||
@REM 修改时无需保留 "+PTX" ,其用于向前兼容,防止用户忘了该步骤。 | ||
|
||
set TORCH_CUDA_ARCH_LIST=6.1+PTX | ||
|
||
@REM 编译安装 PyTorch3D | ||
@REM PyTorch3D 对 Windows 不甚友好,所有二进制安装都可能在某个节点报错,极难排查,故最好提前编译安装。 | ||
@REM 使用清华 PyPI 源 | ||
set PIP_INDEX_URL=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple | ||
|
||
@REM =========================================================================== | ||
|
||
set CMAKE_ARGS=-DBUILD_opencv_world=ON -DWITH_CUDA=ON -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DWITH_NVCUVID=ON | ||
set PATH=%PATH%;%~dp0\python_embeded\Scripts | ||
set CMAKE_ARGS=-DBUILD_opencv_world=ON -DWITH_CUDA=ON -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DWITH_NVCUVID=ON | ||
|
||
set PIP_INDEX_URL=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple | ||
@REM 编译安装 PyTorch3D | ||
@REM PyTorch3D 对 Windows 不甚友好,所有二进制安装都可能在某个节点报错,极难排查,故最好提前编译安装。 | ||
|
||
.\python_embeded\python.exe -s -m pip install --force-reinstall ^ | ||
"git+https://ghp.ci/https://github.com/facebookresearch/pytorch3d.git" | ||
.\extras\pytorch3d | ||
|
||
@REM 编译安装 pointnet2_ops ,该组件用于 Triplane Gaussian | ||
|
||
.\python_embeded\python.exe -s -m pip install --force-reinstall ^ | ||
.\extras\pointnet2_ops | ||
|
||
@REM 编译安装 diff-gaussian-rasterization ,该组件用于 Triplane Gaussian | ||
|
||
.\python_embeded\python.exe -s -m pip install --force-reinstall ^ | ||
"git+https://ghp.ci/https://github.com/ashawkey/diff-gaussian-rasterization.git" | ||
|
||
@REM 编译安装 simple-knn | ||
@REM 编译安装 simple-knn ,该组件用于 Gaussian Splatting | ||
|
||
.\python_embeded\python.exe -s -m pip install --force-reinstall ^ | ||
.\extras\simple-knn | ||
|
||
@REM 编译安装 vox2seq ,该组件用于 TRELLIS | ||
@REM =========================================================================== | ||
@REM 用于 TRELLIS 的组件 | ||
@REM 注意我们跳过了 'utils3d' ,该组件不需要本地重新编译 | ||
|
||
@REM vox2seq | ||
|
||
.\python_embeded\python.exe -s -m pip install --force-reinstall ^ | ||
.\extras\vox2seq | ||
|
||
@REM diff-gaussian-rasterization | ||
|
||
.\python_embeded\python.exe -s -m pip install --force-reinstall ^ | ||
.\extras\diff-gaussian-rasterization | ||
|
||
@REM Differential Octree Rasterization | ||
|
||
.\python_embeded\python.exe -s -m pip install ^ | ||
.\extras\diffoctreerast | ||
|
||
@REM =========================================================================== | ||
|
||
.\python_embeded\python.exe -s -m pip install numpy==1.26.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# 因为 TRELLIS 官方 demo 是以 Linux 语境编写的,未考虑跨平台,这里需用 Bash 运行 | ||
# 下载 Git for Windows: https://git-scm.com/download/win | ||
# 并在安装时选择 Git Bash(默认) | ||
|
||
################################################################################ | ||
# 务必根据你的 GPU 型号配置! | ||
export TORCH_CUDA_ARCH_LIST="6.1+PTX" | ||
|
||
################################################################################ | ||
# 性能优化(可选) | ||
|
||
# 如果仅单次运行,使用 "native" 即可 | ||
# 如果长期运行,使用 "auto" 会有更好性能,但一开始会花时间进行性能测试。 | ||
export SPCONV_ALGO="native" | ||
|
||
# 默认使用 "xformers" 以保证兼容性 | ||
# 如果需要高性能,尝试改为 "flash-attn" | ||
# Flash Attention 只能用于 Ampere (RTX 30 系 / A100) 及更新的 GPU | ||
export ATTN_BACKEND="xformers" | ||
|
||
################################################################################ | ||
|
||
# 如需配置代理,取消注释并编辑以下部分 | ||
# (删除行首井号 # ) | ||
#export HTTP_PROXY=http://localhost:1081 | ||
#export HTTPS_PROXY=$HTTP_PROXY | ||
#export http_proxy=$HTTP_PROXY | ||
#export https_proxy=$HTTP_PROXY | ||
#export NO_PROXY="localhost,*.local,*.internal,[::1],fd00::/7, | ||
#10.0.0.0/8,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.168.0.0/16, | ||
#10.*,127.*,169.254.*,172.16.*,172.17.*,172.18.*,172.19.*,172.20.*, | ||
#172.21.*,172.22.*,172.23.*,172.24.*,172.25.*,172.26.*,172.27.*, | ||
#172.28.*,172.29.*,172.30.*,172.31.*,172.32.*,192.168.*, | ||
#*.cn,ghproxy.com,*.ghproxy.com,ghproxy.org,*.ghproxy.org, | ||
#gh-proxy.com,*.gh-proxy.com,ghproxy.net,*.ghproxy.net" | ||
#export no_proxy=$NO_PROXY | ||
#echo "[INFO] Proxy set to $HTTP_PROXY" | ||
|
||
# 配置使用国内镜像站点 | ||
export PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" | ||
export HF_ENDPOINT="https://hf-mirror.com" | ||
|
||
################################################################################ | ||
|
||
workdir="$(pwd)" | ||
|
||
# 该环境变量指示 HuggingFace Hub 下载模型到"本目录\HuggingFaceHub",而不是"用户\.cache"目录。 | ||
export HF_HUB_CACHE="$workdir/HuggingFaceHub" | ||
|
||
# 该环境变量指示 Pytorch Hub 下载模型到"本目录\TorchHome",而不是"用户\.cache"目录。 | ||
export TORCH_HOME="$workdir/TorchHome" | ||
|
||
# 该命令配置 PATH 环境变量。 | ||
export PATH="${PATH}:$workdir/python_embeded/Scripts" | ||
|
||
# 该环境变量使 .pyc 缓存文件集中保存在一个文件夹下,而不是随 .py 文件分布。 | ||
export PYTHONPYCACHEPREFIX="$workdir/pycache" | ||
|
||
# 该命令会复制 u2net.onnx 到用户主目录下,以免启动时还需下载。 | ||
if [ ! -f "${HOME}/.u2net/u2net.onnx" ]; then | ||
if [ -f "./extras/u2net.onnx" ]; then | ||
mkdir -p "${HOME}/.u2net" | ||
cp "./extras/u2net.onnx" "${HOME}/.u2net/u2net.onnx" | ||
fi | ||
fi | ||
|
||
# 下载 TRELLIS 模型(不会重复下载) | ||
if [ ! -f "$workdir/python_embeded/Scripts/.hf-hub-reinstalled" ] ; then | ||
$workdir/python_embeded/python.exe -s -m pip install --force-reinstall huggingface-hub | ||
touch "$workdir/python_embeded/Scripts/.hf-hub-reinstalled" | ||
fi ; | ||
|
||
$workdir/python_embeded/Scripts/huggingface-cli.exe download JeffreyXiang/TRELLIS-image-large | ||
|
||
# 运行 TRELLIS 官方 Gradio demo | ||
|
||
echo "########################################" | ||
echo "[INFO] Starting TRELLIS demo..." | ||
echo "########################################" | ||
|
||
cd TRELLIS | ||
../python_embeded/python.exe -s app.py |
Oops, something went wrong.