Merge branch 'feat/update_wn9_models' into 'master'

Feat/update wn9 models

See merge request speech-recognition-framework/esp-sr!82
This commit is contained in:
Sun Xiang Yu 2023-12-28 15:03:45 +08:00
commit f91dd9eacb
8 changed files with 31 additions and 36 deletions

View File

@ -109,13 +109,17 @@ choice SR_WN_MODEL_LOAD
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_JARVIS_TTS
bool "jarvis (wn9_jarvis_tts)"
bool "Jarvis (wn9_jarvis_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_COMPUTER_TTS
bool "computer (wn9_computer_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_HEYWILLOW_TTS
bool "Hey,Willow (wn9_heywillow_tts)"
depends on IDF_TARGET_ESP32S3
config SR_WN_WN9_CUSTOMWORD
bool "customized word (wn9_customword)"
depends on IDF_TARGET_ESP32S3
@ -145,6 +149,18 @@ menu "Load Multiple Wake Words"
bool "Hi,ESP (wn9_hiesp)"
default False
config SR_WN_WN9_JARVIS_TTS_MULTI
bool "Jarvis (wn9_jarvis_tts)"
default False
config SR_WN_WN9_COMPUTER_TTS_MULTI
bool "computer (wn9_computer_tts)"
default False
config SR_WN_WN9_HEYWILLOW_TTS_MULTI
bool "Hey,Willow (wn9_heywillow_tts)"
depends on IDF_TARGET_ESP32S3
endmenu
config USE_MULTINET

View File

@ -21,45 +21,22 @@ def copy_wakenet_from_sdkconfig(model_path, sdkconfig_path, target_path):
"""
Copy wakenet model from model_path to target_path based on sdkconfig
"""
models = []
with io.open(sdkconfig_path, "r") as f:
models_string = ''
for label in f:
label = label.strip("\n")
if 'CONFIG_SR_WN' in label and label[0] != '#':
models_string += label
models = []
if "CONFIG_SR_WN_WN7Q8_XIAOAITONGXUE" in models_string:
models.append('wn7q8_xiaoaitongxue')
if "CONFIG_SR_WN_WN7_XIAOAITONGXUE" in models_string:
models.append('wn7_xiaoaitongxue')
if "CONFIG_SR_WN_WN8_HILEXIN" in models_string:
models.append('wn8_hilexin')
if "CONFIG_SR_WN_WN8_ALEXA" in models_string:
models.append('wn8_alexa')
if "CONFIG_SR_WN_WN8_HIESP" in models_string:
models.append('wn8_hiesp')
if "CONFIG_SR_WN_WN9_XIAOAITONGXUE" in models_string:
models.append('wn9_xiaoaitongxue')
if "CONFIG_SR_WN_WN9_HILEXIN" in models_string:
models.append('wn9_hilexin')
if "CONFIG_SR_WN_WN9_ALEXA" in models_string:
models.append('wn9_alexa')
if "CONFIG_SR_WN_WN9_HIESP" in models_string:
models.append('wn9_hiesp')
if "CONFIG_SR_WN_WN9_HIMFIVE" in models_string:
models.append('wn9_himfive')
if "CONFIG_SR_WN_WN9_NIHAOXIAOZHI" in models_string:
models.append('wn9_nihaoxiaozhi')
if "CONFIG_SR_WN_WN9_JARVIS_TTS" in models_string:
models.append('wn9_jarvis_tts')
if "CONFIG_SR_WN_WN9_COMPUTER_TTS" in models_string:
models.append('wn9_computer_tts')
if "CONFIG_SR_WN_WN9_CUSTOMWORD" in models_string:
models.append('wn9_customword')
if 'CONFIG_SR_WN' in label and '#' not in label[0]:
if '=' in label:
label = label.split("=")[0]
if '_MULTI' in label:
label = label[:-6]
model_name = label.split("_SR_WN_")[-1].lower()
models.append(model_name)
for item in models:
shutil.copytree(model_path + '/wakenet_model/' + item, target_path+'/'+item)
wakeword_model_path = model_path + '/wakenet_model/' + item
if os.path.exists(wakeword_model_path):
shutil.copytree(wakeword_model_path, target_path+'/'+item)
def copy_multinet_from_sdkconfig(model_path, sdkconfig_path, target_path):
"""

View File

@ -1,2 +1,2 @@
# (neural network type)_(model data version)_(lable1_detection windown length_threshold for 90%_threshold for 95%)_(lable2 ...)_...
wakenet9l_v3h24_alexa_3_0.625_0.645
wakenet9l_v4h8_alexa_3_0.640_0.650

View File

@ -0,0 +1,2 @@
# (neural network type)_(model data version)_(lable1_detection windown length_threshold for 90%_threshold for 95%)_(lable2 ...)_...
wakenet9l_tts1h8_heywillow_3_0.644_0.650

Binary file not shown.

Binary file not shown.