Virtual object generation method and device, virtual object driving method and device and computer readable storage medium
By acquiring face pictures and voice data, performing face detection and feature extraction, and combining three-dimensional objects and audio driving coefficients, a personalized virtual face is generated, which solves the limitations of the face pinching method in the existing technology and achieves efficient and personalized oriented virtual face generation.
Patent Information
- Application Number
- CN202410005542.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2024-10-18
AI Technical Summary
Face pinching methods in the existing technology have limitations, requiring manual adjustment by the user, which is time-consuming and labor-intensive, and cannot achieve "thousands of faces for thousands of people". The degree of overlap is high, making it difficult to generate personalized and efficient virtual faces.
By obtaining original face pictures and voice data, face detection and voice feature extraction are performed, and the three-dimensional target object and audio driving coefficients are combined to fuse to generate a target virtual object, achieving end-to-end personalized face pinching and face driving.
It reduces the time for virtual image generation, improves production efficiency, realizes dedicated virtual images, and improves the generation efficiency and effect.
Smart Images

Figure CN118799459A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile communication technology, and in particular to a method and device for generating and driving a virtual object, and a computer-readable storage medium. Background Art
[0002] Personalized face generation, commonly known as "face pinching", is to use the elements set by the system to combine into a virtual character to customize a personalized image, such as by recombining elements such as face, eyebrows, eyes, hairstyle, etc. to form a head portrait. The existing face pinching technology mainly includes two solutions, bone pinching and deformation (such as using a deformer blend shape) face pinching. Whether it is through the bone or deformation to adjust the face position, it requires manual adjustment by the user. Through the designed image, the user adjusts and controls the different parameters of the face shape and expression to achieve a personalized image that meets the user's psychological expectations. However, this manual adjustment is time-consuming and laborious, and due to its own constraints, it cannot achieve "a thousand faces for a thousand people", and the overlap is relatively high. Therefore, the face pinching method in the existing technology has strong limitations. Summary of the invention
[0003] At least one embodiment of the present application provides a method, device and computer-readable storage medium for generating and driving a virtual object, which are used to solve the problem of limitations of the face pinching method in the prior art.
[0004] In order to solve the above technical problems, this application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for generating and driving a virtual object, including:
[0006] Obtaining original face images and voice data for driving objects;
[0007] Performing face detection on the original face image to construct a three-dimensional target object;
[0008] Determining an audio driving coefficient according to the speech data;
[0009] The three-dimensional target object and the audio driving coefficient are fused to determine a target virtual object.
[0010] Optionally, fusing the three-dimensional target object and the audio driving coefficient to determine a target virtual object includes:
[0011] Determining, according to the three-dimensional target object, a lip shape control parameter of the three-dimensional target object;
[0012] The lip shape control parameter and the audio driving coefficient are merged to control other control parameters of the three-dimensional target object to remain unchanged, and the target virtual object is determined.
[0013] Optionally, performing face detection on the original face image to construct a three-dimensional target object includes:
[0014] Performing three-dimensional facial key point detection on the original face image to determine three-dimensional key point data;
[0015] Determining a control coefficient for controlling facial movements according to a preset parameter estimation model;
[0016] Determining a virtual similar human face according to the three-dimensional key point data and the control coefficient;
[0017] A three-dimensional target object is determined based on the virtual similar human face and the personalized face model.
[0018] Optionally, determining a three-dimensional target object according to the virtual similar human face and the personalized face model includes:
[0019] Performing similarity calculation on the virtual similar faces to determine a target virtual face;
[0020] According to the face personalized model, the target virtual face is refined and classified, and a classification result after the refined classification is determined;
[0021] A three-dimensional target object is determined according to preset art materials, the classification result and the target virtual face.
[0022] Optionally, a detailed classification is performed, including at least one of the following:
[0023] Gender classification;
[0024] Glasses classification;
[0025] Hairstyle classification;
[0026] Facial features classification, wherein the facial features classification includes at least one of eyebrow classification, face shape classification, mouth classification, nose classification and eye classification.
[0027] Optionally, performing similarity calculation on the virtual similar faces to determine a target virtual face includes:
[0028] Using a preset edge detection algorithm on the target material to determine a first edge contour of the target material;
[0029] Determining a second edge contour of the virtual similar face according to the three-dimensional key point data;
[0030] The first edge contour and the second edge contour are compared for similarity, a material with a higher similarity to the original face image is determined, and a target virtual face is determined.
[0031] Optionally, the method further comprises:
[0032] Get face material;
[0033] Processing the face material by a preset image segmentation algorithm to determine local image information or full image information;
[0034] Performing weighted joint training on different facial attributes according to the local image information or the full image information to determine the facial personalized model;
[0035] The facial attributes include: at least two of: gender, glasses, hairstyle, eyebrows, face shape, mouth, nose and eyes; and the weight values of the facial attributes are configured or pre-configured values.
[0036] Optionally, determining an audio driving coefficient according to the voice data includes:
[0037] Processing the speech data through a speech recognition pre-training model to determine speech feature data;
[0038] Determine a target audio coefficient related to lip shape by using the speech feature data and a preset algorithm of the attention mechanism;
[0039] The audio driving coefficient is determined by using time series filtering and curve scaling for the target audio coefficient.
[0040] In a second aspect, an embodiment of the present application provides a device for generating and driving a virtual object, including:
[0041] A first acquisition module, used to acquire an original face image and voice data for driving an object;
[0042] A construction module, used to perform face detection on the original face image and construct a three-dimensional target object;
[0043] A first determination module, used to determine an audio driving coefficient according to the speech data;
[0044] The second determination module is used to fuse the three-dimensional target object and the audio driving coefficient to determine the target virtual object.
[0045] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating and driving a virtual object as described above are implemented.
[0046] Compared with the prior art, the method, device and computer-readable storage medium for generating and driving virtual objects provided in the embodiments of the present application simultaneously obtain the original face picture and the voice data for driving the object, further perform face detection on the original face picture to construct a three-dimensional target object; determine the audio driving coefficient based on the voice data; fuse the three-dimensional target object and the audio driving coefficient to determine the target virtual object. The present application realizes the virtual image constructed by driving the voice data while pinching the face using the original face picture through the fusion processing method, which can realize the driving of a virtual image dedicated to a specific person, reduce the time for producing virtual images, and improve production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0048] Figure 1 A schematic diagram of a flow chart of a method for generating and driving a virtual object provided in an embodiment of the present application;
[0049] Figure 2 A flowchart of module generation of a face personalization model provided in an embodiment of the present application;
[0050] Figure 3 An overall flow chart of a method for generating and driving a virtual object provided in an embodiment of the present application;
[0051] Figure 4 A schematic diagram of the structure of a device for generating and driving a virtual object provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0053] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. "And / or" in the specification and claims represents at least one of the connected objects.
[0054] As described in the background technology, in the prior art, for a complete process of producing a virtual digital human, personalized face pinching and voice drive are separate, and it is not possible to input photos and audio end-to-end to produce the final three-dimensional virtual digital human. The two-stage optimization will not only cost more in time, but also often require fine joint adjustment for the generated effect, which is not conducive to large-scale promotion and generalization. And if different three-dimensional face representations are used, the adaptation between the two models for later rendering will be a complex project. The face pinching method in the prior art has strong limitations. In order to solve at least one of the above problems, the embodiment of the present application provides a method for generating and driving a virtual object, which can reduce or avoid the occurrence of the above situation, can realize the driving of a virtual image dedicated to a specific person, reduce the time of producing a virtual image, and improve production efficiency.
[0055] Please refer to Figure 1 , a method for generating and driving a virtual object provided in an embodiment of the present application includes:
[0056] Step 11, obtaining the original face image and the voice data for driving the object.
[0057] It should be noted that the present application simultaneously obtains the original face picture and the voice data used to drive the corresponding face picture. The original face picture can be one or more two-dimensional original face pictures input. The voice data is the input voice data to be trained, and the virtual image constructed based on the original face picture can be driven by the voice data to be trained.
[0058] Step 12: perform face detection on the original face image to construct a three-dimensional target object.
[0059] Here, the original face image is subjected to face detection including 3D face key point detection or face personalized classification detection. Through 3D face key point detection, 3D face data features are obtained, and the 3D face data features are processed to obtain a 3D face. Furthermore, through face personalized classification detection, refined classification of the face is achieved, thereby constructing a 3D target object.
[0060] Step 13: Determine the audio driving coefficient according to the speech data.
[0061] In this embodiment, when the avatar needs to be driven by voice, voice data is obtained and input into a target lip shape coefficient inference model, and the output of the target lip shape coefficient inference model is a plurality of first dimension expression lip shape coefficients, i.e., audio driving coefficients. Here, the number of audio driving coefficients corresponds to the duration of the voice data.
[0062] Step 14: Fusing the three-dimensional target object and the audio driving coefficient to determine a target virtual object.
[0063] Here, the target virtual object generated by the present application may be a virtual digital human, a virtual face with voice function, etc.
[0064] In the embodiment of the present application, the three-dimensional target object and the audio driving coefficient are determined and fused, and end-to-end personalized face pinching and face driving are realized at the same time. That is, while pinching the face, voice is input to realize the driving of a dedicated virtual image. By fusing the three-dimensional target object and the audio driving coefficient, the time for producing the virtual image is reduced and the production efficiency is improved.
[0065] Optionally, the above step 14 includes:
[0066] Determining, according to the three-dimensional target object, a lip shape control parameter of the three-dimensional target object;
[0067] The lip shape control parameter and the audio driving coefficient are merged to control other control parameters of the three-dimensional target object to remain unchanged, and the target virtual object is determined.
[0068] In the embodiment of the present application, since the audio driving coefficient determined by the voice data is only used to control the lip features, the lip shape control parameters of the three-dimensional target object can control the opening and closing amplitude of the mouth, the opening and closing duration of the mouth, the amplitude of the mouth corners to the left or right, etc., and the audio driving coefficient is integrated with the lip shape control parameters to ensure that other control parameters of the three-dimensional target object remain unchanged, and to ensure that on the basis of the determined three-dimensional target object, the three-dimensional target object is driven for voice drive or output.
[0069] The target virtual object is a fusion of the three-dimensional target object obtained by face pinching and the audio drive coefficient obtained by driving, and the remaining parameters retain the real coefficients of the three-dimensional target object. For example, the audio drive coefficient is 27 lip shape drive parameters, and the 27 lip shape drive parameters include the opening and closing amplitude of the lip part, the amplitude of the mouth corner to the left and right, etc. Correspondingly, the 27 lip shape control parameters of the three-dimensional target object are obtained, and the 27 parameters of these two parts are fused, such as replacing the 27 lip shape control parameters of the three-dimensional target object with the 27 lip shape drive parameters obtained by audio driving, and thus the final three-dimensional digital speaker, that is, the target virtual object, is obtained.
[0070] Optionally, the above step 12 includes:
[0071] Perform three-dimensional facial key point detection on the original face image to determine three-dimensional key point data.
[0072] In the embodiment of the present application, the key points are pre-specified key pixel points of the face area in the image, such as the pixel points at the edge of the face area, the pixel points at the edge of the facial features, etc. The original face image obtained in this embodiment is two-dimensional photo information. By performing key point detection on the two-dimensional information, the three-dimensional key point data is determined. For example, the original face image can be input into the key point detection model to determine the three-dimensional key point data. The present application can perform face detection on the original face image, perform a three-dimensional face key point detection on the detected face information, obtain 96 (the number here is an example) three-dimensional face key points of the face, estimate the coordinates of the three-dimensional space, that is, determine the three-dimensional key point data.
[0073] For example, the key point detection model as a whole can adopt the Encoder-Decoder (encoder-decoder) structure. After the original face image is sent to the key point detection model. First, the features of the image are extracted through the Encoder network and the image is downsampled. Then the image is gradually upsampled through the Decoder network. In each Decoder module, it will be fused with the Encoder features of the same size to obtain more robust features. Finally, the Decoder outputs a heat map of two-dimensional key points to obtain the predicted two-dimensional key points. For the feature map output by the last layer of Decoder, it is globally pooled to obtain an n-dimensional vector. It is combined with all the predicted two-dimensional key point coordinates and sent to a 2-layer fully connected network. The first fully connected layer extracts features, and the second fully connected layer outputs the predicted three-dimensional key point coordinates, that is, the three-dimensional key point data.
[0074] According to the preset parameter estimation model, the control coefficient for controlling the facial movement is determined.
[0075] Furthermore, the preset parameter estimation model can adopt the parameter estimation model in the game renderer. For example, the original face image is input into the parameter values of the face AUs in the game renderer, and the game renderer renders the control coefficients for controlling the face action according to the parameter values of the face action units (AUs), the parameter values of the control coefficients include: multi-dimensional head angle parameter values, multi-dimensional face expression parameter values and multi-dimensional face identity parameter values, and the parameter values of each dimension of the face AUs can determine the local area of the rendered virtual face image sample.
[0076] For example, the present application can estimate 61 (the number here is an example) deformation control coefficients through a preset parameter estimation model. These control coefficients are used to control the opening and closing of different parts of the face, such as the opening and closing amplitude of the mouth, the degree of facial bulge, etc.
[0077] Determining a virtual similar human face according to the three-dimensional key point data and the control coefficient;
[0078] A three-dimensional target object is determined based on the virtual similar human face and the personalized face model.
[0079] In the embodiment of the present application, if the number of three-dimensional key point data is greater than the control system, it is only necessary to improve the data corresponding to the control coefficient in the three-dimensional key point data, and the other key point data do not need to be changed. For example, if the three-dimensional key point data is 96 and the control coefficient is 61, then only the 61 key point data corresponding to the control coefficient in the three-dimensional key point data need to be replaced, and the other key point data remain unchanged, then a virtual similar face can be obtained. Further, through the face personalization model, the virtual similar face is finely classified, and the three-dimensional target object can be determined.
[0080] It should be noted that the angle of the face in the three-dimensional target object can be fixed. For example, no matter what the angle of the face in the input two-dimensional face image is, the angle of the face in the output virtual face image can be a frontal face. Of course, the angle of the face in the three-dimensional target object can also be adjusted. When adjustment is required, corresponding control instructions need to be input. Here, the brightness of the light on the face can also be fixed or adjustable.
[0081] Optionally, determining a three-dimensional target object according to the virtual similar human face and the personalized face model includes:
[0082] Performing similarity calculation on the virtual similar faces to determine a target virtual face;
[0083] According to the face personalized model, the target virtual face is refined and classified, and a classification result after the refined classification is determined;
[0084] A three-dimensional target object is determined according to preset art materials, the classification result and the target virtual face.
[0085] In the embodiment of the present application, the edge contour of the determined virtual similar face is calculated with the art material in the preset database, that is, the similarity calculation is performed to select the part that is most similar to the current one, for example, the contour of the key points of the eye's face matches the material contours of all eyes in the library, and the most similar material is selected to replace the existing generated deformation effect. The present application calculates and matches the similarity between contours, and the fineness of the facial details is higher, truly achieving the goal of "beautiful and like". Further, according to the face personalization model, the classification result after the refined classification is determined; for example, the classification result of personalized settings for facial features, hair, glasses, etc. The preset art material is a material that is set in advance and used to beautify the features of the face. According to the classification result obtained by the face personalization model and the art material prepared in advance, the target virtual face is set, and a three-dimensional virtual person that is similar and beautiful to the original face photo can be obtained, that is, the final "beautiful and like" three-dimensional target object is obtained.
[0086] Further, performing similarity calculation on the virtual similar faces to determine the target virtual face includes:
[0087] Using a preset edge detection algorithm on the target material to determine a first edge contour of the target material;
[0088] Determining a second edge contour of the virtual similar face according to the three-dimensional key point data;
[0089] The first edge contour and the second edge contour are compared for similarity, a material with a higher similarity to the original face image is determined, and a target virtual face is determined.
[0090] In the embodiment of the present application, the target material is subjected to a preset edge detection algorithm to determine the first edge contour of the target material. The target material image can be binarized using a preset edge detection algorithm (such as a canny edge detection algorithm, etc.) to obtain the edge of the image, and then the edge contour of the target material is obtained by the contour detection algorithm, that is, a series of contour points. According to the edge of the image and a series of contour points, the first edge contour of the target material is obtained; for the determined three-dimensional key point data, the contour points of each part of the image can be directly obtained, that is, the second edge contour of the virtual similar face; the first edge contour and the second edge contour are compared for similarity, which can be understood as comparing the contour similarity of the eyes, nose, mouth, eyebrows and other parts of the two, and selecting the material most similar to the real face as the final synthesized three-dimensional digital human. For the parts without key points of the hairstyle and glasses face, a satisfactory three-dimensional face is obtained by random or arbitrary selection from the material library through the results of the current personalized classification. The present application uses coarse-grained decals and fine-grained parameter fine-tuning, and calculates the similarity matching between contours, so as to achieve a higher degree of refinement of facial details and truly achieve the goal of "beauty and image".
[0091] Specifically, the classification is refined, including at least one of the following:
[0092] Gender classification;
[0093] Glasses classification;
[0094] Hairstyle classification;
[0095] Facial features classification, wherein the facial features classification includes at least one of eyebrow classification, face shape classification, mouth classification, nose classification and eye classification.
[0096] This application uses a personalized face model to achieve refined classification of faces, including gender classification (male, female); glasses classification, specifically whether there are glasses or not; material and frame subdivision into metal full frame, metal half frame, plate full frame, plate half frame, etc.; the shape of glasses is divided into round, square, etc.; hairstyle classification: hair includes different hairstyles for men and women, such as length, curvature, side parting, whether there are bangs, etc. for detailed division. The classification of facial features includes: eyebrows, eyes, nose, mouth, face shape, etc., and each part can be subdivided into different types, such as willow leaf eyebrows, phoenix eyes, hooked nose, pouty mouth, oval face shape, etc. The more subdivided facial attributes, the higher the requirements for data and models. In order to ensure the accuracy of each attribute, it is necessary to ensure that the data of each attribute exists and the quantity is basically the same, so that the accuracy of each attribute of the obtained model can be guaranteed.
[0097] The present application utilizes the above classification structure to determine the virtual image material corresponding to the real face image. The present application can use preset fields to record the storage address of the real face image, and will record the material number corresponding to each face attribute such as gender, face shape, eyes (Eye), nose (Nose), beard (Beard), eyebrows, eyes, glasses, mouth shape, front hair, back hair, hair color, hat (Hat), skin color and mole corresponding to each real face image, and obtain the virtual image material identification corresponding to each real face image. Among them, the virtual image material can be represented by the material identification, and the material identification can represent each virtual image material used to generate the virtual object image corresponding to the sample object image.
[0098] In practical applications, the virtual image material identifier may refer to the material number of the material used by the virtual image. For example, the virtual image material identifier corresponding to the virtual face image is nose "nose-02", mouth shape "mouth-15", and front hair shape "forehair-06", which indicates that the virtual face image is composed of the nose material identified as "nose-02", the mouth shape material identified as "mouth-15", and the front hair shape material identified as "forehair-06".
[0099] The embodiment of the present application also includes specific steps of generating a personalized face model, and the specific steps include:
[0100] Get face material; the face material here is used for subsequent training to generate a personalized face model.
[0101] Processing the face material by a preset image segmentation algorithm to determine local image information or full image information;
[0102] Performing weighted joint training on different facial attributes according to the local image information or the full image information to determine the facial personalized model;
[0103] The facial attributes include: at least two of: gender, glasses, hairstyle, eyebrows, face shape, mouth, nose and eyes; and the weight values of the facial attributes are configured or pre-configured values.
[0104] In an embodiment of the present application, after obtaining a face material (such as a face frame), the input is a picture of the face analysis generated by expanding the detected face material outward by a certain proportion, and a large face model (such as a FARL model, etc.) is used to generate a face analysis, so as to achieve an accurate segmentation map of the facial features and hair. Under limited data, the present application introduces a preset image segmentation algorithm, where the preset image segmentation algorithm is a mask algorithm, and processes the face material through the mask algorithm to determine local image information or full-image image information. According to the local image information or the full-image image information, different face attributes are weighted jointly trained to determine a personalized face model. In order to make the network have better effects on face parts with different attributes and different data amounts, the present application performs weighted joint training on different face attributes to balance the overfitting of each branch due to sample imbalance, thereby affecting the accuracy of the overall network.
[0105] In a specific embodiment, a mask algorithm is used to obtain a local area to be classified, so that the branch focuses on a certain part, thereby accelerating the convergence of the model and improving the accuracy of the model. Figure 2 As shown in the figure, the four convolutional layers from res0 to res3 in ResNet (deep residual network) perform different tasks. Since the mask input is 224*224, different tasks are performed in res3. Since the mask input is 224*224, it needs to be interpolated to the size specified by res3 before dot multiplication can be performed. For face shape, eyebrows, eyes, nose, mouth and hairstyle, the corresponding areas obtained by the segmentation map are respectively used to perform dot multiplication with the res3 layer to obtain the feature layer of the corresponding part, and then subsequent feature extraction is performed. For gender and glasses, since gender requires the features of the entire image, the information of the entire image can be used.
[0106] Furthermore, the loss function Loss of the joint training is as follows: Loss = γL P ; where γ is the weight of different losses, and the number of data sets for each attribute category is inversely proportional, L P Represents the cross entropy loss function for 8 branches (gender, glasses, hairstyle, eyebrows, face shape, mouth, nose and eyes).
[0107] The cross entropy loss function for each branch is as follows:
[0108]
[0109] Here, K represents the number of categories, which is 8 in the eyebrow classification because there are 8 types of eyebrow attributes. i represents the true label of the i-th category, Represents the model's predicted probability for the i-th category. The goal of the cross entropy loss function is still to minimize the gap between the prediction and the actual label, so that the model can classify more accurately.
[0110] Optionally, the above step 13 includes:
[0111] Processing the speech data through a speech recognition pre-training model to determine speech feature data;
[0112] Determine a target audio coefficient related to lip shape by using the speech feature data and a preset algorithm of the attention mechanism;
[0113] The audio driving coefficient is determined by using time series filtering and curve scaling for the target audio coefficient.
[0114] In the embodiment of the present application, the speech recognition pre-training model can adopt the Huber algorithm model. The example of determining speech feature data includes extracting features from speech data through the Huber algorithm model, and each audio is cut to 2.2s (2.2s here is an example) as an audio segment input to the network. For a video with a fps (frames per second) of 30 frames (30 frames here is an example), the dimension of the final corresponding audio feature is 66 frames, and the feature of each frame is 1024 dimensions (1024 dimensions here is an example), so the output is (batch, 66, 1024).
[0115] The attention mechanism preset algorithm can adopt the self-attention mechanism in Transformer. The self-attention mechanism adopted by Transformer is an algorithm that understands the current word through its context, and has a stronger ability to extract semantic features. Therefore, the speech feature data is input into a single-layer transformer, the target audio coefficient related to the lip shape is determined, and the lip shape drive parameters related to the lip shape are obtained through transformer regression. The lip shape drive parameters can be used to extract robust speech features. For example, 27 lip shape deformation-related lip shape drive parameters related to the lip shape are obtained through transformer regression.
[0116] Furthermore, for the target audio coefficients, the jitter of the lip shape is first reduced by the method of time filtering, and then the opening and closing amplitude of the lips is increased by curve scaling. Finally, the coefficients in the original 61 three-dimensional target objects are replaced with 27 lip shape driving parameters. The driving part of the human face is completed, and finally a vivid and natural three-dimensional virtual digital human is obtained, that is, the target virtual object is determined.
[0117] Reference Figure 3As shown, the embodiment of the present application provides an overall process method for generating and driving a virtual object. The entire process inputs the original face picture and the voice data corresponding to the lip shape of the digital human that needs to be driven, and outputs the three-dimensional digital human virtual image video, that is, the output target virtual object. First, face detection is performed on the input original face picture, and then the detected face is divided into two parts. One is to perform three-dimensional face key point detection to obtain 96 3D face key points of the face, and estimate the coordinates of the three-dimensional space. The shape information of the main parts of the face is obtained, and then 61 blendshape (deformation) coefficients are estimated through the parameter estimation module of the game rendering model. These coefficients are used to control the opening and closing of different parts of the face, such as the opening and closing amplitude of the mouth, the degree of facial bulge, etc.
[0118] The other part is processed by the face personalization model to achieve refined classification of faces, including gender classification (male, female); glasses classification, specifically whether there are glasses or not, the material and frame are subdivided into metal full frame, metal half frame, plate full frame, plate half frame, and the shape of glasses is divided into round and square; hairstyle classification, hair includes different hairstyles for men and women, length, curvature, side parting, whether there are bangs, etc. The classification of facial features includes eyebrows, eyes, nose, mouth, face shape, etc. Each part can be subdivided into different types, such as willow leaf eyebrows, phoenix eyes, hooked nose, pouty mouth, and oval face. The more subdivided facial attributes, the higher the requirements for data and models. In order to ensure the accuracy of each attribute, it is necessary to ensure that the data of each attribute exists and the quantity is basically the same, so that the accuracy of each attribute of the obtained face personalization model can be guaranteed.
[0119] After determining the three-dimensional target object based on the virtual similar face and the face personalized model, the next step is how to drive it. This application inputs a piece of voice data while inputting the original face picture, and then extracts features through the pre-trained model Hubert, and inputs the output result into a single-layer transformer. Through transformer regression, 27 blendshapes related to the lip shape are obtained, and then the jitter of the lip shape is reduced by the method of time series filtering, and then the opening and closing amplitude of the lips is increased by curve scaling. Finally, the coefficients in the original 61 blendshapes are replaced with 27 driven coefficients, and the driving part of the face is completed. Finally, a vivid and natural 3D virtual digital person is obtained, that is, a target virtual object is determined.
[0120] To sum up, in view of the fact that face pinching and face driving were separated in the past, which led to the difficulty of later joint debugging and complicated processes, this application proposes an end-to-end personalized face pinching and face driving method, which can realize face pinching and voice input at the same time, so as to realize a virtual image that can be driven for a dedicated person. By integrating the two algorithms of face pinching and driving, the time for producing virtual images is reduced and production efficiency is improved.
[0121] This application generates a digital human by integrating facial decals and game model parameters, which can ensure that on the basis of meeting the aesthetic definition, a high-fidelity digital human similar to a real person is produced. Through coarse-grained decals and fine-grained parameter fine-tuning, and by calculating the similarity matching between contours, the facial details are more refined, truly achieving the goal of "beautiful and like".
[0122] This application uses attention classification based on face analysis and introduces masks to force the network to learn the features of specified positions, thereby improving the classification accuracy of different parts of the face and reducing the impact of data imbalance on model classification.
[0123] This application uses a pre-trained large model to replace traditional voice features with deep learning features, and integrates them into the regression model of deformation coefficients, replacing the original two-stage face-driven method, thereby improving the robustness of voice features and the efficiency of the overall process. At the same time, the lip shape is partially processed in the form of post-processing and curve scaling, making the output image more vivid and natural.
[0124] The above describes various methods of the embodiments of the present application. The following further provides devices for implementing the above methods.
[0125] Reference Figure 4 As shown, the embodiment of the present application also provides a device for generating and driving a virtual object, including:
[0126] A first acquisition module 41, used to acquire an original face image and voice data for driving an object;
[0127] A construction module 42 is used to perform face detection on the original face image and construct a three-dimensional target object;
[0128] A first determination module 43, configured to determine an audio driving coefficient according to the speech data;
[0129] The second determination module 44 is used to fuse the three-dimensional target object and the audio driving coefficient to determine the target virtual object.
[0130] Optionally, in the embodiment of the present application, the second determining module 44 includes:
[0131] A first determining unit, configured to determine a lip shape control parameter of the three-dimensional target object according to the three-dimensional target object;
[0132] The second determination unit is used to merge the lip shape control parameter and the audio driving coefficient, control other control parameters of the three-dimensional target object to remain unchanged, and determine the target virtual object.
[0133] Optionally, in the embodiment of the present application, the above-mentioned building module 42 includes:
[0134] A third determining unit is used to perform three-dimensional facial key point detection on the original face image to determine three-dimensional key point data;
[0135] a fourth determining unit, configured to determine a control coefficient for controlling a facial movement according to a preset parameter estimation model;
[0136] a fifth determining unit, configured to determine a virtual similar human face according to the three-dimensional key point data and the control coefficient;
[0137] The sixth determination unit is used to determine a three-dimensional target object according to the virtual similar human face and the personalized face model.
[0138] Optionally, the sixth determining unit includes:
[0139] A first determination subunit is used to perform similarity calculation on the virtual similar faces to determine a target virtual face;
[0140] A second determining subunit is used to perform refinement classification on the target virtual face according to the face personalization model, and determine a classification result after the refinement classification;
[0141] The third determination subunit is used to determine the three-dimensional target object according to the preset art material, the classification result and the target virtual human face.
[0142] Optionally, the second determining subunit is specifically configured to:
[0143] Gender classification;
[0144] Glasses classification;
[0145] Hairstyle classification;
[0146] Facial features classification, wherein the facial features classification includes at least one of eyebrow classification, face shape classification, mouth classification, nose classification and eye classification.
[0147] Optionally, the first determining subunit is specifically configured to:
[0148] Using a preset edge detection algorithm on the target material to determine a first edge contour of the target material;
[0149] Determining a second edge contour of the virtual similar face according to the three-dimensional key point data;
[0150] The first edge contour and the second edge contour are compared for similarity, a material with a higher similarity to the original face image is determined, and a target virtual face is determined.
[0151] Optionally, in the embodiment of the present application, the generation and driving of the virtual object further includes:
[0152] The second acquisition module is used to acquire face material;
[0153] A third determination module is used to process the face material through a preset image segmentation algorithm to determine local image information or full image information;
[0154] A fourth determination module, configured to perform weighted joint training on different facial attributes according to the local image information or the full image information to determine the facial personalized model;
[0155] The facial attributes include: at least two of: gender, glasses, hairstyle, eyebrows, face shape, mouth, nose and eyes; and the weight values of the facial attributes are configured or pre-configured values.
[0156] Optionally, in the embodiment of the present application, the first determining module 43 includes:
[0157] a seventh determining unit, configured to process the speech data through a speech recognition pre-training model to determine speech feature data;
[0158] an eighth determination unit, configured to determine a target audio coefficient related to the lip shape by using the speech feature data and a preset algorithm of the attention mechanism;
[0159] The ninth determination unit is used to determine the audio driving coefficient by using time series filtering and curve scaling for the target audio coefficient.
[0160] It should be noted that the device in this embodiment is a device corresponding to the method for generating and driving the virtual object, and the implementation methods in the above embodiments are all applicable to the embodiments of the device, and can also achieve the same technical effects. The above device provided in the embodiment of the present application can implement all the method steps implemented in the above method embodiment, and can achieve the same technical effects. The parts and beneficial effects that are the same as those in the method embodiment will not be specifically described in detail here.
[0161] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned virtual object generation and driving method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0162] It should be noted that, in this article, the terms "include", "include" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0164] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for generating and driving a virtual object, characterized in that: include: Obtaining original face images and voice data for driving objects; Performing face detection on the original face image to construct a three-dimensional target object; Determining an audio driving coefficient according to the speech data; The three-dimensional target object and the audio driving coefficient are fused to determine a target virtual object.
2. The method according to claim 1, characterized in that: The three-dimensional target object and the audio driving coefficient are merged to determine the target virtual object, including: Determining, according to the three-dimensional target object, a lip shape control parameter of the three-dimensional target object; The lip shape control parameter and the audio driving coefficient are merged to control other control parameters of the three-dimensional target object to remain unchanged, and the target virtual object is determined.
3. The method according to claim 1, characterized in that Performing face detection on the original face image to construct a three-dimensional target object includes: Performing three-dimensional facial key point detection on the original face image to determine three-dimensional key point data; Determining a control coefficient for controlling facial movements according to a preset parameter estimation model; Determining a virtual similar human face according to the three-dimensional key point data and the control coefficient; A three-dimensional target object is determined based on the virtual similar human face and the personalized face model.
4. The method according to claim 3, characterized in that Determining a three-dimensional target object according to the virtual similar human face and the personalized human face model includes: Performing similarity calculation on the virtual similar faces to determine a target virtual face; According to the face personalized model, the target virtual face is refined and classified, and a classification result after the refined classification is determined; A three-dimensional target object is determined according to preset art materials, the classification result and the target virtual face.
5. The method according to claim 4, characterized in that The classification should include at least one of the following: Gender classification; Glasses classification; Hairstyle classification; Facial features classification, wherein the facial features classification includes at least one of eyebrow classification, face shape classification, mouth classification, nose classification and eye classification.
6. The method according to claim 4, characterized in that Calculating the similarity of the virtual similar faces to determine the target virtual face includes: Using a preset edge detection algorithm on the target material to determine a first edge contour of the target material; Determining a second edge contour of the virtual similar face according to the three-dimensional key point data; The first edge contour and the second edge contour are compared for similarity, a material with a higher similarity to the original face image is determined, and a target virtual face is determined.
7. The method according to claim 3, characterized in that The method further comprises: Get face material; Processing the face material by a preset image segmentation algorithm to determine local image information or full image information; Performing weighted joint training on different facial attributes according to the local image information or the full image information to determine the facial personalized model; The facial attributes include: at least two of: gender, glasses, hairstyle, eyebrows, face shape, mouth, nose and eyes; and the weight values of the facial attributes are configured or pre-configured values.
8. The method according to claim 1, characterized in that Determining an audio driving coefficient according to the voice data includes: Processing the speech data through a speech recognition pre-training model to determine speech feature data; Determine a target audio coefficient related to lip shape by using the speech feature data and a preset algorithm of the attention mechanism; The audio driving coefficient is determined by using time series filtering and curve scaling for the target audio coefficient.
9. A device for generating and driving a virtual object, characterized in that: include: A first acquisition module, used to acquire an original face image and voice data for driving an object; A construction module, used to perform face detection on the original face image and construct a three-dimensional target object; A first determination module, used to determine an audio driving coefficient according to the speech data; The second determination module is used to fuse the three-dimensional target object and the audio driving coefficient to determine the target virtual object.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating and driving a virtual object according to any one of claims 1 to 8 are implemented.
