Skip to content

Latest commit

 

History

History

riva-client

riva-client

CONTAINERS IMAGES RUN BUILD

Start Riva Server

Before doing anything, you should download and run the Riva server container from riva_quickstart_arm64 using riva_start.sh

This will run locally on your Jetson Xavier or Orin device and is supported on JetPack 5. You can disable NLP/NMT in its config.sh and it will use around ~5GB of memory for ASR+TTS. It's then recommended to test the system with these examples under /opt/riva/python-clients

You can also see this helpful video and guide from JetsonHacks for setting up Riva: Speech AI on Jetson Tutorial

List Audio Devices

This will print out a list of audio input/output devices that are connected to your system:

./run.sh --workdir /opt/riva/python-clients $(./autotag riva-client:python) \
   python3 scripts/list_audio_devices.py

You can refer to them in the steps below by either their device number or name. Depending on the sample rate they support, you may also need to set --sample-rate-hz below to a valid frequency (e.g. 16000 44100 48000)

Streaming ASR

./run.sh --workdir /opt/riva/python-clients $(./autotag riva-client:python) \
   python3 scripts/asr/transcribe_mic.py --input-device=24 --sample-rate-hz=48000

You can find more ASR examples to run at https://github.com/nvidia-riva/python-clients#asr

Streaming TTS

./run.sh --workdir /opt/riva/python-clients $(./autotag riva-client:python) \
   python3 scripts/tts/talk.py --stream --output-device=24 --sample-rate-hz=48000 \
     --text "Hello, how are you today? My name is Riva." 

You can set the --voice argument to one of the available voices (the default is English-US.Female-1)

Also, you can customize the rate, pitch, and pronunciation of individual words/phrases by including inline SSML in your text.

Loopback

To feed the live ASR transcript into the TTS and have it speak your words back to you:

./run.sh --workdir /opt/riva/python-clients $(./autotag riva-client:python) \
   python3 scripts/loopback.py --input-device=24 --output-device=24 --sample-rate-hz=48000
CONTAINERS
riva-client:cpp
   Builds riva-client-cpp_jp51
   Requires L4T ['>=34.1.0']
   Dependencies build-essential bazel
   Dockerfile Dockerfile.cpp
   Images dustynv/riva-client:cpp-r35.2.1 (2023-08-29, 6.3GB)
dustynv/riva-client:cpp-r35.3.1 (2024-02-24, 6.3GB)
dustynv/riva-client:cpp-r35.4.1 (2023-10-07, 6.3GB)
   Notes https://github.com/nvidia-riva/cpp-clients
riva-client:python
   Builds riva-client-python_jp60 riva-client-python_jp51
   Requires L4T ['>=34.1.0']
   Dependencies build-essential python
   Dependants llamaspeak
   Dockerfile Dockerfile.python
   Images dustynv/riva-client:python-r35.2.1 (2023-09-07, 5.0GB)
dustynv/riva-client:python-r35.3.1 (2024-02-24, 5.0GB)
dustynv/riva-client:python-r35.4.1 (2023-10-07, 5.0GB)
dustynv/riva-client:python-r36.2.0 (2024-03-11, 0.3GB)
   Notes https://github.com/nvidia-riva/python-clients
CONTAINER IMAGES
Repository/Tag Date Arch Size
  dustynv/riva-client:cpp-r35.2.1 2023-08-29 arm64 6.3GB
  dustynv/riva-client:cpp-r35.3.1 2024-02-24 arm64 6.3GB
  dustynv/riva-client:cpp-r35.4.1 2023-10-07 arm64 6.3GB
  dustynv/riva-client:python-r35.2.1 2023-09-07 arm64 5.0GB
  dustynv/riva-client:python-r35.3.1 2024-02-24 arm64 5.0GB
  dustynv/riva-client:python-r35.4.1 2023-10-07 arm64 5.0GB
  dustynv/riva-client:python-r36.2.0 2024-03-11 arm64 0.3GB
  dustynv/riva-client:r35.2.1 2023-08-10 arm64 6.3GB

Container images are compatible with other minor versions of JetPack/L4T:
    • L4T R32.7 containers can run on other versions of L4T R32.7 (JetPack 4.6+)
    • L4T R35.x containers can run on other versions of L4T R35.x (JetPack 5.1+)

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 riva-client)

# or explicitly specify one of the container images above
jetson-containers run dustynv/riva-client:python-r36.2.0

# or if using 'docker run' (specify image and mounts/ect)
sudo docker run --runtime nvidia -it --rm --network=host dustynv/riva-client:python-r36.2.0

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 riva-client)

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

jetson-containers run $(autotag riva-client) 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 riva-client

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