Update wakenet trigger v4

This commit is contained in:
sxy 2023-01-07 15:33:58 +08:00
parent 9a13f4df05
commit 9279f2525f
14 changed files with 1057 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,16 @@ dl_convq8_queue_t *dl_convq8_queue_alloc(int n, int c);
*/
dl_convq8_queue_t *dl_convq8_queue_alloc_mc(int n, int c, int nch);
/**
* @brief Allocate a bit fixed-point convolution queue from PSRAM
*
* @param n The length of queue
* @param c The number of elements in the queue
* @param nch The channel of queue
* @return The convolution queue, or NULL if out of memory
*/
dl_convq8_queue_t *dl_convq8_queue_alloc_mc_from_psram(int n, int c, int nch);
/**
* @brief Free a fixed-point convolution queue
*

View File

@ -93,8 +93,8 @@ void dl_convq_queue_bzero(dl_convq_queue_t *cq);
* @param cq Input fixed-point convolution queue
* @return Pointer of oldest element
*/
inline qtp_t *dl_convq_queue_pop(dl_convq_queue_t *cq);
inline qtp_t *dl_convq_queue_popn(dl_convq_queue_t *cq, int n);
qtp_t *dl_convq_queue_pop(dl_convq_queue_t *cq);
qtp_t *dl_convq_queue_popn(dl_convq_queue_t *cq, int n);
/**
* @brief Remove the oldest element, then insert the input element at the end of queue
*
@ -125,7 +125,7 @@ dl_conv_queue_t *dl_queue_from_convq(dl_convq_queue_t *cq1);
* @param last_num Offset from the front of the queue
* @return Pointer of the element
*/
inline qtp_t *dl_get_queue_itemq(dl_convq_queue_t *cq, int last_num);
qtp_t *dl_get_queue_itemq(dl_convq_queue_t *cq, int last_num);
/**
* @brief Get the pointer of element in the queue by offset

View File

@ -17,6 +17,17 @@ typedef enum {
ESP_MN_STATE_TIMEOUT = 2, // time out
} esp_mn_state_t;
typedef enum {
ESP_MN_GREEDY_SEARCH = 0, // greedy search
ESP_MN_BEAM_SEARCH = 1, // beam search
ESP_MN_BEAM_SEARCH_WITH_TRIE = 2, // beam search with trie language model
} esp_mn_search_method_t;
typedef enum {
CHINESE_ID = 1, // Chinese language
ENGLISH_ID = 2, // English language
} language_id_t;
// Return all possible recognition results
typedef struct{
esp_mn_state_t state;
@ -24,8 +35,10 @@ typedef struct{
int command_id[ESP_MN_RESULT_MAX_NUM]; // The list of command id.
int phrase_id[ESP_MN_RESULT_MAX_NUM]; // The list of phrase id.
float prob[ESP_MN_RESULT_MAX_NUM]; // The list of probability.
char string[256];
} esp_mn_results_t;
typedef struct{
int16_t num; // The number of error phrases, which can not added into model
int16_t phrase_idx[ESP_MN_MAX_PHRASE_NUM]; // The error phrase index in singly linked list

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -73,6 +73,8 @@ if "CONFIG_SR_MN_EN_MULTINET5_SINGLE_RECOGNITION_QUANT8" in MN_STRING and len(mu
multinet_model.append('mn5q8_en')
elif "CONFIG_SR_MN_EN_MULTINET5_SINGLE_RECOGNITION" in MN_STRING and len(multinet_model) < 2:
multinet_model.append('mn5_en')
elif "CONFIG_SR_MN_EN_MULTINET6_QUANT" in MN_STRING and len(multinet_model) < 2:
multinet_model.append('mn6_en')
print(wakenet_model)
print(multinet_model)

View File

@ -464,7 +464,7 @@ char *get_id_name_cn(int i)
char *get_id_name_en(int i)
{
#if defined CONFIG_USE_MULTINET && defined CONFIG_SR_MN_EN_MULTINET5_SINGLE_RECOGNITION_QUANT8
#if defined CONFIG_SR_MN_EN_MULTINET5_SINGLE_RECOGNITION_QUANT8 || defined CONFIG_SR_MN_EN_MULTINET6_QUANT
if (i == 0)
return CONFIG_EN_SPEECH_COMMAND_ID0;
else if (i == 1)