Forum >Replies by adumont
userhead adumont
Replies (6)
  • You Reply:
    wangyf8797 wrote:
    Tue Nov 10, 2020 2:28 am
    hi bro,sorry for my late.The saved kmodel only contains the weights, and what i learned so far is that the files mentioned in the articles(.tflite .kmodel) are not suppported.
    I will contact you if there are new answers,and i am also curious about that.
    Hi, if the same model architecture is used both on the HL and on the Training computer, I would think the weight file generated on the comuter should be the same format and we could "import" it, don't you think?
  • You Reply: 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.
  • You Reply: Hello,
    I need to be able to trigger the learning button with code. How is this done? Are you going to update the library or can you point me to figuring out how to trigger the learning button? You should be able to trigger a learn action by issuing a COMMAND_REQUEST_LEARN (0x36) command with the huskylens.writeLearn() call in Arduino. See Protocol.

    See this arduino example:
    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.
  • You Reply:
    wangyf8797 wrote:
    Mon Oct 19, 2020 9:50 am
    two tips:
    1. The SD card needs to be formatted as FAT32
    2. When importing models, only models with the same algorithm are supported, and models with different algorithms cannot be imported.
    Very interesting. Now if you could train a pretrained model (using transfer learning) on the computer (using lots of images), and generate the corresponding kmodel with the trained weights, that would be very cool. I wonder if the saved kmodel is only the weights or the whole model (network architecture + weights).

    I have seen an article that shows how to generate kmodel files, maybe we could use that?

    https://www.instructables.com/Object-De ... endryte-K/
    https://colab.research.google.com/githu ... 7yAbYbjV2s
  • You Reply: I am also interested in that.
  • You Reply: Hi Nana,
    Has the "multiple simultaneaous algorithms" been released?
    THanks in advance
    Alex