OSC and Teachable Machine

Dear all

I’m looking for some advice on an educational activity.

I recently trained an AI model using Teachable Machine. The model recognises images captured in real time by the computer’s webcam. I then exported the model via a link to a block-based programming platform called Stretch3 (a fork of Scratch), where I activated the webcam and associated sounds with the captured images.

The experiment was a success. However, my educational aim is to move on to writing lines of code and do the same thing using Sonic Pi. I’m not an expert in OSC, so I’m here to ask for advice: I’m looking for a resource that will allow me to upload the model created with Teachable Machine, which is capable of activating the camera and sending OSC signals to Sonic Pi. I’d prefer not to use the Terminal, as this would make things too complicated for my classes.

I apologise in advance if my question isn’t very clear, but I’m a bit confused myself!

All the best!

Roberto

It sounds like you need an environment that can run the Teachable Machine model and also can send OSC messages. I don’t know if Stretch3 has anything for sending OSC, but you should be able to do this in Python. I found this example of using a Teachable Machine model with a webcam in Python: https://www.hackster.io/mjdargen/easy-object-detection-with-teachable-machine-python-d4063b. There are also Python libraries for sending OSC (I’ve used oscpy before, and I know there are several others), you’ll just have to work out how to wire them together. If you don’t want to use the terminal there are lots of IDEs that support Python.

1 Like

Hi emlyn.

I’ve only just seen your reply. Unfortunately, I didn’t receive a notification, so I’m replying a bit late. Thanks for letting me know. As a beginner, Python is still a bit beyond me, but I’ll get round to learning it…