Face processing method and device, electronic equipment, chip and storage medium

By acquiring and applying multiple facial deformation parameters to deform a 3D facial reference model, a stylized 3D facial model is generated, solving the problem that existing technologies cannot achieve 3D facial editing and realizing stylized 3D facial editing of different 2D facial images.

CN116343276BActive Publication Date: 2026-04-24GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2021-12-14
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies cannot achieve 3D face editing, making it difficult to meet users' needs for stylized 3D faces.

Method used

By acquiring the first face deformation parameters corresponding to the two-dimensional face image, the second face deformation parameters of the stylized target face shape, and the third face deformation parameters of the target face attributes, the three-dimensional face reference model is deformed based on these parameters to generate a stylized three-dimensional face model.

Benefits of technology

It enables stylized 3D face editing of different 2D face images, generating 3D face models with different face shape features, and can adjust face shape and expression according to user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116343276B_ABST
    Figure CN116343276B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of image processing, and provides a face processing method and device, electronic equipment, a chip and a storage medium. The face processing method comprises the following steps: acquiring a first face deformation parameter corresponding to a two-dimensional face image; acquiring a second face deformation parameter corresponding to a stylized target face shape; acquiring a third face deformation parameter corresponding to the stylized target face shape; in response to an adjustment operation on a target face attribute, acquiring a third face deformation parameter corresponding to the target face attribute; and deforming a three-dimensional face reference model based on the first face deformation parameter, the second face deformation parameter and the third face deformation parameter to obtain a stylized three-dimensional face model. The stylized three-dimensional face model can be obtained through the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and particularly relates to a face processing method, device, electronic device, chip, and storage medium. Background Technology

[0002] Facial images are widely used in the field of image processing. In recent years, with advancements in research methods, facial editing has become a popular research area and application direction. Facial editing refers to altering certain attributes of a face, such as face shape, facial feature size, and expression. However, current technology cannot yet achieve three-dimensional facial editing, making it difficult to meet user needs. Summary of the Invention

[0003] This application provides a face processing method, apparatus, electronic device, chip, and storage medium to obtain a stylized three-dimensional face model.

[0004] In a first aspect, embodiments of this application provide a face processing method, including:

[0005] Obtain the first face deformation parameter corresponding to the two-dimensional face image. The first face deformation parameter is the deformation parameter for transforming the three-dimensional face reference model into a three-dimensional face model that includes the face shape features of the two-dimensional face image.

[0006] Obtain the second face deformation parameter corresponding to the stylized target face shape. The second face deformation parameter is the deformation parameter that transforms the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the target face shape.

[0007] In response to the adjustment operation of the target face attribute, the third face deformation parameter corresponding to the target face attribute is obtained. The third face deformation parameter is the deformation parameter that deforms the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the target face attribute.

[0008] Based on the first face deformation parameters, the second face deformation parameters, and the third face deformation parameters, the three-dimensional face reference model is deformed to obtain a stylized three-dimensional face model.

[0009] In this embodiment, by obtaining the first face deformation parameter corresponding to the two-dimensional face image, the second face deformation parameter corresponding to the stylized target face shape (e.g., a stylized youthful face shape), and the third face deformation parameter corresponding to the target face attribute (e.g., large eyes), and deforming the three-dimensional face reference model based on the first, second, and third face deformation parameters, the fusion of the face shape features of the two-dimensional face image, the face shape features of the stylized target face shape, and the face shape features of the target face attribute can be achieved, thereby realizing stylized three-dimensional face editing. For different two-dimensional face images, different face shapes, and different target face attributes, stylized three-dimensional face models with different face shape features can be obtained.

[0010] Secondly, embodiments of this application provide a face processing device, including:

[0011] The first acquisition module is used to acquire the first face deformation parameter corresponding to the two-dimensional face image. The first face deformation parameter is the deformation parameter for deforming the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the two-dimensional face image.

[0012] The second acquisition module is used to acquire the second face deformation parameter corresponding to the stylized target face shape. The second face deformation parameter is the deformation parameter for transforming the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the target face shape.

[0013] The third acquisition module is used to acquire the third face deformation parameters corresponding to the target face attributes in response to the adjustment operation of the target face attributes. The third face deformation parameters are the deformation parameters for deforming the three-dimensional face reference model into a three-dimensional face model that includes the face shape features of the target face attributes.

[0014] The model deformation module is used to deform the three-dimensional face reference model based on the first face deformation parameters, the second face deformation parameters, and the third face deformation parameters to obtain a stylized three-dimensional face model.

[0015] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the face processing method described in the first aspect above.

[0016] Fourthly, embodiments of this application provide a chip including a processor, the processor being configured to read and execute a computer program stored in a memory to perform the steps of the face processing method as described in the first aspect above.

[0017] Optionally, the memory is connected to the processor via a circuit or wire.

[0018] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the face processing method described in the first aspect above.

[0019] In a sixth aspect, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the steps of the face processing method described in the first aspect above.

[0020] Understandably, the second, third, fourth, fifth, and sixth aspects provided above are all used to perform the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1a This is an example image of the camera interface of a camera application;

[0023] Figure 1b This is another example image of the camera interface of a camera application;

[0024] Figure 1c This is another example image of the camera interface of a camera application;

[0025] Figure 1d This is another example image of the camera interface of a camera application;

[0026] Figure 2 This is a schematic diagram illustrating the implementation process of a face processing method provided in an embodiment of this application;

[0027] Figure 3 This is an example image of a 3D human face reference model;

[0028] Figure 4 This is an example diagram of a 3D face reconstruction network;

[0029] Figure 5 This is a schematic diagram illustrating the implementation process of a face processing method provided in another embodiment of this application;

[0030] Figure 6 This is a stylized example image of the target face shape;

[0031] Figure 7 This is a flowchart illustrating the face editing process;

[0032] Figure 8 This is a schematic diagram illustrating the implementation process of a face processing method provided in another embodiment of this application;

[0033] Figure 9 This is an example image of the adjustment control bars for the eyes, nose, and mouth;

