Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Unknown Country
Asked
Resolved Resolved by DJ Sures!

Using Variables For TY2 And Camera

Hi,
I may just be missing something, but how do you use variables in different skills together.

As an example,
If I wanted to make it so every time Tiny Yolo 2 detects a "Person" it says "Hello" TTS using EZ script?

Thanks for your time.


Related Hardware EZ-Robot EZ-B v4
AI Support Bot
Related Content
Synthiam
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
PRO
Synthiam
#1   — Edited
Here's the manual page for tiny yolo: https://synthiam.com/Support/Skills/Camera/Tiny-Yolo2?id=20002

You can access it by pressing the ? (Question mark) on the robot skill. Every robot skill has that question mark which will bring you to the respective manual page.

The variables that tiny yolo creates are explained in the manual page. You can determine how many objects were found by the $YoloFoundCnt variable. Then you can reference the Name of the objects by each array index. 

To be safe, you can do something like this in some script that loops... (I only use JavaScript hehe) So this is a JavaScript example. Just use the JavaScript tab when editing your script/code

Code:


while (true) {

// speak the first detected object
if (getVar("$YoloFoundCnt") > 0) {

Audio.say("I see a " + getVar("$YoloFoundNames"));
}

// pause for a second
sleep(1000);
}
User-inserted image
PRO
Synthiam
#2   — Edited
Oh, and if you want to speak every detected object - this is a kind of neat little code snippet that I just came up with:)

Code:


while (true) {

// get array of names from global vars to a local var
var names = getVar("$YoloFoundNames]");

for (var i=0; i < names.length; i++) {

if (i == 0)
Audio.say("I see a " + names[i]);
else
Audio.say("and a " + names[i]);
}

// pause for a second
sleep(1000);
}



PRO
Unknown Country
#3  
Thanks:) . I appreciate the quick response.
PRO
Synthiam
#4  
No problem. It might actually be more useful if the tiny yolo robot skill executed a script when objects detected. We should make that addition