From a315c44ab709e8e3e740614a9ba2c52b0bfe18f0 Mon Sep 17 00:00:00 2001 From: KleinYuan Date: Mon, 6 Feb 2023 16:44:46 -0800 Subject: [PATCH 1/4] add docker support --- .gitignore | 1 + Dockerfile | 22 ++++++++++++++++++++++ Makefile | 8 ++++++++ requirements.txt | 2 +- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 6c093a6..b966cd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea/ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b537297 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04 + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && apt-get install -y \ + python3-opencv ca-certificates python3-dev git wget sudo ninja-build +RUN ln -sv /usr/bin/python3 /usr/bin/python + +COPY . /home/appuser +WORKDIR /home/appuser + +# https://github.com/facebookresearch/detectron2/issues/3933 +ENV PATH="/home/appuser/.local/bin:${PATH}" +RUN wget https://bootstrap.pypa.io/pip/3.6/get-pip.py && \ + python3 get-pip.py && \ + rm get-pip.py + +# install dependencies +# See https://pytorch.org/ for other options if you use a different version of CUDA +RUN pip install -r requirements.txt +RUN pip install torch==1.10 torchvision==0.11.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html +RUN pip install setuptools==59.5.0 +RUN python setup.py develop diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..53c9577 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +clean: + docker rm -f $$(docker ps -qa) + +build-image: + docker build -t=deeppreid:v0 . + +run: + nvidia-docker run -v ${PWD}:/home/appuser --name=deeppreid --net=host --ipc=host -it deeppreid:v0 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 71da6fe..f3c94ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ flake8 yapf isort==4.3.21 imageio - +chardet # Export -------------------------------------- # onnx # onnx-simplified From a5247476665732f62bbc15c9299784286eaab763 Mon Sep 17 00:00:00 2001 From: KleinYuan Date: Mon, 6 Feb 2023 16:47:59 -0800 Subject: [PATCH 2/4] add to readme --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index cc03951..9a9f775 100755 --- a/README.rst +++ b/README.rst @@ -84,6 +84,10 @@ Make sure `conda `_ is installed. # install torchreid (don't need to re-build it if you modify the source code) python setup.py develop +Another way to install is to run everything inside docker container: + +- build: `make build-image` +- run: `make run` Get started: 30 seconds to Torchreid ------------------------------------- From 2a46695c2a4eda8a6dd9239a4c202fa74cfcd73b Mon Sep 17 00:00:00 2001 From: KleinYuan Date: Mon, 6 Feb 2023 16:48:36 -0800 Subject: [PATCH 3/4] add to readme --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 9a9f775..259fda3 100755 --- a/README.rst +++ b/README.rst @@ -86,8 +86,8 @@ Make sure `conda `_ is installed. Another way to install is to run everything inside docker container: -- build: `make build-image` -- run: `make run` +- build: ``make build-image`` +- run: ``make run`` Get started: 30 seconds to Torchreid ------------------------------------- From 34f6ce5d1986eb6fa87d04e2395ad0e465ddef48 Mon Sep 17 00:00:00 2001 From: KleinYuan Date: Mon, 6 Feb 2023 16:49:34 -0800 Subject: [PATCH 4/4] format --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 53c9577..3d315a8 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,4 @@ build-image: docker build -t=deeppreid:v0 . run: - nvidia-docker run -v ${PWD}:/home/appuser --name=deeppreid --net=host --ipc=host -it deeppreid:v0 \ No newline at end of file + nvidia-docker run -v ${PWD}:/home/appuser --name=deeppreid --net=host --ipc=host -it deeppreid:v0