Giter Site home page Giter Site logo

tflite-esp-template's Introduction

template

Table of Contents:

  1. General information
  2. Requirements
  3. ARCHITECTURE
  4. CONTRIBUTING
  5. LICENSE
  6. Contact

General information

This repository contains a template which you can use to develop your own TinyML projects with an ESP-Board of your choice and the ESP-IDF.

The provided template is based on the TinyML pipeline which you can find in Pete Warden’s and Daniel Situnayake’s TinyML book. Our pipeline consists of five steps. First, data collection requires connecting with hardware and reading data to your PC. Second, preprocessing involves reshaping data into a format suited for training a ML model. Third, design and training. Training is done using Google’s TensorFlow framework. Fourth, the model must be converted from TensorFlow to Tensorflow Lite and then to a C or C++ compatible format. Lastly, we deploy the model onto a microcontroller and run inference.

Requirements

Python, model creation

Python

Install Python. Version 3.10 is tested.

Install packages

pip install -r requirements.txt

Embedded C/C++, embedded model deployment

Espressif IDF

Version 4.4.2 is tested. Install via VSCode > Extensions > ESP-IDF > Express installation with all defaults. At the end of the installation a command is shown. This command should be executed to grant complete permissions.

Libraries

Next, download dependencies for the embedded system.

chmod +x scripts/update_components.sh
./scripts/update_components.sh

Respect the pipeline requirements

  1. Data must be present in order to start training.
  2. Preprocessing may be necessary.
  3. A model must be trained and stored.
  4. The model must be converted to a C array and included in the embedded code.
  5. You cannot run your project on an MCU before completing above steps.

Running

Python environment

Execute Jupyter files via GUI.

Embedded environment

See ESP documentation for an initial setup of the embedded environment. Afterwards, feel free to use this shorthand.

get_idf && idf.py build && idf.py -p /dev/ttyUSB0 flash monitor

Architecture

The architecture of this repository is designed to be simple and self explanatory. You can find a detailed description in the ARCHITECTURE.md file.

Contributing

Pull requests are welcome. We don't have a specific template for PRs. Please follow style guides for Python and C++. For Python style, we follow PEP 8 and PEP 257. For C++ we follow the Google style guide.

License

Copyright (c) 2022 itemis AG
All rights reserved.

This source code is licensed under the Apache-2.0 license found in the license file in the root directory of this source tree.

Contact

Feel free to contact us if you have any questions!

[email protected]
[email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.