diff --git a/Kconfig.projbuild b/Kconfig.projbuild index fb3552c..0fdc3aa 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -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 diff --git a/include/esp32s3/dl_lib.h b/include/esp32s3/dl_lib.h index 63ba6da..47e7c86 100644 --- a/include/esp32s3/dl_lib.h +++ b/include/esp32s3/dl_lib.h @@ -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 \ No newline at end of file +#endif diff --git a/include/esp32s3/dl_lib_convq8_queue.h b/include/esp32s3/dl_lib_convq8_queue.h index 0e53902..28c5da7 100644 --- a/include/esp32s3/dl_lib_convq8_queue.h +++ b/include/esp32s3/dl_lib_convq8_queue.h @@ -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); diff --git a/include/esp32s3/dl_lib_convq_queue.h b/include/esp32s3/dl_lib_convq_queue.h index c71d5ca..ff190fe 100644 --- a/include/esp32s3/dl_lib_convq_queue.h +++ b/include/esp32s3/dl_lib_convq_queue.h @@ -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 diff --git a/include/esp32s3/esp_nsn_models.h b/include/esp32s3/esp_nsn_models.h index 0a7e334..7b3bf49 100644 --- a/include/esp32s3/esp_nsn_models.h +++ b/include/esp32s3/esp_nsn_models.h @@ -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 \ No newline at end of file +/** + * @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); \ No newline at end of file diff --git a/lib/esp32s3/libdl_lib.a b/lib/esp32s3/libdl_lib.a index 713e4aa..8315980 100644 Binary files a/lib/esp32s3/libdl_lib.a and b/lib/esp32s3/libdl_lib.a differ diff --git a/lib/esp32s3/libesp_audio_front_end.a b/lib/esp32s3/libesp_audio_front_end.a index 914b142..0d7db59 100644 Binary files a/lib/esp32s3/libesp_audio_front_end.a and b/lib/esp32s3/libesp_audio_front_end.a differ diff --git a/lib/esp32s3/libmultinet.a b/lib/esp32s3/libmultinet.a index 5940903..e07967b 100644 Binary files a/lib/esp32s3/libmultinet.a and b/lib/esp32s3/libmultinet.a differ diff --git a/lib/esp32s3/libnsnet.a b/lib/esp32s3/libnsnet.a index f77e24b..6a312b3 100644 Binary files a/lib/esp32s3/libnsnet.a and b/lib/esp32s3/libnsnet.a differ diff --git a/lib/esp32s3/libwakenet.a b/lib/esp32s3/libwakenet.a index 341aab2..625de12 100644 Binary files a/lib/esp32s3/libwakenet.a and b/lib/esp32s3/libwakenet.a differ diff --git a/model/movemodel.py b/model/movemodel.py index 4047259..1a84a82 100644 --- a/model/movemodel.py +++ b/model/movemodel.py @@ -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) diff --git a/model/nsnet_model/nsnet2/_MODEL_INFO_ b/model/nsnet_model/nsnet2/_MODEL_INFO_ new file mode 100644 index 0000000..9d0d7d9 --- /dev/null +++ b/model/nsnet_model/nsnet2/_MODEL_INFO_ @@ -0,0 +1,2 @@ +# (neural network type)_(model data version)_ns_0_0.0_0.0 +nsnet2_v1_ns_0_0.0_0.0 diff --git a/model/nsnet_model/nsnet2/nsnet2_data b/model/nsnet_model/nsnet2/nsnet2_data new file mode 100644 index 0000000..97ae20f Binary files /dev/null and b/model/nsnet_model/nsnet2/nsnet2_data differ diff --git a/model/nsnet_model/nsnet2/nsnet2_index b/model/nsnet_model/nsnet2/nsnet2_index new file mode 100644 index 0000000..04e82a3 Binary files /dev/null and b/model/nsnet_model/nsnet2/nsnet2_index differ