From 3387939ba917afd68d94202cb9d92eee03ba81d4 Mon Sep 17 00:00:00 2001 From: MaximilianArnold Date: Thu, 11 Aug 2022 15:52:23 +0200 Subject: [PATCH 1/4] Added Docker Implementation --- Dockerfile | 21 +++++++++++++++++++++ README.md | 40 ++++++---------------------------------- install_rodnet.sh | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 Dockerfile create mode 100644 install_rodnet.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e5d25b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Use nvidia/cuda image +FROM gpuci/miniconda-cuda:10.2-devel-ubuntu18.04 + +# Copy +COPY ./install_rodnet.sh /install_rodnet.sh +RUN chmod +x ./install_rodnet.sh + +# set bash as current shell +RUN chsh -s /bin/bash +SHELL ["/bin/bash", "-c"] +RUN apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub + +# install anacond +ENV PATH /opt/conda/bin:$PATH + +RUN apt-get update --fix-missing && \ + apt-get install -y wget bzip2 ca-certificates curl git rsync nano && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + + diff --git a/README.md b/README.md index 8848b52..55d7c50 100644 --- a/README.md +++ b/README.md @@ -37,44 +37,16 @@ Please cite our paper if this repository is helpful for your research: ``` ## Installation +(Verify you are at CUDA 10.X) -Clone RODNet code. -```commandline -cd $RODNET_ROOT -git clone https://github.com/yizhou-wang/RODNet.git -``` +docker build -t rodnet-docker ./ +docker run --rm -it --gpus all -v /:/workspace/ -p 52713:52713 --name rodnet-docker rodnet-docker bash -Create a conda environment for RODNet. Tested under Python 3.6, 3.7, 3.8. -```commandline -conda create -n rodnet python=3.* -y +Run inside your docker +./install_rodnet conda activate rodnet -``` - -Install pytorch. -**Note:** If you are using Temporal Deformable Convolution (TDC), we only tested under `pytorch<=1.4` and `CUDA=10.1`. -Without TDC, you should be able to choose the latest versions. -If you met some issues with environment, feel free to raise an issue. -```commandline -conda install pytorch=1.4 torchvision cudatoolkit=10.1 -c pytorch # if using TDC -# OR -conda install pytorch torchvision cudatoolkit=10.1 -c pytorch # if not using TDC -``` - -Install `cruw-devkit` package. -Please refer to [`cruw-devit`](https://github.com/yizhou-wang/cruw-devkit) repository for detailed instructions. -```commandline -git clone https://github.com/yizhou-wang/cruw-devkit.git -cd cruw-devkit -pip install . -cd .. -``` -Setup RODNet package. -```commandline -pip install -e . -``` -**Note:** If you are not using TDC, you can rename script `setup_wo_tdc.py` as `setup.py`, and run the above command. -This should allow you to use the latest cuda and pytorch version. +Thats it. ## Prepare data for RODNet diff --git a/install_rodnet.sh b/install_rodnet.sh new file mode 100644 index 0000000..11b3f3d --- /dev/null +++ b/install_rodnet.sh @@ -0,0 +1,39 @@ +#!/bin/bash +git clone https://github.com/yizhou-wang/RODNet.git +conda create -n rodnet python=3.* -y +conda init bash +eval "$(command conda 'shell.bash' 'hook' 2> /dev/null)" +conda activate rodnet +conda -y install pytorch=1.4 torchvision cudatoolkit=10.1 -c pytorch +git clone https://github.com/yizhou-wang/cruw-devkit.git +cd cruw-devkit +pip install . +cd .. +cd RODNet +pip install -e . + +wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1-87V3rBgJHU4HpCtAnu6zhxSMjMTpE5N' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1-87V3rBgJHU4HpCtAnu6zhxSMjMTpE5N" -O TRAIN_RAD_H.zip && rm -rf /tmp/cookies.txt +wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1cTLfwxNw62Km8yNVmKzzHWi2tdaUeVDW' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1cTLfwxNw62Km8yNVmKzzHWi2tdaUeVDW" -O TRAIN_CAM_0.zip && rm -rf /tmp/cookies.txt +wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1rS5eO_qcUPWaYK7NRt7d3ynyjDnmyIYd' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1rS5eO_qcUPWaYK7NRt7d3ynyjDnmyIYd" -O TRAIN_RAD_H_ANNO.zip && rm -rf /tmp/cookies.txt +wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1Mc8_WSUKJvP8_WgmGSuu5D0RJ0TPZViB' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1Mc8_WSUKJvP8_WgmGSuu5D0RJ0TPZViB" -O CAM_CALIB.zip && rm -rf /tmp/cookies.txt + + +unzip TRAIN_RAD_H.zip +unzip TRAIN_CAM_0.zip +unzip TEST_RAD_H.zip +unzip TRAIN_RAD_H_ANNO.zip +unzip CAM_CALIB.zip + +# make folders for data and annotations +mkdir sequences +mkdir annotations + +# rename unzipped folders +mv TRAIN_RAD_H sequences/train +mv TRAIN_CAM_0 train +mv TEST_RAD_H sequences/test +mv TRAIN_RAD_H_ANNO annotations/train + +# merge folders and remove redundant +rsync -av train/ sequences/train/ +rm -r train From 5b53dc27f52f4a2ae27600811b5198900050022f Mon Sep 17 00:00:00 2001 From: MaximilianArnold Date: Thu, 11 Aug 2022 15:52:53 +0200 Subject: [PATCH 2/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 55d7c50..7532e6d 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Please cite our paper if this repository is helpful for your research: (Verify you are at CUDA 10.X) docker build -t rodnet-docker ./ + docker run --rm -it --gpus all -v /:/workspace/ -p 52713:52713 --name rodnet-docker rodnet-docker bash Run inside your docker From 143a0d8401ae9c5e30c2df8baf80ebb0b9431d0d Mon Sep 17 00:00:00 2001 From: MaximilianArnold Date: Thu, 11 Aug 2022 15:53:06 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7532e6d..deb69db 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ docker run --rm -it --gpus all -v /:/workspace/ -p 52713:52713 --name rodnet-doc Run inside your docker ./install_rodnet + conda activate rodnet Thats it. From 8a5482092fd955d1f9fad573d735cf2cb210381a Mon Sep 17 00:00:00 2001 From: MaximilianArnold Date: Thu, 11 Aug 2022 15:57:04 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index deb69db..efe37dc 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Please cite our paper if this repository is helpful for your research: } ``` -## Installation +## Installation and Download of Data (Verify you are at CUDA 10.X) docker build -t rodnet-docker ./