Created
September 25, 2023 17:24
-
-
Save benleb/4db18ea0c099d0615edda085c731ee9d to your computer and use it in GitHub Desktop.
rknn_toolkit2 / python 3.10 docker image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build with: | |
# docker build -t rknn-toolkit2:py310 . | |
# run with: | |
# docker run --rm --name rknn-toolkit2 -it rknn-toolkit2:py310 python3 /rknn_toolkit1/examples/tflite/mobilenet_v1/test.py | |
# or: | |
# docker run --rm --name rknn-toolkit2 -v $PWD:/rknn_repo rknn-toolkit2 -it rknn-toolkit2:py310 python3 /rknn_repo/examples/tflite/mobilenet_v1/test.py | |
FROM python:3.10 | |
ENV rknn_toolkit2_repo="https://github.com/rockchip-linux/rknn-toolkit2" | |
ENV rknn_toolkit2_workdir="/rknn-toolkit2" | |
ENV rknn_toolkit2_version="1.5.2" | |
ENV rknn_toolkit2_requirements="/rknn-toolkit2/doc/requirements_cp310-${rknn_toolkit2_version}.txt" | |
ENV rknn_toolkit2_whl="/rknn-toolkit2/packages/rknn_toolkit2-${rknn_toolkit2_version}+b642f30c-cp310-cp310-linux_x86_64.whl" | |
# install dependencies | |
RUN apt update && \ | |
apt install -y cmake gcc git libgl1-mesa-dev libgl1-mesa-dri libglib2.0-0 libprotobuf-dev libsm6 libxslt1-dev python3-dev python3-pip zlib1g zlib1g-dev | |
# clone repo | |
RUN git clone -b "v${rknn_toolkit2_version}" "${rknn_toolkit2_repo}" "${rknn_toolkit2_workdir}" | |
# set workdir to cloned repo | |
WORKDIR "${rknn_toolkit2_workdir}" | |
# install rknn-toolkit & dependencies | |
RUN python3 -m pip install -r "${rknn_toolkit2_requirements}" && \ | |
python3 -m pip install "${rknn_toolkit2_whl}" | |
# run mobilenet_v1 example | |
# RUN cd examples/tflite/mobilenet_v1 && python3 test.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment