userHead Account cancelled 2022-01-02 03:24:58 480 Views2 Replies
Hello everyone,

when using the object recognition algorithm has anyone figured out how to only select the type of object seen.
For example: when the Huskylens see a car, it only shows "Car" through the display but not the serial.
I do not care about ID#, all I need is to be able to do something like this:

Switch (objectType){
case 0: //car
case 1: //cat
etc, etc

Thanks a lot
2022-03-21 06:08:25 I had the same issue. In "Object Recognition" mode: while there are 20 or so predefined objects, there is a bit of a "trick" needed to associate an ID number with each recognized object when monitoring the serial data. I used the Python lib to query the serial "block" data from the huskylens. At first, serial data seemed useless, as "ID" was always set to "0" regardless if the object being detected was "person", "dog", "car", etc... However, you need to enable multiple object learning (a hidden menu - see wiki doc). Next, you'll learn some of those 20 objects into respective ID number assignments. Yeah, that sounds confusing, was hold on. "Learn" is a bit misleading, as the object recognition is already pre-learned (built-in models), like "dog". So to give dog detection an actual ID number other than 0, you point the HuskyLens at a dog picture so it can detect a dog, then hit learn button, dog now gets ID 1 shown on the screen, hit learn again, now point at a Person picture, hit learn, person gets ID 2, hit learn, point at a car pic, car gets ID 3 ..... and you keep going (if you want). I just did those three and stopped. Again, you are not "learning" a new dog, or specific dog, you're simply teaching the husky to return a set number each time it detects one, hence why I used several staged stock photos at the ready. You are just getting Husky to detect dog on-screen, so you can assign a ID number to it with the learn button press. It's a really weird methodology, but is needed to make any of these pre-known objects detection object return a number other than 0.

Now in my Python code, I just hard-code 1 2 3 to those respective objects (in order of learned) to make my project take action based on what gets detected. Right now, as a test, I have my Pi 4 playing a different MP3 clip depending on if the Husky "sees" a dog, person, or car. WORKS !
userHeadPic console151