From 6a9325374da8ecf1204f3948493da183dbf2fd28 Mon Sep 17 00:00:00 2001 From: Keith Moulton Date: Mon, 12 Apr 2021 11:32:37 -0400 Subject: [PATCH 1/6] fixed test_image.py script --- .../bare-metal/visual_wake_words/test_image.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/bare-metal/visual_wake_words/test_image.py b/examples/bare-metal/visual_wake_words/test_image.py index 7fd6f3a3a..47c5360dc 100755 --- a/examples/bare-metal/visual_wake_words/test_image.py +++ b/examples/bare-metal/visual_wake_words/test_image.py @@ -18,8 +18,8 @@ INPUT_SHAPE = IMAGE_SHAPE + (3,) INPUT_SCALE = 0.003921568859368563 INPUT_ZERO_POINT = -128 -# NORM_SCALE = 127.5 -# NORM_SHIFT = 1 +NORM_SCALE = 127.5 +NORM_SHIFT = 1 OUTPUT_SCALE = 1 / 256 OUTPUT_ZERO_POINT = -128 @@ -137,11 +137,11 @@ def send_blob(self, blob): else: print(f"Person {prob:0.2f}%") - img = np.frombuffer(raw_img, dtype=np.int8).reshape(INPUT_SHAPE) - # np_img = np.round( - # (dequantize(np_img, INPUT_SCALE, INPUT_ZERO_POINT) + NORM_SHIFT) * NORM_SCALE - # ).astype(np.uint8) + np_img = np.frombuffer(raw_img, dtype=np.int8).reshape(INPUT_SHAPE) + np_img = np.round( + (dequantize(np_img, INPUT_SCALE, INPUT_ZERO_POINT) + NORM_SHIFT) * NORM_SCALE + ).astype(np.uint8) # Show the image - pyplot.imshow(img) + pyplot.imshow(np_img) pyplot.show() From 81445d0eed64732a84760b5ee5e451338b008abe Mon Sep 17 00:00:00 2001 From: Keith Moulton Date: Mon, 12 Apr 2021 12:26:04 -0400 Subject: [PATCH 2/6] fixed redefinition of 'clock' as different kind of symbol --- .../inference_engine/src/inference_engine.cc | 7 +++++-- .../inference_engine/src/inference_engine.cc | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/bare-metal/hotdog_not_hotdog/inference_engine/src/inference_engine.cc b/examples/bare-metal/hotdog_not_hotdog/inference_engine/src/inference_engine.cc index f85e9e618..78dedef79 100644 --- a/examples/bare-metal/hotdog_not_hotdog/inference_engine/src/inference_engine.cc +++ b/examples/bare-metal/hotdog_not_hotdog/inference_engine/src/inference_engine.cc @@ -3,13 +3,16 @@ #include "inference_engine.h" -#include // for PLATFORM_REFERENCE_MHZ - #include #include #include #include +#ifdef _TIME_H_ +#define _clock_defined +#endif +#include // for PLATFORM_REFERENCE_MHZ + #include "hotdog_not_hotdog.h" #include "tensorflow/lite/micro/kernels/xcore/xcore_interpreter.h" #include "tensorflow/lite/micro/kernels/xcore/xcore_ops.h" diff --git a/examples/bare-metal/visual_wake_words/inference_engine/src/inference_engine.cc b/examples/bare-metal/visual_wake_words/inference_engine/src/inference_engine.cc index 7fba8d44c..84ba3a615 100644 --- a/examples/bare-metal/visual_wake_words/inference_engine/src/inference_engine.cc +++ b/examples/bare-metal/visual_wake_words/inference_engine/src/inference_engine.cc @@ -3,13 +3,16 @@ #include "inference_engine.h" -#include // for PLATFORM_REFERENCE_MHZ - #include #include #include #include +#ifdef _TIME_H_ +#define _clock_defined +#endif +#include // for PLATFORM_REFERENCE_MHZ + #include "tensorflow/lite/micro/kernels/xcore/xcore_interpreter.h" #include "tensorflow/lite/micro/kernels/xcore/xcore_ops.h" #include "tensorflow/lite/micro/kernels/xcore/xcore_profiler.h" From 00d83918dd4067c481bd3a099f19e23ef8ac4b4d Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 12 May 2021 18:30:09 -0400 Subject: [PATCH 3/6] Updated CI to use tools 15.0.6 (#131) updated CI to use tools 15.0.6 --- Jenkinsfile | 2 +- documents/tutorials/freertos/getting_started.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 74959e67c..ab51bc00b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { parameters { // Available to modify on the job page within Jenkins if starting a build string( // use to try different tools versions name: 'TOOLS_VERSION', - defaultValue: '15.0.5', + defaultValue: '15.0.6', description: 'The tools version to build with (check /projects/tools/ReleasesTools/)' ) booleanParam( // use to check results of rolling all conda deps forward diff --git a/documents/tutorials/freertos/getting_started.rst b/documents/tutorials/freertos/getting_started.rst index d1ac5e4c3..52dc0aaa5 100644 --- a/documents/tutorials/freertos/getting_started.rst +++ b/documents/tutorials/freertos/getting_started.rst @@ -116,7 +116,7 @@ These drivers are all found in the AIoT SDK under the path `modules/rtos/drivers Documentation on each of these drivers can be found under the :doc:`References/RTOS Drivers<../../reference/rtos_drivers/index>` section in the AIoT SDK documentation pages. -It is worth noting that these drivers utilize a lightweight RTOS abstraction layer, meaning that they are not dependent on FreeRTOS. Conceivably they should work on any SMP RTOS, provided an abstraction layer for it is provided. This abstraction layer is found under the path `modules/rtos/drivers/osal `_. At the moment the only available SMP RTOS for XCore is the XMOS SMP FreeRTOS, but more may become available in the future. +It is worth noting that these drivers utilize a lightweight RTOS abstraction layer, meaning that they are not dependent on FreeRTOS. Conceivably they should work on any SMP RTOS, provided an abstraction layer for it is provided. This abstraction layer is found under the path `modules/rtos/osal `_. At the moment the only available SMP RTOS for XCore is the XMOS SMP FreeRTOS, but more may become available in the future. XMOS also includes some higher level RTOS compatible software services, some of which the aforementioned drivers. These include, but are not necessarily limited to: From 8e74a16d41f8c24ce8a486e44a4ca34e89cd411c Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Thu, 13 May 2021 06:52:30 -0400 Subject: [PATCH 4/6] Updated tools name and version --- documents/quick_start/system-requirements.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/quick_start/system-requirements.rst b/documents/quick_start/system-requirements.rst index c00ea4e28..a6b14a947 100644 --- a/documents/quick_start/system-requirements.rst +++ b/documents/quick_start/system-requirements.rst @@ -33,6 +33,6 @@ support is mentioned where appropriate. Prerequisites ************* -`xTIMEComposer 15.0.5 + `_ and `CMake 3.14 `_ + are required for building the example applications. If necessary, download and follow the installation instructions for those components. +`XTC Tools 15.0.6 + `_ and `CMake 3.14 `_ + are required for building the example applications. If necessary, download and follow the installation instructions for those components. `Python 3.8 `_ + is required. We recommend you setup an `Anaconda `_ environment before installing. If necessary, download and follow Anaconda's installation instructions. From 28f73522cace563e2b2881400c5bf43b000c21ac Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Tue, 15 Jun 2021 19:17:34 -0400 Subject: [PATCH 5/6] Updated to tensorflow 2.4.2 --- tools/install/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install/requirements.txt b/tools/install/requirements.txt index 780390fae..47309a6df 100644 --- a/tools/install/requirements.txt +++ b/tools/install/requirements.txt @@ -4,7 +4,7 @@ dill==0.3.1.1 flatbuffers==1.12.0 matplotlib==3.3.4 numpy==1.19.5 -tensorflow==2.4.1 +tensorflow==2.4.2 typing-extensions==3.7.4 -e modules/aif/xcore_interpreters #-e tools/ai_tools/tflite2xcore From 69905e4bc8a4f43e1650134983b1ecd967d752b0 Mon Sep 17 00:00:00 2001 From: Keith Moulton Date: Tue, 22 Jun 2021 13:27:17 -0400 Subject: [PATCH 6/6] FreeRTOS AI examples now use 1 thread for inference --- examples/freertos/cifar10/README.rst | 2 +- .../freertos/cifar10/model/model_xcore.tflite | Bin 98192 -> 97984 bytes .../src/model_runner/cifar10_model_data.c | 162 ++++++++---------- .../src/model_runner/cifar10_model_runner.cc | 4 +- examples/freertos/person_detection/README.rst | 2 +- 5 files changed, 77 insertions(+), 93 deletions(-) diff --git a/examples/freertos/cifar10/README.rst b/examples/freertos/cifar10/README.rst index a9aa1e1de..602009b6a 100644 --- a/examples/freertos/cifar10/README.rst +++ b/examples/freertos/cifar10/README.rst @@ -118,7 +118,7 @@ First, be sure you have installed the XMOS AI Toolchain extensions. If installe .. code-block:: console - $ xformer.py --analyze -par 5 model/model_quant.tflite model/model_xcore.tflite + $ xformer.py --analyze -par 1 model/model_quant.tflite model/model_xcore.tflite Generating the model runner =========================== diff --git a/examples/freertos/cifar10/model/model_xcore.tflite b/examples/freertos/cifar10/model/model_xcore.tflite index 61322aca477de700d6e7fc651b8679fc3cfc4706..f6a7f149f5cac697d0efcce2f01cf794bc89b214 100644 GIT binary patch delta 582 zcmZ{gze_?<6vyxJy=(71vfgWwkP;ER4VFggEQpglD}u-br%)jwMXjMgp`oF{?au8% z1V#-F4bDxC4Gj(b5!vgU>`{qb_;7!4`JT@?J%>LGd2h`#IO!&Dl3>@PeU-60em8YC^0LcfU;nK z5UP^N7xCiD7s5h#!x+X0DoXnlLU|_cXUI81?}zfD2~l~~0Dno-D0w`%wpU}QxB9|3 zSAB)eiVEsXF;HF-VWD9iHyztx#2jKFuOB1(3ZD0oU9w-6k4-RgKb1mO1g+;sEhN)6 zwUEwzw?NSpNxK($!boa>hS5Rjy-E$FQl{y;|4#htp34---45)y?o6(_A^2LH37ks35oo}JyumN;;3ZY`E>`)zpEJ^=vBU&a6c delta 807 zcmbV~&r2IY6vyA&oyiYL;znDDkWi5orUwOs~VlD>42nHoM4gmZyCT36JTHfJS92u`xchbl5rQ`q{Y>6n4ptiNJpf7x$EN6 zHZp%9gkWeeHQ3n)2|>$zo_}eg`NU#EFth5kX_IuCwh$2;0q6l5z^_rNs-H#mjPxyh z|CMUpb2lqhFpwHLuVl%?tUPxyvu4EnNel>qX^3dJbCO!M20(7}zkzd>YI*w%S*nx! z_*mE?rY4i0>Nt@;xeokyX@&z*OZlIb?>rpYzDMh4`4#fL5QI?P_@F}As0AUY2q=F) zf(X?Oziui2POcgHm!}@i z#qV&v{GScYTdw6|14U9_v+{o=iymg==LSx#M<;z(QHTVP)G)4L0)jJqW;*vUss1!! jmWnSZ*rhQ}znV5UqAr-bqiwgxk#lS3QSV~Vz+bUHB#n1U diff --git a/examples/freertos/cifar10/src/model_runner/cifar10_model_data.c b/examples/freertos/cifar10/src/model_runner/cifar10_model_data.c index fae2e48e2..5897b9ca9 100644 --- a/examples/freertos/cifar10/src/model_runner/cifar10_model_data.c +++ b/examples/freertos/cifar10/src/model_runner/cifar10_model_data.c @@ -11,7 +11,7 @@ const unsigned char cifar10_model_data[] __attribute__((aligned(4))) = { 0x00, 0x12, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0xfc, 0x70, 0x01, 0x00, 0x30, 0x71, 0x01, 0x00, - 0x94, 0x7e, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, + 0xc4, 0x7d, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, @@ -7283,17 +7283,17 @@ const unsigned char cifar10_model_data[] __attribute__((aligned(4))) = { 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x2e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x88, - 0x05, 0x00, 0x00, 0x8c, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x44, 0x05, 0x00, 0x00, 0x68, 0x04, 0x00, - 0x00, 0xb4, 0x03, 0x00, 0x00, 0xe4, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, - 0x70, 0x01, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x14, + 0x14, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xb4, 0x04, 0x00, 0x00, 0xb8, + 0x04, 0x00, 0x00, 0xbc, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x74, 0x04, 0x00, 0x00, 0xc4, 0x03, 0x00, + 0x00, 0x30, 0x03, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, + 0x50, 0x01, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x1a, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x0b, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x1c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0xfc, 0xff, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xb4, 0xfc, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, 0x02, 0x00, 0x09, 0x04, 0x04, 0x01, 0x05, 0x28, @@ -7301,91 +7301,75 @@ const unsigned char cifar10_model_data[] __attribute__((aligned(4))) = { 0x00, 0x02, 0x00, 0x00, 0x28, 0xe0, 0x00, 0x05, 0x05, 0x02, 0x0d, 0x2a, 0x02, 0x01, 0x02, 0x0c, 0x17, 0x29, 0x24, 0x04, 0x24, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x28, 0xfd, 0xff, - 0xff, 0x0c, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, - 0x8a, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x02, 0x02, + 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xac, 0xfd, 0xff, + 0xff, 0x0c, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, + 0x69, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x02, 0x02, 0x02, 0x04, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x00, 0x02, 0x02, 0x02, 0x04, 0x04, 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, 0x02, 0x00, 0x0f, 0x04, 0x04, 0x02, 0x10, 0x1f, 0x04, 0x04, 0x02, 0x20, 0x2f, 0x04, 0x04, 0x02, 0x30, 0x3f, 0x04, 0x04, 0x04, 0x14, 0x10, 0x0c, 0x08, 0x28, 0x28, 0x28, 0x28, - 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x01, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x00, 0x01, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x24, 0x1c, 0x14, 0x0c, 0x28, 0x28, 0x28, 0x28, 0x03, 0x51, 0x32, 0x56, - 0x03, 0x01, 0x03, 0x3f, 0x10, 0x04, 0x28, 0x28, 0x04, 0x03, 0x65, 0x70, 0x7d, - 0x03, 0x01, 0x03, 0x0d, 0x70, 0x7b, 0x24, 0x28, 0x28, 0x06, 0x24, 0x01, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x28, 0xfd, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0xac, - 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x99, 0x00, - 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x02, 0x01, 0x01, 0x04, - 0x04, 0x70, 0x61, 0x64, 0x00, 0x02, 0xfe, 0xfe, 0x04, 0x04, 0x70, 0x61, 0x72, - 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, 0x02, 0x00, 0x0f, 0x04, 0x04, 0x02, - 0x10, 0x1f, 0x04, 0x04, 0x02, 0x20, 0x2f, 0x04, 0x04, 0x02, 0x30, 0x3f, 0x04, - 0x04, 0x04, 0x14, 0x10, 0x0c, 0x08, 0x28, 0x28, 0x28, 0x28, 0x72, 0x63, 0x00, - 0x04, 0x00, 0x00, 0x02, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x00, 0x02, - 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x02, 0x08, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x06, 0x00, 0x02, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x24, 0x1c, - 0x14, 0x0c, 0x28, 0x28, 0x28, 0x28, 0x03, 0x51, 0x32, 0x56, 0x03, 0x01, 0x03, - 0x3f, 0x10, 0x04, 0x28, 0x28, 0x04, 0x6d, 0x65, 0x6d, 0x00, 0x00, 0x02, 0x00, - 0x00, 0x32, 0xe0, 0x00, 0x05, 0x05, 0x04, 0x0e, 0x7c, 0x74, 0x8a, 0x04, 0x01, - 0x04, 0x0e, 0x7e, 0x1d, 0x89, 0x29, 0x28, 0x24, 0x28, 0x08, 0x24, 0x01, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, - 0x00, 0x03, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, - 0xa4, 0xfe, 0xff, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x8c, - 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, - 0x00, 0x02, 0x02, 0x02, 0x04, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x00, 0x02, 0x02, - 0x02, 0x04, 0x04, 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, - 0x02, 0x00, 0x0f, 0x04, 0x04, 0x02, 0x10, 0x1f, 0x04, 0x04, 0x02, 0x0a, 0x06, - 0x28, 0x28, 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, 0x02, 0x08, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x02, 0x00, 0x02, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, - 0x02, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x00, 0x02, 0x08, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x24, 0x1c, 0x14, 0x0c, 0x28, 0x28, 0x28, 0x28, 0x03, 0x43, - 0x32, 0x48, 0x03, 0x01, 0x03, 0x3b, 0x10, 0x04, 0x28, 0x28, 0x04, 0x03, 0x57, - 0x62, 0x6f, 0x03, 0x01, 0x03, 0x0d, 0x62, 0x6d, 0x24, 0x28, 0x28, 0x06, 0x24, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x94, 0xfe, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x9c, - 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8b, 0x00, - 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x02, 0x01, 0x01, 0x04, - 0x04, 0x70, 0x61, 0x64, 0x00, 0x02, 0xfe, 0xfe, 0x04, 0x04, 0x70, 0x61, 0x72, - 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, 0x02, 0x00, 0x0f, 0x04, 0x04, 0x02, - 0x10, 0x1f, 0x04, 0x04, 0x02, 0x0a, 0x06, 0x28, 0x28, 0x72, 0x63, 0x00, 0x04, - 0x00, 0x00, 0x04, 0x10, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x10, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x00, 0x04, 0x10, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x0c, 0x00, 0x04, 0x10, 0x04, 0x04, 0x04, 0x04, 0x04, 0x24, 0x1c, 0x14, - 0x0c, 0x28, 0x28, 0x28, 0x28, 0x03, 0x43, 0x32, 0x48, 0x03, 0x01, 0x03, 0x3b, - 0x10, 0x04, 0x28, 0x28, 0x04, 0x6d, 0x65, 0x6d, 0x00, 0x00, 0x02, 0x00, 0x00, - 0x32, 0xe0, 0x00, 0x05, 0x05, 0x04, 0x0e, 0x6e, 0x66, 0x7c, 0x04, 0x01, 0x04, - 0x0e, 0x70, 0x1d, 0x7b, 0x29, 0x28, 0x24, 0x28, 0x08, 0x24, 0x01, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, - 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x8c, - 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, - 0x00, 0x02, 0x02, 0x02, 0x04, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x00, 0x02, 0x02, - 0x02, 0x04, 0x04, 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, - 0x02, 0x00, 0x0f, 0x04, 0x04, 0x02, 0x10, 0x1f, 0x04, 0x04, 0x02, 0x0a, 0x06, - 0x28, 0x28, 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, 0x04, 0x10, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x00, 0x04, 0x10, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x00, - 0x04, 0x10, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0c, 0x00, 0x04, 0x10, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x24, 0x1c, 0x14, 0x0c, 0x28, 0x28, 0x28, 0x28, 0x03, 0x43, - 0x32, 0x48, 0x03, 0x01, 0x03, 0x3b, 0x10, 0x04, 0x28, 0x28, 0x04, 0x03, 0x57, - 0x62, 0x6f, 0x03, 0x01, 0x03, 0x0d, 0x62, 0x6d, 0x24, 0x28, 0x28, 0x06, 0x24, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x08, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, - 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, - 0x00, 0x9c, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x02, - 0x01, 0x01, 0x04, 0x04, 0x70, 0x61, 0x64, 0x00, 0x02, 0xfe, 0xfe, 0x04, 0x04, - 0x4b, 0x77, 0x00, 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, - 0x02, 0x00, 0x0f, 0x04, 0x04, 0x02, 0x10, 0x1f, 0x04, 0x04, 0x02, 0x0a, 0x06, - 0x28, 0x28, 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, 0x07, 0x20, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x07, 0x00, 0x06, 0x20, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0d, 0x00, - 0x06, 0x20, 0x04, 0x04, 0x04, 0x04, 0x04, 0x13, 0x00, 0x06, 0x20, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x19, 0x00, 0x07, 0x20, 0x04, 0x04, 0x04, 0x04, 0x05, 0x2d, - 0x25, 0x1d, 0x15, 0x0d, 0x28, 0x28, 0x28, 0x28, 0x28, 0x03, 0x4e, 0x3d, 0x53, - 0x03, 0x01, 0x03, 0x46, 0x12, 0x05, 0x28, 0x28, 0x04, 0x6d, 0x65, 0x6d, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x0a, 0xe0, 0x00, 0x05, 0x05, 0x05, 0x72, 0x0f, 0x7d, - 0x72, 0x8b, 0x05, 0x01, 0x05, 0x05, 0x10, 0x80, 0x1f, 0x8b, 0x04, 0x29, 0x28, + 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x01, + 0x09, 0x28, 0x03, 0x30, 0x11, 0x35, 0x03, 0x01, 0x03, 0x1e, 0x0a, 0x01, 0x28, + 0x28, 0x04, 0x03, 0x44, 0x4f, 0x5c, 0x03, 0x01, 0x03, 0x0d, 0x4f, 0x5a, 0x24, + 0x28, 0x28, 0x06, 0x24, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0xac, 0xfd, + 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, + 0x64, 0x65, 0x00, 0x02, 0x01, 0x01, 0x04, 0x04, 0x70, 0x61, 0x64, 0x00, 0x02, + 0xfe, 0xfe, 0x04, 0x04, 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, + 0x00, 0x02, 0x00, 0x0f, 0x04, 0x04, 0x02, 0x10, 0x1f, 0x04, 0x04, 0x02, 0x20, + 0x2f, 0x04, 0x04, 0x02, 0x30, 0x3f, 0x04, 0x04, 0x04, 0x14, 0x10, 0x0c, 0x08, + 0x28, 0x28, 0x28, 0x28, 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, 0x08, 0x08, 0x04, + 0x04, 0x04, 0x04, 0x01, 0x09, 0x28, 0x03, 0x30, 0x11, 0x35, 0x03, 0x01, 0x03, + 0x1e, 0x0a, 0x01, 0x28, 0x28, 0x04, 0x6d, 0x65, 0x6d, 0x00, 0x02, 0x00, 0x00, + 0x32, 0xe0, 0x00, 0x05, 0x05, 0x04, 0x0d, 0x5a, 0x52, 0x68, 0x04, 0x01, 0x04, + 0x0e, 0x5c, 0x1c, 0x67, 0x29, 0x28, 0x24, 0x28, 0x08, 0x24, 0x01, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0xe4, 0xfe, 0xff, + 0xff, 0x0c, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, + 0x5b, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x02, 0x02, + 0x02, 0x04, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x00, 0x02, 0x02, 0x02, 0x04, 0x04, + 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, 0x02, 0x00, 0x0f, + 0x04, 0x04, 0x02, 0x10, 0x1f, 0x04, 0x04, 0x02, 0x0a, 0x06, 0x28, 0x28, 0x72, + 0x63, 0x00, 0x04, 0x00, 0x00, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x01, 0x09, + 0x28, 0x03, 0x22, 0x11, 0x27, 0x03, 0x01, 0x03, 0x1a, 0x0a, 0x01, 0x28, 0x28, + 0x04, 0x03, 0x36, 0x41, 0x4e, 0x03, 0x01, 0x03, 0x0d, 0x41, 0x4c, 0x24, 0x28, + 0x28, 0x06, 0x24, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xd4, 0xfe, 0xff, 0xff, 0x10, + 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, + 0x02, 0x01, 0x01, 0x04, 0x04, 0x70, 0x61, 0x64, 0x00, 0x02, 0xfe, 0xfe, 0x04, + 0x04, 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, 0x02, 0x00, + 0x0f, 0x04, 0x04, 0x02, 0x10, 0x1f, 0x04, 0x04, 0x02, 0x0a, 0x06, 0x28, 0x28, + 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, 0x10, 0x10, 0x04, 0x04, 0x04, 0x04, 0x01, + 0x09, 0x28, 0x03, 0x22, 0x11, 0x27, 0x03, 0x01, 0x03, 0x1a, 0x0a, 0x01, 0x28, + 0x28, 0x04, 0x6d, 0x65, 0x6d, 0x00, 0x02, 0x00, 0x00, 0x32, 0xe0, 0x00, 0x05, + 0x05, 0x04, 0x0d, 0x4c, 0x44, 0x5a, 0x04, 0x01, 0x04, 0x0e, 0x4e, 0x1c, 0x59, + 0x29, 0x28, 0x24, 0x28, 0x08, 0x24, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, + 0x00, 0x5b, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x00, 0x02, + 0x02, 0x02, 0x04, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x00, 0x02, 0x02, 0x02, 0x04, + 0x04, 0x70, 0x61, 0x72, 0x00, 0x74, 0x68, 0x00, 0x63, 0x67, 0x00, 0x02, 0x00, + 0x0f, 0x04, 0x04, 0x02, 0x10, 0x1f, 0x04, 0x04, 0x02, 0x0a, 0x06, 0x28, 0x28, + 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, 0x10, 0x10, 0x04, 0x04, 0x04, 0x04, 0x01, + 0x09, 0x28, 0x03, 0x22, 0x11, 0x27, 0x03, 0x01, 0x03, 0x1a, 0x0a, 0x01, 0x28, + 0x28, 0x04, 0x03, 0x36, 0x41, 0x4e, 0x03, 0x01, 0x03, 0x0d, 0x41, 0x4c, 0x24, + 0x28, 0x28, 0x06, 0x24, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x14, 0x00, + 0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x84, 0x00, + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, + 0x69, 0x64, 0x65, 0x00, 0x02, 0x01, 0x01, 0x04, 0x04, 0x70, 0x61, 0x64, 0x00, + 0x02, 0xfe, 0xfe, 0x04, 0x04, 0x4b, 0x77, 0x00, 0x70, 0x61, 0x72, 0x00, 0x74, + 0x68, 0x00, 0x63, 0x67, 0x00, 0x02, 0x00, 0x0f, 0x04, 0x04, 0x02, 0x10, 0x1f, + 0x04, 0x04, 0x02, 0x0a, 0x06, 0x28, 0x28, 0x72, 0x63, 0x00, 0x04, 0x00, 0x00, + 0x20, 0x20, 0x04, 0x04, 0x04, 0x04, 0x01, 0x09, 0x28, 0x03, 0x22, 0x11, 0x27, + 0x03, 0x01, 0x03, 0x1a, 0x0a, 0x01, 0x28, 0x28, 0x04, 0x6d, 0x65, 0x6d, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x0a, 0xe0, 0x00, 0x05, 0x05, 0x05, 0x46, 0x0f, 0x51, + 0x46, 0x5f, 0x05, 0x01, 0x05, 0x05, 0x10, 0x54, 0x1f, 0x5f, 0x04, 0x29, 0x28, 0x24, 0x28, 0x0a, 0x24, 0x01, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, @@ -7563,4 +7547,4 @@ const unsigned char cifar10_model_data[] __attribute__((aligned(4))) = { 0x00, 0x00, 0x00, }; -const int cifar10_model_data_len = 98192; \ No newline at end of file +const int cifar10_model_data_len = 97984; \ No newline at end of file diff --git a/examples/freertos/cifar10/src/model_runner/cifar10_model_runner.cc b/examples/freertos/cifar10/src/model_runner/cifar10_model_runner.cc index 0f85c01b9..805b57ebe 100644 --- a/examples/freertos/cifar10/src/model_runner/cifar10_model_runner.cc +++ b/examples/freertos/cifar10/src/model_runner/cifar10_model_runner.cc @@ -22,12 +22,12 @@ void cifar10_resolver_get(void **v_resolver) // This pulls in all the operation implementations we need. if (resolver == nullptr) { resolver = &resolver_s; - resolver->AddPad(); resolver->AddSoftmax(); + resolver->AddPad(); resolver->AddCustom(tflite::ops::micro::xcore::FullyConnected_8_OpCode, tflite::ops::micro::xcore::Register_FullyConnected_8()); resolver->AddCustom(tflite::ops::micro::xcore::Conv2D_Deep_OpCode, tflite::ops::micro::xcore::Register_Conv2D_Deep()); - resolver->AddCustom(tflite::ops::micro::xcore::MaxPool2D_OpCode, tflite::ops::micro::xcore::Register_MaxPool2D()); resolver->AddCustom(tflite::ops::micro::xcore::Conv2D_Shallow_OpCode, tflite::ops::micro::xcore::Register_Conv2D_Shallow()); + resolver->AddCustom(tflite::ops::micro::xcore::MaxPool2D_OpCode, tflite::ops::micro::xcore::Register_MaxPool2D()); } *v_resolver = static_cast(resolver); diff --git a/examples/freertos/person_detection/README.rst b/examples/freertos/person_detection/README.rst index daab04605..bda402f34 100644 --- a/examples/freertos/person_detection/README.rst +++ b/examples/freertos/person_detection/README.rst @@ -101,7 +101,7 @@ First, be sure you have installed the XMOS AI Toolchain extensions. If installe .. code-block:: console - $ xformer.py --analyze -par 5 model/person_detect_quant.tflite model/person_detect_xcore.tflite + $ xformer.py --analyze -par 1 model/person_detect_quant.tflite model/person_detect_xcore.tflite Generating the model runner ===========================