For cross-compilation you may refer to this guide.
You can try to change import "FROM debian:stretch" to "FROM ubuntu:18.04" in the Dockerfile. However, it is not officially validated for Ubuntu usage so it might or might not work.
These are the required in the Dockerfile:
FROM ubuntu:18.04
USER root
COPY ./sources.list /etc/apt/sources.list
RUN dpkg --add-architecture arm64 && apt-get update
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
crossbuild-essential-arm64 \
git \
wget \
libusb-1.0-0-dev:arm64 \
libgtk-3-dev:arm64 \
libavcodec-dev:arm64 \
libavformat-dev:arm64 \
libswscale-dev:arm64 \
libgstreamer1.0-dev:arm64 \
libgstreamer-plugins-base1.0-dev:arm64 \
libgstreamer-plugins-base1.0-dev:arm64 \
libpython3-dev:arm64 \
libtbb-dev:arm64 \
python-minimal \
python3-distutils:arm64 \
python3-pip \
python3-setuptools \
python-argparse \
libglib2.0-dev-bin:arm64 \
libglib2.0-dev:arm64 \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://www.cmake.org/files/v3.14/cmake-3.14.3.tar.gz && \
tar xf cmake-3.14.3.tar.gz && \
(cd cmake-3.14.3 && ./bootstrap --parallel=$(nproc --all) && make --jobs=$(nproc --all) && make install) && \
rm -rf cmake-3.14.3 cmake-3.14.3.tar.gz
RUN python3 -m pip install pip --upgrade
RUN python3 -m pip install numpy cython scikit-build opencv-python==4.5.3.56
RUN git config --global user.name "Your Name" && \
git config --global user.email "you@example.com"
Make sure to include the referenced sources.list file from your previous post as part of arm64 contents.
Build and run docker:
docker image build -t arm64 arm64
docker run -it -v /home/user/openvino/:/openvino arm64 /bin/bash
Install requirements:
python3 -m pip install -r openvino/inference-engine/ie_bridges/python/requirements.txt
python3 -m pip install -r openvino/inference-engine/ie_bridges/python/wheel/requirements-dev.txt
python3 -m pip install -r openvino/inference-engine/ie_bridges/python/src/requirements-dev.txt
Run CMAKE:
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="../cmake/arm64.toolchain.cmake" \
-DENABLE_MKL_DNN=OFF \
-DTHREADS_PTHREAD_ARG="-pthread" \
-DENABLE_CLDNN=OFF \
-DENABLE_GNA=OFF \
-DENABLE_SSE42=OFF \
-DTHREADING=SEQ \
-DENABLE_OPENCV=ON \
-DNGRAPH_PYTHON_BUILD_ENABLE=ON \
-DNGRAPH_ONNX_IMPORT_ENABLE=ON \
-DENABLE_PYTHON=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python3.6 \
-DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6 ..
Run make:
make --jobs=$(nproc --all)
After exiting Docker (by pressing Ctrl+D), you can find the resulting binaries in the ~/openvino/bin/aarch64/
directory and the OpenCV installation in the ~/openvino/inference-engine/temp.
Do not forget to complete the additional steps under instructions on target board for NCS2.