Auxiliary Function-SD Card saving/loading models

Last revision 2026/01/20

This article explores how HUSKYLENS uses SD cards to save and load models, allowing efficient data management across multiple algorithms. It covers manual and automated methods to export/import models, with detailed steps on using micro:bit, Arduino, Mind+, and MakeCode for model management.

HUSKYLENS supports taking multiple objects learned from the same algorithm as one data model. The SD card can be used to save the model. The model can be reloaded even if all the data from the current algorithm is deleted, allowing HUSKYLENS to automatically learn the data in the model. By saving the model, HUSKYLENS can be used for multiple scenes in one algorithm. For example, in the object classification algorithm, learn rock-paper-scissors as one model and garbage classification as one model. Then, through model switching, the required functions can be quickly realized to avoid repeating learning.

This function requires an SD card, which needs to be formatted as FAT32. All 7 algorithms, each of which can save 5 models, support SD card saving and loading models.

Method 1: Operate manually under the secondary menu of each algorithm

Here we take the object classification function as a demonstration. The usage in other algorithms are the same.

  1. Learn new objects:
    Let HUSKYLENS learn several new objects. For example: in the object classification function, learn several animals with different ID numbers in turn.

  2. Export model:
    long press "Function Button" to enter parameter settings interface of the secondary menu in the classification function, and then dial "Function Button" to the right until the option of “export to SD card" (that is, save the model to the SD card). Short press "Function Button", dial "Function Button", select anyone from 0 to 4(equivalent to select the save location, making it easy to distinguish the different models), then short press "Function Button" to save the model.
    Huskylens_Exporting_Model

    After the model is exported to the SD card, read the SD card with the computer, and you can see the model data file with suffix .conf in the "HUSKYLENS" folder. The file names saved by different algorithms are different. Shown as below:
    Huskylens_Model_File

    According to the names of the files, we can know which algorithm function the exported model data file belongs to. The pictures learned in each model cannot be viewed.

  3. Import model:
    When the model data file is already in the SD card, we can directly import it into HUSKYLENS. For example, in the object classification function, if the model data file of object classification is already in the SD card, then, just select "Import from SD Card" in parameter setting interface of secondary menu of object classification function, and select anyone from 0 to 4 to load the model into HUSKYLENS.

    After importing the model, HUSKYLENS can realize recognition using the current model.
    Huskylens_Imported_Model

    When importing models, only models with the same algorithm are supported.

Method 2: Make A Program to Trigger Saving/Loading Models

In this way, micro:bit, Arduino, and other mainboards can be used to automatically trigger the saving or loading of model files. The following code block can be used to achieve this function.

  • Mind+ Block:
    Trigger_Saving_Loading_Models_Mindplus

  • MakeCode Block:

Trigger_Saving_Loading_Models_MakeCode

  • Arduino function:
bool saveModelToSDCard(int fileNum);
bool loadModelFromSDCard(int fileNum);

Was this article helpful?

TOP