Before you begin
To work through this guide, you need a Raspberry Pi 4 with Raspbian 10 operating system.
You must install the following software on the Raspberry Pi:
Arm NN version 20.05 or newer.
See armnn/README.md for installation instructions.
See pyarmnn/README.md for installation instructions.
These software packages might have further prerequisites. See the installation instructions for each package for more information.
For complete and up-to-date installation information, always refer to the previous README links. However, for your convenience, we provide, at the end of this section, a list of the commands that we used to install Arm NN and PyArmNN.
The installation links referenced earlier use
OpenCV 3. If you want to use OpenCV 4 instead, you can follow the instructions
OpenCV 4 on your Raspberry Pi. The sample application in this guide needs
to have the
WITH_OPENCL flags enabled. In Step
#5: CMake and compile OpenCV 4 for your Raspberry Pi, enable the flags using the following command:
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_NEON=ON -DOPENCV_ENABLE_NONFREE=ON -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_TEST=OFF -DWITH_GTK=ON -DWITH_OPENCL=ON -DWITH_LIBV4L=ON -DWITH_V4L=OFF
PYTHONPATH environment variable to
The following code builds Arm NN and installs PyArmNN: