Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom SVM block examples for Edge Impulse

This repository is an example on how to add a custom learning block to Edge Impulse. This repository contains a Support Vector Machine model written in scikit-learn.

As a primer, read the Custom learning blocks page in the Edge Impulse docs.

Running the pipeline

You run this pipeline via Docker. This encapsulates all dependencies and packages for you.

Running via Docker

  1. Install Docker Desktop.

  2. Install the Edge Impulse CLI v1.16.0 or higher.

  3. We need an Edge Impulse project with some data. Preferably create a new one and upload your own data, or alternatively clone a classification project, e.g. Tutorial: continuous motion recognition

  4. Open a command prompt or terminal window.

  5. Initialize the block:

    $ edge-impulse-blocks init
    
  6. Fetch new data via:

    $ edge-impulse-blocks runner --download-data data/
    
  7. Build the container:

    $ docker build -t custom-ml-svm .
    
  8. Run the container to test the script (you don't need to rebuild the container if you make changes):

    $ docker run --rm -v $PWD:/app custom-ml-svm --data-directory /app/data --out-directory out/ --max-iter -1
    
  9. This creates a .pkl file in the out/ directory.

Adding extra dependencies

If you have extra packages that you want to install within the container, add them to requirements.txt and rebuild the container.

Adding new arguments

To add new arguments, see Custom learning blocks > Arguments to your script.

Fetching new data

To get up-to-date data from your project:

  1. Install the Edge Impulse CLI v1.16 or higher.

  2. Open a command prompt or terminal window.

  3. Fetch new data via:

    $ edge-impulse-blocks runner --download-data data/
    

Pushing the block back to Edge Impulse

You can also push this block back to Edge Impulse, that makes it available like any other ML block so you can retrain your model when new data comes in, or deploy the model to device. See Docs > Adding custom learning blocks for more information.

  1. Push the block:

    $ edge-impulse-blocks push
    
  2. The block is now available under any of your projects via Create impulse > Add new learning block.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages