This repository has been archived by the owner on Dec 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from timmh/master
implement docker support
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# enables cuda support in docker | ||
FROM nvidia/cuda:10.2-cudnn7-runtime-ubuntu18.04 | ||
|
||
# install python 3.6, pip and requirements for opencv-python | ||
# (see https://github.com/NVIDIA/nvidia-docker/issues/864) | ||
RUN apt-get update && apt-get -y install \ | ||
python3 \ | ||
python3-pip \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# install python dependencies | ||
RUN pip3 install torch~=1.2 torchvision opencv-python~=3.4 | ||
|
||
# copy inference code | ||
WORKDIR /opt/MiDaS | ||
COPY ./midas ./midas | ||
COPY ./*.py ./ | ||
|
||
# download model weights so the docker image can be used offline | ||
RUN curl -OL https://github.com/intel-isl/MiDaS/releases/download/v2/model-f46da743.pt | ||
RUN python3 run.py; exit 0 | ||
|
||
# entrypoint (dont forget to mount input and output directories) | ||
CMD python3 run.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters