• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# KWS Configuration File<a name="EN-US_TOPIC_0000001121062971"></a>
2
31.  Add the KWS configuration file to the  **//foundation/ai/engine/services/common/protocol/plugin\_config/plugin\_config\_ini/**  directory.
4
5    ```
6    [base]
7    supported_boards = hi3516dv300
8    related_sessions = asr_keyword_spotting+20001002
9
10    // Naming rule: [algorithm name+algorithm version], for example, [asr_keyword_spotting+20001002]
11    [asr_keyword_spotting+20001002]
12    AID         = asr_keyword_spotting
13    VersionCode = 20001002
14    VersionName = 2.00.01.002
15    XPU         = NNIE
16    District    = China
17    // Location of the complied .so file of the plug-in
18    FullPath    = /usr/lib/libasr_keyword_spotting.so
19    Chipset     = ALL
20    ChkSum      = ''
21    Key         = ''
22    ```
23
242.  Add the type ID of the KWS algorithm to the  **aie\_algorithm\_type.h**  file in the  **//foundation/ai/engine/services/common/protocol/plugin\_config/**  directory.
25
26    ```
27    // Make sure that the type ID maps to the sequence number in ALGORITHM_TYPE_ID_LITS.
28    const int ALGORITHM_TYPE_KWS = 3;
29    ```
30
313.  Add the name of the KWS algorithm and its sequence number in  **ALGORITHM\_TYPE\_ID\_LITS**  to the  **aie\_plugin\_info.h**  file in the  **//foundation/ai/engine/services/server/plugin\_manager/include/**  directory.
32
33    ```
34    const std::string ALGORITHM_ID_SAMPLE_1 = "sample_plugin_1";
35    const std::string ALGORITHM_ID_SAMPLE_2 = "sample_plugin_2";
36    const std::string ALGORITHM_ID_IVP = "cv_human_detect";
37    // Add the name of the KWS algorithm: asr_keyword_spotting.
38    // Name the algorithm variable in the same way as the algorithm type ID in ALGORITHM_TYPE_ID_LIST, for example, ALGORITHM_ID_KWS.
39    const std::string ALGORITHM_ID_KWS = "asr_keyword_spotting";
40    const std::string ALGORITHM_ID_IC = "cv_image_classification";
41    const std::string ALGORITHM_ID_INVALID = "invalid algorithm id";
42
43    const std::vector<std::string> ALGORITHM_TYPE_ID_LIST = {
44        ALGORITHM_ID_SAMPLE_1,
45        ALGORITHM_ID_SAMPLE_2,
46        ALGORITHM_ID_IVP,
47        // Add the sequence number of the KWS algorithm to ALGORITHM_TYPE_ID_LITS, so that the name of the KWS algorithm can be obtained based on the sequence number.
48        // Make sure that the algorithm name maps to the sequence number in ALGORITHM_TYPE_ID_LITS.
49        ALGORITHM_ID_KWS,
50        ALGORITHM_ID_IC,
51    };
52    ```
53
54
55