samples/modules/tflite-micro/magic_wand/README.html · samples/modules/tflite-micro/magic_wand/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · TFLM

TensorFlow Lite Micro Magic Wand

Renode의 LiteX/VexRiscv에서 ring과 slope gesture를 번갈아 분류합니다.

Official pathsamples/modules/tflite-micro/magic_wand/README.html
Source filesamples/modules/tflite-micro/magic_wand/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

TFLM module, Renode 1.12, 전체 ASCII gesture와 project Kconfig를 보존합니다.

Model

20 KB

Gestures

Ring · Slope

Emulator

Renode

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 1F80A1B4B36F61D55FC4EF85F42264BEE4663F225697A13CB31CBD9E233A869F
.. _tensorflow_magic_wand:

TensorFlow Lite Micro Magic Wand sample
#######################################

Overview
********

This sample application shows how to use TensorFlow Lite Micro
to run a 20 kilobyte neural network model that recognizes gestures
from an accelerometer.

.. Note::
    This README and sample have been modified from
    `the TensorFlow Magic Wand sample for Zephyr`_ and
    `the Antmicro tutorial on Renode emulation for TensorFlow`_.

.. _the TensorFlow Magic Wand sample for Zephyr:
    https://github.com/tensorflow/tflite-micro-arduino-examples/tree/main/examples/magic_wand

.. _the Antmicro tutorial on Renode emulation for TensorFlow:
    https://github.com/antmicro/litex-vexriscv-tensorflow-lite-demo

Building and Running
********************

Add the tflite-micro module to your West manifest and pull it:

.. code-block:: console

    west config manifest.project-filter -- +tflite-micro
    west update

The application can be built for the :ref:`litex-vexriscv` for
emulation in Renode as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/modules/tflite-micro/magic_wand
   :host-os: unix
   :board: litex_vexriscv
   :goals: build
   :compact:

Once the application is built, `download and install Renode 1.12 or higher as a package`_
following the instructions in the `Renode GitHub README`_ and
start the emulator:

.. code-block:: console

    renode -e "set zephyr_elf @./build/zephyr/zephyr.elf; s @./samples/modules/tflite-micro/magic_wand/renode/litex-vexriscv-tflite.resc"

.. _download and install Renode 1.12 or higher as a package:
    https://github.com/renode/renode/releases/

.. _Renode GitHub README:
    https://github.com/renode/renode/blob/master/README.rst

Sample Output
=============

The Renode-emulated LiteX/VexRiscv board is fed data that the
application recognizes as a series of alternating ring and slope
gestures.

.. code-block:: console

    Got accelerometer, label: accel-0

    RING:
              *
           *     *
         *         *
        *           *
         *         *
           *     *
              *

    SLOPE:
            *
           *
          *
         *
        *
       *
      *
     * * * * * * * *

    RING:
              *
           *     *
         *         *
        *           *
         *         *
           *     *
              *

    SLOPE:
            *
           *
          *
         *
        *
       *
      *
     * * * * * * * *

Modifying Sample for Your Own Project
*************************************

It is recommended that you copy and modify one of the two TensorFlow
samples when creating your own TensorFlow project. To build with
TensorFlow, you must enable the below Kconfig options in your :file:`prj.conf`:

.. code-block:: cfg

    CONFIG_CPP=y
    CONFIG_REQUIRES_FULL_LIBC=y
    CONFIG_TENSORFLOW_LITE_MICRO=y

Training
********
Follow the instructions in the :file:`train/` directory to train your
own model for use in the sample.

Part 3

한국어 전문 번역

개요

이 sample application은 TensorFlow Lite Micro를 사용해 accelerometer의 gesture를 인식하는 20KB neural network model을 실행하는 방법을 보여줍니다.

이 README와 sample은 TensorFlow Magic Wand sample for Zephyr와 TensorFlow용 Renode emulation Antmicro tutorial을 수정한 것입니다.

Build와 실행

West manifest에 tflite-micro module을 추가하고 내려받습니다.

west config manifest.project-filter -- +tflite-micro
west update

Renode에서 emulation하도록 litex_vexriscv용 application을 build합니다.

west build -b litex_vexriscv samples/modules/tflite-micro/magic_wand

Build가 끝나면 Renode 1.12 이상을 package로 내려받아 설치하고, Renode GitHub README의 지침에 따라 emulator를 시작합니다.

renode -e "set zephyr_elf @./build/zephyr/zephyr.elf; s @./samples/modules/tflite-micro/magic_wand/renode/litex-vexriscv-tflite.resc"

Sample 출력

Renode가 emulation하는 LiteX/VexRiscv board에는 application이 ring과 slope gesture가 번갈아 나타나는 series로 인식할 data가 공급됩니다.

Got accelerometer, label: accel-0

RING:
          *
       *     *
     *         *
    *           *
     *         *
       *     *
          *

SLOPE:
        *
       *
      *
     *
    *
   *
  *
 * * * * * * * *

RING:
          *
       *     *
     *         *
    *           *
     *         *
       *     *
          *

SLOPE:
        *
       *
      *
     *
    *
   *
  *
 * * * * * * * *

자체 project용 sample 수정

자체 TensorFlow project를 만들 때는 TensorFlow sample 두 개 중 하나를 복사해 수정하는 방법을 권장합니다. TensorFlow를 포함해 build하려면 prj.conf에서 다음 Kconfig option을 활성화해야 합니다.

CONFIG_CPP=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_TENSORFLOW_LITE_MICRO=y

Training

Sample에서 사용할 자체 model을 training하려면 train/ directory의 지침을 따르십시오.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.