Data processing method and device for virtual image, electronic device and medium
By extracting facial key points and audio features and using key point generation networks and video generation models, the problems of high computing resource consumption and unstable effects in virtual digital human video generation are solved, and efficient and diverse video generation is achieved.
Patent Information
- Application Number
- CN202411766312.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Existing technologies have problems with generating realistic and expressive virtual human videos, such as high computing resource consumption, unstable generation effects, and insufficient diversity, especially in methods based on GAN and diffusion models.
By extracting the facial key points and audio features of the target object, using the preset key point generation network model and video generation model, a facial key point image sequence is generated, and video generation is guided based on the sequence, reducing the consumption of computing resources and improving the stability and diversity of the generation effect.
It is possible to judge the video generation effect in advance through the facial key point image sequence, save computing resources, improve the accuracy and diversity of generated videos, and reduce computing costs.
Smart Images

Figure CN119648876B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, in particular to the fields of deep learning, image processing, and digital human technology, and specifically to a data processing method, device, electronic device, computer-readable storage medium, and computer program product for virtual images. Background Art
[0002] Artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.
[0003] With the development of artificial intelligence (AI) technology, virtual humans have been widely used in live broadcasts, news broadcasts, voice prompts, and other fields. Typically, the desired audio is used to drive the virtual human to perform movements and expressions synchronized with the audio, resulting in a video driven by the audio. Generating realistic and expressive portrait videos from a single facial image through audio-driven processing has broad application prospects, encompassing a wide range of fields, from digital media to gaming and film and television creation. Summary of the Invention
[0004] The present disclosure provides a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product for a virtual image.
[0005] According to one aspect of the present disclosure, a data processing method for a virtual image is provided, comprising: acquiring audio data and a first target image including a target object's face; performing facial key point extraction based on the first target image to obtain a first facial key point image; performing audio feature extraction based on the audio data to obtain audio features; inputting the first facial key point image and the audio features into a preset key point generation network model to obtain a facial key point image sequence corresponding to the audio data; and, based on the facial key point image sequence and the first target image, obtaining a video corresponding to the audio data generated based on the first target image.
[0006] According to another aspect of the present disclosure, a model training method is provided, comprising: acquiring an audio frame, a first target image including a face of a target object, a first label image, and a second label image, wherein the first label image is a first facial key point image corresponding to the audio frame generated based on the first target image, and the second label image is a first image corresponding to the audio frame generated based on the first target image; performing facial key point extraction based on the first target image to obtain a second facial key point image; performing audio feature extraction based on the audio frame to obtain audio features; inputting the second facial key point image and the audio features into a key point generation network model to obtain a third facial key point image corresponding to the audio frame; and determining a first loss value based on the third facial key point image and the first facial key point image using a preset first loss function; obtaining a second image corresponding to the audio frame generated based on the first target image using a video generation model based on the third facial key point image and the first target image; determining a second loss value based on the second image and the first image using a preset second loss function; adjusting parameter values of the key point generation network model based on the first loss value; and adjusting parameter values of the video generation model based on the second loss value.
[0007] According to another aspect of the present disclosure, a data processing device for a virtual image is provided, including: a first acquisition unit, configured to acquire audio data and a first target image including a target object's face; a first key point extraction unit, configured to perform facial key point extraction based on the first target image to obtain a first facial key point image; a first feature extraction unit, configured to perform audio feature extraction based on the audio data to obtain audio features; a second feature extraction unit, configured to input the first facial key point image and the audio features into a preset key point generation network model to obtain a facial key point image sequence corresponding to the audio data; and a first video generation unit, configured to obtain a video corresponding to the audio data generated based on the first target image based on the facial key point image sequence and the first target image.
[0008] According to another aspect of the present disclosure, a model training device is provided, comprising: a second acquisition unit, configured to acquire an audio frame, a first target image including a target object's face, a first label image, and a second label image, wherein the first label image is a first facial key point image corresponding to the audio frame generated based on the first target image, and the second label image is a first image corresponding to the audio frame generated based on the first target image; a first key point extraction unit, configured to perform facial key point extraction based on the first target image to obtain a second facial key point image; a third feature extraction unit, configured to perform audio feature extraction based on the audio frame to obtain audio features; and a fourth feature extraction unit, configured to input the second facial key point image and the audio features into a key point generation unit. A facial key point generation network model is formed to obtain a third facial key point image corresponding to the audio frame; a first loss unit is configured to determine a first loss value based on the third facial key point image and the first facial key point image through a preset first loss function; a second video generation unit is configured to obtain a second image corresponding to the audio frame generated based on the first target image through a video generation model based on the third facial key point image and the first target image; a second loss unit is configured to determine a second loss value based on the second image and the first image through a preset second loss function; a first adjustment unit is configured to adjust the parameter value of the key point generation network model based on the first loss value; and a second adjustment unit is configured to adjust the parameter value of the video generation model based on the second loss value.
[0009] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the method described in the present disclosure.
[0010] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method described in the present disclosure.
[0011] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the method described in the present disclosure when executed by a processor.
[0012] According to one or more embodiments of the present disclosure, facial images and driving audio of a target object are preprocessed to extract facial key points and audio features, thereby obtaining a facial key point image sequence to guide the generation of a corresponding facial video. Since the computational time and resources consumed by video generation are much greater than the generation of facial key point images, the facial key point image sequence can be used to determine the video generation effect in advance and make timely adjustments, thereby saving computing resources.
[0013] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the description of the specification, they serve to explain exemplary implementation of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals designate similar, but not necessarily identical, elements.
[0015] Figure 1 A schematic diagram illustrating an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;
[0016] Figure 2 A flow chart of a data processing method according to an embodiment of the present disclosure is shown;
[0017] Figure 3 A schematic diagram showing a data processing method according to an embodiment of the present disclosure is shown;
[0018] Figure 4 A schematic diagram of a facial key point image sequence generation model according to an embodiment of the present disclosure is shown;
[0019] Figure 5 A schematic diagram of a video generation model for generating a video according to an embodiment of the present disclosure is shown;
[0020] Figure 6 A flow chart of a model training method according to an embodiment of the present disclosure is shown;
[0021] Figure 7 shows a structural block diagram of a data processing device according to an embodiment of the present disclosure;
[0022] Figure 8 shows a structural block diagram of a model training device according to an embodiment of the present disclosure; and
[0023] Figure 9A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0024] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0025] In this disclosure, unless otherwise specified, the use of terms such as "first" and "second" to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements. Such terms are only used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of the element, while in some cases, based on the context of the description, they may also refer to different instances.
[0026] The terms used in the descriptions of the various examples described in this disclosure are for the purpose of describing specific examples only and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element may be one or more. In addition, the term "and / or" used in this disclosure encompasses any one and all possible combinations of the listed items.
[0027] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0028] Figure 1 FIG2 is a schematic diagram of an exemplary system 100 in which the various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 can be configured to execute one or more applications.
[0029] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the method of data processing to be performed.
[0030] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0031] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may, in turn, utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0032] The user can use the client device 101, 102, 103, 104, 105 and / or 106 to input a first target image, audio data or display video, etc. The client device can provide an interface that enables the user of the client device to interact with the client device. The client device can also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure can support any number of client devices.
[0033] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux, or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing a variety of different applications, such as various internet-related applications, communication applications (such as email applications), and short message service (SMS) applications, and may use various communication protocols.
[0034] The network 110 may be any type of network known to those skilled in the art that can support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0035] Server 120 may include one or more general-purpose computers, specialized server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0036] The computing units in the server 120 may run one or more operating systems including any of the operating systems described above as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
[0037] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display the data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0038] In some embodiments, server 120 may be a distributed system server or a server integrated with blockchain. Server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host equipped with artificial intelligence technology. A cloud server is a host product within the cloud computing service system that addresses the management difficulties and poor scalability of traditional physical hosts and virtual private servers (VPS) services.
[0039] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in a variety of locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.
[0040] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0041] Figure 1The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in accordance with the present disclosure.
[0042] In early studies, researchers achieved face reconstruction by constructing parametric facial models (such as 3DMM). 3DMM can model features such as shape, expression, texture, and angle. However, the performance of the face model rendering algorithm based on 3DMM is poor and it is impossible to generate high-precision texture, teeth and other detailed areas.
[0043] Recently, deep learning-based approaches have been widely studied for their impressive video generation performance. The two most representative approaches are GAN-based methods (such as the StyleGAN series) and diffusion model-based methods (such as Hallo, Follow-Your-Emoji, EchoMimic, and Aniportrait). GAN-based methods generate more realistic portraits, but their diversity is significantly affected by data distribution, and the training process is unstable, prone to mode collapse. Diffusion model-based methods, on the other hand, can generate high-quality, high-resolution, and more diverse portrait videos, but require more computing resources.
[0044] Therefore, according to an embodiment of the present disclosure, a data processing method for a virtual image is provided to generate a corresponding video based on audio drive. Figure 2 A flow chart of a data processing method according to an embodiment of the present disclosure is shown. Figure 2 As shown, method 200 includes: acquiring audio data and a first target image including a target object's face (step 210); performing facial key point detection based on the first target image to obtain a first facial key point image (step 220); performing audio feature extraction based on the audio data to obtain audio features (step 230); inputting the first facial key point image and the audio features into a preset key point generation network model to obtain a facial key point image sequence corresponding to the audio data (step 240); and obtaining a video corresponding to the audio data generated based on the first target image based on the facial key point image sequence and the first target image (step 250).
[0045] Figure 3 FIG. 1 shows a schematic diagram of a data processing method according to an embodiment of the present disclosure. Figure 3 As shown, the generation of key point images is guided by inputting a target image and a driving audio. Here, exemplarily, based on a sequence of facial key point images and a target image, a video corresponding to the audio data is generated by a video generation model (described in detail later).
[0046] According to the embodiments of the present disclosure, the facial image and driving audio of the target object are preprocessed to extract facial key points and audio features, and then a facial key point image sequence is obtained to guide the generation of the corresponding facial video. Since the computational time and resources consumed by video generation are much greater than the generation of facial key point images, the facial key point image sequence can be used to judge the video generation effect in advance and make timely adjustments, thereby saving computing resources.
[0047] In step 210 , audio data and a first target image including a target object's face are acquired.
[0048] In this disclosure, audio data refers to digitized voice data. For example, the audio data may be a segment of voice data that needs to be broadcast or live-broadcasted, and the audio data is the audio that a virtual digital human needs to output. For example, the audio data may be voice data generated by reading a paragraph of text aloud; further, the audio data may be voice data generated by reading the paragraph of text aloud with corresponding emotions, such as joy, sadness, anger, etc. The virtual digital human is a digital human used to broadcast the audio data, and the virtual digital human may be a two-dimensional virtual digital human generated based on the target object.
[0049] In the present disclosure, the target object may not only be a person, but may also be an animal, or an anthropomorphic animal, an object, etc., which is not limited here.
[0050] For example, taking the target object as a real person, when the audio data is voice data generated by reading a text, the generated video can be a video clip including the target object, wherein the expression changes of the target object in the video are consistent with the usual expression changes of the real person when reading the text.
[0051] In some embodiments, the generated video may include not only the face of the target object, but also further include a background area in the first target image except the face of the target object.
[0052] In step 220, facial key point detection is performed based on the first target image to obtain a first facial key point image.
[0053] Specifically, in some examples, facial landmark detection involves using algorithms to locate key areas in a facial image, such as eyebrows, eyes, nose, mouth, and facial contours. During the detection process, the system returns the coordinates of these landmarks, enabling detailed recognition and analysis of the target subject's face.
[0054] In some examples, facial keypoint detection can use various suitable keypoint annotation methods, such as 68 points, 96 / 98 points, or 106 / 186 points, without limitation. For example, when implementing 68-point annotation on a face, facial keypoints are divided into internal keypoints and contour keypoints. Internal keypoints include eyebrows, eyes, nose, and mouth, totaling 51 keypoints, while contour keypoints include 17 keypoints. Thus, a facial keypoint image is obtained. This facial keypoint image can include coordinate information or position information for each keypoint.
[0055] In some examples, pupil keypoints can be further included in facial landmark detection. For eye-related applications such as face recognition, expression transformation, and eye movement tracking, accurate pupil location is crucial. Using two keypoints to represent the left and right pupils provides more accurate location information, enabling more refined expression transformation analysis and processing.
[0056] In some examples, 3D facial reconstruction can be performed on the first image using 3D facial reconstruction technology to obtain an image of the target subject's facial key points. For example, the 3D coordinates of facial key points can be extracted using open-source plugins such as Media Pipe or FaceNet. Alternatively, it is understood that 2D coordinates of facial key points can also be extracted using OpenCV, etc., without limitation.
[0057] In step 230, audio feature extraction is performed based on the audio data to obtain audio features.
[0058] In the present disclosure, feature extraction can be performed on audio data using any suitable method to obtain audio features. For example, feature extraction can be performed on audio data using a Mel Frequency Cepstral Coefficient (MFCC) method to obtain audio features, which can represent spectral characteristics of the audio data.
[0059] In some examples, feature extraction operations on audio data can also be implemented through trained neural networks, such as wav2vec, whisper, etc., which are not limited here.
[0060] In step 240, the first facial key point image and the audio feature are input into a preset key point generation network model to obtain a facial key point image sequence corresponding to the audio data.
[0061] According to some embodiments, the preset key point generation network model includes a self-attention layer and a cross-attention layer. Inputting the first facial key point image and the audio features into the preset key point generation network model to obtain a facial key point image sequence corresponding to the audio data includes: inputting the first facial key point image into the self-attention layer to obtain a first image feature; and inputting the first image feature and the audio feature into the cross-attention layer to obtain a facial key point image sequence corresponding to the audio data.
[0062] In this embodiment, image features are extracted through a preset self-attention layer, and image features and audio features are fused through a cross-attention layer to obtain a facial key point image sequence.
[0063] According to some embodiments, inputting the first image features and the audio features into a preset cross-attention layer to obtain a facial key point image sequence corresponding to the audio data includes: generating a first expression image based on the first facial key point image, wherein the first expression image is generated based on the lines connecting facial key points related to expressions in the first facial key point image; channel-wise splicing the first expression image and the first target image to obtain a spliced image; performing image feature extraction on the spliced image to obtain a second image feature; and inputting the second image feature, the first image feature and the audio feature into a preset cross-attention layer to obtain a facial key point image sequence corresponding to the audio data.
[0064] In this embodiment, the first expression image generated based on the first target image and the target object are spliced together, and the image of the spliced image is further input into the cross-attention layer to more accurately identify the facial position (e.g., human face position) in the first target image and enhance the target facial features, thereby improving the accuracy of the subsequently generated video.
[0065] In some examples, the above-mentioned operation of obtaining the first image features and / or the facial key point image sequence can be implemented through the attention model in the Transformer model to complete the feature embedding of the audio data and the first target image, and further guide the generation of the facial key point image.
[0066] According to some embodiments, inputting the second image feature, the first image feature and the audio feature into a preset cross-attention layer to obtain a facial key point image sequence corresponding to the audio data includes: inputting the first image feature and the audio feature into a preset first cross-attention layer to obtain a first output feature; inputting the first output feature and the second image feature into a preset second cross-attention layer to obtain a second output feature; and inputting the second output feature and the audio feature into a preset third cross-attention layer to obtain a facial key point image sequence corresponding to the audio data.
[0067] In step 250, based on the facial key point image sequence and the first target image, a video corresponding to the audio data and generated based on the first target image is obtained.
[0068] According to some embodiments, based on the facial key point image sequence and the first target image, obtaining a video corresponding to the audio data generated based on the first target image includes: generating an expression image sequence based on the facial key point image sequence, wherein the expression images in the expression image sequence are generated based on the lines connecting facial key points related to expressions in the corresponding facial key point images; and based on the expression image sequence and the first target image, obtaining a video corresponding to the audio data generated based on the first target image.
[0069] Figure 4 FIG. 1 shows a schematic diagram of a facial key point image sequence generation model according to an embodiment of the present disclosure. Figure 4As shown, facial key point detection (i.e., key point extraction) is performed on a first target image to obtain a first facial key point image. Drawing is performed based on the first facial key point image to obtain a first expression image. The first expression image and the first target image are channel-joined to obtain a spliced image. The spliced image is subjected to image feature extraction by a face localization module to obtain a second image feature. The first facial key point image is input into a self-attention layer to extract key point features and obtain a first image feature. The output first image feature and the extracted audio feature are input into a first cross-attention layer to calculate a cross-attention score between the key point features (i.e., the first image feature) and the audio feature to achieve audio feature embedding and obtain a first output feature. The second image feature and the first output feature are input into a second cross-attention layer to further embed the image feature in the same manner to enhance facial region features and supplement additional information such as identity and environment, thereby obtaining a second output feature. The second output feature and the audio feature are input into a third cross-attention layer, and finally, audio feature embedding is performed again to enhance the audio-driven effect, thereby obtaining a facial key point image sequence corresponding to the audio data. Finally, the corresponding expression images are drawn according to the generated facial key point image sequence to obtain the expression image sequence.
[0070] In some examples, the expression image may include lines connecting key points of the eyes, mouth, eyebrows, or facial contour below the eyebrows or eyes. Typically, the nose changes little or nothing during facial expression, so the nose may be ignored in the expression image, and no lines are drawn for the key points of the nose.
[0071] In the above facial key point detection example including pupil key points, the expression image can further include pupil key point information, thereby providing more accurate facial position information and facilitating more detailed analysis and processing.
[0072] According to some embodiments, based on the expression image sequence and the first target image, obtaining a video corresponding to the audio data generated based on the first target image includes: performing image feature extraction on the first target image to obtain a third image feature; performing image feature extraction on the expression images in the expression image sequence to obtain a fourth image feature sequence; inputting the third image feature and the fourth image feature sequence into a preset diffusion model to obtain a fifth image feature sequence; and obtaining a video corresponding to the audio data generated based on the first target image based on the fifth image feature sequence.
[0073] In this disclosure, image feature extraction is the process of extracting useful information from an image. This information is typically expressed in the form of numerical values, vectors, or symbols, rather than directly in the image itself. These features help computers "understand" the image content, thereby enabling image recognition and classification. Image features typically include geometric features, shape features, amplitude features, histogram features, and color features.
[0074] In some examples, image features are extracted from each expression image in the expression image sequence to obtain a fourth image feature sequence.
[0075] In some examples, image features can be extracted from the first target image using an image encoder to obtain third image features. An image encoder is a component used to process visual information, converting image data into a format that can be further analyzed by a model. This typically involves feature extraction, which extracts useful information from an image, such as color, texture, shape, and object location.
[0076] According to some embodiments, performing image feature extraction on the first target image to obtain a third image feature includes: inputting the first target image into a variational autoencoder to obtain the third image feature; and obtaining a video corresponding to the audio data generated based on the first target image based on the fifth image feature sequence includes: inputting the fifth image feature sequence into a variational autodecoder to obtain a video corresponding to the audio data generated based on the first target image.
[0077] In some cases, image feature extraction can be performed using deep learning-based neural networks, such as convolutional neural networks (CNNs). CNNs automatically learn features through multi-layer networks, eliminating the need for manual feature extraction rules. VGG and ResNet are two well-known CNN architectures that extract image features through deep network structures.
[0078] It is understandable that in the embodiments of the present disclosure, image feature extraction can be achieved by any suitable method, which is not limited here.
[0079] According to some embodiments, the diffusion model includes an image generation module and a video synthesis module, wherein inputting the third image feature and the fourth image feature sequence into a preset diffusion model to obtain a fifth image feature sequence includes: inputting the third image feature and the fourth image feature sequence into the image generation module to obtain a sixth image feature sequence, wherein each image feature in the sixth image feature sequence is an image feature generated based on the first target image and corresponds to the corresponding image feature in the fourth image feature sequence; and inputting the sixth image feature sequence into the video synthesis module to obtain the fifth image feature sequence, wherein the video synthesis model is used to achieve the smoothness of the video generated based on the fifth image feature sequence.
[0080] According to some embodiments, performing image feature extraction on the expression images in the expression image sequence to obtain a fourth image feature sequence includes: for the corresponding expression images in the expression image sequence, inputting the expression images into a preset linear attention network to obtain corresponding image features; and obtaining the fourth image feature sequence based on the corresponding image features corresponding to the expression image sequence.
[0081] Figure 5 FIG. 5 shows a schematic diagram of a video generation model for generating a video according to an embodiment of the present disclosure. Figure 5 As shown, the first target image is input into an image encoder to obtain a third image feature; the expression image sequence is input into a key point encoder to obtain a fourth image feature sequence; the third and fourth image feature sequences are sequentially input into the image generation module and video synthesis module in the diffusion model to obtain a fifth image feature sequence. The fifth image feature sequence is then passed through an image decoder to obtain a video generated based on the first target image. In some examples, the diffusion model can employ a Unet framework, with the image generation module responsible for generating the target object and supplementing the image background in a single image, and the video synthesis module ensuring the smoothness and stability of the entire video to be generated.
[0082] According to the embodiments of the present disclosure, Figure 6As shown, a model training method 600 is also provided, comprising: obtaining an audio frame, a first target image including a target object's face, a first label image, and a second label image (step 610); performing facial key point extraction based on the first target image to obtain a second facial key point image (step 620); performing audio feature extraction based on the audio frame to obtain audio features (step 630); inputting the second facial key point image and the audio features into a key point generation network model to obtain a third facial key point image corresponding to the audio frame (step 640); extracting the second facial key point image and the audio features from the third .... The first facial key point image is obtained by using a preset first loss function (step 650); based on the third facial key point image and the first target image, a second image corresponding to the audio frame generated based on the first target image is obtained through a video generation model (step 660); based on the second image and the first image, a second loss value is determined through a preset second loss function (step 670); based on the first loss value, the parameter value of the key point generation network model is adjusted (step 680); based on the second loss value, the parameter value of the video generation model is adjusted (step 690).
[0083] In an embodiment of the present disclosure, the first label image is a first facial key point image corresponding to the audio frame generated based on the first target image, and the second label image is a first image corresponding to the audio frame generated based on the first target image.
[0084] In the present disclosure, audio frames can be obtained by framing a segment of audio data, where audio data refers to digitized voice data. For example, the audio data can be voice data that needs to be broadcast or live-broadcasted, and the audio data is the audio that a virtual digital human needs to output. For example, the audio data can be voice data generated by reading a paragraph of text aloud; further, the audio data can be voice data generated by reading the paragraph of text aloud with a corresponding emotion, such as joy, sadness, anger, etc.
[0085] In an embodiment of the present disclosure, the self-attention layer and the cross-attention layer can be trained based on the first loss function, and then the video generation model can be trained based on the second loss function. That is, the self-attention layer and the cross-attention layer can be trained separately from the video generation model or together, without limitation.
[0086] According to some embodiments, the keypoint generation network model includes a self-attention layer and a cross-attention layer. Inputting the second facial keypoint image and the audio features into the keypoint generation network model to obtain a third facial keypoint image corresponding to the audio frame includes: inputting the second facial keypoint image into the self-attention layer to obtain first image features; and inputting the first image features and the audio features into the cross-attention layer to obtain a third facial keypoint image corresponding to the audio frame.
[0087] According to some embodiments, based on the third facial landmark image and the first target image, obtaining, through a video generation model, a second image corresponding to the audio frame and generated based on the first target image includes: generating a first expression image based on the third facial landmark image, wherein the first expression image is generated based on lines connecting facial landmarks related to expression in the third facial landmark image; inputting the first expression image and the first target image into the video generation model to obtain a second image corresponding to the audio frame, generated based on the first target image. According to some embodiments, inputting the first image features and the audio features into a cross-attention layer to obtain a third facial landmark image corresponding to the audio frame includes: generating a second expression image based on the second facial landmark image, wherein the second expression image is generated based on lines connecting facial landmarks related to expression in the second facial landmark image; channel-wise concatenating the second expression image and the first target image to obtain a concatenated image; inputting the concatenated image into a face localization module to obtain second image features; and inputting the first image features, the second image features, and the audio features into a cross-attention layer to obtain a third facial landmark image corresponding to the audio frame.
[0088] According to some embodiments, adjusting the parameter values of the key point generation network model based on the first loss value includes: adjusting the parameter values of the self-attention layer, the cross-attention layer and the face localization module based on the first loss value.
[0089] According to some embodiments, the cross-attention layer includes a first cross-attention layer, a second cross-attention layer, and a third cross-attention layer. Inputting the first image feature and the audio feature into the cross-attention layer to obtain a third facial landmark image corresponding to the audio frame includes: inputting the first image feature and the audio feature into the first cross-attention layer to obtain a first output feature; inputting the first output feature and the second image feature into the second cross-attention layer to obtain a second output feature; and inputting the second output feature and the audio feature into the third cross-attention layer to obtain a third facial landmark image corresponding to the audio frame.
[0090] According to some embodiments, the video generation model includes a first image encoder, a second image encoder, a diffusion model, and an image decoder. Inputting the first expression image and the first target image into the video generation model to obtain a second image corresponding to the audio frame generated based on the first target image includes: inputting the first target image into the first image encoder to obtain a third image feature; inputting the first expression image into the second image encoder to obtain a fourth image feature; inputting the third image feature and the fourth image feature into the diffusion model to obtain a fifth image feature; and inputting the fifth image feature into the image decoder to obtain the second image corresponding to the audio frame generated based on the first target image.
[0091] According to some embodiments, adjusting parameter values of the video generation model based on the second loss value includes adjusting parameter values of the second image encoder and the diffusion model based on the second loss value.
[0092] According to some embodiments, the diffusion model includes an image generation module and a video synthesis module, wherein inputting the third image feature and the fourth image feature into the diffusion model to obtain the fifth image feature includes: inputting the third image feature and the fourth image feature into the image generation module to obtain a sixth image feature, wherein the sixth image feature is an image feature corresponding to the fourth image feature generated based on the first target image; and inputting the sixth image feature into the video synthesis module to obtain the fifth image feature, wherein the video synthesis model is used to achieve the smoothness of the video when generating the video based on multiple fourth image features.
[0093] According to some embodiments, adjusting parameter values of the video generation model based on the second loss value includes adjusting parameter values of the second image encoder and the image generation module based on the second loss value.
[0094] According to some embodiments, the model training method according to the present disclosure also includes: obtaining multiple second expression images, a second target image including the face of the target object, and multiple third label images corresponding one-to-one to the multiple second expression images, wherein each of the multiple second expression images is generated based on the connection lines of facial key points related to the expression in the corresponding facial key point image; inputting the second target image into the first image encoder to obtain a seventh image feature; inputting the multiple second expression images into the second image encoder to obtain a plurality of eighth image features; inputting the seventh image feature and the multiple eighth image features into the image generation module to obtain a plurality of ninth image features, wherein the multiple ninth image features correspond one-to-one to the multiple eighth image features; and inputting the multiple ninth image features into the video synthesis module to obtain a plurality of tenth image features; inputting the multiple tenth image features into the image decoder to obtain a plurality of third images; determining a third loss value based on the multiple third images and the multiple third label images through a preset second loss function; and adjusting the parameter value of the video synthesis module based on the third loss value.
[0095] Specifically, in some examples, the training of the video generation model can be divided into two stages. In the first stage, the second image encoder and image generation module are trained based on a single-frame expression image; in the second stage, the video synthesis module is trained based on multiple frames of expression images to improve the fluency of the generated video.
[0096] According to some embodiments, the second image encoder comprises a linear attention network.
[0097] According to some embodiments, the preset first loss function loss1 is determined based on the following formula:
[0098]
[0099] in, represents the coordinate information of the i-th facial key point in the first facial key point image, A i represents the coordinate information of the i-th facial key point in the third facial key point image, n1 represents the number of facial key points in the first facial key point image and the third facial key point image, B j represents the coordinate information of the jth key point related to the mouth in the third facial key point image, represents the coordinate information of the jth key point related to the mouth in the first facial key point image, n2 represents the number of key points related to the mouth in the first facial key point image and the third facial key point image, and a1 and b1 are both preset hyperparameters.
[0100] According to some embodiments, the preset second loss function loss2 is determined based on the following formula:
[0101]
[0102] in, represents the first image or the corresponding third label image, C represents the second image or the corresponding third image, D represents the mouth mask image, and a2 and b2 are both preset hyperparameters.
[0103] In some examples, when When represents the corresponding third label image among the multiple third label images and C represents the corresponding third image among the multiple third images, the loss value corresponding to each image in the multiple third label images / third images can be calculated by the above formula, and the third loss value is obtained by adding the loss values corresponding to the multiple third label images / third images to adjust the parameter value of the video synthesis module based on the third loss value.
[0104] In this example, to improve the clarity and stability of tooth generation, a mouth mask loss and an overall image loss are used to supervise model training simultaneously. Furthermore, in some examples, by appropriately setting a2 and b2, the weight of the mouth mask loss can be increased to further improve the clarity and stability of tooth generation.
[0105] In the present disclosure, the model trained by the model training method described in any one of the above embodiments can be used to implement the data processing method described in any one of the embodiments of the present disclosure.
[0106] Here, the embodiments for implementing the model training method and the embodiments for implementing the data processing method have similar corresponding operations and will not be repeated here.
[0107] According to the embodiments of the present disclosure, Figure 7As shown, a data processing device 700 for a virtual image is also provided, including: a first acquisition unit 710, configured to acquire audio data and a first target image including a target object's face; a first key point extraction unit 720, configured to perform facial key point extraction based on the first target image to obtain a first facial key point image; a first feature extraction unit 730, configured to perform audio feature extraction based on the audio data to obtain audio features; a second feature extraction unit 740, configured to input the first facial key point image and the audio features into a preset key point generation network model to obtain a facial key point image sequence corresponding to the audio data; and a first video generation unit 750, configured to obtain a video corresponding to the audio data generated based on the first target image based on the facial key point image sequence and the first target image.
[0108] Here, the operations of the above-mentioned units 710-750 of the data processing device 700 are similar to the operations of steps 210-250 described above, and are not repeated here.
[0109] According to the embodiments of the present disclosure, Figure 8As shown, a model training device 800 is also provided, including: a second acquisition unit 810, configured to acquire an audio frame, a first target image including a target object's face, a first label image, and a second label image, wherein the first label image is a first facial key point image corresponding to the audio frame generated based on the first target image, and the second label image is a first image corresponding to the audio frame generated based on the first target image; a first key point extraction unit 820, configured to perform facial key point extraction based on the first target image to obtain a second facial key point image; a third feature extraction unit 830, configured to perform audio feature extraction based on the audio frame to obtain audio features; a fourth feature extraction unit 840, configured to input the second facial key point image and the audio features into a key point generation network model. model to obtain a third facial key point image corresponding to the audio frame; a first loss unit 850 is configured to determine a first loss value based on the third facial key point image and the first facial key point image through a preset first loss function; a second video generation unit 860 is configured to obtain a second image corresponding to the audio frame generated based on the first target image through a video generation model based on the third facial key point image and the first target image; a second loss unit 870 is configured to determine a second loss value based on the second image and the first image through a preset second loss function; a first adjustment unit 880 is configured to adjust the parameter value of the key point generation network model based on the first loss value; and a second adjustment unit 890 is configured to adjust the parameter value of the video generation model based on the second loss value.
[0110] Here, the operations of the above-mentioned units 810 to 890 of the model training device 800 are similar to the operations of steps 610 to 690 described above, and will not be repeated here.
[0111] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0112] According to an embodiment of the present disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.
[0113] refer to Figure 9, a block diagram of an electronic device 900 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0114] like Figure 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0115] Multiple components within electronic device 900 are connected to I / O interface 905, including an input unit 906, an output unit 907, a storage unit 908, and a communication unit 909. Input unit 906 can be any type of device capable of inputting information into electronic device 900. Input unit 906 can receive input numeric or character information and generate key signal input related to user settings and / or function control of the electronic device. It may include, but is not limited to, a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 907 can be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. Storage unit 908 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 909 allows electronic device 900 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks. It may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0116] The computing unit 901 may be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as method 200 or 600. For example, in some embodiments, method 200 or 600 may be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of method 200 or 600 described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute the method 200 or 600 in any other appropriate manner (eg, by means of firmware).
[0117] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0118] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0119] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0121] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0122] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0123] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0124] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but is only limited by the claims after authorization and their equivalents. Various elements in the embodiments or examples can be omitted or replaced by their equivalents. In addition, the steps can be performed in an order different from that described in this disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that as technology evolves, many of the elements described here can be replaced by equivalent elements that appear after this disclosure.
Claims
1. A data processing method for a virtual image, comprising: Acquire audio data and a first target image including a face of a target object; Extracting facial key points based on the first target image to obtain a first facial key point image; Performing audio feature extraction based on the audio data to obtain audio features; Inputting the first facial key point image and the audio feature into a preset key point generation network model to obtain a facial key point image sequence corresponding to the audio data, wherein the preset key point generation network model includes: a self-attention layer and a cross-attention layer, including: Inputting the first facial landmark image into the self-attention layer to obtain a first image feature; generating a first expression image based on the first facial key point image, wherein the first expression image is generated based on lines connecting facial key points related to expression in the first facial key point image; Perform channel stitching on the first expression image and the first target image to obtain a stitched image; performing image feature extraction on the spliced image to obtain a second image feature; and Inputting the second image feature, the first image feature, and the audio feature into the cross attention layer to obtain a facial landmark image sequence corresponding to the audio data; and Based on the facial key point image sequence and the first target image, a video corresponding to the audio data generated based on the first target image is obtained.
2. The method of claim 1, wherein Obtaining, based on the facial key point image sequence and the first target image, a video corresponding to the audio data generated based on the first target image includes: generating an expression image sequence based on the facial key point image sequence, wherein the expression images in the expression image sequence are generated based on lines connecting facial key points related to expressions in corresponding facial key point images; and Based on the expression image sequence and the first target image, a video corresponding to the audio data and generated based on the first target image is obtained.
3. The method according to claim 1, wherein The cross-attention layer includes a first cross-attention layer, a second cross-attention layer, and a third cross-attention layer, and wherein inputting the second image feature, the first image feature, and the audio feature into a preset cross-attention layer to obtain a facial key point image sequence corresponding to the audio data includes: Inputting the first image feature and the audio feature into a preset first cross attention layer to obtain a first output feature; Inputting the first output feature and the second image feature into a preset second cross attention layer to obtain a second output feature; and The second output feature and the audio feature are input into a preset third cross-attention layer to obtain a facial key point image sequence corresponding to the audio data.
4. The method according to claim 2, wherein: Obtaining, based on the expression image sequence and the first target image, a video corresponding to the audio data and generated based on the first target image includes: performing image feature extraction on the first target image to obtain a third image feature; performing image feature extraction on the facial expression images in the facial expression image sequence to obtain a fourth image feature sequence; Inputting the third image feature and the fourth image feature sequence into a preset diffusion model to obtain a fifth image feature sequence; and A video corresponding to the audio data and generated based on the first target image is obtained based on the fifth image feature sequence.
5. The method according to claim 4, wherein The diffusion model includes an image generation module and a video synthesis module, wherein inputting the third image feature and the fourth image feature sequence into a preset diffusion model to obtain a fifth image feature sequence includes: inputting the third image feature and the fourth image feature sequence into the image generation module to obtain a sixth image feature sequence, wherein the image features in the sixth image feature sequence are image features generated based on the first target image and corresponding to the corresponding image features in the fourth image feature sequence; and The sixth image feature sequence is input into the video synthesis module to obtain the fifth image feature sequence, wherein the video synthesis module is used to achieve smoothness of the video generated based on the fifth image feature sequence.
6. The method according to claim 4 or 5, wherein Extracting image features from the first target image to obtain third image features includes: inputting the first target image into a variational autoencoder to obtain the third image features; and Obtaining a video corresponding to the audio data generated based on the first target image based on the fifth image feature sequence includes: inputting the fifth image feature sequence into a variational autodecoder to obtain a video corresponding to the audio data generated based on the first target image.
7. The method according to claim 4 or 5, wherein Extracting image features from the facial expression images in the facial expression image sequence to obtain a fourth image feature sequence includes: For a corresponding expression image in the expression image sequence, inputting the expression image into a preset linear attention network to obtain corresponding image features; and The fourth image feature sequence is obtained based on the corresponding image features corresponding to the expression image sequence.
8. A model training method comprising: Acquire an audio frame, a first target image including a target object's face, a first label image, and a second label image, wherein the first label image is a first facial key point image corresponding to the audio frame generated based on the first target image, and the second label image is a first image corresponding to the audio frame generated based on the first target image; Extracting facial key points based on the first target image to obtain a second facial key point image; Performing audio feature extraction based on the audio frame to obtain audio features; Inputting the second facial key point image and the audio features into a key point generation network model to obtain a third facial key point image corresponding to the audio frame, wherein the key point generation network model includes: a self-attention layer and a cross-attention layer, including: Inputting the second facial key point image into the self-attention layer to obtain a first image feature; generating a second facial expression image based on the second facial key point image, wherein the second facial expression image is generated based on lines connecting facial key points related to facial expressions in the second facial key point image; Perform channel stitching on the second expression image and the first target image to obtain a stitched image; Inputting the stitched image into a face positioning module to obtain a second image feature; and Inputting the first image feature, the second image feature, and the audio feature into the cross attention layer to obtain a third facial landmark image corresponding to the audio frame; and Determining a first loss value based on the third facial key point image and the first facial key point image using a preset first loss function; Based on the third facial key point image and the first target image, obtaining, by a video generation model, a second image corresponding to the audio frame and generated based on the first target image; Determining a second loss value based on the second image and the first image using a preset second loss function; Adjusting parameter values of the keypoint generation network model based on the first loss value; and Parameter values of the video generation model are adjusted based on the second loss value.
9. The method of claim 8, wherein: Based on the third facial key point image and the first target image, obtaining, by a video generation model, a second image corresponding to the audio frame and generated based on the first target image includes: generating a first facial expression image based on the third facial key point image, wherein the first facial expression image is generated based on lines connecting facial key points related to facial expressions in the third facial key point image; The first expression image and the first target image are input into the video generation model to obtain a second image corresponding to the audio frame that is generated based on the first target image.
10. The method of claim 9, wherein: Adjusting the parameter values of the key point generation network model based on the first loss value includes: adjusting the parameter values of the self-attention layer, the cross-attention layer and the face positioning module based on the first loss value.
11. The method according to claim 9 or 10, wherein: The cross-attention layer includes a first cross-attention layer, a second cross-attention layer, and a third cross-attention layer, and wherein inputting the first image feature and the audio feature into the cross-attention layer to obtain a third facial landmark image corresponding to the audio frame includes: Inputting the first image feature and the audio feature into a first cross-attention layer to obtain a first output feature; Inputting the first output feature and the second image feature into a second cross attention layer to obtain a second output feature; and The second output features and the audio features are input into a third cross-attention layer to obtain a third facial landmark image corresponding to the audio frame.
12. The method of claim 9, wherein: The video generation model includes a first image encoder, a second image encoder, a diffusion model, and an image decoder, and wherein inputting the first expression image and the first target image into the video generation model to obtain a second image corresponding to the audio frame generated based on the first target image includes: Inputting the first target image into the first image encoder to obtain a third image feature; Inputting the first expression image into the second image encoder to obtain a fourth image feature; inputting the third image feature and the fourth image feature into the diffusion model to obtain a fifth image feature; and The fifth image feature is input into the image decoder to obtain a second image corresponding to the audio frame that is generated based on the first target image.
13. The method of claim 12, wherein: Adjusting the parameter values of the video generation model based on the second loss value includes adjusting the parameter values of the second image encoder and the diffusion model based on the second loss value.
14. The method according to claim 12 or 13, wherein The diffusion model includes an image generation module and a video synthesis module, wherein the third image feature and the fourth image feature are input into the diffusion model to obtain the fifth image feature, comprising: inputting the third image feature and the fourth image feature into the image generation module to obtain a sixth image feature, wherein the sixth image feature is an image feature generated based on the first target image and corresponding to the fourth image feature; and The sixth image feature is input into the video synthesis module to obtain the fifth image feature, wherein the video synthesis module is used to achieve the smoothness of the video when generating the video based on the plurality of the fourth image features.
15. The method of claim 14, wherein: Adjusting the parameter values of the video generation model based on the second loss value includes: adjusting the parameter values of the second image encoder and the image generation module based on the second loss value.
16. The method of claim 14, further comprising: Acquire a plurality of second expression images, a second target image including a target object's face, and a plurality of third label images corresponding one-to-one to the plurality of second expression images, wherein the second expression images in the plurality of second expression images are generated based on lines connecting facial key points related to the expression in corresponding facial key point images; inputting the second target image into the first image encoder to obtain a seventh image feature; inputting the plurality of second expression images into the second image encoder to obtain a plurality of eighth image features; inputting the seventh image feature and the plurality of eighth image features into the image generation module to obtain a plurality of ninth image features, wherein the plurality of ninth image features correspond one-to-one to the plurality of eighth image features; and inputting the plurality of ninth image features into the video synthesis module to obtain a plurality of tenth image features; inputting the plurality of tenth image features into the image decoder to obtain a plurality of third images; Based on the plurality of third images and the plurality of third label images, determining a third loss value by using a preset second loss function; and The parameter value of the video synthesis module is adjusted based on the third loss value.
17. The method of any one of claims 12-13 and 16, wherein The second image encoder comprises a linear attention network.
18. The method according to claim 8 or 10, wherein: The preset first loss function Determined based on the following formula: in, Indicates the first facial key point image The coordinate information of facial key points, Indicates the first facial key point in the third facial key point image The coordinate information of facial key points, represents the number of facial landmarks in the first facial landmark image and the third facial landmark image, The third facial key point image is related to the mouth. The coordinate information of key points, The first facial key point image related to the mouth The coordinate information of key points, represents the number of key points related to the mouth in the first facial key point image and the third facial key point image, and These are all preset hyperparameters.
19. The method of claim 8, 13 or 16, wherein: The preset second loss function Determined based on the following formula: in, represents the first image or the corresponding third label image, represents the second image or the corresponding third image, represents the mouth mask image, and These are all preset hyperparameters.
20. A data processing device for a virtual image, comprising: a first acquiring unit configured to acquire audio data and a first target image including a face of a target object; a first key point extraction unit configured to extract facial key points based on the first target image to obtain a first facial key point image; a first feature extraction unit, configured to perform audio feature extraction based on the audio data to obtain audio features; The second feature extraction unit is configured to input the first facial key point image and the audio feature into a preset key point generation network model to obtain a facial key point image sequence corresponding to the audio data, wherein the preset key point generation network model includes: a self-attention layer and a cross-attention layer, and the second feature extraction unit is configured to: Inputting the first facial landmark image into the self-attention layer to obtain a first image feature; generating a first expression image based on the first facial key point image, wherein the first expression image is generated based on lines connecting facial key points related to expression in the first facial key point image; Perform channel stitching on the first expression image and the first target image to obtain a stitched image; performing image feature extraction on the spliced image to obtain a second image feature; and Inputting the second image feature, the first image feature, and the audio feature into the cross attention layer to obtain a facial landmark image sequence corresponding to the audio data; and The first video generating unit is configured to obtain, based on the facial key point image sequence and the first target image, a video corresponding to the audio data generated based on the first target image.
21. A model training device comprising: a second acquiring unit configured to acquire an audio frame, a first target image including a face of a target object, a first label image, and a second label image, wherein the first label image is a first facial key point image corresponding to the audio frame generated based on the first target image, and the second label image is a first image corresponding to the audio frame generated based on the first target image; a first key point extraction unit configured to extract facial key points based on the first target image to obtain a second facial key point image; a third feature extraction unit, configured to perform audio feature extraction based on the audio frame to obtain audio features; a fourth feature extraction unit configured to input the second facial key point image and the audio feature into a key point generation network model to obtain a third facial key point image corresponding to the audio frame, wherein the key point generation network model includes: a self-attention layer and a cross-attention layer, wherein the fourth feature extraction unit is configured to: Inputting the second facial key point image into the self-attention layer to obtain a first image feature; generating a second facial expression image based on the second facial key point image, wherein the second facial expression image is generated based on lines connecting facial key points related to facial expressions in the second facial key point image; Perform channel stitching on the second expression image and the first target image to obtain a stitched image; Inputting the stitched image into a face positioning module to obtain a second image feature; and Inputting the first image feature, the second image feature, and the audio feature into the cross attention layer to obtain a third facial landmark image corresponding to the audio frame; a first loss unit configured to determine a first loss value based on the third facial key point image and the first facial key point image by using a preset first loss function; a second video generating unit configured to obtain, based on the third facial key point image and the first target image, a second image corresponding to the audio frame and generated based on the first target image through a video generation model; a second loss unit configured to determine a second loss value by using a preset second loss function based on the second image and the first image; a first adjusting unit configured to adjust a parameter value of the key point generation network model based on the first loss value; and A second adjustment unit is configured to adjust the parameter value of the video generation model based on the second loss value.
22. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 19.
23. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-19.
24. A computer program product comprising a computer program, wherein When the computer program is executed by a processor, the method according to any one of claims 1 to 19 is implemented.