mirror of
https://github.com/espressif/esp-sr.git
synced 2025-09-15 15:28:44 +08:00
feat: Add mutex lock when loading model parameter
This commit is contained in:
parent
0cf2db1540
commit
bca14a02f7
@ -1,8 +1,13 @@
|
|||||||
# Change log for esp-sr
|
# Change log for esp-sr
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 1.2.1
|
||||||
|
- Fix bugs in model loader
|
||||||
- Read all parameters sequentially, which reduces about 5x in model loading time.
|
- Read all parameters sequentially, which reduces about 5x in model loading time.
|
||||||
- Use esp_partition_mmap to replace spiffs file system, which further reduces about 3x in model loading time
|
- Use esp_partition_mmap to replace spiffs file system, which further reduces about 3x in model loading time
|
||||||
|
- Add WakeNet API unity test
|
||||||
|
- Add MultiNet API unity test
|
||||||
|
|
||||||
## 1.2.0
|
## 1.2.0
|
||||||
- ESP-DSP dependency is now installed from the component registry
|
- ESP-DSP dependency is now installed from the component registry
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
version: "1.2.0"
|
version: "1.2.1"
|
||||||
description: esp_sr provides basic algorithms for Speech Recognition applications
|
description: esp_sr provides basic algorithms for Speech Recognition applications
|
||||||
url: https://github.com/espressif/esp-sr
|
url: https://github.com/espressif/esp-sr
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -874,7 +874,9 @@ char *get_id_name_en(int i)
|
|||||||
|
|
||||||
esp_mn_error_t* esp_mn_commands_update_from_sdkconfig(const esp_mn_iface_t *multinet, model_iface_data_t *model_data)
|
esp_mn_error_t* esp_mn_commands_update_from_sdkconfig(const esp_mn_iface_t *multinet, model_iface_data_t *model_data)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SR_MN_CN_MULTINET6_QUANT || CONFIG_SR_MN_EN_MULTINET6_QUANT
|
#ifdef CONFIG_SR_MN_CN_MULTINET6_QUANT
|
||||||
|
return NULL;
|
||||||
|
#else if CONFIG_SR_MN_EN_MULTINET6_QUANT
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -51,14 +51,15 @@ TEST_CASE("multinet create/destroy API & memory leak", "[mn]")
|
|||||||
int mem_leak = start_size - last_end_size;
|
int mem_leak = start_size - last_end_size;
|
||||||
printf("create&destroy times:%d, memory leak:%d\n", 1, mem_leak);
|
printf("create&destroy times:%d, memory leak:%d\n", 1, mem_leak);
|
||||||
|
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<5; i++) {
|
||||||
printf("init partition ...\n");
|
printf("init partition ...\n");
|
||||||
models = esp_srmodel_init("model");
|
models = esp_srmodel_init("model");
|
||||||
model_name = esp_srmodel_filter(models, ESP_MN_PREFIX, NULL);
|
model_name = esp_srmodel_filter(models, ESP_MN_PREFIX, NULL);
|
||||||
multinet = esp_mn_handle_from_name(model_name);
|
multinet = esp_mn_handle_from_name(model_name);
|
||||||
|
|
||||||
printf("create ...\n");
|
int time_out = 3000+i*2000;
|
||||||
model_data = multinet->create(model_name, 6000);
|
printf("create ..., time out = %d\n", time_out);
|
||||||
|
model_data = multinet->create(model_name, time_out);
|
||||||
|
|
||||||
printf("destroy ...\n");
|
printf("destroy ...\n");
|
||||||
multinet->destroy(model_data);
|
multinet->destroy(model_data);
|
||||||
|
|||||||
@ -50,14 +50,22 @@ TEST_CASE("wakenet create/destroy API & memory leak", "[wn]")
|
|||||||
int mem_leak = start_size - last_end_size;
|
int mem_leak = start_size - last_end_size;
|
||||||
printf("create&destroy times:%d, memory leak:%d\n", 1, mem_leak);
|
printf("create&destroy times:%d, memory leak:%d\n", 1, mem_leak);
|
||||||
|
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
printf("init partition ...\n");
|
printf("init partition ...\n");
|
||||||
models = esp_srmodel_init("model");
|
models = esp_srmodel_init("model");
|
||||||
model_name = esp_srmodel_filter(models, ESP_WN_PREFIX, NULL);
|
model_name = esp_srmodel_filter(models, ESP_WN_PREFIX, NULL);
|
||||||
wakenet = esp_wn_handle_from_name(model_name);
|
wakenet = esp_wn_handle_from_name(model_name);
|
||||||
|
|
||||||
printf("create ...\n");
|
printf("create ...\n");
|
||||||
model_data = wakenet->create(model_name, DET_MODE_3CH_95);
|
// typedef enum {
|
||||||
|
// DET_MODE_90 = 0, // Normal
|
||||||
|
// DET_MODE_95 = 1, // Aggressive
|
||||||
|
// DET_MODE_2CH_90 = 2,
|
||||||
|
// DET_MODE_2CH_95 = 3,
|
||||||
|
// DET_MODE_3CH_90 = 4,
|
||||||
|
// DET_MODE_3CH_95 = 5,
|
||||||
|
// } det_mode_t;
|
||||||
|
model_data = wakenet->create(model_name, i);
|
||||||
|
|
||||||
printf("destroy ...\n");
|
printf("destroy ...\n");
|
||||||
wakenet->destroy(model_data);
|
wakenet->destroy(model_data);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user