PyTorch ExecuTorch - Custom Extension

Hi!

I’m a long time teacher and work for Edge Impulse and contribute to ExecuTorch and wrote some examples for Microbit on Tensorflow back in the day now coming back to Android and App Inventor to help out with making some ML example blocks but realise that there are many AI extensions, and tutorials.

Given that it matters very little to the students learning about the block what is running “under the hood” so to speak. I would love to get some feedback from the community on what kinds of AI / ML examples are lacking currently. Then make this as the showcase for PyTorch / ExecuTorch tutorial as a way to fill that gap for example:

Wake word to action

Shake phone to action

Classification

Detect and track an object
Pose estimation (not sure if this one will work yet, but keen to try)

Let me know what you think :smiley:

Best

Eoin

My vote to classification

1 Like

Thanks @davidefa ! For sure that makes sense,

A short script to show how to train a model with pytorch to compile to pte ExecuTorch for more advanced users that want to expore that then.

We want to make a short tutorial for this block too in docs about training vs inference for students and share the training dataset and scripts so those who want to go deeper can do so on the ExecuTorch docs then

Classification for sure of images on pretrained pte we load, Fruit I think makes the most universally accessible example, but happy to hear what others think

Best

Eoin

Oh also I LOVE to see the lego mindstorms blocks have been added, I absolutely want to add a connector from ExecuTorch to those for my own EV3 robot hacking with the kids :smiley:

So for starters I’ve got this tested and it works on my Android Pixel 7A as seen in this gif of a screen recording, dataset is very small only 3 classes Banana Apple and Orange.

It will put any image you feed into one bucket and run the inference on your phone.
ExecuTorch Fruit Classification App Demo

This is the most important thing for students to learn that they are running the model on their phone, and this model can be trained again by running the script in the repo on any consumer grade laptop

ExecuTorch Fruit Classification App Demo

[mod edit] Download :smiley:

2 Likes

Does anyone know what licensing is best to work with for datasets and model examples? I was thinking of making a functional example with one of the Yolo models and a Classification example:

So users can learn about training a classifier and about functionally using yolo for applications like robotics and in car android cameras etc.

Can't see images in your post.

Tried your demo aia, but it crashes calling ExecuTorch1.RunImage ( both in companion and apk )
Wanted to give a try to the multi-ABI version, but it returns an error "Import Extension Failed! null" when trying to import.