ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

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


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:)


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);
}




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