This commit is contained in:
Jeffreytsai1004 2025-02-14 02:42:40 +08:00
parent f75690c751
commit b43468ed6b
6 changed files with 159 additions and 8 deletions

View File

@ -48,7 +48,21 @@
4. **安装 COLMAP** 4. **安装 COLMAP**
- 从 https://github.com/colmap/colmap/releases 下载并安装 - 从 https://github.com/colmap/colmap/releases 下载并安装
- 确保将COLMAP添加到系统PATH环境变量中 - 下载最新的Windows安装包(例如COLMAP-3.8-windows-cuda.zip)
- 解压到一个不含空格的路径(例如C:\COLMAP)
- 确保CUDA版本与系统安装的CUDA 11.8匹配
- 将解压目录(C:\COLMAP)添加到系统环境变量PATH中:
1. 打开"系统属性" > "环境变量"
2. 在"系统变量"中找到"Path"
3. 点击"编辑" > "新建"
4. 添加COLMAP目录路径(C:\COLMAP)
5. 点击"确定"保存更改
- 重启PowerShell或CMD以使PATH更改生效
- 验证安装:
```cmd
colmap -h
```
如果显示帮助信息,则安装成功
5. **安装 micromamba** 5. **安装 micromamba**
- 从 https://mamba.readthedocs.io/en/latest/installation.html 下载并安装 - 从 https://mamba.readthedocs.io/en/latest/installation.html 下载并安装
@ -58,18 +72,38 @@
```cmd ```cmd
git clone git@github.com:eth-ait/GaussianHaircut.git git clone git@github.com:eth-ait/GaussianHaircut.git
cd GaussianHaircut cd GaussianHaircut
# 在CMD中运行:
install.bat install.bat
# 或在PowerShell中运行:
.\install.bat
``` ```
## 重建 ## 重建
1. **录制单目视频** 1. **录制单目视频**
参考项目页面上的示例,并尽可能减少运动模糊。 - 参考项目页面上的示例视频
- 录制要求:
* 拍摄对象应缓慢转动头部,确保捕捉到所有角度
* 保持头发和面部清晰可见
* 避免快速移动导致的运动模糊
* 保持光照条件稳定
* 建议视频长度10-20秒
* 建议分辨率1920x1080或更高
2. **设置重建场景的目录** 2. **设置重建场景的目录**
将视频文件放入其中,并将其重命名为 raw.mp4 创建场景目录结构:
```
[your_scene_folder]/
└── raw.mp4 # 您录制的视频文件
```
注意:
- DATA_PATH 应指向包含 raw.mp4 的目录
- 目录路径不应包含空格或特殊字符
- 脚本会在此目录下自动创建所需的子目录
- 确保有足够的磁盘空间(建议至少20GB)
3. **运行脚本** 3. **运行脚本**
@ -82,6 +116,7 @@ Linux:
Windows: Windows:
```cmd ```cmd
# 在CMD中运行:
set PROJECT_DIR=[path\to\]GaussianHaircut set PROJECT_DIR=[path\to\]GaussianHaircut
set DATA_PATH=[path\to\scene\folder] set DATA_PATH=[path\to\scene\folder]
run.bat run.bat

View File