[0034] Figure 10 This is a flowchart illustrating the eye editing process;

[0035] Figure 11 This is a schematic diagram illustrating the implementation process of a face processing method provided in another embodiment of this application;

[0036] Figure 12 This is a flowchart illustrating the process of editing facial expressions;

[0037] Figure 13 This is a schematic diagram of the structure of a face processing device provided in an embodiment of this application;

[0038] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0039] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0040] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0041] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0042] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0043] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0044] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0045] The face processing method provided in this application can be applied to electronic devices such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application does not impose any restrictions on the specific type of electronic device.

[0046] It should be understood that the sequence number of each step in this embodiment does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.

[0047] Face editing typically includes face shape editing, facial feature editing, and facial expression editing.

[0048] Face shape editing is used to adjust the overall shape of a face. For example, for a rectangular face, face shape editing can change the face shape from rectangular to oval.

[0049] Facial feature editing is used to adjust the size of facial features such as eyes, nose, mouth, ears, and eyebrows. For example, for a face with small eyes, you can enlarge the eyes by editing the eyes.

[0050] When editing facial features, editing can be performed based on facial landmark detection combined with local image distortion algorithms. For example, by combining facial landmark detection with a local scaling algorithm applied to the eye area, the eyes can be enlarged or reduced; similarly, by combining facial landmark detection with a local scaling algorithm applied to the mouth area, a mouth deformation effect can be achieved.

[0051] Facial expression editing is used to adjust facial expressions. For example, for a face with a sad expression, facial expression editing can be used to change the expression from sad to happy.

[0052] It should be noted that face shape editing is a global adjustment of the face, allowing for adjustments to a global area of ​​the face. Facial feature editing and facial expression editing are local adjustments of the face, allowing for adjustments to specific areas of the face.

[0053] Existing technical solutions, when editing two-dimensional face images, still output two-dimensional face images, failing to achieve stylized three-dimensional faces. To achieve stylized three-dimensional faces, this application provides a face processing method applicable to face editing, through which stylized three-dimensional face images can be obtained. For example, applications such as photo-taking and social media apps often have face editing functions. When an electronic device detects that the face editing function in these applications has been activated, it can deform a 3D face reference model based on the first face deformation parameters corresponding to the input 2D face image, the second face deformation parameters corresponding to the stylized target face shape, and the second face deformation parameters corresponding to the target face attributes adjusted by the user. This results in a stylized 3D face model that integrates the face shape features of the 2D face image, the second face deformation parameters corresponding to the stylized target face shape, and the face shape features of the target face attributes. Combined with texture mapping, the stylized 3D face model can be rendered to obtain a stylized 3D face image that integrates the face shape features of the 2D face image, the second face deformation parameters corresponding to the stylized target face shape, and the face shape features of the target face attributes. Furthermore, this application can generate stylized 3D face images containing different face shape features for different 2D face images (e.g., images of different faces), meaning the stylized 3D face image can vary depending on the face, achieving a personalized look for each individual.

[0054] like Figure 1a The image shown is an example of a camera app's camera interface. This interface may include a 2D face image in the preview area, a "Video" option, a "Portrait" option, a "Style" selection, a "Face Editing" option, and a "Take Photo" button. When a click on the "Style" option in the camera interface is detected, the camera interface can be switched from... Figure 1a Switch to Figure 1b ,exist Figure 1b The app displays various styles such as "sketch portrait style", "cartoon character style", and "oil painting style". The cartoon character style usually allows you to enlarge the eyes. Figure 1b The preview area displays a 3D face image in a cartoon style. Figure 1a and Figure 1b It can be seen that, Figure 1b The 3D face images in the image have a cartoonish style with adjustable enlarged eyes and incorporate facial shape features from 2D face images (such as elongated face shape).

[0055] exist Figure 1b Based on this, if a click on the "Face Editing" option in the camera interface is detected, the camera interface can be changed from... Figure 1b Switch to Figure 1c ,exist Figure 1cThe app displays multiple options such as "face shape," "facial features," and "expression," and detects... Figure 1c When clicking the "Face Shape" option, the camera interface can be changed from... Figure 1c Switch to Figure 1d ,exist Figure 1d The app displays five face shapes for users to choose from. These five face shapes, from left to right, are "Stylized Childhood Face Shape", "Stylized Adult Face Shape", "Stylized Neutral Face Shape", "Stylized Teen Face Shape", and "Stylized Elderly Face Shape". The Neutral Face Shape refers to a face with common characteristics, also known as a mainstream face shape. Figure 1d The displayed face image is a 3D face image corresponding to the "stylized youthful face shape" selected by the user. This 3D face image combines the facial shape features of a 2D face image (e.g., a longer face) with the facial shape features of the "stylized youthful face shape" (e.g., a slightly shorter chin, more rounded features). Different 3D face images can be generated by selecting different face shapes.

[0056] The 3D face reference model, stylized 3D face model, 3D face sample model, and 3D face prediction model in this application are all 3D face models. A 3D face model typically includes a large number of 3D vertices, and these 3D vertices, as well as the relative positions of each 3D vertex to its surrounding 3D vertices, can represent the 3D face model.

[0057] To illustrate the technical solution described in this application, specific embodiments are provided below.

[0058] See Figure 2 This is a schematic diagram illustrating the implementation flow of a face processing method provided in an embodiment of this application, which is applied to an electronic device. Figure 2 As shown, the face processing method may include the following steps:

[0059] Step 201: Obtain the first face deformation parameters corresponding to the two-dimensional face image.

[0060] The format of the two-dimensional face image can be any format such as YUV or RGB, and there is no limitation here.

[0061] The electronic device can first acquire a two-dimensional face image, and then obtain the corresponding first face deformation parameters based on the two-dimensional face image. This application does not limit the method of acquiring the two-dimensional face image. For example, it can be acquired from two-dimensional face images stored in the electronic device, from other devices, or the two-dimensional face image can be a two-dimensional face image displayed in the preview area when taking a photo using the electronic device.

