diff --git a/.python-version b/.python-version deleted file mode 100644 index 7560320b..00000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.7.9 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..696e2b39 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/README_SUPPLEMENT.md b/README_SUPPLEMENT.md index c5f9d0da..97516e3c 100644 --- a/README_SUPPLEMENT.md +++ b/README_SUPPLEMENT.md @@ -2,18 +2,24 @@ 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 @@ -21,11 +27,11 @@ export PYTHONPATH="/path/to/lanenet-lane-detection:$PYTHONPATH" ### 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 ``` \ No newline at end of file diff --git a/config/tusimple_lanenet.yaml b/config/tusimple_lanenet.yaml index e68e0190..ffa8ebad 100755 --- a/config/tusimple_lanenet.yaml +++ b/config/tusimple_lanenet.yaml @@ -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 diff --git a/requirements.txt b/requirements.txt index 88f3267b..29c2e5b6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file