2022-10-19 17:33:36 +00:00
|
|
|
FROM docker.io/library/python:3.10-slim as base
|
2022-10-19 14:59:15 +00:00
|
|
|
|
|
|
|
# Configure piwheels repo to use pre-compiled numpy wheels for arm
|
|
|
|
RUN echo -n "[global]\nextra-index-url=https://www.piwheels.org/simple\n" >> /etc/pip.conf
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0
|
|
|
|
|
|
|
|
#################
|
|
|
|
FROM base as model-builder
|
2022-08-10 13:46:33 +00:00
|
|
|
|
|
|
|
RUN python3 -m pip install blobconverter
|
|
|
|
|
|
|
|
RUN mkdir -p /models
|
|
|
|
|
|
|
|
RUN blobconverter --zoo-name mobile_object_localizer_192x192 --zoo-type depthai --shaves 6 --version 2021.4 --output-dir /models || echo ""
|
2022-01-15 17:42:14 +00:00
|
|
|
|
2022-10-19 14:59:15 +00:00
|
|
|
#################
|
|
|
|
FROM base as builder
|
2022-01-15 17:42:14 +00:00
|
|
|
|
2022-10-19 14:59:15 +00:00
|
|
|
RUN apt-get install -y git && \
|
|
|
|
pip3 install poetry==1.2.0 && \
|
|
|
|
poetry self add "poetry-dynamic-versioning[plugin]"
|
2022-11-02 12:56:41 +00:00
|
|
|
|
|
|
|
ADD poetry.lock .
|
|
|
|
ADD pyproject.toml .
|
|
|
|
ADD camera camera
|
|
|
|
ADD README.md .
|
2022-01-15 17:42:14 +00:00
|
|
|
|
2022-11-02 14:35:47 +00:00
|
|
|
# Poetry expect to found a git project
|
|
|
|
ADD .git .git
|
|
|
|
|
2022-10-19 14:59:15 +00:00
|
|
|
RUN poetry build
|
2022-01-15 17:42:14 +00:00
|
|
|
|
2022-10-19 14:59:15 +00:00
|
|
|
#################
|
|
|
|
FROM base
|
2022-01-15 17:42:14 +00:00
|
|
|
|
2022-10-19 14:59:15 +00:00
|
|
|
RUN mkdir /models
|
|
|
|
COPY --from=model-builder /models/mobile_object_localizer_192x192_openvino_2021.4_6shave.blob /models/mobile_object_localizer_192x192_openvino_2021.4_6shave.blob
|
2022-01-15 17:42:14 +00:00
|
|
|
|
2022-10-19 14:59:15 +00:00
|
|
|
COPY --from=builder dist/*.whl /tmp/
|
|
|
|
RUN pip3 install /tmp/*whl
|
2022-01-15 17:42:14 +00:00
|
|
|
|
|
|
|
WORKDIR /tmp
|
|
|
|
USER 1234
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/rc-oak-camera"]
|