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

Add Dockerfile #204

Open
wants to merge 1 commit into
base: main
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
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Stage 1
FROM python:3.8-bullseye AS builder

COPY requirements.txt /requirements.txt
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install --no-cache-dir --user \
--no-warn-script-location -r /requirements.txt \
--extra-index-url https://download.pytorch.org/whl/cu116 && \
rm -rf /requirements.txt

# Stage 2
FROM python:3.8-slim-bullseye

RUN apt-get update && apt-get install -y --no-install-recommends\
libgl1-mesa-glx \
libglib2.0-0 \
wget && \
rm -rf /var/lib/apt/lists/*

COPY --from=builder /root/.local /root/.local
ENV PATH=$PATH:/root/.local

WORKDIR /workspace
CMD ["/bin/bash"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ cd YOLOv6
pip install -r requirements.txt
```

### Docker
```shell
docker build -t yolov6 .
docker run --gpus all --shm-size 2g --rm -it -v $(pwd):/workspace yolov6

```
### Inference

First, download a pretrained model from the YOLOv6 [release](https://github.com/meituan/YOLOv6/releases/tag/0.1.0)
Expand Down