Skip to content

Commit

Permalink
Add Docker support
Browse files Browse the repository at this point in the history
TensorFlow w/ GPU should be properly configured now.
  • Loading branch information
estherjk committed Oct 10, 2020
1 parent 3d32600 commit a1a0dbd
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 11 deletions.
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM tensorflow/tensorflow:1.15.4-gpu-py3

# Install dependencies
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
libgl1-mesa-glx \
python3-pyqt5 \
python3-tk

# Install Python dependencies
WORKDIR /tmp
COPY requirements.txt .
RUN pip install -r requirements.txt

# Add project code to PYTHONPATH (assumes volume mount point is /code)
ENV PYTHONPATH="/code:$PYTHONPATH"

WORKDIR /code
20 changes: 13 additions & 7 deletions README_SUPPLEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@

Additional info (didn't want to modify original README).

## Setup
## Docker Usage

### Installing dependencies
### Build

```bash
pip install -r requirements.txt
docker build -t lanenet:latest .
```

### Updating PYTHONPATH
### Run

```bash
export PYTHONPATH="/path/to/lanenet-lane-detection:$PYTHONPATH"
docker run -it --rm \
--gpus all \
-u $(id -u):$(id -g) \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix/:/tmp/.X11-unix \
-v $PWD:/code \
lanenet:latest bash
```

## Testing LaneNet model

### Testing a single image

```bash
python3 tools/test_lanenet.py --weights_path ./model/tusimple_lanenet/tusimple_lanenet.ckpt --image_path ./data/tusimple_test_image/0.jpg
python tools/test_lanenet.py --weights_path ./model/tusimple_lanenet/tusimple_lanenet.ckpt --image_path ./data/tusimple_test_image/0.jpg
```

### Testing a video source

```bash
python3 tools/test_lanenet_video.py --weights_path ./model/tusimple_lanenet/tusimple_lanenet.ckpt --video_src ./data/tusimple_test_video/0.mp4
python tools/test_lanenet_video.py --weights_path ./model/tusimple_lanenet/tusimple_lanenet.ckpt --video_src ./data/tusimple_test_video/0.mp4
```
2 changes: 1 addition & 1 deletion config/tusimple_lanenet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ SOLVER:
SCORE_THRESH: 0.65
MIN_SAMPLE_NUMS: 65536
GPU:
GPU_MEMORY_FRACTION: 0.9
GPU_MEMORY_FRACTION: 0.3
TF_ALLOW_GROWTH: True
POSTPROCESS:
MIN_AREA_THRESHOLD: 100
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
easydict==1.9
glog==0.3.1
loguru==0.5.3
numpy==1.18.5
# numpy==1.18.5
matplotlib==3.3.2
opencv-python==4.4.0.44
PyYAML==5.3.1
scipy==1.5.2
scikit-learn==0.23.2
tensorflow-gpu==1.15.4
# tensorflow-gpu==1.15.4
tqdm==4.49.0

0 comments on commit a1a0dbd

Please sign in to comment.