feat/add_nsnet2

This commit is contained in:
xysun 2024-02-28 20:27:02 +08:00
parent 9c140600e0
commit debd558c24
14 changed files with 24 additions and 37 deletions

View File

@ -46,7 +46,9 @@ choice SR_NSN_MODEL_LOAD
config SR_NSN_NSNET1
bool "Deep noise suppression v1 (nsnet1)"
depends on IDF_TARGET_ESP32S3
config SR_NSN_NSNET2
bool "Deep noise suppression v2 (nsnet2)"
depends on IDF_TARGET_ESP32S3
endchoice
config USE_WAKENET
@ -120,22 +122,6 @@ choice SR_WN_MODEL_LOAD
bool "Hey,Willow (wn9_heywillow_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_SOPHIA_TTS
bool "Sophia (wn9_sophia_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_NIHAOXIAOXIN_TTS
bool "nihaoxiaoxin (wn9_nihaoxiaoxin_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_XIAOMEITONGXUE_TTS
bool "xiaomeitongxue (wn9_xiaomeitongxue_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_HIXIAOXING_TTS
bool "Hi,Xiaoxing (wn9_hixiaoxing_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_CUSTOMWORD
bool "customized word (wn9_customword)"
depends on IDF_TARGET_ESP32S3
@ -177,18 +163,6 @@ menu "Load Multiple Wake Words"
bool "Hey,Willow (wn9_heywillow_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_SOPHIA_TTS_MULTI
bool "Sophia (wn9_sophia_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_NIHAOXIAOXIN_TTS_MULTI
bool "nihaoxiaoxin (wn9_nihaoxiaoxin_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_XIAOMEITONGXUE_TTS_MULTI
bool "xiaomeitongxue (wn9_xiaomeitongxue_tts)"
depends on IDF_TARGET_ESP32S3
endmenu
config USE_MULTINET

View File

@ -78,7 +78,7 @@ void *dl_lib_calloc_psram(int cnt, int size, int align);
/**
* @brief Free aligned memory allocated by `dl_lib_calloc` or `dl_lib_calloc_psram`
*
* @param prt Pointer to free
* @param ptr Pointer to free
*/
void dl_lib_free(void *ptr);
@ -415,4 +415,4 @@ dl_matrix2d_t *dl_basic_conv_layer_quantised_weight(const dl_matrix2d_t *in, con
}
#endif
#endif
#endif

View File

@ -292,6 +292,7 @@ qtp_t *dl_atrous_conv1dq8_16_s3(dl_convq8_queue_t *in, dl_convq_queue_t *out, in
void print_convq8(dl_convq8_queue_t *cq, int offset);
void print_convq(dl_convq_queue_t *cq, int offset);
void dl_relu_convq8(dl_convq8_queue_t *cq);
void lstmq8_free(void);

View File

@ -279,9 +279,9 @@ dl_matrix2dq_t *dl_convq_lstm_layer(const dl_convq_queue_t *in, dl_convq_queue_t
dl_matrix2dq_t *dl_basic_lstm_layer1_q(const dl_convq_queue_t *in, dl_matrix2dq_t *state_c, dl_matrix2dq_t *state_h,
const dl_matrix2dq_t *weight, const dl_matrix2dq_t *bias, int step, int shift);
dl_matrix2dq_t *dl_convq16_lstm_layer(const dl_convq_queue_t *in, dl_convq_queue_t *out, dl_matrix2dq_t *state_c,
dl_matrix2dq_t *state_h, const dl_matrix2dq_t *in_weight, const dl_matrix2dq_t *h_weight,
const dl_matrix2dq_t *bias, int prenum);
dl_matrix2dq_t *dl_convq16_lstm_layer(dl_convq_queue_t *in, dl_convq_queue_t *out, dl_matrix2dq_t *state_c,
dl_matrix2dq_t *state_h, dl_matrix2dq_t *in_weight, dl_matrix2dq_t *h_weight,
dl_matrix2dq_t *bias, int prenum);
/**
* @brief Allocate a fixed-point multi channel convolution queue

View File

@ -2,8 +2,16 @@
#include "esp_nsn_iface.h"
// The prefix of nsnet model name is used to filter all wakenet from availabel models.
/*
The prefix of nset
Now there are nsnet1 and nsnet2
*/
#define ESP_NSNET_PREFIX "nsnet"
extern const esp_nsn_iface_t esp_nsnet1_quantized;
#define ESP_NSN_HANDLE esp_nsnet1_quantized
/**
* @brief Get the nsnet handle from model name
*
* @param model_name The name of model
* @returns The handle of multinet
*/
esp_nsn_iface_t *esp_nsnet_handle_from_name(char *model_name);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -97,6 +97,8 @@ def copy_nsnet_from_sdkconfig(model_path, sdkconfig_path, target_path):
models = []
if "CONFIG_SR_NSN_NSNET1" in models_string:
models.append('nsnet1')
if "CONFIG_SR_NSN_NSNET2" in models_string:
models.append('nsnet2')
for item in models:
shutil.copytree(model_path + '/nsnet_model/' + item, target_path+'/'+item)

View File

@ -0,0 +1,2 @@
# (neural network type)_(model data version)_ns_0_0.0_0.0
nsnet2_v1_ns_0_0.0_0.0

Binary file not shown.

Binary file not shown.