Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docker & docker-compose to the project #31

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -13,4 +13,6 @@ datasets/t2*
split_files/

# Outputs.
results_*/
results_*/

images/
58 changes: 58 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM pytorch/pytorch:2.5.1-cuda11.8-cudnn9-devel

WORKDIR /workspace

RUN apt-get update && \
apt-get install wget -y && \
apt-get install git -y

# Install Miniconda
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
amonszpart marked this conversation as resolved.
Show resolved Hide resolved

RUN git clone https://github.com/nianticlabs/acezero --recursive

RUN conda install ipykernel

#Create ace0 env
RUN cd acezero && \
conda env create -f environment.yml

RUN echo "source activate ace0" > ~/.bashrc && \
conda run -n ace0 pip install ipykernel && \
conda install -n ace0 -c conda-forge libstdcxx-ng && \
/opt/conda/envs/ace0/bin/python -m ipykernel install --user --name=ace0

RUN cd acezero/dsacstar && \
conda run -n ace0 python setup.py install

#Install ace0 deps
RUN apt-get install -y libnvidia-egl-wayland1
amonszpart marked this conversation as resolved.
Show resolved Hide resolved
RUN apt-get install -y xvfb mesa-utils
RUN apt-get install -y libgl1-mesa-glx libgl1-mesa-dri
ENV DISPLAY=:99
RUN Xvfb :99 -screen 0 1024x768x24 & export DISPLAY=:99

# Install nerfstudio
RUN conda create --name nerfstudio -y python=3.8

RUN conda run -n nerfstudio pip install --upgrade pip

RUN conda run -n nerfstudio pip install torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118

RUN conda run -n nerfstudio conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit

ENV TCNN_CUDA_ARCHITECTURES="50;52;60;61;70;75;80;86"

RUN conda run -n nerfstudio pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

RUN conda run -n nerfstudio pip install nerfstudio

RUN apt-get install -y libglib2.0-0

RUN conda run -n nerfstudio ns-install-cli
amonszpart marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /workspace/acezero
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ See [this link](https://github.com/isl-org/ZoeDepth) for its license and details
ACE0 uses that model to estimate the depth for the seed images.
It can be replaced, please see the [FAQ](#frequently-asked-questions) section below for details.

## Docker

If you would prefer to run Ace0 in a docker container, you can start it with:

```shell
docker-compose up -d
```

You can then shell into the container with the following command:

```shell
docker exec -it acezero /bin/bash
```

From there you can follow the Gaussian Splatting tutorial described at the bottom of the README [here.](#frequently-asked-questions) Make sure to add your images to the volume defined in ```docker-compose.yml```

## Usage

We explain how to run ACE0 to reconstruct images from scratch, with and without knowledge about the image intrinsics.
Expand Down
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.8"

services:
acezero:
restart: always
container_name: acezero
build:
context: .
dockerfile: Dockerfile
tty: true
stdin_open: true
ports:
- "7771:7007"
amonszpart marked this conversation as resolved.
Show resolved Hide resolved
volumes:
- ./images:/workspace/images
amonszpart marked this conversation as resolved.
Show resolved Hide resolved
deploy:
resources:
reservations:
devices:
- driver: 'nvidia'
count: all
capabilities: [gpu]
amonszpart marked this conversation as resolved.
Show resolved Hide resolved
extra_hosts:
- "host.docker.internal:host-gateway"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: put a comment above explaining what this does and why it's needed.