Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,6 @@ dmypy.json

# Pyre type checker
.pyre/
learnableearthparser/fast_sampler/_sampler.c
learnableearthparser/fast_sampler/_sampler.c

milo/data
100 changes: 100 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 4 additions & 1 deletion milo/configs/mesh/default.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion milo/regularization/regularizer/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down