dscripka / openWakeWord

An open-source audio wake word (or phrase) detection framework with a focus on performance and simplicity.
Apache License 2.0
747 stars 71 forks source link

Error while running detection_from_microphone.py #143

Open manushaanabham opened 7 months ago

manushaanabham commented 7 months ago

I am facing following issue (attached the screen shot) while running detection_from_microphone.py with the give pre-trained model available in the folder docs/models/alexa.md

Using the following command python detect_from_microphone.py --model_path ~/Desktop/wakeup_word/openWakeWord/docs/models/alexa.md

Error message:- ValueError: Model provided has model identifier 'del ', should be 'TFL3'

Thanks in advance

Screenshot from 2024-03-27 17-25-37

dscripka commented 7 months ago

When using this script you need to provide the path to the .tflite or the .onnx models files, you are currently passing the path to a markdown (.md) file.

You can download these automatically using the openwakeword.utils.download_models() command, or download them manually from this release.

manushaanabham commented 7 months ago

Thanks for your reply I have downloaded the files from the link you have provided and executed the below command

python examples/detect_from_microphone.py --model_path alexa_v0.1.tflite --inference_framework melspectrogram.tflite

Still i am facing some issue. I have attached the screenshot of error please help me to solve the issue

Screenshot from 2024-03-28 21-30-48

Mohit-Ak commented 2 months ago

Quick workaround.

#create missing directories
import os
import openwakeword as oww

# Create the directory structure
models_path = os.path.join(os.path.dirname(oww.__file__), 'resources', 'models')
os.makedirs(models_path, exist_ok=True)
print(f"Created directory: {models_path}")

# Download the models
oww.utils.download_models()
print("Models downloaded successfully.")

# Verify the downloaded files
files = os.listdir(models_path)
print(f"Files in {models_path}:")
for file in files:
    print(f" - {file}")

Sample Output

python download_openwakeworkd_models.py 

Created directory: /home/pi/eh_voice_ai/babuenv/lib/python3.11/site-packages/openwakeword/resources/models
Models downloaded successfully.
Files in /home/pi/eh_voice_ai/babuenv/lib/python3.11/site-packages/openwakeword/resources/models:
 - weather_v0.1.onnx
 - timer_v0.1.onnx
 - melspectrogram.tflite
 - embedding_model.onnx
 - hey_jarvis_v0.1.onnx
 - silero_vad.onnx
 - hey_mycroft_v0.1.tflite
 - alexa_v0.1.onnx
 - hey_rhasspy_v0.1.tflite
 - timer_v0.1.tflite
 - embedding_model.tflite
 - alexa_v0.1.tflite
 - hey_mycroft_v0.1.onnx
 - melspectrogram.onnx
 - hey_rhasspy_v0.1.onnx
 - weather_v0.1.tflite
 - hey_jarvis_v0.1.tflite
raisbecka commented 2 months ago

Awesome fix - thanks