From b43468ed6b632faf9bea05849f266920e2964881 Mon Sep 17 00:00:00 2001 From: Jeffreytsai1004 Date: Fri, 14 Feb 2025 02:42:40 +0800 Subject: [PATCH] Update --- README.md | 41 +++++++++++++++++-- install.bat | 22 ++++++++--- micromamba/condabin/_mamba_activate.bat | 52 +++++++++++++++++++++++++ micromamba/condabin/activate.bat | 4 ++ micromamba/condabin/mamba_hook.bat | 18 +++++++++ micromamba/condabin/micromamba.bat | 30 ++++++++++++++ 6 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 micromamba/condabin/_mamba_activate.bat create mode 100644 micromamba/condabin/activate.bat create mode 100644 micromamba/condabin/mamba_hook.bat create mode 100644 micromamba/condabin/micromamba.bat diff --git a/README.md b/README.md index f235734..da2af5b 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,21 @@ 4. **安装 COLMAP** - 从 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** - 从 https://mamba.readthedocs.io/en/latest/installation.html 下载并安装 @@ -58,18 +72,38 @@ ```cmd git clone git@github.com:eth-ait/GaussianHaircut.git cd GaussianHaircut + # 在CMD中运行: install.bat + # 或在PowerShell中运行: + .\install.bat ``` ## 重建 1. **录制单目视频** - 参考项目页面上的示例,并尽可能减少运动模糊。 + - 参考项目页面上的示例视频 + - 录制要求: + * 拍摄对象应缓慢转动头部,确保捕捉到所有角度 + * 保持头发和面部清晰可见 + * 避免快速移动导致的运动模糊 + * 保持光照条件稳定 + * 建议视频长度:10-20秒 + * 建议分辨率:1920x1080或更高 2. **设置重建场景的目录** - 将视频文件放入其中,并将其重命名为 raw.mp4 + 创建场景目录结构: + ``` + [your_scene_folder]/ + └── raw.mp4 # 您录制的视频文件 + ``` + + 注意: + - DATA_PATH 应指向包含 raw.mp4 的目录 + - 目录路径不应包含空格或特殊字符 + - 脚本会在此目录下自动创建所需的子目录 + - 确保有足够的磁盘空间(建议至少20GB) 3. **运行脚本** @@ -82,6 +116,7 @@ Linux: Windows: ```cmd + # 在CMD中运行: set PROJECT_DIR=[path\to\]GaussianHaircut set DATA_PATH=[path\to\scene\folder] run.bat diff --git a/install.bat b/install.bat index eb6bb5c..fc6bbef 100644 --- a/install.bat +++ b/install.bat @@ -26,7 +26,7 @@ SET MAMBA_ROOT_PREFIX=%PROJECT_DIR%\micromamba IF NOT EXIST "%MAMBA_ROOT_PREFIX%" mkdir "%MAMBA_ROOT_PREFIX%" REM 初始化micromamba -CALL "%MICROMAMBA_EXE%" shell init --root-prefix "%MAMBA_ROOT_PREFIX%" +CALL "%MICROMAMBA_EXE%" shell init --prefix "%MAMBA_ROOT_PREFIX%" REM 检查必要的环境和依赖 IF NOT EXIST "%CUDA_HOME%\" ( @@ -46,6 +46,18 @@ IF NOT EXIST "%VS2019_VCVARS%" ( 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版本 nvcc --version 2>nul | findstr "release 11.8" >nul IF %ERRORLEVEL% NEQ 0 ( @@ -53,11 +65,11 @@ IF %ERRORLEVEL% NEQ 0 ( exit /b 1 ) -REM 检查COLMAP -where colmap >nul 2>nul +REM 检查COLMAP是否可用 +colmap -h >nul 2>nul IF %ERRORLEVEL% NEQ 0 ( - echo ERROR: COLMAP not found in PATH - echo Please install COLMAP and add it to PATH + echo ERROR: COLMAP installation appears to be broken + echo Please try reinstalling COLMAP exit /b 1 ) diff --git a/micromamba/condabin/_mamba_activate.bat b/micromamba/condabin/_mamba_activate.bat new file mode 100644 index 0000000..9890946 --- /dev/null +++ b/micromamba/condabin/_mamba_activate.bat @@ -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-\" & 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%" diff --git a/micromamba/condabin/activate.bat b/micromamba/condabin/activate.bat new file mode 100644 index 0000000..0ac0e4d --- /dev/null +++ b/micromamba/condabin/activate.bat @@ -0,0 +1,4 @@ +@REM Copyright (C) 2021 QuantStack +@REM SPDX-License-Identifier: BSD-3-Clause +@CALL "%~dp0..\condabin\mamba_hook.bat" +micromamba activate %* diff --git a/micromamba/condabin/mamba_hook.bat b/micromamba/condabin/mamba_hook.bat new file mode 100644 index 0000000..710ba95 --- /dev/null +++ b/micromamba/condabin/mamba_hook.bat @@ -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 diff --git a/micromamba/condabin/micromamba.bat b/micromamba/condabin/micromamba.bat new file mode 100644 index 0000000..8f26d22 --- /dev/null +++ b/micromamba/condabin/micromamba.bat @@ -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%