A method for constructing a face sample and a related device
By obtaining the target face image and generating the first face model, the problem of high face sample construction cost and poor sample effect in the existing technology is solved, and efficient and low-cost face sample acquisition is achieved.
Patent Information
- Application Number
- CN202210243213.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-03-11
AI Technical Summary
In the prior art, the construction cost of face samples is high and the sample effect is poor, making it difficult to meet the growing demand for face samples.
By acquiring a target face image, determining its corresponding first face parameters, generating a first face model, and synthesizing a first sample face image, high-precision and diverse face samples can be obtained efficiently.
Face samples that fit the characteristics of real faces can be obtained without face collection equipment, which reduces the cost and difficulty of constructing face samples.
Smart Images

Figure CN116778076B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of face reconstruction, and in particular to a face sample construction method and related devices. Background Art
[0002] Face reconstruction refers to the technology of reconstructing a person's face model based on a face image. In order to evaluate the accuracy of face reconstruction, in related technologies, the reconstructed face model is usually compared with the face model actually corresponding to the face image, and the accuracy of face reconstruction is determined based on the difference between the two face models. The smaller the difference, the higher the accuracy of face reconstruction.
[0003] Therefore, in order to evaluate the accuracy of face reconstruction technology in the related art, it is necessary to obtain a large amount of accurate face sample data, which is a face image with an accurate corresponding face model. However, the face sample construction in the related art needs to be carried out through professional face model acquisition equipment, the cost of face sample construction is high, and the sample effect is poor, which is difficult to meet the growing demand for face samples. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a face sample construction method, which can efficiently obtain a large number of high-precision and diversified face samples to meet the demand for face samples.
[0005] The embodiments of the present application disclose the following technical solutions:
[0006] In a first aspect, an embodiment of the present application discloses a method for constructing a face sample, the method comprising:
[0007] Get the target face image;
[0008] Determine, by means of a parameter determination model, a first facial parameter corresponding to the target facial image according to the target facial image;
[0009] generating a first face model corresponding to the first face parameter;
[0010] A first sample face image corresponding to the first face model is synthesized, where the first face model is a sample face model corresponding to the first sample face image.
[0011] In a second aspect, an embodiment of the present application discloses a face sample construction device, the device comprising an acquisition unit, a first determination unit, a generation unit and a synthesis unit:
[0012] The acquisition unit is used to acquire a target face image;
[0013] The first determination unit is used to determine a first facial parameter corresponding to the target facial image according to the target facial image through a parameter determination model;
[0014] The generating unit is configured to generate a first face model corresponding to the first face parameter;
[0015] The synthesis unit is used to synthesize a first sample face image corresponding to the first face model, and the first face model is a sample face model corresponding to the first sample face image.
[0016] In a possible implementation, the parameter determination model is trained in the following manner:
[0017] Determine the model through the initial parameters, and determine the second face parameters, posture parameters and illumination parameters corresponding to the second sample face image;
[0018] generating a second face model corresponding to the second sample face image according to the second face parameters;
[0019] synthesizing a pending face image corresponding to the second face model according to the posture parameters and the illumination parameters;
[0020] According to the difference between the second sample facial image and the to-be-determined facial image, the initial parameter determination model is adjusted to obtain the parameter determination model.
[0021] In a possible implementation manner, the first face model is a plurality of first face models, and the generating unit is specifically configured to:
[0022] Determining a plurality of interference parameters corresponding to the first facial parameters;
[0023] generating a plurality of expanded face parameters according to the first face parameter and the plurality of interference parameters;
[0024] The multiple first face models are determined according to the multiple expanded face parameters.
[0025] In a possible implementation manner, the device further includes a second determining unit and a screening unit:
[0026] The second determining unit is used to determine face measurement parameters corresponding to the multiple first face models respectively, and the face measurement parameters are used to measure whether the multiple first face models are real;
[0027] The screening unit is used to screen out the first face model whose face measurement parameter does not meet the face measurement parameter threshold value from the multiple first face models;
[0028] The synthesis unit is specifically used for:
[0029] The first sample face images respectively corresponding to the plurality of first face models after the screening process are synthesized.
[0030] In a possible implementation, the face measurement parameter includes a face depth measurement parameter and / or a face plane measurement parameter;
[0031] With respect to the face measurement parameter including the face depth measurement parameter, the second determining unit is specifically configured to:
[0032] Determine the distance parameter between the nose tip key point and the ear key point on each first face model in the face depth direction, where the face depth direction is a direction perpendicular to the plane of the facial features;
[0033] Determining the distance parameter as the face depth measurement parameter;
[0034] The face measurement parameter threshold is a face depth measurement parameter threshold, and the screening unit is specifically used for:
[0035] Screening out the first face model whose face depth measurement parameter is smaller than the face depth measurement parameter threshold from the plurality of first face models;
[0036] With respect to the face measurement parameter including the face plane measurement parameter, the second determination unit is specifically configured to:
[0037] Determine a first target position corresponding to a first facial key point on one side of the face on each first facial model and on the other side of the face;
[0038] Determine a second target position corresponding to a second facial key point on the other side of the face, wherein the second facial key point corresponds to the first facial key point;
[0039] determining the face plane measurement parameter according to a distance difference between the first target position and the second target position;
[0040] The face measurement parameter threshold is a face plane measurement parameter threshold, and the screening unit is specifically used for:
[0041] The first face models whose face plane measurement parameters are greater than the face plane measurement parameter threshold are screened out from the multiple first face models.
[0042] In a possible implementation manner, the first face parameter includes a face model parameter and a face texture parameter, and the generating unit is specifically configured to:
[0043] Generating a basic face model according to the face model parameters, and generating a texture map according to the face texture parameters;
[0044] The first face model is generated according to the basic face model and the texture map.
[0045] In a possible implementation manner, the first face model is a plurality of first face models, and the generating unit is specifically configured to:
[0046] Adjusting the texture color parameters corresponding to the texture map to obtain a plurality of extended texture maps;
[0047] The multiple first face models are generated according to the basic face model and the multiple extended texture maps.
[0048] In a possible implementation, the synthesis unit is specifically used for:
[0049] Determine synthesis parameters corresponding to the first face model, where the synthesis parameters include any one or more combinations of synthesis illumination parameters and synthesis camera parameters, where the illumination parameters are used to identify the illumination environment corresponding to the first face model, and the synthesis camera parameters are used to determine the facial pose of the first face model in the first sample face image;
[0050] A first sample face image corresponding to the first face model is synthesized according to the synthesis parameters.
[0051] In a third aspect, an embodiment of the present application discloses a computer device, wherein the computer device includes a processor and a memory:
[0052] The memory is used to store program code and transmit the program code to the processor;
[0053] The processor is used to execute the face sample construction method described in any one of the first aspects according to the instructions in the program code.
[0054] In a fourth aspect, an embodiment of the present application discloses a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the face sample construction method described in any one of the first aspects.
[0055] In a fifth aspect, an embodiment of the present application discloses a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the face sample construction method described in any one of the first aspects.
[0056] It can be seen from the above technical solution that when constructing a face sample, the target face image can be obtained first, and then the model can be determined by parameters, and the first face parameters corresponding to the target face image can be determined according to the target face image, and the first face parameters are used to reconstruct the face model corresponding to the target face image. Since the first face parameters are determined based on the actual face image, although the first face parameters may not accurately match the actual face corresponding to the face image, the face model constructed based on the first face parameters is more in line with the characteristics of the real face. Based on this, the first face model corresponding to the first face parameters can be generated, and then the first sample face image corresponding to the first face model can be synthesized. Since the first sample face image is synthesized through the first face model, the first sample face image is the actual face model corresponding to the first sample face image, and the first face model can be used as the sample face model corresponding to the first sample face image. In this way, face samples that fit the characteristics of real faces can be efficiently obtained without face acquisition equipment, reducing the construction cost of face samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0058] Figure 1 A schematic diagram of a method for constructing a face sample in an actual application scenario provided by an embodiment of the present application;
[0059] Figure 2 A flowchart of a method for constructing a face sample provided in an embodiment of the present application;
[0060] Figure 3 A schematic diagram of a model training provided in an embodiment of the present application;
[0061] Figure 4 A schematic diagram of a face sample construction method provided in an embodiment of the present application;
[0062] Figure 5 A schematic diagram of a face sample construction method provided in an embodiment of the present application;
[0063] Figure 6 A structural block diagram of a face sample construction device provided in an embodiment of the present application;
[0064] Figure 7 A structural diagram of a computer device provided in an embodiment of the present application;
[0065] Figure 8 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0067] In related technologies, the construction of face samples requires the use of high-precision face acquisition equipment to collect face images of test persons and build face models to obtain face samples corresponding to the test persons. However, this sample construction method has a high construction cost, resulting in a small number of samples and poor sample diversity, which is difficult to meet the evaluation and training of diverse face reconstruction technologies.
[0068] In order to solve the above technical problems, the present application provides a method for constructing a face sample, wherein a processing device can determine the first face parameters corresponding to a target face image through a relatively efficient parameter determination model, so that the first face parameters can fit the characteristics of a real face. The processing device can generate a first face model corresponding to the first face parameters, and synthesize a first sample image corresponding to the first face model, so that the first face model can be used as a sample face image corresponding to the first face image. Based on this, the processing device can obtain a face image with an accurately corresponding face model without the participation of a face acquisition device, thereby reducing the cost of constructing a face sample.
[0069] It is understandable that the method can be applied to a processing device, which is a processing device capable of constructing a face sample, for example, a terminal device or a server with a face sample construction function. The method can be executed independently by a terminal device or a server, or can be applied to a network scenario in which a terminal device and a server communicate, and is executed by the cooperation of the terminal device and the server. Among them, the terminal device can be a computer, a mobile phone and other devices. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent server or a cluster server.
[0070] In order to facilitate understanding of the technical solution provided by the present application, a face sample construction method provided by an embodiment of the present application will be introduced below in combination with an actual application scenario.
[0071] See also Figure 1 , Figure 1 A schematic diagram of a face sample construction method in an actual application scenario provided in an embodiment of the present application. In this actual application scenario, the processing device is a server 101 capable of constructing face samples.
[0072] The server 101 can obtain the target face image, and then determine the model through parameters, and can determine the first face parameters corresponding to the target face image, and the first face parameters include face model parameters and face texture parameters. Since the first face parameters are determined based on the target face image, although they may not completely match the actual face corresponding to the target face object, they are more in line with the face features of the real face, such as the distribution of facial features and facial contours that are more in line with the real face. Therefore, the face model reconstructed based on the first face parameters has a higher authenticity. The server 101 can determine the basic face model through the face model parameters, determine the texture map through the face texture parameters, and then generate the first face model based on the basic face model and the texture map, and the first face model has a higher authenticity. Through the first face model, server 101 can synthesize the corresponding first sample face image. Since the face image is synthesized based on the first face model, the first face model can be used as the sample face model corresponding to the first sample face image. Therefore, server 101 can obtain the first face model and the first sample face image with accurate correspondence to form a face sample. This process does not require the participation of professional face acquisition equipment, and can obtain face samples with higher authenticity and accuracy, thereby reducing the cost of constructing face samples.
[0073] Next, a face sample construction method provided in an embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0074] See also Figure 2 , Figure 2 A flowchart of a face sample construction method provided in an embodiment of the present application, the method comprising:
[0075] S201: Acquire a target face image.
[0076] The target face image can be any image containing a face, such as a frontal face image, a side face image, etc. Since the present application does not need to obtain face parameters that completely match the actual face corresponding to the target face image, it can support faces of multiple angles and types in the target face image, with low difficulty in acquisition and a large number of images that can be acquired, further improving the efficiency of constructing face samples of the present application.
[0077] S202: Determine a first facial parameter corresponding to the target facial image according to the target facial image by using a parameter determination model.
[0078] The parameter determination model is used to determine the facial parameters corresponding to the facial image based on the facial image, and the facial parameters are used to synthesize the facial model. The processing device can determine the first facial parameters corresponding to the target facial image according to the target facial image through the parameter determination model, and the first facial parameters are used to synthesize the facial model determined by the target facial image. As mentioned above, the present application does not require facial parameters that completely match the actual face corresponding to the target facial image. Therefore, the training difficulty of the parameter determination model is also relatively low, further reducing the difficulty of constructing facial samples.
[0079] S203: Generate a first face model corresponding to the first face parameters.
[0080] According to the first face parameters, the processing device can perform face reconstruction to obtain a first face model. As mentioned above, the first face parameters determined by the real face image have a high degree of authenticity. Therefore, although the first face model may not have a high degree of match with the actual face corresponding to the target face image, it also has a high degree of authenticity, thereby ensuring the validity of the constructed face sample.
[0081] S204: Synthesize a first sample face image corresponding to the first face model.
[0082] The first sample facial image is a facial image that includes the first facial model. For example, the processing device can simulate the portrait photography method in real life and shoot the facial image corresponding to the first facial model through a virtual camera. Since the first sample facial image is synthesized through the first facial model, the first facial model and the first sample facial image have an accurate corresponding relationship, and the first facial model can be used as a sample facial model corresponding to the first sample facial image. Therefore, the processing device obtains the first sample facial image and the first facial model with an accurate corresponding relationship through the above method, and then constructs a facial sample with high accuracy and authenticity.
[0083] It can be seen from the above technical solution that when constructing a face sample, the target face image can be obtained first, and then the model can be determined by parameters, and the first face parameters corresponding to the target face image can be determined according to the target face image, and the first face parameters are used to reconstruct the face model corresponding to the target face image. Since the first face parameters are determined based on the actual face image, although the first face parameters may not accurately match the actual face corresponding to the face image, the face model constructed based on the first face parameters is more in line with the characteristics of the real face. Based on this, the first face model corresponding to the first face parameters can be generated, and then the first sample face image corresponding to the first face model can be synthesized. Since the first sample face image is synthesized through the first face model, the first sample face image is the actual face model corresponding to the first sample face image, and the first face model can be used as the sample face model corresponding to the first sample face image. In this way, face samples that fit the characteristics of real faces can be efficiently obtained without face acquisition equipment, reducing the construction cost of face samples.
[0084] In a possible implementation, in order to reduce the difficulty of constructing a face sample, when obtaining a parameter determination model through training, the processing device may perform training in the following manner:
[0085] First, the processing device can determine the model through the initial parameters, and determine the second facial parameters, posture parameters and illumination parameters corresponding to the second sample facial image. The second sample facial image is a facial image used for model training. The second facial parameters are used to reconstruct the facial model corresponding to the second sample facial image. The posture parameters and illumination parameters are used to simulate the state of the corresponding actual face in the image when the second sample facial image is generated, such as the facial angle, the illumination intensity corresponding to the face, etc. The processing device can generate the second facial model corresponding to the second sample facial image according to the second facial parameters, and then synthesize the pending facial image corresponding to the second facial model according to the posture parameters and illumination parameters. The pending facial image is the image corresponding to the second facial model in the posture identified by the posture parameters and under the illumination environment identified by the illumination parameters.
[0086] It is understandable that the more accurate the parameters determined by the initial parameter determination model are, the more closely the second face model generated based on these parameters should fit the actual face corresponding to the second sample face image, and the face image to be determined synthesized based on these parameters should be closer to the second sample face image. Therefore, through the difference between the second sample face image and the face image to be determined, the accuracy of the second face parameters, posture parameters and illumination parameters determined by the initial parameter determination model can be analyzed. Based on this, the processing device can adjust the initial parameter determination model according to the difference between the second sample face image and the face image to be determined, and obtain a parameter determination model that can be used for face parameter determination. Since the training process does not need to use the face model of the actual face corresponding to the second sample face image, and the parameter determination model does not need to provide high-precision face parameters in the face sample construction process of this application, it is not necessary to perform face reconstruction to construct an accurate face model corresponding to the second sample face image, which can meet the needs of model training and further reduce the difficulty of face sample construction.
[0087] For example, Figure 3 As shown, Figure 3 A schematic diagram of a model training provided in an embodiment of the present application, the initial parameter determination model can be a convolutional neural network model, and the processing device can use a large number of collected face photos to train the convolutional neural network model in a self-supervised manner. The processing device can use a convolutional neural network to predict 3DMM coefficients, pose coefficients, and illumination coefficients. The 3DMM coefficients are face parameters, and the pose coefficients are posture parameters. These coefficients are converted into a 3D model and projected onto a picture to obtain a projection picture, which is a face image to be determined. Then, the loss function can be determined based on the difference between the projection picture and the original picture, and the gradient information is calculated based on the loss function. The weight of the neural network is adjusted using the gradient information to make it more accurate next time until the result converges. The difference between the projection picture and the original picture can be reflected in many aspects, the most common of which is the difference in color information between the two pictures; or the difference between the projection result of the predefined key points on the 3D model and the key points detected in the original picture is calculated for constraint. Since the parameter determination model is trained based on a large number of real face images, the model can learn the distribution of facial features and facial shape characteristics of real faces. Even if the parameter determination model cannot determine the facial parameters that completely match the facial image, the facial parameters fit the real facial features and can be used to construct facial samples.
[0088] In order to construct a face sample more efficiently, after determining the first face parameter, the processing device can determine multiple interference parameters corresponding to the first face parameter, such as Gaussian noise. The interference parameter can be used to fine-tune the first face parameter without affecting the authenticity of the first face parameter, so that the first face parameter can be expanded, greatly increasing the number of first face models that can be determined. The processing device can generate multiple expanded face parameters based on the first face parameter and multiple interference parameters, and the expanded face parameters are parameters obtained by interfering with the first face parameter through the interference parameters. Therefore, based on the multiple expanded face parameters, multiple first face models can be determined, so that the number of generated first face models is increased while ensuring the authenticity of the first face model, and then the number of obtained face samples can be increased, so as to achieve efficient construction of face samples.
[0089] It is understandable that, since the first facial parameters are determined based on the facial image, some facial images may cause the generated facial parameters to be partially distorted due to the facial angle problem contained therein. For example, when the facial image is a frontal image of a face, the facial parameters determined based on the image may cause the generated facial model to be distorted to a certain extent in the side face direction; when the facial image is a measurement image of a face, the facial parameters determined based on the image may cause the generated facial model to be distorted to a certain extent in the front face direction.
[0090] Therefore, in a possible implementation, in order to further ensure the authenticity of the face sample construction and avoid the distortion of the face sample due to the limitations of the face image or when the face sample is expanded by adding interference parameters, the processing device can verify the authenticity of the multiple first face models obtained in the above manner. The processing device can determine the face measurement parameters corresponding to the multiple first face models, which are used to measure whether the multiple first face models are real. Subsequently, the processing device can screen out the first face model whose face measurement parameters do not meet the face measurement parameter threshold among the multiple first face models. The processing device can synthesize the first sample face images corresponding to the multiple first face models after the screening process, so as to ensure the authenticity of the obtained first face model and the first sample face image, thereby improving the authenticity of the face sample.
[0091] Specifically, in a possible implementation, the face measurement parameter may include a face depth measurement parameter and / or a face plane measurement parameter. For the face measurement parameter including the face depth measurement parameter, when determining the face measurement parameters corresponding to the multiple first face models, the processing device may determine the distance parameter between the nose tip key point and the ear key point on each first face model in the face depth direction, and the face depth direction is the direction perpendicular to the plane of the facial features, that is, the side face direction of the face. The processing device may determine the distance parameter as the face depth measurement parameter, and the face measurement parameter threshold may be the face depth measurement parameter threshold, and then filter out the first face models whose face depth measurement parameters are less than the face depth measurement parameter threshold from the multiple first face models. Although these filtered out first face models may be more consistent with the characteristics of the real face in terms of the facial features ratio and face shape of the front face, they are greatly different from the real face in terms of face depth, which will cause the generated face model to lack authenticity. For example, the processing device may filter out 10% of the face models with smaller face depth measurement parameters from the multiple first face models in this way.
[0092] For the face measurement parameters including face plane measurement parameters, the processing device can determine the first target position corresponding to the first face key point on one side of the face on each first face model in the other side of the face, and the first target position is the symmetrical position corresponding to the first face key point with the face midline as the symmetry axis. After that, the processing device can determine the second target position corresponding to the second face key point on the other side of the face, and the second face key point corresponds to the first face key point, for example, the first face key point can be the left eye key point, and the second face key point can be the right eye key point. It can be understood that if the facial features distribution and face shape of the first face model fit the characteristics of a real face, the positions of the first face key point and the second face key point on the face should have a relatively close corresponding relationship, that is, the first target position and the second target position should be relatively matched. Based on this, the processing device can determine the face plane measurement parameter according to the distance difference between the first target position and the second target position, and the face measurement parameter threshold is the face plane measurement parameter threshold. The processing device can screen out first face models whose face plane measurement parameters are greater than the face plane measurement parameter threshold from multiple first face models. The positions of the first face key points and the second face key points on these first face models correspond poorly, which does not conform to the facial characteristics of real faces, resulting in a lack of authenticity in the face models.
[0093] Specifically, in a possible implementation, the first face parameter includes a face model parameter and a face texture parameter, and the processing device can generate a basic face model according to the face model parameter, and the basic face model is used to reflect the face shape, distribution of facial features, etc., and the processing device can generate a texture map according to the face texture parameter, and the texture map is used to simulate the skin color and texture of a real face. According to the basic face model and the texture map, the processing device can generate the first face model.
[0094] like Figure 4 As shown, first, the processing device can perturb and expand the data of the 3DMM model parameters and texture parameters output by the model by adding Gaussian noise (different 3DMM models have different mean and variance of the added Gaussian noise, which needs to be debugged). Then the 3DMM parameters are synthesized into a basic face model, and the texture parameters are synthesized into a texture map, thereby obtaining multiple basic face models and multiple texture maps, and then the multiple basic face models and texture maps are arranged and combined to synthesize a large number of diverse face models. .
[0095] In order to further expand the diversity of face samples, in a possible implementation, the processing device can also make various adjustments to the texture map. For example, the processing device can adjust the texture color parameters corresponding to the texture map to obtain multiple expanded texture maps. The texture color parameters may include color temperature, saturation, contrast, etc. Since the risk of distortion is lower when adjusting the texture map than when adjusting the face model, this method can further improve the diversity of the synthesized face model while ensuring the authenticity of the face sample.
[0096] In a possible implementation, when synthesizing a corresponding first sample face image based on a first face model, the processing device may determine synthesis parameters corresponding to the first face model, the synthesis parameters including any one or more combinations of synthesis illumination parameters and synthesis camera parameters, the illumination parameters are used to identify the illumination environment corresponding to the first face model, such as the number of light sources, light source intensity, light source angle, etc., the synthesis camera parameters are used to determine the face pose of the first face model in the first sample face image, for example, the synthesis camera parameters may be the angle, position, etc. of a virtual camera synthesizing the first sample face image. The processing device may synthesize the first sample face image corresponding to the first face model according to the synthesis parameters.
[0097] For example, in an actual application scenario, the processing device can construct a face sample through an engine that can synthesize face images. The processing device can input the first face model into the engine, randomly build virtual cameras and light sources at different angles in the engine, and generate pictures with different character postures, lighting, and focal lengths to ensure scene richness.
[0098] The camera position can face the front face, with the nose tip of the first face parameter as the center, and randomly rotate 0-90 degrees to the left or right, and 0-30 degrees up or down. Left and right rotation and up and down rotation can be performed at the same time. The camera focal length can be random within a certain range according to the actual distance from the nose tip (needs to be adjusted).
[0099] The number of light sources can be randomly set, usually 0-5 light sources. The type of light source is randomly set, usually one of spotlight, point light source and matrix light source; the position of each light source is also centered on the nose tip of the first face model, randomly rotated 0-90 degrees to the left or right, and randomly rotated 0-45 degrees up and down, and left and right rotation and up and down rotation can be performed at the same time; the brightness of each light source can be random within a certain range (needs debugging). Finally, the engine will synthesize the face image according to the virtual camera settings, the number and position of light sources, such as Figure 5 As shown, a first face model may correspond to a first sample face image.
[0100] Based on the face sample construction method provided in the above embodiment, the present application embodiment also provides a face sample construction device, see Figure 6 , Figure 6 This is a structural block diagram of a face sample construction device provided in an embodiment of the present application. The device 600 includes an acquisition unit 601, a first determination unit 602, a generation unit 603 and a synthesis unit 604:
[0101] The acquisition unit 601 is used to acquire a target face image;
[0102] The first determining unit 602 is used to determine the first facial parameter corresponding to the target facial image according to the target facial image through a parameter determination model;
[0103] The generating unit 603 is used to generate a first face model corresponding to the first face parameter;
[0104] The synthesis unit 604 is used to synthesize a first sample face image corresponding to the first face model, where the first face model is a sample face model corresponding to the first sample face image.
[0105] In a possible implementation, the parameter determination model is trained in the following manner:
[0106] Determine the model through the initial parameters, and determine the second face parameters, posture parameters and illumination parameters corresponding to the second sample face image;
[0107] generating a second face model corresponding to the second sample face image according to the second face parameters;
[0108] synthesizing a pending face image corresponding to the second face model according to the posture parameters and the illumination parameters;
[0109] According to the difference between the second sample facial image and the to-be-determined facial image, the initial parameter determination model is adjusted to obtain the parameter determination model.
[0110] In a possible implementation, the first face model is a plurality of first face models, and the generating unit 603 is specifically configured to:
[0111] Determining a plurality of interference parameters corresponding to the first facial parameters;
[0112] generating a plurality of expanded face parameters according to the first face parameter and the plurality of interference parameters;
[0113] The multiple first face models are determined according to the multiple expanded face parameters.
[0114] In a possible implementation manner, the device further includes a second determining unit and a screening unit:
[0115] The second determining unit is used to determine face measurement parameters corresponding to the multiple first face models respectively, and the face measurement parameters are used to measure whether the multiple first face models are real;
[0116] The screening unit is used to screen out the first face model whose face measurement parameter does not meet the face measurement parameter threshold value from the multiple first face models;
[0117] The synthesis unit 604 is specifically used for:
[0118] The first sample face images respectively corresponding to the plurality of first face models after the screening process are synthesized.
[0119] In a possible implementation, the face measurement parameter includes a face depth measurement parameter and / or a face plane measurement parameter;
[0120] With respect to the face measurement parameter including the face depth measurement parameter, the second determining unit is specifically configured to:
[0121] Determine the distance parameter between the nose tip key point and the ear key point on each first face model in the face depth direction, where the face depth direction is a direction perpendicular to the plane of the facial features;
[0122] Determining the distance parameter as the face depth measurement parameter;
[0123] The face measurement parameter threshold is a face depth measurement parameter threshold, and the screening unit is specifically used for:
[0124] Screening out the first face model whose face depth measurement parameter is smaller than the face depth measurement parameter threshold from the plurality of first face models;
[0125] With respect to the face measurement parameter including the face plane measurement parameter, the second determination unit is specifically configured to:
[0126] Determine a first target position corresponding to a first facial key point on one side of the face on each first facial model and on the other side of the face;
[0127] Determine a second target position corresponding to a second facial key point on the other side of the face, wherein the second facial key point corresponds to the first facial key point;
[0128] determining the face plane measurement parameter according to a distance difference between the first target position and the second target position;
[0129] The face measurement parameter threshold is a face plane measurement parameter threshold, and the screening unit is specifically used for:
[0130] The first face models whose face plane measurement parameters are greater than the face plane measurement parameter threshold are screened out from the multiple first face models.
[0131] In a possible implementation, the first face parameters include face model parameters and face texture parameters, and the generating unit 603 is specifically configured to:
[0132] Generating a basic face model according to the face model parameters, and generating a texture map according to the face texture parameters;
[0133] The first face model is generated according to the basic face model and the texture map.
[0134] In a possible implementation, the first face model is a plurality of first face models, and the generating unit 603 is specifically configured to:
[0135] Adjusting the texture color parameters corresponding to the texture map to obtain a plurality of extended texture maps;
[0136] The multiple first face models are generated according to the basic face model and the multiple extended texture maps.
[0137] In a possible implementation, the synthesis unit 604 is specifically configured to:
[0138] Determine synthesis parameters corresponding to the first face model, where the synthesis parameters include any one or more combinations of synthesis illumination parameters and synthesis camera parameters, where the illumination parameters are used to identify the illumination environment corresponding to the first face model, and the synthesis camera parameters are used to determine the facial pose of the first face model in the first sample face image;
[0139] A first sample face image corresponding to the first face model is synthesized according to the synthesis parameters.
[0140] The present application also provides a computer device, which is described below in conjunction with the accompanying drawings. Figure 7 As shown, the embodiment of the present application provides a device, which may also be a terminal device. The terminal device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sale terminal (POS), a vehicle-mounted computer, etc., and the terminal device is a mobile phone as an example:
[0141] Figure 7 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Figure 7 The mobile phone includes: a radio frequency (RF) circuit 710, a memory 720, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780, and a power supply 790. Those skilled in the art will understand that Figure 7 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0142] Combine the following Figure 7 A detailed introduction to the various components of the mobile phone:
[0143] The RF circuit 710 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 780 for processing; in addition, the designed uplink data is sent to the base station. Usually, the RF circuit 710 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, referred to as LNA), a duplexer, etc. In addition, the RF circuit 710 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0144] The memory 720 can be used to store software programs and modules. The processor 780 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 720. The memory 720 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 720 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0145] The input unit 730 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732. The touch panel 731, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 731 or near the touch panel 731 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 731 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 780, and can receive and execute commands sent by the processor 780. In addition, the touch panel 731 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 731, the input unit 730 may further include other input devices 732. Specifically, the other input devices 732 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
[0146] The display unit 740 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 740 may include a display panel 741. Optionally, the display panel 741 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc. Further, the touch panel 731 may cover the display panel 741. When the touch panel 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of touch event. Subsequently, the processor 780 provides a corresponding visual output on the display panel 741 according to the type of touch event. Although in Figure 7 In the embodiment, the touch panel 731 and the display panel 741 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 731 and the display panel 741 can be integrated to realize the input and output functions of the mobile phone.
[0147] The mobile phone may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 741 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0148] The audio circuit 760, the speaker 761, and the microphone 762 can provide an audio interface between the user and the mobile phone. The audio circuit 760 can transmit the received audio data to the speaker 761 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 762 converts the collected sound signal into an electrical signal, which is received by the audio circuit 760 and converted into audio data, and then the audio data is output to the processor 780 for processing, and then sent to another mobile phone through the RF circuit 710, or the audio data is output to the memory 720 for further processing.
[0149] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 770. It provides users with wireless broadband Internet access. Figure 7 A WiFi module 770 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0150] The processor 780 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 720, and calling data stored in the memory 720, it executes various functions of the mobile phone and processes data, thereby performing overall detection of the mobile phone. Optionally, the processor 780 may include one or more processing units; preferably, the processor 780 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 780.
[0151] The mobile phone also includes a power supply 790 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 780 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.
[0152] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0153] In this embodiment, the processor 780 included in the terminal device also has the following functions:
[0154] Get the target face image;
[0155] Determine, by means of a parameter determination model, a first facial parameter corresponding to the target facial image according to the target facial image;
[0156] generating a first face model corresponding to the first face parameter;
[0157] A first sample face image corresponding to the first face model is synthesized, where the first face model is a sample face model corresponding to the first sample face image.
[0158] The present application also provides a server. Figure 8 As shown, Figure 8 The structural diagram of the server 800 provided in the embodiment of the present application, the server 800 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 822 (for example, one or more processors) and a memory 832, and one or more storage media 830 (for example, one or more mass storage devices) storing application programs 842 or data 844. Among them, the memory 832 and the storage medium 830 can be temporary storage or permanent storage. The program stored in the storage medium 830 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 822 can be configured to communicate with the storage medium 830 and execute a series of instruction operations in the storage medium 830 on the server 800.
[0159] The server 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input and output interfaces 858, and / or one or more operating systems 841, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM, FreeBSD TM etc.
[0160] The steps performed by the server in the above embodiment can be based on Figure 8 The server structure shown.
[0161] In addition, an embodiment of the present application further provides a storage medium, wherein the storage medium is used to store a computer program, and the computer program is used to execute the face sample construction method provided in the above embodiment.
[0162] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the face sample construction method provided in the above embodiment.
[0163] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0164] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0165] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for constructing a face sample, characterized in that: The method comprises: Get the target face image; Determine, by means of a parameter determination model, a first facial parameter corresponding to the target facial image according to the target facial image; Generating a first face model corresponding to the first face parameter, comprising: determining a plurality of interference parameters corresponding to the first face parameter, generating a plurality of extended face parameters according to the first face parameter and the plurality of interference parameters, and determining a plurality of first face models according to the plurality of extended face parameters; synthesizing a first sample face image corresponding to the first face model, where the first face model is a sample face model corresponding to the first sample face image; The parameter determination model is obtained by training in the following way: Determine the model through the initial parameters, and determine the second face parameters, posture parameters and illumination parameters corresponding to the second sample face image; generating a second face model corresponding to the second sample face image according to the second face parameters; synthesizing a pending face image corresponding to the second face model according to the posture parameters and the illumination parameters; According to the difference between the second sample facial image and the to-be-determined facial image, the initial parameter determination model is adjusted to obtain the parameter determination model.
2. The method according to claim 1, characterized in that The method further comprises: Determine face measurement parameters corresponding to the plurality of first face models respectively, wherein the face measurement parameters are used to measure whether the plurality of first face models are real; Screening out first face models whose face measurement parameters do not meet the face measurement parameter threshold from among the plurality of first face models; The synthesizing a first sample face image corresponding to the first face model includes: The first sample face images respectively corresponding to the plurality of first face models after the screening process are synthesized.
3. The method according to claim 2, characterized in that The face measurement parameters include face depth measurement parameters and / or face plane measurement parameters; With respect to the face measurement parameters including the face depth measurement parameter, the determining the face measurement parameters corresponding to the plurality of first face models includes: Determine the distance parameter between the nose tip key point and the ear key point on each first face model in the face depth direction, where the face depth direction is a direction perpendicular to the plane of the facial features; Determining the distance parameter as the face depth measurement parameter; The face measurement parameter threshold is a face depth measurement parameter threshold, and the step of screening out the first face model whose face measurement parameter does not meet the face measurement parameter threshold from the plurality of first face models includes: Screening out the first face model whose face depth measurement parameter is smaller than the face depth measurement parameter threshold from the plurality of first face models; With respect to the face measurement parameters including the face plane measurement parameters, the determining of the face measurement parameters corresponding to the plurality of first face models includes: Determine a first target position corresponding to a first facial key point on one side of the face on each first facial model and on the other side of the face; Determine a second target position corresponding to a second facial key point on the other side of the face, wherein the second facial key point corresponds to the first facial key point; determining the face plane measurement parameter according to a distance difference between the first target position and the second target position; The face measurement parameter threshold is a face plane measurement parameter threshold, and the step of screening out the first face model whose face measurement parameter does not meet the face measurement parameter threshold from the plurality of first face models includes: The first face models whose face plane measurement parameters are greater than the face plane measurement parameter threshold are screened out from the multiple first face models.
4. The method according to claim 1, characterized in that: The first face parameters include face model parameters and face texture parameters, and generating a first face model corresponding to the first face parameters includes: Generating a basic face model according to the face model parameters, and generating a texture map according to the face texture parameters; The first face model is generated according to the basic face model and the texture map.
5. The method according to claim 4, characterized in that The first face model is a plurality of first face models, and generating the first face model according to the basic face model and the texture map includes: Adjusting the texture color parameters corresponding to the texture map to obtain a plurality of extended texture maps; The multiple first face models are generated according to the basic face model and the multiple extended texture maps.
6. The method according to claim 1, characterized in that The synthesizing a first sample face image corresponding to the first face model includes: Determine synthesis parameters corresponding to the first face model, where the synthesis parameters include any one or more combinations of synthesis illumination parameters and synthesis camera parameters, where the illumination parameters are used to identify the illumination environment corresponding to the first face model, and the synthesis camera parameters are used to determine the facial pose of the first face model in the first sample face image; A first sample face image corresponding to the first face model is synthesized according to the synthesis parameters.
7. A face sample construction device, characterized in that: The device comprises an acquisition unit, a first determination unit, a generation unit and a synthesis unit: The acquisition unit is used to acquire a target face image; The first determination unit is used to determine a first facial parameter corresponding to the target facial image according to the target facial image through a parameter determination model; The generating unit is used to generate a first face model corresponding to the first face parameter; the generating unit is specifically used to: determine a plurality of interference parameters corresponding to the first face parameter; generate a plurality of extended face parameters according to the first face parameter and the plurality of interference parameters; determine a plurality of first face models according to the plurality of extended face parameters; The synthesis unit is used to synthesize a first sample face image corresponding to the first face model, where the first face model is a sample face model corresponding to the first sample face image; The parameter determination model is obtained by training in the following way: Determine the model through the initial parameters, and determine the second face parameters, posture parameters and illumination parameters corresponding to the second sample face image; generating a second face model corresponding to the second sample face image according to the second face parameters; synthesizing a pending face image corresponding to the second face model according to the posture parameters and the illumination parameters; According to the difference between the second sample facial image and the to-be-determined facial image, the initial parameter determination model is adjusted to obtain the parameter determination model.
8. The device according to claim 7, characterized in that The device also includes a second determining unit and a screening unit: The second determining unit is used to determine face measurement parameters corresponding to the multiple first face models respectively, and the face measurement parameters are used to measure whether the multiple first face models are real; The screening unit is used to screen out the first face model whose face measurement parameter does not meet the face measurement parameter threshold value from the multiple first face models; The synthesis unit is specifically used for: The first sample face images respectively corresponding to the plurality of first face models after the screening process are synthesized.
9. The device according to claim 8, characterized in that The face measurement parameters include face depth measurement parameters and / or face plane measurement parameters; With respect to the face measurement parameter including the face depth measurement parameter, the second determining unit is specifically configured to: Determine the distance parameter between the nose tip key point and the ear key point on each first face model in the face depth direction, where the face depth direction is a direction perpendicular to the plane of the facial features; Determining the distance parameter as the face depth measurement parameter; The face measurement parameter threshold is a face depth measurement parameter threshold, and the screening unit is specifically used for: Screening out the first face model whose face depth measurement parameter is smaller than the face depth measurement parameter threshold from the plurality of first face models; With respect to the face measurement parameter including the face plane measurement parameter, the second determination unit is specifically configured to: Determine a first target position corresponding to a first facial key point on one side of the face on each first facial model and on the other side of the face; Determine a second target position corresponding to a second facial key point on the other side of the face, wherein the second facial key point corresponds to the first facial key point; determining the face plane measurement parameter according to a distance difference between the first target position and the second target position; The face measurement parameter threshold is a face plane measurement parameter threshold, and the screening unit is specifically used for: The first face models whose face plane measurement parameters are greater than the face plane measurement parameter threshold are screened out from the multiple first face models.
10. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the face sample construction method described in any one of claims 1-6 according to the instructions in the program code.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the face sample construction method according to any one of claims 1 to 6.
12. A computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the face sample construction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Three-dimensional face model reconstruction method and device, storage medium and computer equipment
CN114037802A