aboutsummaryrefslogtreecommitdiff
path: root/python/pyarmnn/examples
diff options
context:
space:
mode:
authorÉanna Ó Catháin <eanna.ocathain@arm.com>2020-09-10 13:02:37 +0100
committerJakub Sujak <jakub.sujak@arm.com>2020-10-02 15:57:53 +0000
commit6c3dee490483f4c20bee4c56fee4a1e8a095b89b (patch)
tree1f56947e59f1b121424b3a7f6613b36e0bc16a63 /python/pyarmnn/examples
parent5b5c222f6b0c40a8e0f9ef9dedccd6f0f18c4c2c (diff)
downloadarmnn-6c3dee490483f4c20bee4c56fee4a1e8a095b89b.tar.gz
PyArmNN Updates
* Updated setup.py to raise error on mandatory ext * Updated examples section of main readme * Added readme to img class * Moved img class to new subdir Change-Id: Iea5f6d87c97e571b8ca5636268231506538840c7 Signed-off-by: Éanna Ó Catháin <eanna.ocathain@arm.com> Signed-off-by: Jakub Sujak <jakub.sujak@arm.com>
Diffstat (limited to 'python/pyarmnn/examples')
-rw-r--r--python/pyarmnn/examples/image_classification/README.md46
-rw-r--r--python/pyarmnn/examples/image_classification/example_utils.py (renamed from python/pyarmnn/examples/example_utils.py)2
-rw-r--r--[-rwxr-xr-x]python/pyarmnn/examples/image_classification/onnx_mobilenetv2.py (renamed from python/pyarmnn/examples/onnx_mobilenetv2.py)2
-rw-r--r--python/pyarmnn/examples/image_classification/requirements.txt (renamed from python/pyarmnn/examples/requirements.txt)1
-rw-r--r--[-rwxr-xr-x]python/pyarmnn/examples/image_classification/tflite_mobilenetv1_quantized.py (renamed from python/pyarmnn/examples/tflite_mobilenetv1_quantized.py)2
5 files changed, 49 insertions, 4 deletions
diff --git a/python/pyarmnn/examples/image_classification/README.md b/python/pyarmnn/examples/image_classification/README.md
new file mode 100644
index 0000000000..61efbc421f
--- /dev/null
+++ b/python/pyarmnn/examples/image_classification/README.md
@@ -0,0 +1,46 @@
+# PyArmNN Image Classification Sample Application
+
+## Overview
+
+To further explore PyArmNN API, we provide an example for running image classification on an image.
+
+All resources are downloaded during execution, so if you do not have access to the internet, you may need to download these manually. The file `example_utils.py` contains code shared between the examples.
+
+## Prerequisites
+
+##### PyArmNN
+
+Before proceeding to the next steps, make sure that you have successfully installed the newest version of PyArmNN on your system by following the instructions in the README of the PyArmNN root directory.
+
+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())"
+'22.0.0'
+```
+
+##### Dependencies
+
+Install the dependencies:
+
+```bash
+$ pip install -r requirements.txt
+```
+
+## Perform Image Classification
+
+Perform inference with TFLite model by running the sample script:
+```bash
+$ python tflite_mobilenetv1_quantized.py
+```
+
+Perform inference with ONNX model by running the sample script:
+```bash
+$ python onnx_mobilenetv2.py
+```
+
+The output from inference will be printed as <i>Top N</i> results, listing the classes and probabilities associated with the classified image.
diff --git a/python/pyarmnn/examples/example_utils.py b/python/pyarmnn/examples/image_classification/example_utils.py
index e5425dde52..090ce2f5b3 100644
--- a/python/pyarmnn/examples/example_utils.py
+++ b/python/pyarmnn/examples/image_classification/example_utils.py
@@ -1,4 +1,4 @@
-# Copyright 2020 NXP
+# Copyright © 2020 NXP and Contributors. All rights reserved.
# SPDX-License-Identifier: MIT
from urllib.parse import urlparse
diff --git a/python/pyarmnn/examples/onnx_mobilenetv2.py b/python/pyarmnn/examples/image_classification/onnx_mobilenetv2.py
index 05bfd7b415..9e95f76dcc 100755..100644
--- a/python/pyarmnn/examples/onnx_mobilenetv2.py
+++ b/python/pyarmnn/examples/image_classification/onnx_mobilenetv2.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# Copyright 2020 NXP
+# Copyright © 2020 NXP and Contributors. All rights reserved.
# SPDX-License-Identifier: MIT
import pyarmnn as ann
diff --git a/python/pyarmnn/examples/requirements.txt b/python/pyarmnn/examples/image_classification/requirements.txt
index 9af2b27f5f..f97e85636e 100644
--- a/python/pyarmnn/examples/requirements.txt
+++ b/python/pyarmnn/examples/image_classification/requirements.txt
@@ -2,4 +2,3 @@ requests>=2.23.0
urllib3>=1.25.8
Pillow>=6.1.0
numpy>=1.18.1
-pyarmnn>=19.8.0
diff --git a/python/pyarmnn/examples/tflite_mobilenetv1_quantized.py b/python/pyarmnn/examples/image_classification/tflite_mobilenetv1_quantized.py
index cb2c91cba7..229a9b6778 100755..100644
--- a/python/pyarmnn/examples/tflite_mobilenetv1_quantized.py
+++ b/python/pyarmnn/examples/image_classification/tflite_mobilenetv1_quantized.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# Copyright 2020 NXP
+# Copyright © 2020 NXP and Contributors. All rights reserved.
# SPDX-License-Identifier: MIT
import numpy as np