Back
nvidia / audio2face
PREVIEW

Converts streamed audio to facial blendshapes for realtime lipsyncing and facial performances.

Getting Started

Audio2Face uses gRPC APIs. The following instructions demonstrate usage of audio2face model using Python client.

Prerequisites

You will need a system with Python 3+ installed.

Prepare Python Client

Start by creating a python venv using

$ python3 -m venv .venv
$ source .venv/bin/activate

Download and Install Proto Files

Python wheel available for download at here

$ pip3 install nvidia_ace-1.0.0-py3-none-any.whl

Download A2F Python Client

Download Python client code by cloning ACE Github Repository.

$ git clone https://github.com/NVIDIA/ACE.git
$ cd ACE/microservices/audio_2_face_microservice/scripts/audio2face_api_client

Then install the required dependencies:

$ pip3 install -r requirements

Run Python Client

$ python ./nim_a2f_client.py ./audio/sample.wav ./config/config_claire.yml \
    --apikey  $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC\
    --function-id 462f7853-60e8-474a-9728-7b598e58472c

The script takes four mandatory parameters, an audio file at format PCM 16 bits, a yaml configuration file for the emotions parameters, the API Key generated by API Catalog, and the Function ID used to access the API function.

--apikey for the API Key generated through the API Catalog --function-id for the Function ID provided to access the API function.

What does this example do?

  1. Reads the audio data from a wav 16bits PCM file
  2. Reads emotions and parameters from the yaml configuration file
  3. Sends emotions, parameters and audio to the A2F Controller
  4. Receives back blendshapes, audio and emotions
  5. Saves blendshapes as animation key frames in a csv file with their name, value and time codes
  6. Same process for the emotion data.
  7. Saves the received audio as out.wav (Should be the same as input audio)

Connect from any client

For gRPC connection from any client, use the following endpoint and function-id alongside the API Key. To generate a new API Key, click the Get API Key button on this page.

grpc.nvcf.nvidia.com:443 or https://grpc.nvcf.nvidia.com:443
authorization: Bearer $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC
function-id: 462f7853-60e8-474a-9728-7b598e58472c