From c7cdf7991a190a66379c69811c6b15d137ba6b95 Mon Sep 17 00:00:00 2001 From: so-tech-f Date: Fri, 12 Sep 2025 19:59:25 +0900 Subject: [PATCH 1/3] add milo/data to .gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 544d455..e943932 100755 --- a/.gitignore +++ b/.gitignore @@ -206,4 +206,6 @@ dmypy.json # Pyre type checker .pyre/ -learnableearthparser/fast_sampler/_sampler.c \ No newline at end of file +learnableearthparser/fast_sampler/_sampler.c + +milo/data \ No newline at end of file From 57d72eece386866acc79b935c28162cacd23b652 Mon Sep 17 00:00:00 2001 From: so-tech-f Date: Fri, 12 Sep 2025 20:41:15 +0900 Subject: [PATCH 2/3] add use_opengl to default.yaml --- milo/configs/mesh/default.yaml | 5 ++++- milo/regularization/regularizer/mesh.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/milo/configs/mesh/default.yaml b/milo/configs/mesh/default.yaml index aced999..b2f31ce 100644 --- a/milo/configs/mesh/default.yaml +++ b/milo/configs/mesh/default.yaml @@ -1,6 +1,9 @@ +# Mesh Rasterizer backend +use_opengl: true # true for OpenGL backend, false for CUDA backend + # Regularization schedule start_iter: 8_001 -mesh_update_interval: 1 +mesh_update_interval: 1 stop_iter: 18000 # Depth loss weight diff --git a/milo/regularization/regularizer/mesh.py b/milo/regularization/regularizer/mesh.py index c6d4c7d..f49fe67 100644 --- a/milo/regularization/regularizer/mesh.py +++ b/milo/regularization/regularizer/mesh.py @@ -61,7 +61,7 @@ def initialize_mesh_regularization( print(f" > Mesh depth loss type: {config['mesh_depth_loss_type']}") print(f" > Occupancy mode: {config['occupancy_mode']}") - mesh_rasterizer = MeshRasterizer(cameras=scene.getTrainCameras().copy()) + mesh_rasterizer = MeshRasterizer(cameras=scene.getTrainCameras().copy(), use_opengl=config['use_opengl']) if config["use_scalable_renderer"]: print("[INFO] Using scalable mesh renderer.") mesh_renderer = ScalableMeshRenderer(mesh_rasterizer) From 4a0c9224c1e26e099f611c8fd7855d7223dc686c Mon Sep 17 00:00:00 2001 From: so-tech-f Date: Fri, 12 Sep 2025 22:17:23 +0900 Subject: [PATCH 3/3] Dockerfile --- Dockerfile | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..500b1ab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,100 @@ +FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 + +ENV TORCH_CUDA_ARCH_LIST="8.9" \ + DEBIAN_FRONTEND=noninteractive \ + PATH=/opt/conda/bin:$PATH \ + CPATH=/usr/local/cuda-11.8/targets/x86_64-linux/include:$CPATH \ + LD_LIBRARY_PATH=/usr/local/cuda-11.8/targets/x86_64-linux/lib:$LD_LIBRARY_PATH + +RUN apt-get update && apt-get install -y --no-install-recommends \ + git \ + wget \ + curl \ + build-essential \ + cmake \ + vim \ + libgl1-mesa-glx \ + libglib2.0-0 \ + libegl1-mesa-dev \ + libgles2-mesa-dev \ + libgl1-mesa-dev \ + libegl1 \ + libegl1-mesa \ + libgles2-mesa \ + libx11-6 \ + libxext6 \ + libxdamage1 \ + libxfixes3 \ + libx11-xcb1 \ + libxcb1 \ + libxrender1 \ + libxrandr2 \ + libxi6 \ + && rm -rf /var/lib/apt/lists/* + +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ + bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + conda clean -afy + +# Accept Conda Terms of Service +RUN conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \ + conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r + +# Prioritize conda-forge channel +RUN conda config --system --add channels conda-forge && \ + conda config --system --set channel_priority strict + +RUN conda create -n milo python=3.9 -y + +# Install PyTorch with CUDA 11.8 inside the "milo" environment +RUN /bin/bash -c "source activate milo && \ + conda install -y pytorch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 pytorch-cuda=11.8 -c pytorch -c nvidia" + +# Install ninja build system +RUN /bin/bash -c "source activate milo && conda install -y ninja -c conda-forge" + +WORKDIR /workspace/MILo + +COPY requirements.txt ./ + +# Install additional Python dependencies from requirements.txt +RUN /bin/bash -c "source activate milo && pip install -r requirements.txt" + +COPY .gitmodules ./ +COPY .git ./.git +COPY submodules ./submodules + +# Initialize git submodules and convert URLs to HTTPS +RUN git submodule init && \ + git config submodule.submodules/Depth-Anything-V2.url https://github.com/DepthAnything/Depth-Anything-V2.git && \ + git config submodule.submodules/nvdiffrast.url https://github.com/NVlabs/nvdiffrast.git && \ + git submodule update --init --recursive + +# Install Gaussian Splatting related submodules +RUN /bin/bash -c "source activate milo && \ + pip install submodules/diff-gaussian-rasterization_ms \ + submodules/diff-gaussian-rasterization \ + submodules/diff-gaussian-rasterization_gof \ + submodules/simple-knn \ + submodules/fused-ssim" + +# Build Tetra-Nerf Delaunay Triangulation +WORKDIR /workspace/MILo/submodules/tetra_triangulation +RUN /bin/bash -c "source activate milo && \ + conda install -y cmake && \ + conda install -y -c conda-forge gmp cgal && \ + cmake . && make && pip install -e ." + +# Install nvdiffrast for efficient mesh rasterization +WORKDIR /workspace/MILo/submodules/nvdiffrast +RUN /bin/bash -c "source activate milo && pip install ." + +WORKDIR /workspace +COPY . MILo/ + +# Return to the MILo root directory +WORKDIR /workspace/MILo + +SHELL ["/bin/bash", "--login", "-c"] +CMD ["bash", "-c", "source activate milo && bash"]