[0062] The first face deformation parameter is the deformation parameter used to transform a 3D face reference model into a 3D face model that incorporates the facial shape features of a 2D face image. In other words, by adjusting the deformation of the 3D face reference model using the first face deformation parameter, the deformed 3D face reference model can contain the facial shape features of the 2D face image, especially some personalized details of the 2D face image. For example, given two different 2D face images A and B, where the forehead of the face in 2D face image A is wider and the forehead of the face in 2D face image B is narrower, then when the 3D face reference model is deformed based on the first face deformation parameter corresponding to 2D face image A, the forehead of the deformed 3D face reference model will be wider; conversely, when deformed based on the first face deformation parameter corresponding to 2D face image B, the forehead of the deformed 3D face reference model will be narrower.

[0063] The aforementioned 3D face reference model can be understood as a 3D model of a neutral face or an average face, serving as the basis for deformation. For example... Figure 3 The image shown is an example of a 3D human face reference model.

[0064] By deforming a 3D face reference model, 3D face models of different shapes can be generated. Combined with texture mapping, 3D face images with different face shape features can be generated.

[0065] To make the 3D face reference model more adaptable, at least two 3D face models can be obtained. By weighted summation of the various 3D models, the 3D face reference model can be obtained.

[0066] For example, three 3D models of faces can be obtained, namely X 1 X 2 and X 3 p j Let represent the coordinates of the j-th 3D vertex in the 3D face reference model. X represents 1 The coordinates of the 3D vertex corresponding to the j-th 3D vertex in the 3D face reference model. X represents 2 The coordinates of the 3D vertex corresponding to the j-th 3D vertex in the 3D face reference model. X represents 3 The coordinates of the 3D vertex corresponding to the j-th 3D vertex in the 3D face reference model, where α1 represents X. 1 The weights, α2 represents X 2 The weight, α3 represents X 3 The weight, then Where α1+α2+α3=1.

[0067] As an optional embodiment, a two-dimensional face image can be input into a three-dimensional face reconstruction network to obtain the first face deformation parameters.

[0068] 3D face reconstruction networks are used to reconstruct 3D face models. For different 2D face images, the first face deformation parameters output by the 3D face reconstruction network are usually different. Therefore, by deforming the 3D face reference model based on different first face deformation parameters, 3D face models with different shapes can be reconstructed.

[0069] 3D face reconstruction networks have excellent feature extraction capabilities and can extract rich semantic information. Therefore, the 3D face model reconstructed by the 3D face reconstruction network can accurately represent the face shape features of the 2D face image.

[0070] Before inputting a 2D face image into a 3D face reconstruction network, face detection can be performed on the 2D face image. Based on the detected face location information, the face region can be cropped from the 2D face image. After normalizing the face region image, it is then input into the 3D face reconstruction network. Cropping the 2D face image reduces the computational load on the 3D face reconstruction network. Normalizing the face region image before inputting it into the 3D face reconstruction network can prevent overfitting.

[0071] If the 2D face image is displayed in the preview area (i.e., an image captured by the camera of an electronic device), the image can be rotated according to the shooting direction output by the gyroscope of the electronic device to ensure that the face orientation in the 2D face image is the reference direction (e.g., face facing upwards), thus matching the face orientation of the 3D face reference model. Based on this, a 3D face target model can be obtained. Here, face orientation can refer to the direction in which the chin points towards the top of the head. The face orientation in 2D face images stored on the electronic device or acquired from other devices is used as the default reference direction.

[0072] For image normalization of the face region, in one example, the RGB values ​​of each pixel in the face region image can be obtained first. The RGB values ​​of each pixel are then subtracted from a preset mean (e.g., 127.5) and divided by a preset variance (e.g., 127.5), thus normalizing the face region image. Optionally, other methods can also be used (e.g., dividing the RGB values ​​of each pixel by 255) to normalize the face region image; this is not limited here.

[0073] When a two-dimensional face image is displayed in the preview area, if no face is detected in the image, or the size of the largest detected face is smaller than the size threshold, the user can be prompted to retake the image (e.g., with a voice prompt or by displaying a prompt message on the user interface) to improve the accuracy of the first face deformation parameters.

[0074] A 3D face reconstruction network can include a feature extraction module and a multilayer perceptron. For example... Figure 4 The image shown is an example diagram of a 3D face reconstruction network.

[0075] The feature extraction module is used to extract image features from 2D face images. This module can be based on a Convolutional Neural Network (CNN) encoder, specifically MobileNet, Residual Network (ResNet), Xception, or similar networks. After passing through the feature extraction module, the scale of the 2D face image decreases, and the number of channels increases.

[0076] Multilayer perceptrons (MLPs) are used to regress facial deformation parameters based on image features extracted by a feature extraction module. An MLP typically consists of multiple fully connected layers, with the number of nodes increasing sequentially within each layer.

[0077] Alternatively, this embodiment can also use a combination of convolutional layers and fully connected layers to regress facial deformation parameters. A flattening layer can be added after the convolutional layer, and then connected to the fully connected layer. The flattening layer is used to "flatten" the input. That is, the flattening layer can reduce the multidimensional input of the fully connected layer to one dimension, realizing the transition from the convolutional layer to the fully connected layer.

[0078] Before inputting a 2D face image into a 3D face reconstruction network, a neural network needs to be trained first. The trained neural network is the 3D face reconstruction network. In one example, at least one 2D face sample image and its corresponding 3D face sample model can be obtained. The 2D face sample image is input into the neural network to be trained to obtain the deformation parameters corresponding to the 2D face sample image. Based on the deformation parameters corresponding to the 2D face sample image, the 3D face reference model is deformed to obtain the 3D face prediction model. Based on a preset loss function, the loss values ​​of the 3D face sample model and the 3D face prediction model can be calculated. Supervised regression is performed based on the loss values ​​of the 3D face sample model and the 3D face prediction model to complete the training of the neural network, resulting in the 3D face reconstruction network. The third face sample model is the 3D face model used to train the neural network. The 3D face prediction model is the 3D face model output by the neural network during the training process.

