Skip to content

Latest commit

 

History

History
 
 

openwakeword

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

openwakeword

CONTAINERS IMAGES RUN BUILD

Wyoming openWakeWord

Home Assistant add-on that uses openWakeWord (demo on huggingface) for wake word detection over the wyoming protocol on NVIDIA Jetson devices. Thank you to @ms1design for contributing these Home Assistant & Wyoming containers!

Features

  • Works well with home-assistant-core container on Jetson devices as well as Home Assistant hosted on different hosts
  • Use custom wake word's, pass model name as OPENWAKEWORD_PRELOAD_MODEL to preload custom model. For example you can find jetson (jets_un) wake word model included in /share/openwakeword models directory.
  • Supports *.tflite CPU wake word models
  • Supports *.onnx CUDA wake word models [WIP]

Requires Home Assistant 2023.9 or later.

docker-compose example

If you want to use docker compose to run Home Assistant Core Voice Assistant Pipeline on a Jetson device with cuda enabled, you can find a full example docker-compose.yaml here.

name: home-assistant-jetson
version: "3.9"
services:
  homeassistant:
    image: dustynv/homeassistant-core:latest-r36.2.0
    restart: unless-stopped
    init: false
    privileged: true
    network_mode: host
    container_name: homeassistant
    hostname: homeassistant
    ports:
      - "8123:8123"
    volumes:
      - ha-config:/config
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro

  openwakeword:
    image: dustynv/wyoming-openwakeword:latest-r36.2.0
    restart: unless-stopped
    runtime: nvidia
    network_mode: host
    container_name: openwakeword
    hostname: openwakeword
    init: false
    ports:
      - "10400:10400/tcp"
    volumes:
      - ha-openwakeword-custom-models:/share/openwakeword
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    environment:
      OPENWAKEWORD_CUSTOM_MODEL_DIR: /share/openwakeword
      OPENWAKEWORD_PRELOAD_MODEL: ok_nabu

volumes:
  ha-config:
  ha-openwakeword-custom-models:

Environment variables

Variable Type Default Description
OPENWAKEWORD_PORT str 10400 Port number to use on host
OPENWAKEWORD_THRESHOLD float 0.5 Wake word model threshold (0.0-1.0), where higher means fewer activations.
OPENWAKEWORD_TRIGGER_LEVEL int 1 Number of activations before a detection is registered. A higher trigger level means fewer detections.
OPENWAKEWORD_PRELOAD_MODEL str ok_nabu Name or path of wake word model to pre-load. The name of the model should match with name used during custom wake word model training. When changing this, it's also recommended to set WAKEWORD_NAME variable with same value for wyoming-assist-microphone container
OPENWAKEWORD_CUSTOM_MODEL_DIR str /share/openwakeword Path to directory containing custom wake word models. Skip the trailing slash (/)
OPENWAKEWORD_DEBUG bool true Log DEBUG messages

Configuration

Read more how to configure wyoming-openwakeword in the official documentation:

Wyoming openWakeWord configuration

Training custom wake word's

Note

You can find a custom trained, example jetson (jets_un) wake word model in the custom models directory (/share/openwakeword). To use it, set WAKEWORD_NAME to jets_un in appropriate containers.

The Home Assistant Community has trained numerous wake word models, as detailed in this GitHub repository. However, these models are specifically designed for use with CPU.

To train a new wake word model for CPU (*.tflite) or cuda (*.onnx), you can follow @dscripka documentation or just jump to the point and use wake word training environment.

TODO's

  • Build openWakeWord from source based on onnxruntime gpu enabled container (currently openWakeWord is still using tflite models instead onnx)
  • Custom Wake Word Models training container using automatic synthetic data creation

Support

Got questions? You have several options to get them answered:

For general Home Assistant Support:

For NVIDIA Jetson based Home Assistant Support:

Note

This project was created by Jetson AI Lab Research Group.

CONTAINERS
wyoming-openwakeword:latest
   Aliases wyoming-openwakeword
   Requires L4T ['>=34.1.0']
   Dependencies build-essential homeassistant-base python:3.11
   Dockerfile Dockerfile
   Images dustynv/wyoming-openwakeword:latest-r36.2.0 (2024-04-30, 0.3GB)
   Notes The openWakeWord using the wyoming protocol for usage with Home Assistant. Based on https://github.com/home-assistant/addons/blob/master/openwakeword/Dockerfile and https://github.com/rhasspy/wyoming-openwakeword
RUN CONTAINER

To start the container, you can use jetson-containers run and autotag, or manually put together a docker run command:

# automatically pull or build a compatible container image
jetson-containers run $(autotag openwakeword)

# or if using 'docker run' (specify image and mounts/ect)
sudo docker run --runtime nvidia -it --rm --network=host openwakeword:35.2.1

jetson-containers run forwards arguments to docker run with some defaults added (like --runtime nvidia, mounts a /data cache, and detects devices)
autotag finds a container image that's compatible with your version of JetPack/L4T - either locally, pulled from a registry, or by building it.

To mount your own directories into the container, use the -v or --volume flags:

jetson-containers run -v /path/on/host:/path/in/container $(autotag openwakeword)

To launch the container running a command, as opposed to an interactive shell:

jetson-containers run $(autotag openwakeword) my_app --abc xyz

You can pass any options to it that you would to docker run, and it'll print out the full command that it constructs before executing it.

BUILD CONTAINER

If you use autotag as shown above, it'll ask to build the container for you if needed. To manually build it, first do the system setup, then run:

jetson-containers build openwakeword

The dependencies from above will be built into the container, and it'll be tested during. Run it with --help for build options.