Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Turoad committed Mar 31, 2022
1 parent 95c06c2 commit 35665fc
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 9 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ Supported backbones:
- [x] ERFNet
- [x] VGG
- [x] MobileNet
- [] DLA(coming soon)

Supported detectors:
- [x] [SCNN](configs/scnn)
- [x] [UFLD](configs/ufld)
- [x] [RESA](configs/resa)
- [x] [LaneATT](configs/laneatt)
- [x] [CondLane](configs/condlane)
- [] CLRNet(coming soon)


## Installation
Expand All @@ -51,10 +53,10 @@ conda activate lanedet
```Shell
# Install pytorch firstly, the cudatoolkit version should be same in your system.

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=10.1 -c pytorch

# Or you can install via pip
pip install torch torchvision
pip install torch==1.8.0 torchvision==0.9.0

# Install python packages
python setup.py build develop
Expand All @@ -67,7 +69,7 @@ python setup.py build develop
Download [CULane](https://xingangpan.github.io/projects/CULane.html). Then extract them to `$CULANEROOT`. Create link to `data` directory.

```Shell
cd $RESA_ROOT
cd $LANEDET_ROOT
mkdir -p data
ln -s $CULANEROOT data/CULane
```
Expand All @@ -83,7 +85,7 @@ $CULANEROOT/list # data lists
Download [Tusimple](https://github.com/TuSimple/tusimple-benchmark/issues/3). Then extract them to `$TUSIMPLEROOT`. Create link to `data` directory.

```Shell
cd $RESA_ROOT
cd $LANEDET_ROOT
mkdir -p data
ln -s $TUSIMPLEROOT data/tusimple
```
Expand Down Expand Up @@ -116,7 +118,7 @@ python main.py [configs/path_to_your_config] --gpus [gpu_ids]

For example, run
```Shell
python main.py configs/resa/resa50_culane.py --gpus 0 1 2 3
python main.py configs/resa/resa50_culane.py --gpus 0
```

### Testing
Expand All @@ -127,7 +129,7 @@ python main.py [configs/path_to_your_config] --validate --load_from [path_to_you

For example, run
```Shell
python main.py configs/resa/resa50_culane.py --validate --load_from culane_resnet50.pth --gpus 0 1 2 3
python main.py configs/resa/resa50_culane.py --validate --load_from culane_resnet50.pth --gpus 0
```

Currently, this code can output the visualization result when testing, just add `--view`.
Expand Down
18 changes: 18 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM nvcr.io/nvidia/pytorch:21.10-py3

ENV DEBIAN_FRONTEND noninteractive

RUN rm -rf /var/lib/apt/lists/* && rm -rf /etc/apt/sources.list.d/*\
/etc/apt/sources.list.d/cuda.list \
/etc/apt/sources.list.d/nvidia-ml.list && \
sed -i s@/archive.ubuntu.com/@/mirrors.ustc.edu.cn/@g /etc/apt/sources.list && \
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install LaneDet
RUN conda clean --all
RUN git clone https://github.com/turoad/lanedet.git /lanedet
WORKDIR /lanedet
RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ && \
pip install --no-cache-dir -e .
22 changes: 22 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Building a LaneDet container

### Install Docker and NVIDIA Container Toolkit

https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html

### Build Container

>
```Shell
# From root of LaneDet repo
cd $LANEDET_ROOT

# Build:
docker build -f docker/Dockerfile -t lanedet:latest .

# Run:
docker run --gpus all -it \
--shm-size=8gb \
--name=lanedet --ipc=host --net=host lanedet:latest
```
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
torch==1.6.0
torchvision==0.7.0
torch==1.8.0
torchvision==0.9.0
pandas
addict
sklearn
Expand All @@ -13,5 +13,5 @@ Shapely==1.7.0
ujson==1.35
yapf
albumentations==0.4.6
mmcv==0.5.6
mmcv==1.2.5
pathspec

0 comments on commit 35665fc

Please sign in to comment.