[0079] It should be noted that 3D face sample models may or may not have stylized features; this is not a limitation here. If the 3D face sample model has stylized features, then the first face deformation parameters output by the 3D face reconstruction network can be stylized when deforming the 3D face reference model.

[0080] In a practical application scenario, a user may continuously edit the face of the same 2D face image. During continuous editing, the electronic device does not need to re-acquire the first face deformation parameters corresponding to the 2D face image, reducing the computational load during face editing and improving efficiency. Continuous face editing can be performed by performing multiple different edits (e.g., editing the face shape and then editing the editor), or by performing multiple identical edits (e.g., editing the face shape twice), without limitation.

[0081] Step 202: Obtain the second face deformation parameters corresponding to the stylized target face shape.

[0082] The second face deformation parameter is the deformation parameter that transforms the 3D face reference model into a 3D face model containing the stylized face shape features of the target face.

[0083] The target face shape for stylization can be any face shape selected by the user. For example, a stylized youthful face shape, a stylized young adult face shape, etc.

[0084] Electronic devices can generate different stylized 3D face models by adjusting the stylization type of the target face shape, and then combine them with texture mapping to generate different stylized 3D face images.

[0085] Step 203: In response to the adjustment operation on the target face attributes, obtain the third face deformation parameters corresponding to the target face attributes.

[0086] The third face deformation parameter is used to transform the 3D face reference model into a 3D face model that includes the face shape features of the target face attributes. The aforementioned adjustments to the target face attributes are used to adjust the size of these attributes. For example, adjusting the size of the eyes.

[0087] The target face attribute is any one of the target face organs or the target expression.

[0088] The target facial organ can be any of the five sense organs, such as the target eye, target nose, target mouth, target eyebrow, and target ear. The target eye can be the eye with the first target value. The target nose can be the nose with the second target value. The target mouth can be the mouth with the third target value. The target eyebrow can be the eyebrow with the fourth target value. The target ear can be the ear with the fifth target value. The first target value is greater than or equal to the minimum or less than or equal to the maximum value of the eye organ. The second target value is greater than or equal to the minimum or less than or equal to the maximum value of the nose organ. The third target value is less than or equal to the minimum or less than or equal to the maximum value of the mouth organ. The fourth target value is less than or equal to the minimum or less than or equal to the maximum value of the eyebrow organ. The fifth target value is less than or equal to the minimum or less than or equal to the maximum value of the ear organ. The organ value indicates the size of the facial organ, such as the size of the eyes, nose, ears, eyebrows, and mouth. The size of eyebrows can refer to their length, thickness, etc.

[0089] The target expression mentioned above can be any stylized expression.

[0090] The third face deformation parameter is the deformation parameter used to transform a third-dimensional face reference model into a three-dimensional face model that includes the face shape features of the target face attributes. In other words, by adjusting the deformation of the three-dimensional face reference model through the third face deformation parameter, the deformed three-dimensional face reference model can contain the face shape features of the target face attributes.

[0091] The third-party face deformation parameters corresponding to the target face attributes can be pre-stored in the electronic device or obtained by the electronic device from other devices; no limitation is made here.

[0092] Step 204: Based on the first face deformation parameters, the second face deformation parameters, and the third face deformation parameters, deform the first face reference model to obtain a stylized 3D face model.

[0093] Based on the first face deformation parameter, the second face deformation parameter, and the third face deformation parameter, the face reference model is deformed, which can transform the face reference model into a stylized three-dimensional face model that integrates the face shape features of the two-dimensional face image, the face shape features of the stylized target face shape, and the face shape features of the target face attributes.

[0094] As an optional embodiment, when obtaining the third face deformation parameter corresponding to the target face attribute, the method further includes: obtaining the adjustment coefficient corresponding to the target face attribute; and deforming the three-dimensional face reference model based on the adjustment coefficient corresponding to the target face attribute, the first face deformation parameter, the second face deformation parameter, and the third face deformation parameter corresponding to the target face attribute.

[0095] The adjustment coefficient corresponding to the target face attribute is used to adjust the magnitude of the target face attribute. This adjustment coefficient allows for the localized adjustment of the target face attribute to be applied to the stylized face shape, achieving localized adjustment of the target face attribute within the stylized face shape.

[0096] Specifically, the deformation parameters of the fourth face can be calculated based on the deformation formula;

[0097] Based on the fourth face deformation parameter, the 3D face reference model is deformed;

[0098] The deformation formula is as follows:

[0099] M represents the total number of target face attributes, RS 输入 RS represents the first face deformation parameter. 中性 RS represents the second face deformation parameter. i The third face deformation parameter, k, represents the attribute of the i-th target face. i This represents the adjustment coefficient corresponding to the i-th target face attribute.

[0100] When calculating the fourth face deformation parameter, we can first calculate the difference between the third face deformation parameter corresponding to the M target face attributes and the second face deformation parameter corresponding to the stylized target face shape, and obtain M differences; calculate the product of the M differences and the corresponding adjustment coefficient, and obtain M products; finally, add the M products, the second face deformation parameter and the first face deformation parameter to obtain the fourth face deformation parameter.

[0101] After obtaining the stylized 3D face model through step 204, the stylized 3D face model can be rendered by combining texture mapping to obtain a stylized 3D face image that integrates the face shape features of the 2D face image, the face shape features of the stylized target face, and the face shape features of the target face attributes. Thus, for different 2D face images, stylized 3D face images containing different face shape features can be generated.

[0102] This application embodiment obtains a first face deformation parameter corresponding to a two-dimensional face image, a second face deformation parameter corresponding to a stylized target face shape (e.g., a stylized youthful face shape), and a third face deformation parameter corresponding to the target face attribute. Based on the first, second, and third face deformation parameters, the three-dimensional face reference model is deformed. This enables the fusion of the face shape features of the two-dimensional face image, the face shape features of the stylized target face shape, and the face shape features of the target face attribute, thereby achieving stylized three-dimensional face editing. For different two-dimensional face images, different face shapes, and different target face attributes, stylized three-dimensional face models with different face shape features are obtained.

