[Huawei Developers] Freemind R:
1. Introduction to Virtual Human

Virtual Human is a service that utilizes cutting-edge AI technologies, including image vision, emotion generation, voice cloning, and semantic understanding, and has a wide range of applications, spanning news broadcasting, financial customer service, and virtual gaming.

Application scenarios:

[IMG="https://miro.medium.com/max/700/0*MyNW51gYNhP7FUH-.jpg"]https://miro.medium.com/max/700/0*MyNW51gYNhP7FUH-.jpg[/IMG]

2. ML Kit's Virtual Human Service

ML Kit's Virtual Human service is backed by core Huawei AI technologies, such as image processing, text to speech, voice cloning, and semantic understanding, and provides innovative, cost-effective authoring modes for education, news, and multimedia production enterprises. Virtual Human service features a number of crucial advantages over other similar services, including the following:

Ultra-HD 4K cinematic effects

Supports large-screen displays. The details and textures of the entire body are rendered in the same definition.

Generates images that fit seamlessly with the real background, and achieve trackless fusion under HD resolution.

Generates detailed lip features, distinct lipstick reflection, and lifelike textures.

Produces clear and visible teeth, and true-to-life textures.

Hyper-real synthesis effects

True restoration of teeth (no painting involved), lips, and even lipstick reflections.

True restoration of facial features such as illumination, contrasts, shadows, and dimples.

Seamless connections between the generated texture for the mouth and the real texture.

Intricate animation effects that outperform those for 3D live anchors.

Comparing with services provided by other enterprises.

[IMG="https://miro.medium.com/max/700/0*7AwX0xJ7LHTw_EEL.jpg"]https://miro.medium.com/max/700/0*7AwX0xJ7LHTw_EEL.jpg[/IMG]

3. ML Kit's Virtual Human Video Display

As shown below, Virtual Human generates ultra-HD video effects, provides for clearer enunciation, and exercises better control over key details, such as lip features, lipstick reflections, actual pronunciation and illumination.

[IMG="https://miro.medium.com/max/400/0*3RyXSDbkVPUGNBZp.jpg"]https://miro.medium.com/max/400/0*3RyXSDbkVPUGNBZp.jpg[/IMG]

4. Integrating ML Kit's Virtual Human Service

4.1 Integration Process

4.1.1 Submitting the Text of the Video for Generation

Call the customized API for converting text into the virtual human video, and pass the required configurations (specified by parameter config) and text (specified by parameter data) to the backend for processing through the API. First, check the length of the passed text. The maximum length of the Chinese text is 1,000 characters, and that for the English text is 3,000 characters. Perform the non-null check on the passed configurations, then submit the text and configurations to convert the text into audio

4.1.2 Using the Data Provided by an Asynchronous Scheduled Task

Call the text-to-speech algorithm to convert text into the video, based on the data provided by the asynchronous scheduled task, and synthesize the video with the previously obtained audio.

4.1.3 Checking Whether the Text Has been Successfully Converted

Call the API for querying the results of converting text into the virtual human video, to check whether the text has been successfully converted. If the execution is complete, the video link will be returned.

4.1.4 Accessing the Videos via the Link

Access the generated video through the link returned by the API, to query the results of converting text into the virtual human video.

4.2 Main APIs for Integration

4.2.1 Customized API for Converting Text into the Virtual Human Video

URL: http://10.33.219.58:8888/v1/vup/text2vedio/submit

Request parameters

[IMG="https://miro.medium.com/max/569/1*Kiy80iILCXn-EONr0g3Mqg.png"]https://miro.medium.com/max/569/1*Kiy80iILCXn-EONr0g3Mqg.png[/IMG]

Main functions:

Input the customized API for converting text into the virtual human video. The API is asynchronous. Currently, Virtual Human can only complete the conversion using an offline mode, a process that takes time to complete. The conversion results can be queried via the API for querying the results of converting text into the virtual human video. If the submitted text has been synthesized, you can return and play the video directly.

Main logic:

Convert the text into audio based on the text and configurations to be synthesized, passed by the frontend. Execute multithreading asynchronously, generate the video that meets pronunciation requirements based on the text-to-speech algorithm, and then compound the video with audio to generate the virtual human video. If the submitted text has been synthesized, you can return and play the video directly.

4.2.2 API for Querying the Results of Converting Text into the Virtual Human Video

URL: http://10.33.219.58:8888/v1/vup/text2vedio/query

Request parameters

[IMG="https://miro.medium.com/max/621/1*e6LyaQSz8WIk6P3U1656Gw.png"]https://miro.medium.com/max/621/1*e6LyaQSz8WIk6P3U1656Gw.png[/IMG]

Main functions:

Query the conversion status in batches, based on the submitted text IDs.

Main logic:

Query the synthesis status of the video through textlds (the ID list of the synthesized text passed by the frontend), save the obtained status results to a set as the output parameter, and insert the parameter to the returned request. If the requested text has been synthesized, you can return and play the video directly.

4.2.3 API for Taking the Virtual Human Video Offline in Batches

URL: http://10.33.219.58:8888/v1/vup/text2vedio/offline

Request parameters

[IMG="https://miro.medium.com/max/569/1*1O0UNzk-y2qCCjmtD5MVDA.png"]https://miro.medium.com/max/569/1*1O0UNzk-y2qCCjmtD5MVDA.png[/IMG]

Main functions:

Bring the video offline in batches, based on the submitted text ID.

Main logic:

Change the status of the video corresponding to the ID in the array to offline through textlds (the ID array of the synthesized text transmitted by the frontend), and then delete the video. The offline video is not capable of being played.

4.3 Main Functions of ML Kit's Virtual Human

ML Kit's Virtual Human service has a myriad of powerful functions.

1. Dual language support: Virtual Human currently supports Chinese and English, and thus text in either Chinese or English can be used as audio data.

2. Multiple virtual anchors: The service supports up to four virtual anchors, one Chinese female voice, one English female voice, and two English male voices.

3. Picture-in-picture video: Picture-in-picture video play, in essence, small-window video playback, is supported as well. When playing a video in picture-in-picture mode, the video window moves in accordance with the rest of the screen. Users are able to view the text while playing the video, and can drag the video to any location on the screen for easier reading.

4. Adjustable speech speed, volume, and tone: The speech speed, volume, and tone can be adjusted at will, to meet a wide range of user needs.

5. Multi-background settings: The service allows you to choose from diverse backgrounds for virtual anchors. There are currently three built-in backgrounds provided: transparent, green-screen, and technological. You can also upload an image to apply a customized background.

6. Subtitles: Virtual Human is capable of automatically generating Chinese, English, and bilingual subtitles.

7. Multi-layout settings: You can change the position of the virtual anchors on the screen (left, right, or middle of the screen) by setting parameters. You can also determine the size of the virtual anchors and choose to place either their upper body or entire body in view. In addition, you are free to set a channel logo, its position on the screen, as well as the video to be played. This ensures that the picture-in-picture effect achieves a bona fide news broadcast experience.

Picture-in-picture effect:

[IMG="https://miro.medium.com/max/400/0*6OWXkKe6XOxX63EP.jpg"]https://miro.medium.com/max/400/0*6OWXkKe6XOxX63EP.jpg[/IMG]

5. Final Thoughts

As a developer, after using ML Kit's Virtual Human service to generate a video, I was shocked at its capabilities, especially the picture-in-picture capability, which helped me generate real news broadcast effects. It has got me wondering whether virtual humans will soon replace real anchors.

To learn more, please visit the official website:

Reference

Official website of Huawei Developers

Development Guide

HMS Core official community on Reddit

Demo and sample code

Discussions on Stack Overflow