Basic Inference
-
Perform a health check on the gRPC endpoint.
-
Install
grpcurlfrom github.com/fullstorydev/grpcurl/releases.Example commands to run on Ubuntu:
-
Download the health checking proto:
-
Run the health check:
-
If the service is ready, you get a response similar to the following:
For using grpcurl with an SSL-enabled server, avoid using the
--plaintextargument, and use--cacertwith a CA certificate,--keywith a private key, or--certwith a certificate file. For more details, refer togrpcurl --help. -
-
Download the Audio2Face-2D client code by cloning the gRPC Client repository:
-
Install the required dependencies:
- For python client
- For Node.js client
Compile the Protos (Optional)
If you want to use the client code provided in the github Client repository, you can skip this step.
The proto files are available in the audio2face-2d/protos folder. You can compile them to generate client interfaces in your preferred programming language. For more details, refer to Supported languages in the gRPC documentation.
Here is an example of how to compile the protos for Python and Node.js on Linux and Windows.
Python
The grpcio version needed for compilation can be referred from requirements.txt
To compile protos on Linux, run:
To compile protos on Windows, run:
Node.js
Before running the Node.js client, you can choose to compile the protos.
To compile protos on Linux, run:
To compile protos on Windows, run:
Running Inference via Python Script
You can use the sample client script in the Audio2Face-2D GitHub repo to send a gRPC request to the hosted NIM server:
-
Go to the Python scripts directory.
-
Run the command to send a gRPC request (all command-line parameters are optional).
The first inference is not indicative of the model’s actual performance, as it includes the time taken by the Triton Inference Server to load the models for the first time. The subsequent inference requests will reflect the actual processing performance.
For Blackwell GPUs, the initial inference might time out because of the time needed to load the models. If timeout occurs, send another request; subsequent inferences will reflect the actual processing performance.
To view details of command-line arguments, run this command:
You will get a response similar to the following.
If the command-line arguments are not passed, the script uses the following default values:
Default Command-Line Arguments
Running Inference via Node.js Script
A Node.js client, similar to a Python client, can also be used to exercise the A2F2D feature by sending gRPC requests to a hosted NIM server.
The audio2face-2d.js Node.js script takes a portrait image and a .wav or .pcm audio file (default is .wav) and generates the MP4 video output.
Go the Node.js script folder
Run the following command to send a gRPC request (all command-line parameters are optional):
The default configuration expected for PCM audio format in the Node.js client is as follows:
- Sample rate: 48kHz
- Channels: Mono-channel
- Bit Depth: 16
If any other configuration is needed, change it in the Node.js client audio2face-2d/nodejs/scripts/audio2face-2d.js in the function sendInputAudioChunks().
To view details of the command-line arguments, run this command:
You will get a response similar to the following.
Performance data
The following table shows the performance data for the Audio2Face-2D model on various GPUs and modes with the provided sample input files and the Python client.