HuskyLens is an easy-to-use AI machine vision sensor. It is equipped with multiple functions, such as face recognition, object tracking, object recognition, line tracking, color recognition, and tag(QR code) recognition.
#43225
Is there a way to "teach" the Husky with multiple photos per class? (similar to teaching multiple shots of the same face in the Face recognition algorithm, then all would recognize the same Face ID).

What I mean, for example, in the facemasks example, I would like take like 5 or 10 shots of people with "surgical mask" (class1), another 5-10 shots of people with FFP2/KN95 masks (class2), then another 5-10 shots of people with no masks (class3).

Is it possible? I haven't managed to do so. Each time I click to learn something new, it gets a new ID, it's not learning a new photo of the same class.
#43380
Yes, it is possible. You can let HuskyLens learn the multiple photos of the same object with keep pressing the learning button. Do not release it, otherwise HuskyLens will mark it as a new object.
So what you do is just keep pressing the learning button.
More information can be found on the wiki: https://wiki.dfrobot.com/HUSKYLENS_V1.0 ... #target_21
#43435
adumont wrote:
Sat Sep 26, 2020 6:21 pm
Is there a way to "teach" the Husky with multiple photos per class? (similar to teaching multiple shots of the same face in the Face recognition algorithm, then all would recognize the same Face ID).

What I mean, for example, in the facemasks example, I would like take like 5 or 10 shots of people with "surgical mask" (class1), another 5-10 shots of people with FFP2/KN95 masks (class2), then another 5-10 shots of people with no masks (class3).

Is it possible? I haven't managed to do so. Each time I click to learn something new, it gets a new ID, it's not learning a new photo of the same class.
I have found this way (I have to test it). The Huskylens protocol has a command to trigger a learn action for a specific ID: trigger a learn action by issuing a COMMAND_REQUEST_LEARN (0x36) command with the huskylens.writeLearn() call in the Arduino API. See Protocol.

For example this arduino sketch:
Code: Select all
#include "HUSKYLENS.h"

HUSKYLENS huskylens;

void setup() 
{
    Serial.begin(115200);
    pinMode(A0,INPUT_PULLUP);
    Wire.begin();
    while (!huskylens.begin(Wire))
    {
        Serial.println(F("Begin failed!"));
        delay(100);
    }
}

void loop() 
{
  if(digitalRead(A0) == 0)
  {
     while (!huskylens.writeLearn(1))  // bool writeLearn(int ID)
    {
      Serial.println(F("learn object ID1 failed!")); 
      delay(100);
    }
    Serial.println(F("learn object ID1 success")); 
  }
}
Each time you'll ground the A0 pin in this example, the Huskylens will learn a new image for ID1. You can adapt the code to learn multiple classes (by using more pins for example). At the end, save the model to SD card to keep it for example.