[0103] See Figure 5 This is a schematic diagram illustrating the implementation flow of a face processing method provided in another embodiment of this application, which is applied to an electronic device. Figure 5 As shown, the face processing method may include the following steps:

[0104] Step 501: Obtain the first face deformation parameters corresponding to the two-dimensional face image.

[0105] This step is the same as step 201. For details, please refer to the relevant description of step 201. It will not be repeated here.

[0106] Step 502: Display N stylized candidate face shapes, where N is an integer greater than zero.

[0107] Step 503: In response to the selection operation of the target face shape among the N stylized candidate face shapes, obtain the second face deformation parameters corresponding to the stylized target face shape.

[0108] The selection operation mentioned above can be any operation such as clicking or swiping, and there is no limitation here.

[0109] The stylized target face shape is the face shape that the user selects from N stylized candidate face shapes displayed. For example... Figure 6 The image shown is an example of a stylized target face shape.

[0110] A 3D face reference model and various stylized candidate face 3D models can be pre-set. The deformation parameters between the 3D face reference model and various stylized candidate face 3D models can be obtained by using iterative algorithms such as the least squares method or Newton's method. These deformation parameters are the second face deformation parameters corresponding to the stylized candidate face 3D model.

[0111] When editing facial features in a 2D face image, displaying N stylized candidate face shapes allows users to easily select different face shapes according to their actual needs.

[0112] The electronic device can pre-set the second face deformation parameters corresponding to N stylized candidate face shapes, and obtain the second face deformation parameters corresponding to the stylized target face shape from the above N stylized candidate face shape second face deformation parameters; or the electronic device can store the second face deformation parameters corresponding to N stylized candidate face shapes in other devices, and obtain the second face deformation parameters corresponding to the stylized target face shape from other devices.

[0113] Different face shapes correspond to different second-face deformation parameters, resulting in different face shapes in the final stylized 3D face models. Applying texture mapping to these stylized 3D face models with different face shapes can generate 3D face images with different face shapes. Similarly, different styles of the same face shape also correspond to different second-face deformation parameters, resulting in different styles of the final generated 3D face models. After texture mapping, the stylized 3D face images generated will also differ.

[0114] When N is greater than 1, the aforementioned N stylized candidate face shapes can be different face shapes of different styles, or different face shapes of the same style. For example, if no style is selected before executing step 502, the N stylized candidate face shapes can include the second face deformation parameters corresponding to the same face shape in different styles, as well as the second face deformation parameters corresponding to different face shapes of the same style, so as to provide users with more face shape choices; if a style has been selected before executing step 502, the N candidate face shapes can include the second face deformation parameters corresponding to different face shapes of the selected style, so as to provide users with more face shape choices.

[0115] Step 504: In response to the adjustment operation on the target face attributes, obtain the third face deformation parameters corresponding to the target face attributes.

[0116] This step is the same as step 203, and you can refer to the relevant description of step 203 for details, which will not be repeated here.

[0117] Step 504: Based on the first face deformation parameter, the second face deformation parameter and the third face deformation parameter, deform the three-dimensional face reference model to obtain a stylized three-dimensional face model.

[0118] The same applies to step 204, which can be found in the relevant description of step 204 and will not be repeated here.

[0119] like Figure 7The diagram illustrates a flowchart of the face editing process. The electronic device first rotates a 2D face image, changing the face orientation from left-facing to top-facing. Then, it performs face detection on the 2D image and crops the face region based on its position. The cropped face region is then normalized and input into a 3D face reconstruction network, which outputs the first face deformation parameter. Multiple faces of the same style are displayed on the user interface of the electronic device, and the second face deformation parameter of the selected face is obtained. Based on the first, second, and third face deformation parameters and adjustment coefficients, a fourth face deformation parameter is calculated. By adjusting the deformation of the 3D face reference model using the fourth face deformation parameter, a stylized 3D face model can be obtained. Figure 7 This will be illustrated using "stylized youthful face shapes" and "stylized aged face shapes" as examples. Figure 7 It can be seen that by combining these two face shapes with two-dimensional face images, three-dimensional face target models with different face shapes can be generated. Figure 7 The calculation process within the dashed box only needs to be performed once without updating the 2D face image, reducing the amount of computation required when continuously editing the same 2D face image and improving the efficiency of face editing.

[0120] This application embodiment displays N stylized candidate face shapes, which allows users to easily select the desired face shape from the N stylized candidate face shapes according to their actual needs, thereby realizing stylized 3D face shape editing.

[0121] See Figure 8 This is a schematic diagram illustrating the implementation flow of a face processing method provided in another embodiment of this application, which is applied to an electronic device. For example... Figure 8 As shown, the face processing method may include the following steps:

[0122] Step 801: Obtain the first face deformation parameters corresponding to the two-dimensional face image.

[0123] This step is the same as step 201. For details, please refer to the relevant description of step 201. It will not be repeated here.

[0124] Step 802: Obtain the second face deformation parameters corresponding to the stylized target face shape.

[0125] This step is the same as step 202, and you can refer to the relevant description of step 202 for details, which will not be repeated here.

[0126] Step 803: In response to the first adjustment operation on the target facial organ, obtain the third facial deformation parameter corresponding to the target facial organ and the first adjustment coefficient corresponding to the target facial organ.

[0127] Specifically, when the first adjustment operation is to increase the organ value of the target facial organ, the third facial deformation parameter corresponding to the target facial organ is the deformation parameter when the organ value of the target facial organ reaches its first maximum value; when the first adjustment operation is to decrease the organ value of the target facial organ, the third facial deformation parameter corresponding to the target facial organ is the deformation parameter when the organ value of the target facial organ reaches its first minimum value; the organ value of the target facial organ represents the size of the target facial organ. The aforementioned first maximum value is the maximum value of the organ value corresponding to the target facial organ, such as the maximum value of the eyebrow organ value. The aforementioned first minimum value is the minimum value of the organ value corresponding to the target facial organ, such as the minimum value of the eyebrow organ value.

