Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Docker and installation Script #59

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*


42 changes: 8 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
39 changes: 39 additions & 0 deletions install_rodnet.sh
Original file line number Diff line number Diff line change
@@ -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