From 417abd436573c0b6f3def468f69211b653e35f1f Mon Sep 17 00:00:00 2001 From: Francis Murtagh Date: Wed, 25 Jan 2023 16:18:45 +0000 Subject: GitHub #651: Add PyArmNN installation instructions for prebuilt binaries * Previous instruction didn't generate SWIG wrappers. Signed-off-by: Francis Murtagh Change-Id: I8e4a28ad334fc7fec1740d520d1fde9359c30397 --- python/pyarmnn/README.md | 40 +++++++++++++++++++++++++++++++++++++++- python/pyarmnn/README.md.license | 2 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/python/pyarmnn/README.md b/python/pyarmnn/README.md index 3962e11395..0defd910b0 100644 --- a/python/pyarmnn/README.md +++ b/python/pyarmnn/README.md @@ -50,7 +50,7 @@ The recommended way to build the python packages is by CMake. ### CMake build -The recommended aproach is to build PyArmNN together with Arm NN by adding the following options to your CMake command: +The recommended approach is to build PyArmNN together with Arm NN by adding the following options to your CMake command: ``` -DBUILD_PYTHON_SRC=1 ``` @@ -113,6 +113,44 @@ $ python -c "import pyarmnn as ann;print(ann.GetVersion())" '32.0.0' ``` + +## Installing PyArmNN while using ArmNN prebuilt binaries + +If you wish to use ArmNN prebuilt binaries from our release page, you will need to generate the PyArmNN SWIG wrappers. + +Again setup your environmental variables along with a virtual environment: + +```bash +$ python -m venv env +$ source env/bin/activate + +$ export ARMNN_LIB=/path/to/libs +$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libs +$ export ARMNN_INCLUDE=/full/path/to/armnn/include:/full/path/to/armnn/profiling/common/include +``` + +Then generate the SWIG wrappers: +```bash +$ cd armnn/python/pyarmnn/ +$ python swig_generate.py -v +``` + +Then install PyArmNN: +```bash +# From directory armnn/python/pyarmnn/ +$ pip install . +``` + +As above, you can verify that PyArmNN library is installed and check PyArmNN version using: +```bash +$ pip show pyarmnn +``` +You can also verify it by running the following and getting output similar to below: +```bash +$ python -c "import pyarmnn as ann;print(ann.GetVersion())" +'32.0.0' +``` + # PyArmNN API overview #### Getting started diff --git a/python/pyarmnn/README.md.license b/python/pyarmnn/README.md.license index 6b63511843..d1f04aeae2 100644 --- a/python/pyarmnn/README.md.license +++ b/python/pyarmnn/README.md.license @@ -1,4 +1,4 @@ # -# Copyright © 2020-2022 Arm Ltd and Contributors. All rights reserved. +# Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved. # SPDX-License-Identifier: MIT # -- cgit v1.2.1