[0128] To adjust each facial feature, we can categorize each facial feature into two candidate facial features with different shape characteristics based on the limit values ​​(i.e., maximum and minimum values) of the corresponding organ values. For example, if eyes can be categorized into stylized large eyes and stylized small eyes, then the third facial deformation parameters corresponding to the target facial feature include the facial deformation parameters corresponding to stylized large eyes and stylized small eyes. Based on the facial deformation parameters corresponding to stylized large eyes, the eyes in the 3D facial reference model can be enlarged, while based on the facial deformation parameters corresponding to stylized small eyes, the eyes in the 3D facial reference model can be reduced. Similarly, if noses can be categorized into stylized large noses and stylized small noses, then the third facial deformation parameters corresponding to the target facial feature include the facial deformation parameters corresponding to stylized large noses and stylized small noses. Based on the facial deformation parameters corresponding to stylized large noses, the nose in the 3D facial reference model can be enlarged, while based on the facial deformation parameters corresponding to stylized small noses, the nose in the 3D facial reference model can be reduced. The classification of other facial organs is the same as that of the eyes and nose, and will not be repeated here.

[0129] To facilitate user adjustment of each facial feature, one possible approach is to set an adjustment control bar for each feature, with a progress bar within the control bar. By adjusting the position of the progress bar on the control bar, the facial features can be adjusted. The target facial feature is the adjusted facial feature. When the progress bar is in the center of the control bar, it indicates that the size of the target facial feature is the same as the size of the facial feature in the second 3D facial reference model, and the first adjustment coefficient is zero. When the progress bar is on the right side of the control bar, it indicates that the size of the target facial feature is larger than the size of the eyes in the second 3D facial reference model. When the progress bar is on the left side of the control bar, it indicates that the size of the target facial feature is larger than the size of the corresponding facial feature in the second 3D facial reference model. When the progress bar is on the far right and far left of the control bar, the first adjustment coefficient is 1. As the progress bar slides from the center to both sides, the first adjustment coefficient continuously changes between 0 and 1. Figure 9 The image shown is an example of the adjustment control bar for the eyes, nose, and mouth. By sliding the progress bar left and right, you can adjust the eyes, nose, mouth, and other organs.

[0130] As another possible implementation, multi-touch can be used to adjust facial features. For example, when performing touch zoom operations on the corresponding areas of facial features in a two-dimensional face image, the scale of the touch zoom can be converted into a first adjustment coefficient. The larger the scale of the touch zoom, the larger the first adjustment coefficient; conversely, the smaller it is.

[0131] Step 804: Based on the adjustment coefficients corresponding to the target face attributes, the first face deformation parameter, the second face deformation parameter, and the third face deformation parameter corresponding to the target face attributes, deform the 3D face reference model to obtain a stylized 3D face model.

[0132] like Figure 10 The diagram shows an example of the eye editing process. The electronic device first rotates the 2D face image, changing the face orientation from left-facing to top-facing. Then, it performs face detection on the 2D image and crops the face region based on the face position information. The cropped face region is then normalized and input into a 3D face reconstruction network. The 3D face reconstruction network outputs the first face deformation parameter. An adjustment control bar for the eyes is displayed on the electronic device's user interface. By adjusting the progress bar's position on the control bar, the third face deformation parameter and the first adjustment coefficient corresponding to the eye are obtained. Based on the third face deformation parameter, the first adjustment coefficient, the first face deformation parameter, and the second face deformation parameter, the fourth face deformation parameter can be calculated. By adjusting the deformation of the 3D face reference model using the fourth face deformation parameter, the 3D face target model can be obtained. Figure 10The calculation process within the dashed box only needs to be performed once without updating the 2D face image, reducing the amount of computation required when continuously editing the same 2D face image and improving the efficiency of face editing.

[0133] This application embodiment obtains the third face deformation parameters and the first adjustment coefficient corresponding to the target face organ, which makes it convenient for users to edit the face organ according to actual needs, thereby realizing stylized three-dimensional face organ editing.

[0134] See Figure 11 This is a schematic diagram illustrating the implementation flow of a face processing method provided in another embodiment of this application, which is applied to an electronic device. Figure 11 As shown, the face processing method may include the following steps:

[0135] Step 1101: Obtain the first face deformation parameters corresponding to the two-dimensional face image.

[0136] This step is the same as step 201. For details, please refer to the relevant description of step 201. It will not be repeated here.

[0137] Step 1102: Obtain the second face deformation parameters corresponding to the stylized target face shape.

[0138] Step 1103: In response to the second adjustment operation on the target facial expression, obtain the third facial deformation parameter corresponding to the target facial expression and the second adjustment coefficient corresponding to the target facial expression.

[0139] Among them, the third facial deformation parameter corresponding to the target facial expression is the deformation parameter when the degree of expression of the target facial expression takes the second maximum value.

[0140] For example, if the target face expression is with the left eye closed, the maximum expression level corresponding to this expression is when the left eye is completely closed. Therefore, when the expression level of the target face expression reaches its maximum value, the left eye can be completely closed. Based on the third face deformation parameters, the 3D face reference model can be deformed to obtain a 3D face model with the left eye completely closed. The expression level represents the degree of closure of the left eye.

[0141] Based on the third facial deformation parameter and the second adjustment coefficient, target facial expressions with different levels of expression can be achieved, such as target facial expressions with different degrees of left eye closure. To facilitate user adjustment of each facial expression, one possible implementation is to set an adjustment control bar for each facial expression, with a progress bar within the control bar. By adjusting the position of the progress bar on the adjustment control bar, the degree of expression can be adjusted. The target facial expression is the expression obtained after adjusting the degree of expression of a given facial expression. When the progress bar is at the far left of the adjustment control bar, it indicates that the expression level of the target face is at its minimum (for example, the maximum expression level corresponds to the left eye being completely closed, and the minimum expression level corresponds to the left eye being completely open), and the first adjustment coefficient is zero; when the progress bar is at the far right of the adjustment control bar, it indicates that the expression level of the target face is at its maximum; when the progress bar slides between the far left and far right of the adjustment control bar, the first adjustment coefficient continuously changes between 0 and 1 or 1 and 0. For example, when the progress bar slides from the far left to the far right of the adjustment control bar, the second adjustment coefficient continuously changes between 0 and 1, and the left eye transitions from being completely open to being completely closed.

