Ml5-library: Example: Simple P5 version of Teachable Machine

Created on 17 Nov 2017  路  9Comments  路  Source: ml5js/ml5-library

Teachable Machine: Teachable Machine

The code is here: https://github.com/googlecreativelab/teachable-machine

I'd like to make a very simple version of it in p5.

Most helpful comment

Two things to investigate:

  • [ ] The first time I hit "train" the browser locks up for a few seconds. Subsequent calls to train do not have this issue.
  • [ ] Continuously training or predicting will throw an error unless there is some small amount of milliseconds wait time between receiving results and guessing again. I built this delay into the example, but it might be nice to handle this internally somehow.

I also have some thoughts about working with images in general, will file as a separate issue.

All 9 comments

great! I'm currently porting this that can be used as reference too.

Thank you!

I just pushed https://github.com/ITPNYU/p5-deeplearn-js/commit/03df180a434ed50bdcdb1fb97572161f07067c72 that implements the KNN Image Classifier.

demo

The working example is here

@yining1023 I think this will work to port the Teachable Machine to p5.
@shiffman what other examples do you think we could build with this?

This is amazing! I tried it. It worked perfectly.

I made some changes to the example and ran into some small issues that I think we could address to make it simpler / easier to use. Will file them here soon!

Two things to investigate:

  • [ ] The first time I hit "train" the browser locks up for a few seconds. Subsequent calls to train do not have this issue.
  • [ ] Continuously training or predicting will throw an error unless there is some small amount of milliseconds wait time between receiving results and guessing again. I built this delay into the example, but it might be nice to handle this internally somehow.

I also have some thoughts about working with images in general, will file as a separate issue.

I made this teachable machines example that outputs gifs. My next step would be using p5.sound.js to output sounds!

demo

@yining1023 When I found out about this library a few weeks ago I thought that a Teachable Machine-like example would be nice, but totally missed that you had already made one! Great job :D I'd be happy to help with expanding this example with p5.sound if you have something going on.

@achimkoh that would be great!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joeyklee picture joeyklee  路  5Comments

K1ngjulien picture K1ngjulien  路  6Comments

sps014 picture sps014  路  6Comments

bmoren picture bmoren  路  8Comments

harshitmahendra picture harshitmahendra  路  3Comments