@ -26,7 +26,7 @@ SET MAMBA_ROOT_PREFIX=%PROJECT_DIR%\micromamba
IF NOT EXIST "%MAMBA_ROOT_PREFIX%" mkdir "%MAMBA_ROOT_PREFIX%" IF NOT EXIST "%MAMBA_ROOT_PREFIX%" mkdir "%MAMBA_ROOT_PREFIX%"
REM 初始化micromamba REM 初始化micromamba
CALL "%MICROMAMBA_EXE%" shell init --root-prefix "%MAMBA_ROOT_PREFIX%" CALL "%MICROMAMBA_EXE%" shell init --prefix "%MAMBA_ROOT_PREFIX%"
REM 检查必要的环境和依赖 REM 检查必要的环境和依赖
IF NOT EXIST "%CUDA_HOME%\" ( IF NOT EXIST "%CUDA_HOME%\" (
@ -46,6 +46,18 @@ IF NOT EXIST "%VS2019_VCVARS%" (
exit /b 1 exit /b 1
) )
REM 检查COLMAP
where colmap >nul 2>nul
IF %ERRORLEVEL% NEQ 0 (
echo ERROR: COLMAP not found in PATH
echo Please follow these steps to install COLMAP:
echo 1. Download COLMAP from https://github.com/colmap/colmap/releases
echo 2. Extract to a path without spaces (e.g., C:\COLMAP)
echo 3. Add the COLMAP directory to your system PATH
echo 4. Restart your terminal and try again
exit /b 1
)
REM 检查CUDA版本 REM 检查CUDA版本
nvcc --version 2>nul | findstr "release 11.8" >nul nvcc --version 2>nul | findstr "release 11.8" >nul
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
@ -53,11 +65,11 @@ IF %ERRORLEVEL% NEQ 0 (
exit /b 1 exit /b 1
) )
REM 检查COLMAP REM 检查COLMAP是否可用
where colmap >nul 2>nul colmap -h >nul 2>nul
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
echo ERROR: COLMAP not found in PATH echo ERROR: COLMAP installation appears to be broken
echo Please install COLMAP and add it to PATH echo Please try reinstalling COLMAP
exit /b 1 exit /b 1
) )

View File

@ -0,0 +1,52 @@
@REM Copyright (C) 2012 Anaconda, Inc
@REM SPDX-License-Identifier: BSD-3-Clause
@REM Helper routine for activation, deactivation, and reactivation.
@IF "%CONDA_PS1_BACKUP%"=="" GOTO FIXUP43
@REM Handle transition from shell activated with conda 4.3 to a subsequent activation
@REM after conda updated to 4.4. See issue #6173.
@SET "PROMPT=%CONDA_PS1_BACKUP%"
@SET CONDA_PS1_BACKUP=
:FIXUP43
@SETLOCAL EnableDelayedExpansion
@REM This is the standard user case. This script is run in root\condabin.
@REM FOR %%A IN ("%~dp0.") DO @SET _sysp=%%~dpA
@REM IF NOT EXIST "!_sysp!\Scripts\micromamba.exe" @SET "_sysp=!_sysp!..\"
@FOR %%A in ("%TMP%") do @SET TMP=%%~sA
@IF "%MAMBA_ROOT_PREFIX%" NEQ "" (
@SET "_sysp=%MAMBA_ROOT_PREFIX%"
@SET "PATH=!_sysp!;!_sysp!\Library\mingw-w64\bin;!_sysp!\Library\usr\bin;!_sysp!\Library\bin;!_sysp!\Scripts;!_sysp!\bin;%PATH%"
)
@REM It seems that it is not possible to have "CONDA_EXE=Something With Spaces"
@REM and %* to contain: activate "Something With Spaces does not exist".
@REM MSDOS associates the outer "'s and is unable to run very much at all.
@REM @SET CONDA_EXES="%CONDA_EXE%" %_CE_M% %_CE_CONDA%
@REM @FOR /F %%i IN ('%CONDA_EXES% shell.cmd.exe %*') DO @SET _TEMP_SCRIPT_PATH=%%i not return error
@REM This method will not work if %TMP% contains any spaces.
@FOR /L %%I IN (1,1,100) DO @(
SET UNIQUE_DIR=%TMP%\conda-!RANDOM!
MKDIR !UNIQUE_DIR! > NUL 2>&1
IF NOT ERRORLEVEL 1 (
SET UNIQUE=!UNIQUE_DIR!\conda.tmp
TYPE NUL 1> !UNIQUE!
GOTO tmp_file_created
)
)
@ECHO Failed to create temp directory "%TMP%\conda-<RANDOM>\" & exit /b 1
:tmp_file_created
@"%MAMBA_EXE%" shell --shell cmd.exe %* 1>%UNIQUE%
@IF %ErrorLevel% NEQ 0 @EXIT /B %ErrorLevel%
@FOR /F %%i IN (%UNIQUE%) DO @SET _TEMP_SCRIPT_PATH=%%i
@RMDIR /S /Q %UNIQUE_DIR%
@FOR /F "delims=" %%A in (""!_TEMP_SCRIPT_PATH!"") DO @ENDLOCAL & @SET _TEMP_SCRIPT_PATH=%%~A
@IF "%_TEMP_SCRIPT_PATH%" == "" @EXIT /B 1
@IF NOT "%CONDA_PROMPT_MODIFIER%" == "" @CALL SET "PROMPT=%%PROMPT:%CONDA_PROMPT_MODIFIER%=%_empty_not_set_%%%"
@CALL "%_TEMP_SCRIPT_PATH%"
@IF NOT "%CONDA_TEST_SAVE_TEMPS%x"=="x" @ECHO CONDA_TEST_SAVE_TEMPS :: retaining activate_batch %_TEMP_SCRIPT_PATH% 1>&2
@IF "%CONDA_TEST_SAVE_TEMPS%x"=="x" @DEL /F /Q "%_TEMP_SCRIPT_PATH%"
@SET _TEMP_SCRIPT_PATH=
@SET "PROMPT=%CONDA_PROMPT_MODIFIER%%PROMPT%"