[0142] As another possible implementation, multi-touch can be used to adjust facial expressions. For example, by performing a touch zoom operation on the area corresponding to the left eye in a 2D face image, the scale of the touch zoom can be converted into a second adjustment coefficient. The larger the touch zoom scale, the larger the first adjustment coefficient; conversely, the smaller it is.

[0143] Step 1104: Based on the adjustment coefficients corresponding to the target face attributes, the first face deformation parameter, the second face deformation parameter, and the third face deformation parameter corresponding to the target face attributes, deform the 3D face reference model to obtain a stylized 3D face model.

[0144] like Figure 12 The diagram illustrates a flowchart of facial expression editing. The electronic device first rotates a 2D face image, changing the face orientation from left-facing to top-facing. Then, it performs face detection on the 2D image and crops the face region based on its position. The cropped face region is then normalized and input into a 3D face reconstruction network. The network outputs the first face deformation parameter. A facial expression adjustment control bar is displayed on the user interface. By adjusting the progress bar, the third face deformation parameter and the second adjustment coefficient corresponding to the facial expression are obtained. Based on the third, second, first, and second face deformation parameters, a fourth face deformation parameter can be calculated. By adjusting the deformation of the 3D face reference model using the fourth face deformation parameter, a 3D face target model can be obtained. Figure 12 The calculation process within the dashed box only needs to be performed once without updating the 2D face image, reducing the amount of computation required when continuously editing the same 2D face image and improving the efficiency of face editing.

[0145] This application embodiment obtains the third face deformation parameters and the second adjustment coefficient corresponding to the target face expression, which makes it convenient for users to edit the face expression according to actual needs, thereby realizing stylized three-dimensional face expression editing.

[0146] In this application, all facial deformation parameters have the same dimension to facilitate the calculation between different facial deformation parameters.

[0147] See Figure 13 This is a schematic diagram of the structure of a face processing device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.

[0148] The aforementioned face processing device includes:

[0149] The first acquisition module 1301 is used to acquire the first face deformation parameters corresponding to the two-dimensional face image. The first face deformation parameters are the deformation parameters for transforming the three-dimensional face reference model into a three-dimensional face model that includes the face shape features of the two-dimensional face image.

[0150] The second acquisition module 1302 is used to acquire the second face deformation parameters corresponding to the stylized target face shape. The second face deformation parameters are the deformation parameters for transforming the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the stylized target face shape.

[0151] The third acquisition module 1303 is used to acquire the third face deformation parameters corresponding to the target face attributes in response to the adjustment operation of the target face attributes. The third face deformation parameters are the deformation parameters of the three-dimensional face reference model to be deformed into a three-dimensional face model containing the face shape features of the target face attributes.

[0152] The model deformation module 1304 is used to deform the 3D face reference model based on the first face deformation parameter, the second face deformation parameter and the third face deformation parameter to obtain a stylized 3D face model.

[0153] Optionally, the second acquisition module 1302 described above is specifically used for:

[0154] Display N stylized candidate faces, where N is a positive integer;

[0155] Obtain the second face deformation parameters corresponding to the stylized target face shape, including:

[0156] In response to the selection operation of the target face shape among N stylized candidate face shapes, the second face deformation parameters corresponding to the stylized target face shape are obtained.

[0157] The third acquisition module 1303 mentioned above is also used for:

[0158] Obtain the adjustment coefficients corresponding to the target face attributes;

[0159] The aforementioned model deformation module 1304 is specifically used for:

[0160] The 3D face reference model is deformed based on the adjustment coefficients corresponding to the target face attributes, the first face deformation parameter, the second face deformation parameter, and the third face deformation parameter corresponding to the target face attributes.

[0161] Optionally, the above-mentioned model deformation module 1304 is specifically used for:

[0162] Calculate the deformation parameters of the fourth face according to the deformation formula;

[0163] Based on the fourth face deformation parameter, the 3D face reference model is deformed;

[0164] The deformation formula is as follows:

[0165] M represents the total number of target face attributes, RS 输入 RS represents the first face deformation parameter. 中性 RS represents the second face deformation parameter. i Let k represent the third face deformation parameter of the i-th target face attribute. i This represents the adjustment coefficient corresponding to the i-th target face attribute.

[0166] Optionally, when the target face attributes include target facial features, the third acquisition module 1303 is specifically used for:

[0167] In response to a first adjustment operation on the target facial organ, the third facial deformation parameter corresponding to the target facial organ and the first adjustment coefficient corresponding to the target facial organ are obtained. When the first adjustment operation is to increase the organ value of the target facial organ, the third facial deformation parameter corresponding to the target facial organ is the deformation parameter when the organ value of the target facial organ takes the first maximum value; when the first adjustment operation is to decrease the organ value of the target facial organ, the third facial deformation parameter corresponding to the target facial organ is the deformation parameter when the organ value of the target facial organ takes the first minimum value; the organ value of the target facial organ represents the size of the target facial organ.

[0168] Optionally, when the target face attributes include the target face expression, the third acquisition module 1303 is specifically used for:

[0169] In response to the second adjustment operation on the target facial expression, the third facial deformation parameter corresponding to the target facial expression and the first adjustment coefficient corresponding to the target facial expression are obtained; the third facial deformation parameter corresponding to the target facial expression is the deformation parameter when the degree of expression of the target facial expression takes the second maximum value.

[0170] Optionally, the first acquisition module 1301 described above is specifically used for:

