Kubernetes Deployment

Quick deployment on microk8s

To start with a simple kubernetes deployment of an Audio2Face cluster, you can use our quick deployment script.

It assumes the following dependencies:
  • microk8s

  • microk8s GPU addon running the NVIDIA GPU operator.

  • A valid NGC token to connect to NVIDIA’s image repository as well as a configured NGC CLI.

Make sure you have an NVAIE Access and your Personal Key.

Start by fetching the content of the quick deploy script:

$ ngc registry resource download-version "eevaigoeixww/animation/audio2face_service_quick_deployment:1.0.14"
$ cd audio2face_service_quick_deployment_v1.0.14
$ unzip deployment.zip
$ cd deployment/baremetal-deployment
$ ./a2f_deploy.sh $NGC_CLI_API_KEY claire_v1.3

Note

The $NGC_CLI_API_KEY environment variable is your Personal Key.

And it should create and setup an Audio2Face cluster inside your microk8s install.

You can get the IP and port of the A2FController by using:

$ microk8s kubectl get svc -o wide
NAME                                                  TYPE        CLUSTER-IP       PORT(S)
a2f-a2f-deployment-a2f-service                        ClusterIP   10.152.183.56    50010/TCP
a2f-controller-ax-for-a2x-deployment-ac-a2x-service   NodePort    10.152.183.202   8021:31392/TCP,52010:32352/TCP,51010:32723/TCP
kubernetes                                            ClusterIP   10.152.183.1     443/TCP

The port binding for a2f-controller is 52010 so our local deployment is available at port 127.0.0.1:32352.

Microservice configs

Configure deployment parameters for the Audio2Face cluster in the values.yaml file. During deployment, this YAML file is internally converted into a2f_config.yaml and ac_a2f_config.yaml, which are used by each container.

Parameter Name

Default Value

Description

streamNumber

10

Specifies the maximum number of streams supported simultaneously. Audio2Face preallocates resources for these streams. To ensure optimal performance, it is recommended not to set this number too high.

a2eEnabled

TRUE

Enables emotion inference for Audio2Face.

a2eInferenceInterval

16

A2E processes 1 out of N frames. Frequent A2E inference is not beneficial, and setting the value too low reduces performance.

a2fEnabled

TRUE

Must be TRUE.

faceParams

{ }

Face parameters for Audio2Face.

a2fModelName

mark_v2

Audio2Face model name; options are mark_v2.2 or claire_v1.3

addSilencePaddingAfterAudio

TRUE

Adds 1.5 seconds of silence to allow A2E to stabilize and the mouth to close.

queueAfterStreammux

1

Internal parameter; modifying it may cause latency issues.

queueAfterA2F

3000

Internal parameter; modifying it may cause latency issues.

queueAfterA2E

30

Internal parameter; modifying it may cause latency issues.

a2eEmotionContrast

1

Modifies the intensity of the inferred emotion values using a sigmoid function when applied.

a2eLiveBlendCoef

0

Regulates the blend between emotions for temporal smoothing, reducing noise and sudden fluctuations in the emotion vector output.

a2eEnablePreferredEmotion

FALSE

Allows the use of a user-provided preferred emotion vector.

a2ePreferredEmotionStrength

0

Adjusts the blending ratio between the preferred emotion vector and the inferred emotion vector.

a2eEmotionStrength

1

Scales the intensity of emotion vector by multiplying them with this value.

a2eMaxEmotions

6

Specifies the number of emotions to retain, setting lower strength ones to zero (valid range: 0-6).

bsWeightMultipliers

{all 1.0}

Adjust inferred blendshape weights by multiplying them with these values.

maxLenUUID

100

Maximum length of UUID used in Audio2Face (request_id, stream_id, target_object_id).

maxSampleRate

140000

Maximum sample rate accepted by Audio2Face.

minSampleRate

16000

Minimum sample rate accepted by Audio2Face.

lowFps

29

Lowest allowable FPS.

lowFpsMaxDurationSecond

30

Maximum duration to allow low FPS.

GarbageCollectorEnabled

TRUE

True if garbage collector is enabled.

fpsLoggingIntervalSecond

1

Time interval for FPS logging in seconds.

GarbageCollectorIntervalRunSecond

10

Interval at which the garbage collector runs, in seconds.

GarbageCollectorMaxSizeStoredDataSecond

60

Maximum accumulation of animation data in seconds.

MaxUserNumber

10

Maximum number of users that can be connected simultaneously.

MaxWaitTimeIdleMs

30000

Maximum wait time in milliseconds for A2F Controller to receive data from A2F.

MaxProcessingDurationSecond

300

Maximum processing duration in seconds, setting the timeout for processing user data.

MaxAudioBufferSizeSecond

10

Maximum audio buffer size in seconds.

MaxAudioClipSizeSecond

300

Maximum audio clip size in seconds.

MaxSampleRate

144000

Maximum sample rate accepted by Audio2Face.