1 Star 0 Fork 5K

seashell / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
唤醒词识别配置文件的开发示例.md 2.26 KB
一键复制 编辑 原始数据 按行查看 历史
mamingshuai 提交于 2021-06-02 01:00 . update OpenHarmony 2.0 Canary

唤醒词识别配置文件的开发示例

  1. 代码路径//foundation/ai/engine/services/common/protocol/plugin_config/plugin_config_ini/中添加唤醒词识别的配置文件

    [base]
    supported_boards = hi3516dv300
    related_sessions = asr_keyword_spotting+20001002
    
    //[asr_keyword_spotting+20001002]的命名规则为[算法名称+算法version]
    [asr_keyword_spotting+20001002]
    AID         = asr_keyword_spotting
    VersionCode = 20001002
    VersionName = 2.00.01.002
    XPU         = NNIE
    District    = China
    // 编译出的插件so所在的位置
    FullPath    = /usr/lib/libasr_keyword_spotting.so
    Chipset     = ALL
    ChkSum      = ''
    Key         = ''
  2. 代码路径//foundation/ai/engine/services/common/protocol/plugin_config/aie_algorithm_type.h文件中添加唤醒词识别算法类型id。

    // 唤醒词识别的算法类型id与唤醒词识别在ALGORITHM_TYPE_ID_LITS中的序号一一对应
    const int ALGORITHM_TYPE_KWS = 3;
  3. 代码路径//foundation/ai/engine/services/server/plugin_manager/include/aie_plugin_info.h文件中添加唤醒词识别算法名称及在ALGORITHM_TYPE_ID_LITS中的序号

    const std::string ALGORITHM_ID_SAMPLE_1 = "sample_plugin_1";
    const std::string ALGORITHM_ID_SAMPLE_2 = "sample_plugin_2";
    const std::string ALGORITHM_ID_IVP = "cv_human_detect";
    // 添加唤醒词识别的算法名称asr_keyword_spotting
    // 算法的变量名称与ALGORITHM_TYPE_ID_LIST中算法typeId命名相同,例如;ALGORITHM_ID_KWS 
    const std::string ALGORITHM_ID_KWS = "asr_keyword_spotting";
    const std::string ALGORITHM_ID_IC = "cv_image_classification";
    const std::string ALGORITHM_ID_INVALID = "invalid algorithm id";
    
    const std::vector<std::string> ALGORITHM_TYPE_ID_LIST = {
        ALGORITHM_ID_SAMPLE_1,
        ALGORITHM_ID_SAMPLE_2,
        ALGORITHM_ID_IVP,
        // 添加唤醒词识别在ALGORITHM_TYPE_ID_LITS中的序号,通过该序号可获得唤醒词识别的算法名称
        // 唤醒词识别的算法名称和唤醒词识别在ALGORITHM_TYPE_ID_LITS中的序号顺序需保持一致
        ALGORITHM_ID_KWS,
        ALGORITHM_ID_IC,
    };
1
https://gitee.com/luquick/docs.git
git@gitee.com:luquick/docs.git
luquick
docs
docs
master

搜索帮助