Skip to content

v0.2.0

Compare
Choose a tag to compare
@KoljaB KoljaB released this 28 Jun 20:53
· 165 commits to master since this release

v0.2.0 with OpenWakeWord Support

Training models

Look here for information about how to train your own OpenWakeWord models. You can use a simple Google Colab notebook for a start or use a more detailed notebook that enables more customization (can produce high quality models, but requires more development experience).

Convert model to ONNX format

You might need to use tf2onnx to convert tensorflow tflite models to onnx format:

pip install -U tf2onnx
python -m tf2onnx.convert --tflite my_model_filename.tflite --output my_model_filename.onnx

Configure RealtimeSTT

Suggested starting parameters for OpenWakeWord usage:

    with AudioToTextRecorder(
        wakeword_backend="oww",
        wake_words_sensitivity=0.35,
        openwakeword_model_paths="word1.onnx,word2.onnx",
        wake_word_buffer_duration=1,
        ) as recorder:

OpenWakeWord Test

  1. Set up the openwakeword test project:

    mkdir samantha_wake_word && cd samantha_wake_word
    curl -O https://raw.githubusercontent.com/KoljaB/RealtimeSTT/master/tests/openwakeword_test.py
    curl -L https://huggingface.co/KoljaB/SamanthaOpenwakeword/resolve/main/suh_mahn_thuh.onnx -o suh_mahn_thuh.onnx
    curl -L https://huggingface.co/KoljaB/SamanthaOpenwakeword/resolve/main/suh_man_tuh.onnx -o suh_man_tuh.onnx

    Ensure you have curl installed for downloading files. If not, you can manually download the files from the provided URLs.

  2. Create and activate a virtual environment:

    python -m venv venv
    • For Windows:
      venv\Scripts\activate
    • For Unix-like systems (Linux/macOS):
      source venv/bin/activate
    • For macOS:
      Use python3 instead of python and pip3 instead of pip if needed.
  3. Install dependencies:

    python -m pip install --upgrade pip
    python -m pip install RealtimeSTT
    python -m pip install -U torch torchaudio --index-url https://download.pytorch.org/whl/cu121

    The PyTorch installation command includes CUDA 12.1 support. Adjust if a different version is required.

  4. Run the test script:

    python openwakeword_test.py

    On the very first start some models for openwakeword are downloaded.