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..efe37dc 100644 --- a/README.md +++ b/README.md @@ -36,45 +36,19 @@ 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) -Clone RODNet code. -```commandline -cd $RODNET_ROOT -git clone https://github.com/yizhou-wang/RODNet.git -``` +docker build -t rodnet-docker ./ -Create a conda environment for RODNet. Tested under Python 3.6, 3.7, 3.8. -```commandline -conda create -n rodnet python=3.* -y -conda activate rodnet -``` +docker run --rm -it --gpus all -v /:/workspace/ -p 52713:52713 --name rodnet-docker rodnet-docker bash -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 -``` +Run inside your docker +./install_rodnet -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 .. -``` +conda activate rodnet -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