View File

@ -0,0 +1,4 @@
@REM Copyright (C) 2021 QuantStack
@REM SPDX-License-Identifier: BSD-3-Clause
@CALL "%~dp0..\condabin\mamba_hook.bat"
micromamba activate %*

View File

@ -0,0 +1,18 @@
@REM Copyright (C) 2021 QuantStack
@REM SPDX-License-Identifier: BSD-3-Clause
@REM This file is derived from conda_hook.bat
@IF DEFINED CONDA_SHLVL GOTO :EOF
@FOR %%F in ("%~dp0") do @SET "__mambabin_dir=%%~dpF"
@SET "__mambabin_dir=%__mambabin_dir:~0,-1%"
@SET "PATH=%__mambabin_dir%;%PATH%"
@SET "MAMBA_BAT=%__mambabin_dir%\micromamba.bat"
@FOR %%F in ("%__mambabin_dir%") do @SET "__mamba_root=%%~dpF"
@SET "MAMBA_EXE=E:\Zoroot\Dev\GaussianHaircut\micromamba.exe"
@SET __mambabin_dir=
@SET __mamba_root=
@DOSKEY micromamba="%MAMBA_BAT%" $*
@SET CONDA_SHLVL=0

View File

@ -0,0 +1,30 @@
@REM Copyright (C) 2012 Anaconda, Inc
@REM SPDX-License-Identifier: BSD-3-Clause
@REM echo _CE_CONDA is %_CE_CONDA%
@REM echo _CE_M is %_CE_M%
@REM echo CONDA_EXE is %CONDA_EXE%
@REM @SET "MAMBA_EXE=%~dp0..\Scripts\micromamba.exe"
@SET "MAMBA_EXE=E:\Zoroot\Dev\GaussianHaircut\micromamba.exe"
@SET "MAMBA_ROOT_PREFIX=E:\Zoroot\Dev\GaussianHaircut\micromamba"
@IF [%1]==[activate] "%~dp0_mamba_activate" %*
@IF [%1]==[deactivate] "%~dp0_mamba_activate" %*
@SETLOCAL EnableDelayedExpansion
@REM This is the standard user case. This script is run in root\condabin.
@REM FOR %%A IN ("%~dp0.") DO @SET _sysp=%%~dpA
@REM IF NOT EXIST "!_sysp!\Scripts\micromamba.exe" @SET "_sysp=!_sysp!..\"
@SET PATH=!MAMBA_ROOT_PREFIX!;!MAMBA_ROOT_PREFIX!\Library\mingw-w64\bin;!MAMBA_ROOT_PREFIX!\Library\usr\bin;!MAMBA_ROOT_PREFIX!\Library\bin;!MAMBA_ROOT_PREFIX!\Scripts;!MAMBA_ROOT_PREFIX!\bin;%PATH%
@CALL %MAMBA_EXE% %*
@ENDLOCAL
@IF %errorlevel% NEQ 0 EXIT /B %errorlevel%
@IF [%1]==[install] "%~dp0_mamba_activate" reactivate
@IF [%1]==[update] "%~dp0_mamba_activate" reactivate
@IF [%1]==[upgrade] "%~dp0_mamba_activate" reactivate
@IF [%1]==[remove] "%~dp0_mamba_activate" reactivate
@IF [%1]==[uninstall] "%~dp0_mamba_activate" reactivate
@EXIT /B %errorlevel%