aboutsummaryrefslogtreecommitdiff
path: root/python/pyarmnn/examples/image_classification/README.md
blob: a360f01148b156c3fa54235b8b8b369f821e757a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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())"
'30.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.