A method, device, electronic device and storage medium for processing facial information
By utilizing the dense point data and linear fitting coefficients of multiple second face images, a virtual face model of the first face image in a preset style is quickly generated, which solves the problem of flexibility and efficiency in style conversion in the existing technology. This reduces the problem and achieves more efficient virtual face model generation.
Patent Information
- Application Number
- CN202011339595.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-25
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-11-25
AI Technical Summary
Existing technology has poor flexibility and low efficiency when building virtual face models of different styles. It requires re-acquisition and training of a large number of face images for each style, resulting in a time-consuming and inflexible generation process.
By obtaining the dense point data of multiple second face images in different styles, combined with the face parameter values of the first face image, the linear fitting coefficient is used to quickly determine the dense points of the first face image in the preset style. data to generate a virtual face model.
It improves the generation efficiency and flexibility of virtual face models, can quickly adapt to the needs of different styles, and reduces the retraining and data collection process for each style.
Smart Images

Figure CN112396693B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for processing facial information. Background Art
[0002] With the development of artificial intelligence technology, image processing technology is being used in more and more scenarios for virtual images, such as games, animation, and social networking.
[0003] In different application scenarios, virtual face models of different styles can be constructed, such as classical style, modern style, Western style, Chinese style, etc. For different application styles, it is generally necessary to set the construction method of the virtual face model corresponding to each application style, which has poor flexibility and low efficiency. Summary of the invention
[0004] The disclosed embodiments at least provide a solution for processing facial information.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for processing facial information, comprising:
[0006] Obtaining dense point data corresponding to a first face image and a plurality of second face images in a preset style;
[0007] Determining the dense point data of the first face image in the preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in the preset style;
[0008] Based on the dense point data corresponding to the first facial image, a virtual facial model of the first facial image in the preset style is generated.
[0009] In the disclosed embodiment, a virtual face model of a first face image in a corresponding style can be quickly determined based on dense point data corresponding to a plurality of second face images in different styles, thereby making the generation process of the virtual face model more flexible and improving the generation efficiency of the virtual face model of the face image in a preset style.
[0010] In a possible implementation, determining the dense point data of the first face image in the preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in the preset style includes:
[0011] Extracting facial parameter values of the first facial image and facial parameter values corresponding to the plurality of second facial images; wherein the facial parameter values include parameter values representing facial shape and parameter values representing facial expression;
[0012] Based on the facial parameter values of the first facial image, and the facial parameter values and dense point data respectively corresponding to the plurality of second facial images, the dense point data of the first facial image in the preset style is determined.
[0013] In the disclosed embodiment, it is proposed that in the process of determining the dense point data of the first face image under the preset style, the facial parameter values of the first face image and multiple second face images can be combined to determine it. Because the number of parameter values used when representing the face by facial parameter values is relatively small, the dense point data of the first face image under the preset style can be determined more quickly.
[0014] In a possible implementation, determining the dense point data of the first facial image in the preset style based on the facial parameter value of the first facial image and the facial parameter values and dense point data respectively corresponding to the plurality of second facial images includes:
[0015] Determining a linear fitting coefficient between the first facial image and the plurality of second facial images based on the facial parameter value of the first facial image and the facial parameter values respectively corresponding to the plurality of second facial images;
[0016] The dense point data of the first facial image in the preset style is determined according to the dense point data respectively corresponding to the plurality of second facial images and the linear fitting coefficient.
[0017] In the disclosed embodiment, it is possible to quickly obtain a linear fitting coefficient representing the correlation between a first face image and multiple second face images using a small number of face parameter values, and further, the dense point data of the multiple second face images in a preset style can be adjusted according to the linear fitting coefficient, so that the dense point data of the first face image in the preset style can be quickly obtained.
[0018] In a possible implementation, determining a linear fitting coefficient between the first facial image and the plurality of second facial images based on the facial parameter value of the first facial image and the facial parameter values respectively corresponding to the plurality of second facial images includes:
[0019] Obtaining a current linear fitting coefficient; wherein, in the case where the current linear fitting coefficient is an initial linear fitting coefficient, the initial linear fitting coefficient is preset;
[0020] Predicting a current facial parameter value of the first facial image based on the current linear fitting coefficient and the facial parameter values respectively corresponding to the plurality of second facial images;
[0021] Determining a current loss value between the extracted facial parameter value of the first facial image and the predicted facial parameter value of the first facial image based on the predicted current facial parameter value of the first facial image and the extracted facial parameter value of the first facial image;
[0022] Based on the current loss value and the constraint range corresponding to the preset linear fitting coefficient, the current linear fitting coefficient is adjusted to obtain the adjusted linear fitting coefficient, the adjusted linear fitting coefficient is used as the current linear fitting coefficient, and the step of predicting the current facial parameter value of the first facial image is returned to obtain the linear fitting coefficient until the adjustment operation of the current linear fitting coefficient meets the adjustment cutoff condition.
[0023] In the disclosed embodiment, in the process of adjusting the linear fitting coefficient between the first face image and multiple second face images, the linear fitting coefficient is adjusted multiple times by loss value and / or adjustment times, so that the accuracy of the linear fitting coefficient can be improved; on the other hand, during the adjustment process, the constraint is adjusted within a preset constraint range of the linear fitting coefficient, so that the linear fitting coefficient is obtained, which can more reasonably determine the dense point data corresponding to the first face image.
[0024] In a possible implementation, the dense point data includes coordinate values of the dense points; and determining the dense point data of the first face image in the preset style according to the dense point data respectively corresponding to the plurality of second face images and the linear fitting coefficients includes:
[0025] Determining a coordinate mean of the dense points based on the coordinate values of the dense points respectively corresponding to the plurality of second face images;
[0026] Based on the coordinate values of the dense points respectively corresponding to the plurality of second facial images and the coordinate mean of the dense points, determining a coordinate difference value of the coordinate values of the dense points respectively corresponding to the plurality of second facial images relative to the coordinate mean of the dense points;
[0027] Determine, based on the coordinate difference values and the linear fitting coefficients respectively corresponding to the plurality of second facial images, a coordinate difference value of the coordinate value of the dense point corresponding to the first facial image relative to the coordinate mean value of the dense point;
[0028] Based on the coordinate difference value corresponding to the first facial image and the coordinate mean value of the dense points, dense point data corresponding to the first facial image is determined.
[0029] In the embodiment of the present disclosure, when there are fewer second facial images, dense point data of different first facial images in a preset style can be accurately represented by dense point data of diverse second facial images.
[0030] In a possible implementation manner, the processing method further includes:
[0031] In response to the update style trigger operation, obtaining dense point data of the plurality of second face images in the changed style;
[0032] Determine the dense point data of the first face image in the changed style based on the dense point data of the first face image and the plurality of second face images in the changed style respectively;
[0033] Based on the dense point data of the first facial image in the changed style, a virtual facial model of the first facial image in the changed style is generated.
[0034] In the disclosed embodiment, after detecting the update style trigger operation, the virtual face model of the first face image in the changed style can be quickly obtained based on the pre-stored dense point data of multiple second face images in the changed style, thereby improving the efficiency of determining the virtual face model corresponding to the first face image in different styles.
[0035] In a possible implementation manner, the processing method further includes:
[0036] Acquire decoration information and skin color information corresponding to the first face image;
[0037] Based on the decoration information, the skin color information and the generated virtual face model of the first face image, a virtual face image corresponding to the first face image is generated.
[0038] In the disclosed embodiment, a virtual face image corresponding to the first face image can be generated according to the decoration information and skin color information selected by the user, thereby improving the interactivity with the user and increasing the user experience.
[0039] In a possible implementation, the facial parameter values are extracted by a pre-trained neural network, and the neural network is trained based on sample images with pre-labeled facial parameter values.
[0040] In the disclosed embodiments, it is proposed to extract facial parameter values of facial images through a pre-trained neural network, which can improve the extraction efficiency and accuracy of facial parameter values.
[0041] In one possible implementation, the neural network is pre-trained in the following manner:
[0042] Obtain a sample image set, wherein the sample image set includes multiple sample images and annotated face parameter values corresponding to each sample image;
[0043] Inputting the plurality of sample images into the neural network to be trained to obtain a predicted face parameter value corresponding to each sample image;
[0044] Based on the predicted face parameter values and the labeled face parameter values corresponding to each sample image, the network parameter values of the neural network to be trained are adjusted to obtain a trained neural network.
[0045] In the disclosed embodiment, during the training process of the neural network for extracting facial parameter values, it is proposed to continuously adjust the network parameter values of the neural network by annotating the facial parameter values of each sample image, so as to obtain a neural network with higher accuracy.
[0046] In a second aspect, an embodiment of the present disclosure provides a facial information processing device, including:
[0047] An acquisition module, used to acquire the first face image and the dense point data corresponding to the plurality of second face images under a preset style;
[0048] a determination module, configured to determine the dense point data of the first face image in a preset style based on the dense point data respectively corresponding to the first face image and the second face image in a preset style;
[0049] A generation module is used to generate a virtual face model of the first face image in the preset style based on the dense point data corresponding to the first face image.
[0050] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the processing method described in the first aspect are performed.
[0051] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the processing method described in the first aspect are executed.
[0052] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0054] Figure 1 A flowchart of a facial information processing method provided by an embodiment of the present disclosure is shown;
[0055] Figure 2 A schematic diagram showing a 3D model of a human face represented by dense point data provided by an embodiment of the present disclosure
[0056] Figure 3 A flow chart of a method for determining dense point data of a first face image in a preset style provided by an embodiment of the present disclosure is shown;
[0057] Figure 4 A flow chart of a method for training a neural network provided by an embodiment of the present disclosure is shown;
[0058] Figure 5 A flowchart of a specific method for determining dense point data of a first face image in a preset style provided by an embodiment of the present disclosure is shown;
[0059] Figure 6 A flow chart of a method for determining a virtual face model of a first face image in a changed style provided by an embodiment of the present disclosure is shown;
[0060] Figure 7 A flow chart of a method for generating a virtual face image corresponding to a first face image provided by an embodiment of the present disclosure is shown;
[0061] Figure 8 A schematic diagram of determining a virtual face model corresponding to a first face image provided by an embodiment of the present disclosure is shown;
[0062] Fig. 9 A schematic diagram showing the structure of a facial information processing device provided by an embodiment of the present disclosure is shown;
[0063] Fig.10 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0065] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0066] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0067] Facial modeling technology is often used in games and virtual social interactions, because different facial styles are usually required in different scenarios, such as classical style, modern style, Western style, Chinese style, etc. For different facial styles, it is necessary to construct facial modeling methods corresponding to different styles. For example, for the classical style facial modeling method, it is necessary to collect a large number of facial images and their corresponding classical style facial models, and then build a classical style virtual facial model based on this training. When other styles need to be changed, the virtual facial models of other styles need to be retrained. This process has poor flexibility and low efficiency.
[0068] Based on the above research, the present disclosure provides a method for processing facial information. For different first face images, a virtual face model of the first face image in the corresponding style can be quickly determined according to the dense point data corresponding to multiple second face images in different styles, thereby making the generation process of the virtual face model more flexible and improving the generation efficiency of the virtual face model of the face image in a preset style.
[0069] To facilitate understanding of this embodiment, a facial information processing method disclosed in an embodiment of the present disclosure is first introduced in detail. The execution subject of the processing method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a handheld device, a computing device, a wearable device, etc. In some possible implementations, the facial information processing method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0070] See also Figure 1 FIG. 1 is a flowchart of a facial information processing method provided by an embodiment of the present disclosure, and the processing method includes the following S11 to S13:
[0071] S11, obtaining dense point data corresponding to a first face image and a plurality of second face images in a preset style.
[0072] Exemplarily, the first facial image may be a color facial image or a grayscale facial image acquired by an image acquisition device, which is not specifically limited herein.
[0073] Exemplarily, the multiple second facial images are pre-selected images with certain features, and different first facial images can be characterized by these second facial images. For example, n second facial images are selected, and for each first facial image, the first facial image can be characterized by these n second facial images and a linear fitting coefficient. Exemplarily, in order to enable the multiple second facial images to fit and represent most of the first facial images, an image of a face with some prominent features compared to the average face can be selected as the second facial image, for example, a facial image of a face with a smaller face size than the average face is selected as the second facial image, or a facial image of a face with a larger mouth size than the average face is selected as the second facial image, or a facial image of a face with a larger eye size than the average face is selected as the second facial image.
[0074] Exemplarily, dense point data corresponding to multiple second facial images with different styles can be pre-acquired and saved, such as dense point data corresponding to a second facial image with a cartoon style, dense point data corresponding to a second facial image with a science fiction style, etc., to facilitate the subsequent determination of a virtual facial model of the first facial image in different styles. Exemplarily, the virtual facial model can include a virtual three-dimensional facial model or a virtual two-dimensional facial model.
[0075] Exemplarily, for each second facial image, dense point data corresponding to the second facial image and facial parameter values of the second facial image can be extracted, where the facial parameter values include but are not limited to three-dimensional deformable model (3D Morphable Face Model, 3DMM) parameter values, and then the coordinate values of the dense points are adjusted according to the facial parameter values to obtain dense point data corresponding to each second facial image in multiple styles. For example, dense point data corresponding to each second facial image in a classical style and dense point cloud data corresponding to a cartoon style can be obtained, and then the dense point data of each second facial image in different styles can be saved.
[0076] Exemplarily, the dense point data can represent a three-dimensional model of a human face. Specifically, the dense point data can include coordinate values of multiple vertices on the surface of the human face in a pre-constructed three-dimensional coordinate system. A three-dimensional network (3D mesh) formed by connecting multiple vertices and the coordinate values of multiple vertices can be used to represent the three-dimensional model of the human face, such as Figure 2 As shown, it is a schematic diagram of a three-dimensional model of a human face represented by different dense point data. The more dense points there are, the more refined the dense point data is when representing the three-dimensional model of the human face.
[0077] Exemplarily, the facial parameter values include parameter values representing facial shape and parameter values representing facial expressions. For example, the facial parameter values may include K-dimensional parameter values for representing facial shape and M-dimensional parameter values for representing facial expressions, wherein the K-dimensional parameter values for representing facial shape jointly reflect the facial shape of the second facial image, and the M-dimensional parameter values for representing facial expressions jointly reflect the facial expressions of the second facial image.
[0078] Exemplarily, the dimensional value range of K is generally between 150 and 400. The smaller the dimension of K, the simpler the facial shape that can be represented, and the larger the dimension of K, the more complex the facial shape that can be represented; the value range of M is generally between 10 and 40. The fewer the dimension of M, the simpler the facial expression that can be represented, and the more the dimension of M, the more complex the facial expression that can be represented. It can be seen that the embodiment of the present disclosure proposes that a face can be represented by a smaller number of facial parameter values, thereby facilitating the subsequent determination of the virtual face model corresponding to the first face image.
[0079] Exemplarily, in combination with the meaning of the facial parameter values, the above-mentioned adjustment of the coordinate values of the dense points according to the facial parameter values to obtain the dense point data corresponding to each second facial image in multiple styles can be understood as adjusting the coordinate values of the vertices in a pre-established three-dimensional coordinate system according to the facial parameter values and the feature attributes corresponding to the multiple styles (such as the feature attributes of the cartoon style, the feature attributes of the classical style, etc.), thereby obtaining the dense point data corresponding to the second facial image in multiple styles.
[0080] S12, determining dense point data of the first face image in a preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in a preset style.
[0081] Exemplarily, the linear fitting coefficient between the multiple second facial images and the first facial image can be determined by finding the correlation between the first facial image and the multiple second facial images, for example, by linear fitting. Then, the dense point data of the first facial image in the preset style can be further determined based on the linear fitting coefficient and the dense point data corresponding to the multiple second facial images in the preset style.
[0082] S13, generating a virtual face model of the first face image in a preset style based on the dense point data corresponding to the first face image.
[0083] After determining the dense point data corresponding to the first face image, the three-dimensional coordinate values of multiple vertices contained in the input face in a pre-established three-dimensional coordinate system can be obtained. In this way, a virtual face model of the first face image in a preset style can be obtained based on the three-dimensional coordinate values of the multiple vertices in the three-dimensional coordinate system.
[0084] In the disclosed embodiment, for different first facial images, a virtual facial model of the first facial image in the corresponding style can be quickly determined based on the dense point data corresponding to multiple second facial images in different styles, thereby making the generation process of the virtual facial model more flexible and improving the generation efficiency of the virtual facial model of the facial image in a preset style.
[0085] The above S11 to S13 will be described below in conjunction with specific embodiments.
[0086] With respect to the above S12, when determining the dense point data of the first face image in a preset style based on the dense point data corresponding to the first face image and the plurality of second face images in a preset style, as follows: Figure 3 As shown, the following S121 to S122 may be included:
[0087] S121, extracting facial parameter values of the first facial image and facial parameter values corresponding to the plurality of second facial images respectively; wherein the facial parameter values include parameter values representing facial shape and parameter values representing facial expression.
[0088] Exemplarily, a pre-trained neural network can be used to extract facial parameter values of the first facial image and facial parameter values corresponding to multiple second facial images. For example, the first facial image and each second facial image can be input into a pre-trained neural network respectively to obtain their corresponding facial parameter values.
[0089] S122, determining dense point data of the first facial image in a preset style based on the facial parameter values of the first facial image and the facial parameter values and dense point data respectively corresponding to the plurality of second facial images.
[0090] Taking into account that facial parameter values and dense point data have a corresponding relationship when representing the same face, the association relationship between the first facial image and the multiple second facial images can be determined through the facial parameter values corresponding to the first facial image and the multiple second facial images, and then the dense point data of the first facial image under the preset style can be determined based on the association relationship and the dense point data corresponding to the multiple second facial images.
[0091] In the disclosed embodiment, it is proposed that in the process of determining the dense point data of the first face image under the preset style, the facial parameter values of the first face image and multiple second face images can be combined to determine it. Because the number of parameter values used when representing the face by facial parameter values is relatively small, the dense point data of the first face image under the preset style can be determined more quickly.
[0092] Exemplarily, the above-mentioned facial parameter values may be extracted by a pre-trained neural network, which is trained based on sample images with pre-labeled facial parameter values.
[0093] In the disclosed embodiments, it is proposed to extract facial parameter values of facial images through a pre-trained neural network, which can improve the extraction efficiency and accuracy of facial parameter values.
[0094] Specifically, the neural network can be pre-trained in the following manner: Figure 4 As shown, including S201 to S203:
[0095] S201, obtaining a sample image set, where the sample image set includes multiple sample images and annotated face parameter values corresponding to each sample image;
[0096] S202, inputting a plurality of sample images into a neural network to be trained, and obtaining a predicted face parameter value corresponding to each sample image;
[0097] S203, adjusting the network parameter values of the neural network to be trained based on the predicted face parameter values and the labeled face parameter values corresponding to each sample image, to obtain a trained neural network.
[0098] Exemplarily, a large number of facial images and the annotated facial parameter values corresponding to each facial image can be collected as the sample image set here, and each sample image is input into the neural network to be trained, so that the predicted facial parameter value corresponding to the sample image output by the neural network to be trained can be obtained. Further, the loss value corresponding to the neural network to be trained can be determined based on the annotated facial parameter values and the predicted facial parameter values corresponding to the sample image, and then the network parameter values of the neural network to be trained can be adjusted according to the loss value until the number of adjustments reaches a preset number of times and / or the third loss value is less than the third preset threshold, so as to obtain a trained neural network.
[0099] In the disclosed embodiment, during the training process of the neural network for extracting facial parameter values, it is proposed to continuously adjust the network parameter values of the neural network by annotating the facial parameter values of each sample image, so as to obtain a neural network with higher accuracy.
[0100] Specifically, with respect to the above S122, when determining the dense point data of the first face image in a preset style based on the face parameter value of the first face image and the face parameter values and dense point data corresponding to the plurality of second face images, such as Figure 5 As shown, the following S1231 to S1232 may be included:
[0101] S1231, determining a linear fitting coefficient between the first facial image and the plurality of second facial images based on the facial parameter value of the first facial image and the facial parameter values respectively corresponding to the plurality of second facial images;
[0102] S1232, determining dense point data of the first face image in a preset style according to the dense point data and linear fitting coefficients respectively corresponding to the plurality of second face images.
[0103] Exemplarily, taking the facial parameter value as a 3DMM parameter value as an example, considering that the 3DMM parameter value of the first facial image can characterize the facial shape and expression corresponding to the first facial image, and similarly, the 3DMM parameter value corresponding to each second facial image can characterize the facial shape and expression corresponding to the second facial image, the association relationship between the first facial image and the plurality of second facial images can be determined by the 3DMM parameter value. Specifically, assuming that the plurality of second facial images include n second facial images, the linear fitting coefficient between the first facial image and the plurality of second facial images also includes n linear fitting coefficient values. The association relationship between the facial parameter value of the first facial image and the facial parameter values corresponding to the plurality of second facial images can be expressed according to the following formula (1):
[0104]
[0105] Among them, IN 3DMM Indicates the 3DMM parameter value corresponding to the first face image; α x Indicates the linear fitting coefficient value between the first face image and the xth second face image; BASE 3DMM(x) represents the facial parameter value corresponding to the x-th second facial image; L represents the number of second facial images used when determining the facial parameter value corresponding to the first facial image; x is used to indicate the x-th second facial image, where x∈(1,L).
[0106] In the disclosed embodiment, it is possible to quickly obtain a linear fitting coefficient representing the correlation between a first face image and multiple second face images using a small number of face parameter values, and further, the dense point data of the multiple second face images in a preset style can be adjusted according to the linear fitting coefficient, so that the dense point data of the first face image in the preset style can be quickly obtained.
[0107] Specifically, when determining the linear fitting coefficient between the first face image and the plurality of second face images based on the face parameter value of the first face image and the face parameter values respectively corresponding to the plurality of second face images, the following steps S12311 to S12314 may be included:
[0108] S12311, obtaining a current linear fitting coefficient; wherein, when the current linear fitting coefficient is an initial linear fitting coefficient, the initial linear fitting coefficient is preset.
[0109] The current linear fitting coefficient may be a linear fitting coefficient that has been adjusted at least once according to the following S12312 to S12314, or it may be an initial linear fitting coefficient. In the case where the current linear fitting coefficient is the initial linear fitting coefficient, the initial linear fitting coefficient may be pre-set based on experience.
[0110] S12312, predicting the current facial parameter values of the first facial image based on the current linear fitting coefficient and the facial parameter values corresponding to the plurality of second facial images.
[0111] Exemplarily, the facial parameter values corresponding to the multiple second facial images can be extracted by the pre-trained neural network mentioned above, and then the current linear fitting coefficient and the facial parameter values corresponding to the multiple second facial images can be input into the above formula (1) to predict the current facial parameter values of the first facial image.
[0112] S12313, based on the predicted current facial parameter values of the first facial image and the facial parameter values of the extracted first facial image, determine the current loss value between the facial parameter values of the extracted first facial image and the predicted facial parameter values of the first facial image.
[0113] In the process of adjusting the linear fitting coefficients, there is a certain gap between the predicted current facial parameter values of the first facial image and the facial parameter values of the first facial image extracted by the pre-trained neural network mentioned above. Based on this gap, the current loss value between the facial parameter values of the extracted first facial image and the predicted facial parameter values of the first facial image can be determined.
[0114] S12314, based on the current loss value and the constraint range corresponding to the preset linear fitting coefficient, adjust the current linear fitting coefficient to obtain the adjusted linear fitting coefficient, use the adjusted linear fitting coefficient as the current linear fitting coefficient, return to execute the step of predicting the current face parameter value of the first face image, until the adjustment operation of the current linear fitting coefficient meets the adjustment cutoff condition, and obtain the linear fitting coefficient.
[0115] For example, considering that the facial parameter values are used to represent the facial shape and size, in order to avoid distortion of the dense point data of the first facial image determined by the linear fitting coefficient in the later stage when characterizing the virtual facial model, it is proposed here that in the process of adjusting the current linear fitting coefficient based on the current loss value, it is necessary to adjust the current linear fitting coefficient in combination with the constraint range of the preset linear fitting coefficient. For example, a large amount of data statistics can be used to determine that the constraint range corresponding to the preset linear fitting coefficient is set to between -0.5 and 0.5. In this way, in the process of adjusting the current linear fitting coefficient based on the current loss value, each adjusted linear fitting coefficient can be between -0.5 and 0.5.
[0116] Exemplarily, based on the current loss value and the constraint range corresponding to the preset linear fitting coefficient, the current linear fitting coefficient is adjusted so that the current facial parameter value of the predicted first facial image and the facial parameter value of the first facial image extracted based on the neural network are closer, and then the adjusted linear fitting coefficient is used as the current linear fitting coefficient and returned to S12312 until the linear fitting coefficient is obtained after the current loss value is less than the preset threshold and / or the number of repeated adjustments reaches the preset number of times.
[0117] In the disclosed embodiment, in the process of adjusting the linear fitting coefficient between the first face image and multiple second face images, the linear fitting coefficient is adjusted multiple times by loss value and / or adjustment times, so that the accuracy of the linear fitting coefficient can be improved; on the other hand, during the adjustment process, the constraint is adjusted within a preset constraint range of the linear fitting coefficient, so that the linear fitting coefficient is obtained, which can more reasonably determine the dense point data corresponding to the first face image.
[0118] Specifically, the dense point data includes coordinate values of the dense points; for the above S1232, when determining the dense point data of the first face image in a preset style according to the dense point data and linear fitting coefficients respectively corresponding to the plurality of second face images, the following S12321 to S12324 may be included:
[0119] S12321, determining a coordinate mean of the dense points based on the coordinate values of the dense points respectively corresponding to the plurality of second facial images.
[0120] Exemplarily, when determining the coordinate mean of dense points of multiple second facial images, it can be determined based on the coordinate values of the dense points corresponding to the multiple second facial images, and the number of the multiple second facial images. For example, the multiple second facial images include 10 images, and the coordinate values of the dense points corresponding to each second facial image include the three-dimensional coordinate values of 100 vertices. For the first vertex, the three-dimensional coordinate values corresponding to the first vertex in the 10 second facial images can be summed, and then the ratio of the summation result to the number of second facial images can be used as the coordinate mean of the first vertex. In the same way, the coordinate mean of each vertex in the three-dimensional coordinate system can be obtained, and the coordinate means corresponding to multiple vertices constitute the coordinate mean of the dense points here.
[0121] S12322, based on the coordinate values of the dense points corresponding to the multiple second facial images respectively and the coordinate mean of the dense points, determine the coordinate difference value of the coordinate values of the dense points corresponding to the multiple second facial images respectively relative to the coordinate mean of the dense points.
[0122] Exemplarily, the coordinate mean of the dense points can represent the average virtual face model corresponding to multiple second face images. For example, the size of facial features represented by the coordinate mean of the dense points can be the average size of facial features corresponding to multiple second face images, and the face size represented by the coordinate mean of the dense points can be the average face size corresponding to multiple second face images, etc.
[0123] Exemplarily, by subtracting the coordinate values of the dense points corresponding to multiple second facial images and the coordinate mean of the dense points, the coordinate difference values of the coordinate values of the dense points corresponding to multiple second facial images relative to the coordinate mean of the dense points can be obtained. The coordinate difference value corresponding to each second facial image can characterize the difference between the second facial image and the average facial image mentioned above.
[0124] S12323, based on the coordinate difference values and linear fitting coefficients respectively corresponding to the plurality of second facial images, determine the coordinate difference values of the dense points corresponding to the first facial image relative to the coordinate mean of the dense points.
[0125] Exemplarily, the linear fitting coefficient can represent the correlation between the facial parameter values corresponding to the first facial image and the facial parameter values corresponding to the multiple second facial images respectively, and there is a corresponding relationship between the facial parameter values corresponding to the facial image and the dense point data corresponding to the facial image. Therefore, the linear fitting coefficient can also represent the correlation between the dense point data corresponding to the first facial image and the dense point data corresponding to the multiple second facial images respectively.
[0126] In the case of the same coordinate mean of the dense points, the linear fitting coefficient can also represent the correlation between the coordinate difference value corresponding to the first face image and the coordinate difference values corresponding to the multiple second face images. Therefore, the coordinate difference value of the dense point data corresponding to the first face image relative to the coordinate mean of the dense points can be determined based on the coordinate difference values corresponding to the multiple second face images and the linear fitting coefficient.
[0127] S12324, determining dense point data corresponding to the first facial image based on the coordinate difference value corresponding to the first facial image and the coordinate mean value of the dense points.
[0128] Specifically, by summing the coordinate difference value corresponding to the first face image and the coordinate mean of the dense points, the dense point data corresponding to the first face image can be obtained, specifically the coordinate value of the dense points corresponding to the first face image. Based on the dense point data, the virtual face model corresponding to the first face image can be represented.
[0129] Specifically, the dense point data corresponding to the first face image is determined here. Considering the relationship between the dense point data and the 3DMM, the dense point data corresponding to the first face image can be obtained by OUT3dmesh It can be determined according to the following formula (2):
[0130]
[0131] Among them, BASE 3dmeh(x) Represents the coordinate value of the dense point corresponding to the x-th second face image; MEAN 3dmeh Represents the coordinate mean of dense points of multiple second face images; The coordinate difference value of the coordinate value of the dense point corresponding to the first face image relative to the coordinate mean value of the dense point can be represented.
[0132] Here, when determining the dense point data of the first face image, the method of S12321 to S12324 is used for determination, that is, the method of determining by the above formula (2) is used. Compared with the method of determining the dense point data corresponding to the first face image by using the dense point data corresponding to a plurality of second face images and the linear fitting coefficient, the following advantages can be included:
[0133] In the disclosed embodiment, considering that the linear fitting coefficient is used to perform linear fitting on the coordinate difference values corresponding to the multiple second facial images respectively, what is obtained is the coordinate difference value of the coordinate value of the dense point corresponding to the first facial image relative to the coordinate mean of the dense point. Therefore, there is no need to limit the sum of the linear fitting coefficients to 1. After adding the coordinate difference value corresponding to the first facial image and the coordinate mean of the dense point, the dense point data representing a normal face can be obtained.
[0134] In addition, when there are fewer second facial images, the method provided in the embodiment of the present disclosure can be used to reasonably adjust the linear fitting coefficient to achieve the purpose of using fewer second facial images to determine the dense point data corresponding to the first facial image. For example, the eye size of the first facial image is small. Through the above method, there is no need to limit the eye size of multiple second facial images. The coordinate difference value can be adjusted by the linear fitting coefficient, so that after the adjusted coordinate difference value is superimposed with the coordinate mean of the dense points, dense point data representing small eyes can be obtained. For example, when multiple second facial images all have big eyes, the eyes represented by the coordinate mean of the dense points are also big eyes. At this time, the linear fitting coefficient can still be adjusted so that after the adjusted coordinate difference value is summed with the coordinate mean of the dense points, dense point data representing small eyes can be obtained.
[0135] It can be seen that, for different first facial images, the embodiments of the present disclosure do not need to select a second facial image with facial features similar to the first facial image to determine the dense point data corresponding to the first facial image. When there are fewer second facial images, this method can accurately represent the dense point data of different first facial images in a preset style through the dense point data of the diverse second facial images.
[0136] According to the above method, a virtual face model of the first face image in a preset style can be obtained, for example, a virtual face model of the first face image in a classical style can be obtained. When the style of the virtual face model corresponding to the first face image needs to be adjusted, for example, when a virtual face model of the first face image in a modern style needs to be generated, in one embodiment, Figure 6 As shown, the processing method provided in the embodiment of the present disclosure also includes the following S301 to S303:
[0137] S301, in response to a style update trigger operation, obtaining dense point data of a plurality of second face images under a changed style.
[0138] Exemplarily, because the dense point data corresponding to multiple second face images in multiple styles can be pre-saved, after receiving the update style trigger operation, the dense point data of each second face image in the changed style can be directly obtained.
[0139] S302, determining dense point data of the first facial image in a style after the change based on the dense point data of the first facial image and the plurality of second facial images in the style after the change.
[0140] The method of determining the dense point data of the first face image in the changed style here is similar to the method of determining the dense point data of the first face image in the preset style mentioned above, and will not be repeated here.
[0141] S303: Generate a virtual face model of the first face image in the changed style based on the dense point data of the first face image in the changed style.
[0142] Similarly, the method of generating a virtual face model of the first face image in the changed style is similar to the process of generating a virtual face model of the first face image in the preset style based on the dense point data corresponding to the first face image mentioned above, and will not be repeated here.
[0143] In the disclosed embodiment, after detecting the update style trigger operation, the virtual face model of the first face image in the changed style can be quickly obtained based on the pre-stored dense point data of multiple second face images in the changed style, thereby improving the efficiency of determining the virtual face model corresponding to the first face image in different styles.
[0144] In some scenarios, after obtaining the virtual face model, it is also necessary to generate a virtual face image corresponding to the first face image. The virtual face image can be a three-dimensional face image or a two-dimensional face image. In one embodiment, Figure 7 As shown, the processing method provided by the embodiment of the present disclosure also includes:
[0145] S401, obtaining decoration information and skin color information corresponding to a first face image;
[0146] S402: Generate a virtual face image corresponding to the first face image based on the decoration information, the skin color information and the generated virtual face model of the first face image.
[0147] Exemplarily, the decorative information may include hairstyle, hair accessories, etc. The decorative information and skin color information can be obtained by performing image recognition on the first facial image, or can be obtained according to the user's selection. For example, the virtual facial image generation interface provides an option bar for decorative information and skin color information, and the decorative information and skin color information corresponding to the first facial image can be determined based on the user's selection in the option bar.
[0148] Furthermore, after determining the decoration information and skin color information contained in the first facial image, the virtual facial model of the first facial image can be combined to generate a virtual facial image corresponding to the first facial image. Here, the virtual facial model of the first facial image can be a virtual facial model of the first facial image in a preset style, or it can be a virtual facial model of the first facial image in a changed style. The virtual facial image generated in this way can be a virtual facial image with a specific style.
[0149] In the disclosed embodiment, a virtual face image corresponding to the first face image can be generated according to the decoration information and skin color information selected by the user, thereby improving the interactivity with the user and increasing the user experience.
[0150] The following will describe the facial information processing process with a specific embodiment, including the following S501 to S507:
[0151] S501, preparing a sample image set, where the sample image set includes multiple sample images and a 3DMM parameter value corresponding to each sample image;
[0152] S502, training a neural network based on the sample image set to obtain a neural network capable of predicting 3DMM parameter values corresponding to the face image;
[0153] S503, using the trained neural network to determine the 3DMM parameter value IN corresponding to the first face image 3DMM 3DMM parameter values BASE corresponding to multiple face images 3DMM ;
[0154] S504, according to IN 3DMM and BASE 3DMM , confirm that the BASE 3DMM Indicates IN 3DMM The weight value α can be obtained by IN 3DMM =αBASE 3DMM Determine α, where α can represent a linear fitting coefficient between the first face image and the plurality of second face images;
[0155] S505, using a machine learning algorithm to continuously optimize α in S504 so that IN3dmm and alpha*BASE3dmm are as close as possible, and during the optimization process, the value of α is constrained so that the range of α is between -0.5 and 0.5;
[0156] S506, based on the 3D meshes corresponding to the plurality of second face images, the BASE 3dmeh Indicates that the 3D mesh corresponding to the average face image can be determined by MEAN 3dmeh Indicates that (where 3Dmesh can be determined by dense point data, the relationship between 3Dmesh and dense point data is detailed in the above Figure 2 explanation of the place);
[0157] S507, using the BASE corresponding to the plurality of second face images 3dmeh , MEAN corresponding to the average face image 3dmeh , and OUT 3DMM =α(BASE 3mesh -MEAN 3mesh )+MEAN 3dmesh The 3D mesh of the first face image can be determined, that is, OUT 3dmesh .
[0158] Among them, the above S501~S502 can be completed before facial processing is performed on the first facial image. When facial processing is performed on a new first facial image received each time, execution can be started from S503. Of course, if only the virtual facial model of the first facial image under the changed style is determined, execution can be started from S506. It can be seen that after obtaining the neural network that predicts the 3DMM parameter value corresponding to the facial image, the virtual facial model of the first facial image obtained each time under the preset style can be quickly determined. After obtaining the linear fitting coefficient between the obtained first facial image and multiple second facial images, when it is necessary to change the style of the specified first facial image, the virtual facial model corresponding to the first facial image in different styles can be quickly obtained.
[0159] like Figure 8 As shown, it is a schematic diagram of the process of determining a virtual face model corresponding to a first face image 81. An average face image 83 can be determined based on multiple second face images 82, and then a virtual face model 84 of the first face image can be determined based on the first face image 81, multiple second face images 82 and the average face image 83.
[0160] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0161] Based on the same technical concept, the embodiment of the present disclosure also provides a facial information processing device corresponding to the facial information processing method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned processing method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0162] Reference Fig. 9 FIG. 6 is a schematic diagram of a facial information processing device 600 provided in an embodiment of the present disclosure. The facial information processing device 600 includes:
[0163] An acquisition module 601 is used to acquire dense point data corresponding to a first face image and a plurality of second face images in a preset style;
[0164] A determination module 602, configured to determine dense point data of the first face image in a preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in the preset style;
[0165] The generation module 603 is used to generate a virtual face model of the first face image in a preset style based on the dense point data corresponding to the first face image.
[0166] In a possible implementation, the determination module 602, when used to determine the dense point data of the first face image in a preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in the preset style, includes:
[0167] Extracting facial parameter values of the first facial image and facial parameter values corresponding to the plurality of second facial images; wherein the facial parameter values include parameter values representing facial shape and parameter values representing facial expression;
[0168] Based on the facial parameter values of the first facial image, and the facial parameter values and dense point data respectively corresponding to the plurality of second facial images, the dense point data of the first facial image in a preset style is determined.
[0169] In a possible implementation, the determination module 602, when used to determine the dense point data of the first face image in a preset style based on the face parameter value of the first face image and the face parameter values and dense point data corresponding to the plurality of second face images, includes:
[0170] Determining a linear fitting coefficient between the first facial image and the plurality of second facial images based on the facial parameter values of the first facial image and the facial parameter values corresponding to the plurality of second facial images;
[0171] The dense point data of the first face image in a preset style is determined according to the coordinate values of the dense points respectively corresponding to the plurality of second face images, the coordinate mean of the dense points, and the linear fitting coefficient.
[0172] In a possible implementation, the determination module 602, when used to determine the linear fitting coefficient between the first face image and the plurality of second face images based on the face parameter value of the first face image and the face parameter values respectively corresponding to the plurality of second face images, includes:
[0173] Obtaining a current linear fitting coefficient; wherein, when the current linear fitting coefficient is an initial linear fitting coefficient, the initial linear fitting coefficient is preset;
[0174] Predicting the current facial parameter value of the first facial image based on the current linear fitting coefficient and the facial parameter values corresponding to the plurality of second facial images;
[0175] Determining a current loss value between the facial parameter values of the extracted first facial image and the facial parameter values of the predicted first facial image based on the predicted current facial parameter values of the first facial image, the facial parameter values of the extracted first facial image, and a constraint range corresponding to a preset linear fitting coefficient;
[0176] Based on the current loss value, the current linear fitting coefficient is adjusted to obtain the adjusted linear fitting coefficient, the adjusted linear fitting coefficient is used as the current linear fitting coefficient, and the step of predicting the current face parameter value of the first face image is returned to obtain the linear fitting coefficient until the adjustment operation of the current linear fitting coefficient meets the adjustment cutoff condition.
[0177] In a possible implementation, the dense point data includes coordinate values of the dense points; when the determination module 602 is used to determine the dense point data of the first face image in a preset style according to the dense point data and the linear fitting coefficients respectively corresponding to the plurality of second face images, it includes:
[0178] Determine a coordinate mean of the dense points based on the coordinate values of the dense points respectively corresponding to the plurality of second face images;
[0179] Based on the coordinate values of the dense points respectively corresponding to the plurality of second face images and the coordinate mean of the dense points, determining a coordinate difference value of the coordinate values of the dense points respectively corresponding to the plurality of second face images relative to the coordinate mean of the dense points;
[0180] Determine, based on the coordinate difference values and linear fitting coefficients respectively corresponding to the plurality of second face images, a coordinate difference value of the coordinate value of the dense point corresponding to the first face image relative to the coordinate mean value of the dense point;
[0181] Based on the coordinate difference value corresponding to the first face image and the coordinate mean value of the dense points, the dense point data corresponding to the first face image is determined.
[0182] In a possible implementation manner, the processing device further includes an updating module 604, and the updating module 604 is configured to:
[0183] In response to the update style trigger operation, obtaining dense point data of a plurality of second face images in the changed styles respectively;
[0184] Determining dense point data of the first face image in the style after the change based on the dense point data of the first face image and the plurality of second face images in the style after the change;
[0185] Based on the dense point data of the first facial image in the changed style, a virtual facial model of the first facial image in the changed style is generated.
[0186] In a possible implementation, the generating module 603 is further configured to:
[0187] Acquire decoration information and skin color information corresponding to the first face image;
[0188] Based on the decoration information, the skin color information and the virtual face model generated for the first face image, a virtual face image corresponding to the first face image is generated.
[0189] In a possible implementation, the facial parameter values are extracted by a pre-trained neural network, and the neural network is trained based on sample images with pre-labeled facial parameter values.
[0190] In a possible implementation, the processing device further includes a training module 606, and the training module 606 is used to pre-train the neural network in the following manner:
[0191] Obtain a sample image set, where the sample image set includes multiple sample images and annotated face parameter values corresponding to each sample image;
[0192] Input multiple sample images into the neural network to be trained to obtain the predicted face parameter value corresponding to each sample image;
[0193] Based on the predicted face parameter values and the labeled face parameter values corresponding to each sample image, the network parameter values of the neural network to be trained are adjusted to obtain a trained neural network.
[0194] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0195] Corresponds to Figure 1 The present disclosure also provides an electronic device 700, such as Fig.10 FIG. 7 is a schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present disclosure, including:
[0196] Processor 71, memory 72, and bus 73; memory 72 is used to store execution instructions, including internal memory 721 and external memory 722; the internal memory 721 here is also called internal memory, which is used to temporarily store the calculation data in the processor 71, as well as the data exchanged with the external memory 722 such as a hard disk. The processor 71 exchanges data with the external memory 722 through the internal memory 721. When the electronic device 700 is running, the processor 71 and the memory 72 communicate through the bus 73, so that the processor 71 executes the following instructions: obtain a first face image, and dense point data corresponding to multiple second face images under a preset style; determine the dense point data of the first face image under the preset style based on the dense point data corresponding to the first face image and the multiple second face images under the preset style; generate a virtual face model of the first face image under the preset style based on the dense point data corresponding to the first face image.
[0197] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the facial information processing method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0198] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the facial information processing method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0199] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0200] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0201] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0202] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0203] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0204] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for processing facial information, characterized in that: include: Obtaining dense point data corresponding to a first face image and a plurality of second face images in a preset style; Determining the dense point data of the first face image in the preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in the preset style; generating a virtual face model of the first face image in the preset style based on the dense point data corresponding to the first face image; The determining of the dense point data of the first face image in the preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in the preset style comprises: Extracting facial parameter values of the first facial image and facial parameter values corresponding to the plurality of second facial images; wherein the facial parameter values include parameter values representing facial shape and parameter values representing facial expression; Determining a linear fitting coefficient between the first facial image and the plurality of second facial images based on the facial parameter value of the first facial image and the facial parameter values respectively corresponding to the plurality of second facial images; The dense point data of the first facial image in the preset style is determined according to the dense point data respectively corresponding to the plurality of second facial images and the linear fitting coefficient.
2. The processing method according to claim 1, characterized in that: The step of determining a linear fitting coefficient between the first face image and the plurality of second face images based on the face parameter value of the first face image and the face parameter values respectively corresponding to the plurality of second face images comprises: Obtaining a current linear fitting coefficient; wherein, in the case where the current linear fitting coefficient is an initial linear fitting coefficient, the initial linear fitting coefficient is preset; Predicting a current facial parameter value of the first facial image based on the current linear fitting coefficient and the facial parameter values respectively corresponding to the plurality of second facial images; Determining a current loss value between the extracted facial parameter value of the first facial image and the predicted facial parameter value of the first facial image based on the predicted current facial parameter value of the first facial image and the extracted facial parameter value of the first facial image; Based on the current loss value and the constraint range corresponding to the preset linear fitting coefficient, the current linear fitting coefficient is adjusted to obtain the adjusted linear fitting coefficient, the adjusted linear fitting coefficient is used as the current linear fitting coefficient, and the step of predicting the current facial parameter value of the first facial image is returned to, until the adjustment operation of the current linear fitting coefficient meets the adjustment cutoff condition, and the linear fitting coefficient is obtained.
3. The processing method according to claim 1 or 2, characterized in that: The dense point data includes coordinate values of the dense points; and determining the dense point data of the first face image in the preset style according to the dense point data respectively corresponding to the plurality of second face images and the linear fitting coefficients, comprises: Determining a coordinate mean of the dense points based on the coordinate values of the dense points respectively corresponding to the plurality of second face images; Based on the coordinate values of the dense points respectively corresponding to the plurality of second facial images and the coordinate mean of the dense points, determining a coordinate difference value of the coordinate values of the dense points respectively corresponding to the plurality of second facial images relative to the coordinate mean of the dense points; Determine, based on the coordinate difference values and the linear fitting coefficients respectively corresponding to the plurality of second facial images, a coordinate difference value of the coordinate value of the dense point corresponding to the first facial image relative to the coordinate mean value of the dense point; Based on the coordinate difference value corresponding to the first facial image and the coordinate mean value of the dense points, dense point data corresponding to the first facial image is determined.
4. The processing method according to claim 1, characterized in that: The processing method also includes: In response to the update style trigger operation, obtaining dense point data of the plurality of second face images in the changed style; Determine the dense point data of the first face image in the changed style based on the dense point data of the first face image and the plurality of second face images in the changed style respectively; Based on the dense point data of the first facial image in the changed style, a virtual facial model of the first facial image in the changed style is generated.
5. The processing method according to claim 1, characterized in that: The processing method also includes: Acquire decoration information and skin color information corresponding to the first face image; Based on the decoration information, the skin color information and the generated virtual face model of the first face image, a virtual face image corresponding to the first face image is generated.
6. The processing method according to claim 1, characterized in that: The facial parameter values are extracted by a pre-trained neural network, and the neural network is trained based on sample images with pre-labeled facial parameter values.
7. The processing method according to claim 6, characterized in that: The neural network is pre-trained as follows: Obtain a sample image set, wherein the sample image set includes multiple sample images and annotated face parameter values corresponding to each sample image; Inputting the plurality of sample images into the neural network to be trained to obtain a predicted face parameter value corresponding to each sample image; Based on the predicted face parameter values and the labeled face parameter values corresponding to each sample image, the network parameter values of the neural network to be trained are adjusted to obtain a trained neural network.
8. A facial information processing device, characterized in that: include: An acquisition module, used to acquire the first face image and the dense point data corresponding to the plurality of second face images under a preset style; a determination module, configured to determine the dense point data of the first face image in the preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in the preset style; A generating module, configured to generate a virtual face model of the first face image in the preset style based on the dense point data corresponding to the first face image; Wherein, the determination module, when determining the dense point data of the first face image in the preset style based on the dense point data respectively corresponding to the first face image and the plurality of second face images in the preset style, is used to: Extracting facial parameter values of the first facial image and facial parameter values corresponding to the plurality of second facial images; wherein the facial parameter values include parameter values representing facial shape and parameter values representing facial expression; Determining a linear fitting coefficient between the first facial image and the plurality of second facial images based on the facial parameter value of the first facial image and the facial parameter values respectively corresponding to the plurality of second facial images; Determine the dense point data of the first face image in the preset style according to the dense point data respectively corresponding to the plurality of second face images and the linear fitting coefficient.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the processing method as described in any one of claims 1 to 7 are performed.
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 processing method according to any one of claims 1 to 7 are executed.
