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
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04

# Set the timezone
ENV TZ Europe/Berlin
ARG DEBIAN_FRONTEND noninteractive

# Update the system timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Set the working directory inside the container
ENV APP_WORKDIR /home/depth_estimation
WORKDIR $APP_WORKDIR

RUN apt update -y && apt upgrade -y
RUN apt-get install libopenblas-dev liblapack-dev -y

# needed for cv2
RUN apt-get install ffmpeg libsm6 libxext6 -y

# install pip
RUN apt install python3-pip -y
RUN python3 -m pip install --upgrade setuptools pip wheel

COPY ./requirements.txt $APP_WORKDIR/requirements.txt

# Install UniDepth and dependencies
RUN pip3 install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu118

EXPOSE 80

CMD ["/bin/bash"]
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Requirements are not in principle hard requirements, but there might be some dif
- Python 3.10+
- CUDA 11.8+


### Local installation
Install the environment needed to run UniDepth with:
```shell
export VENV_DIR=<YOUR-VENVS-DIR>
Expand Down Expand Up @@ -102,6 +104,32 @@ If everything runs correctly, `demo.py` should print: `ARel: 7.45%`.

If you encounter `Segmentation Fault` after running the demo, you may need to uninstall torch via pip (`pip uninstall torch`) and install the torch version present in [requirements](requirements.txt) with `conda`.


### Installation with Docker

Make sure that you have installed [Docker]() and [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html).

First, build the image:
```shell
docker build -t unidepth_image .
```

Second, run the container:
```shell
docker run -it --gpus all \
--name unidepth_container_1 \
-v "$(pwd):/home/depth_estimation" \
unidepth_image
```

Run the example inside of the containner:
```shell
# move the target file to the project root
mv ./scripts/demo.py .
# run the demo
python3 demo.py
```

## Get Started

After installing the dependencies, you can load the pre-trained models easily from [Hugging Face](https://huggingface.co/models?other=UniDepth) as follows:
Expand Down