[0171] The two-dimensional face image is input into the three-dimensional face reconstruction network to obtain the first face deformation parameters.

[0172] The face processing device provided in this application embodiment can be applied in the foregoing method embodiment. For details, please refer to the description of the above method embodiment, which will not be repeated here.

[0173] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 14 As shown, the electronic device of this embodiment includes: one or more processors 1400 (only one is shown in the figure), a memory 1401, and a computer program 1402 stored in the memory 1401 and executable on the at least one processor 1400. When the processor 1400 executes the computer program 1402, it implements the steps in the various face processing method embodiments described above.

[0174] The electronic device may include, but is not limited to, a processor 1400 and a memory 1401. Those skilled in the art will understand that... Figure 14 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0175] The processor 1400 may be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0176] The memory 1401 can be an internal storage unit of the electronic device, such as a hard drive or memory. The memory 1401 can also be an external storage device of the electronic device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 1401 can include both internal and external storage units. The memory 1401 is used to store the computer program and other programs and data required by the electronic device. The memory 1401 can also be used to temporarily store data that has been output or will be output.

[0177] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0178] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various method embodiments above.

[0179] This application also provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the above-described method embodiments.

[0180] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0181] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0182] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0183] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0184] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0185] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A face processing method, characterized in that, include: Obtain the first face deformation parameter corresponding to the two-dimensional face image. The first face deformation parameter is the deformation parameter for transforming the three-dimensional face reference model into a three-dimensional face model that includes the face shape features of the two-dimensional face image. Obtain the second face deformation parameter corresponding to the stylized target face shape. The second face deformation parameter is the deformation parameter for transforming the three-dimensional face reference model into a three-dimensional face model that includes the face shape features of the stylized target face shape. In response to the adjustment operation on the target face attribute, the third face deformation parameter corresponding to the target face attribute and the adjustment coefficient corresponding to the target face attribute are obtained. The third face deformation parameter is the deformation parameter that deforms the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the target face attribute. Calculate the deformation parameters of the fourth face according to the deformation formula; Based on the fourth face deformation parameter, the three-dimensional face reference model is deformed to obtain a stylized three-dimensional face model; The deformation formula is as follows: ; This represents the total number of the target face attributes. Integers greater than zero This represents the deformation parameters of the first face. This represents the second face deformation parameter. Indicates the first The third face deformation parameter of the target face attribute, Indicates the first The adjustment coefficients corresponding to the target face attributes.

2. The face processing method according to claim 1, characterized in that, The acquisition of the second facial deformation parameters corresponding to the stylized target facial shape includes: Display N stylized candidate faces, where N is a positive integer; In response to the selection operation of the target face shape among the N stylized candidate face shapes, the second face deformation parameter corresponding to the target face shape is obtained.

3. The face processing method according to claim 1, characterized in that, When the target facial attribute includes target facial features, in response to an adjustment operation on the target facial attribute, the third facial deformation parameter corresponding to the target facial attribute and the adjustment coefficient corresponding to the target facial attribute are obtained, including: In response to a first adjustment operation on the target facial organ, the third facial deformation parameter corresponding to the target facial organ and the first adjustment coefficient corresponding to the target facial organ are obtained. When the first adjustment operation is to increase the organ value of the target facial organ, the third facial deformation parameter corresponding to the target facial organ is the deformation parameter when the organ value of the target facial organ takes the first maximum value; when the first adjustment operation is to decrease the organ value of the target facial organ, the third facial deformation parameter corresponding to the target facial organ is the deformation parameter when the organ value of the target facial organ takes the first minimum value; the organ value of the target facial organ represents the size of the target facial organ.

4. The face processing method according to claim 1, characterized in that, When the target face attribute includes a target face expression, in response to an adjustment operation on the target face attribute, the third face deformation parameter corresponding to the target face attribute and the adjustment coefficient corresponding to the target face attribute are obtained, including: In response to the second adjustment operation on the target facial expression, the third facial deformation parameter corresponding to the target facial expression and the first adjustment coefficient corresponding to the target facial expression are obtained; the third facial deformation parameter corresponding to the target facial expression is the deformation parameter when the degree of expression of the target facial expression takes the second maximum value.

5. The face processing method according to any one of claims 1 to 4, characterized in that, The step of obtaining the first facial deformation parameters corresponding to the two-dimensional facial image includes: The two-dimensional face image is input into a three-dimensional face reconstruction network to obtain the first face deformation parameters.

6. A face processing device, characterized in that, include: The first acquisition module is used to acquire the first face deformation parameter corresponding to the two-dimensional face image. The first face deformation parameter is the deformation parameter for deforming the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the two-dimensional face image. The second acquisition module is used to acquire the second face deformation parameter corresponding to the stylized target face shape. The second face deformation parameter is the deformation parameter for transforming the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the stylized target face shape. The third acquisition module is used to respond to the adjustment operation of the target face attribute by acquiring the third face deformation parameter corresponding to the target face attribute and the adjustment coefficient corresponding to the target face attribute. The third face deformation parameter is the deformation parameter for deforming the three-dimensional face reference model into a three-dimensional face model containing the face shape features of the target face attribute. The model deformation module is used to calculate the deformation parameters of the fourth face according to the deformation formula. Based on the fourth face deformation parameter, the three-dimensional face reference model is deformed to obtain a stylized three-dimensional face model; The deformation formula is as follows: ; This represents the total number of the target face attributes. Integers greater than zero This represents the deformation parameters of the first face. This represents the second face deformation parameter. Indicates the first The third face deformation parameter of the target face attribute, Indicates the first The adjustment coefficients corresponding to the target face attributes.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the face processing method as described in any one of claims 1 to 5.

8. A chip, comprising a processor, characterized in that, The processor is used to read and execute a computer program stored in the memory to perform the steps of the face processing method as described in any one of claims 1 to 5.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the face processing method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Three-dimensional virtual image generation method and device, electronic equipment and storage medium

    CN112541963A

  • Three-dimensional face processing method, training method, generating method, device and equipment

    CN113538221A