Three-dimensional face generation method and electronic equipment
By performing two refined processing of the initial three-dimensional face, combined with the input of face geometric UV map and texture UV map, the problem of low fineness in the generation of existing three-dimensional faces is solved, and the imaging quality of three-dimensional faces is significantly improved and Rendering effect.
Patent Information
- Application Number
- CN202410798784.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-19
AI Technical Summary
The existing three-dimensional face generation methods generate low fineness, resulting in low imaging quality.
By extracting face geometric UV maps and texture UV maps from the initial three-dimensional face, inputting them into the three-dimensional face details generation model for fine processing, further input face grids and texture UV maps into high-definition face texture map generation In the model, two fine-graining processes were performed to improve the imaging quality of three-dimensional faces.
Through two refinement processing, the imaging quality of the three-dimensional face is significantly improved, making the generated three-dimensional face more realistic and three-dimensional, and improving the rendering effect.
Smart Images

Figure CN118657880A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of visual processing technology, and in particular to a three-dimensional face generation method and electronic device. Background Art
[0002] 3D face is a basic research in the field of computer graphics processing, involving typical applications such as 3D games, visual communication systems, virtual reality enhancement and medical simulation. With the development of the Internet, 3D face generation has become a research hotspot in the field of video telephony and virtual network conferencing applications.
[0003] In the related art, linear texture basis vectors and face shape basis vectors are extracted from a two-dimensional face, and three-dimensional mesh reconstruction and UV mapping are performed by extracting the linear texture basis vectors and face shape basis vectors, and then a three-dimensional face is obtained. However, the three-dimensional face generated in this way has low precision, which reduces the imaging quality of the three-dimensional face.
[0004] Therefore, how to generate high-quality 3D faces becomes a problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, an embodiment of the present application provides a three-dimensional face generation solution to at least partially solve the above-mentioned problem.
[0006] According to a first aspect of an embodiment of the present application, a three-dimensional face generation method is provided, including: based on an initial three-dimensional face, obtaining a corresponding face geometry UV map and a face texture UV map; the initial three-dimensional face is obtained by three-dimensionally reconstructing a two-dimensional face uploaded by a user; the face geometry UV map and the face texture UV map are input into a three-dimensional face detail generation model to obtain a face mesh and a face texture UV map with a clarity greater than a first threshold; the face normal map corresponding to the face mesh and the face texture UV map are input into a high-definition face texture map generation model to obtain a target face texture UV map with a clarity greater than a second threshold; the second threshold is greater than the first threshold; and a target three-dimensional face is obtained based on the face mesh and the target texture UV map.
[0007] According to a second aspect of an embodiment of the present application, a three-dimensional face generation device is provided, the device comprising: an initial three-dimensional face reconstruction module, used to obtain a corresponding face geometry UV map and a face texture UV map based on an initial three-dimensional face; the initial three-dimensional face is obtained by three-dimensionally reconstructing a two-dimensional face uploaded by a user; a three-dimensional face detail generation module, used to input the face geometry UV map and the face texture UV map into a three-dimensional face detail generation model, to obtain a face mesh and a face texture UV map with a clarity greater than a first threshold; a three-dimensional face high-definition texture detail generation module, used to input a face normal map corresponding to the face mesh and the face texture UV map into a high-definition face texture map generation model, to obtain a target face texture UV map with a clarity greater than a second threshold; the second threshold is greater than the first threshold; a three-dimensional face generation module, used to obtain a target three-dimensional face based on the face mesh and the target texture UV map.
[0008] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.
[0009] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.
[0010] According to the scheme provided in the embodiment of the present application, based on the initial three-dimensional face, the corresponding face geometry UV map and face texture UV map are obtained; the initial three-dimensional face is obtained by three-dimensional reconstruction of the two-dimensional face uploaded by the user; the face geometry UV map and the face texture UV map are input into the three-dimensional face detail generation model to obtain a face mesh and face texture UV map with a clarity greater than a first threshold; the face normal map and the face texture UV map corresponding to the face mesh are input into the high-definition face texture map generation model to obtain a target face texture UV map with a clarity greater than a second threshold; the second threshold is greater than the first threshold; the target three-dimensional face is obtained according to the face mesh and the target texture UV map. In this process, the face geometry UV map and the face texture UV map corresponding to the initial three-dimensional face are input into the three-dimensional face detail generation model, and the face details of the initial three-dimensional face are generated through analysis and processing by the three-dimensional face detail generation model to obtain a refined face mesh and face texture UV map. Then, the face normal map and face texture UV map corresponding to the refined face mesh are input into the high-definition face texture map generation model, and the high-definition face texture map generation model is used to analyze and process the texture details of the face texture UV map to obtain a more refined target face texture UV map, and the face mesh and the target texture UV map are merged to obtain the target 3D face. The imaging quality of the 3D face is improved by twice refining the initial 3D face. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] 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 recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0012] Figure 1 A schematic diagram of a 3D face generation method provided in an embodiment of the present application Figure 1 ;
[0013] Figure 2 A general architecture diagram of a three-dimensional face generation system is provided for an embodiment of the present application;
[0014] Figure 3 This is a schematic diagram of a three-dimensional face generation method provided in an embodiment of the present application. Figure 2 ;
[0015] Figure 4 A schematic diagram of a two-dimensional face reconstruction system provided in an embodiment of the present application;
[0016] Figure 5An architecture diagram for obtaining a general three-dimensional face provided in an embodiment of the present application;
[0017] Figure 6 An architecture diagram for generating an initial three-dimensional face provided in an embodiment of the present application;
[0018] Figure 7 A training architecture diagram of a three-dimensional face detail generation model provided in an embodiment of the present application;
[0019] Figure 8 A schematic diagram of a target face texture UV map generation provided in an embodiment of the present application;
[0020] Fig. 9 A schematic diagram of the structure of a three-dimensional face generation device provided in an embodiment of the present application;
[0021] Fig.10 The present invention is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0023] The following describes a method for generating a three-dimensional face according to an embodiment of the present invention. Figure 1 As shown, Figure 1 This is a schematic diagram of a three-dimensional face generation method provided in an embodiment of the present application. Figure 1 The 3D face generation method provided in the embodiment of the present application can be performed by the 3D face generation device provided in the embodiment of the present application, and the device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in an electronic device, and the electronic device can be a computer, a server, etc.
[0024] In order to adapt the 3D face generation method provided in the embodiment of the present application, the embodiment of the present application also provides a general architecture diagram of a 3D face generation system, that is, the 3D face generation method of the embodiment of the present application can be applied to the 3D face generation system provided in the embodiment of the present application. Figure 2 As shown, Figure 2A general architecture diagram of a 3D face generation system is provided for the embodiment of the present application, including four modules, namely a key point feature extraction module, an image preprocessing module, an image reconstruction module and a 3D face step-by-step refinement module. Among them, the processing process of the 3D face step-by-step refinement module specifically includes the generation of an initial face mesh and an initial texture UV, and further refinement of the initial face mesh to obtain face mesh detail generation. The initial face texture UV generation is refined to obtain a texture detail UV map generation, and the texture detail UV map is further refined to obtain a high-definition texture UV generation, and the clarity of the high-definition texture is greater than the clarity of the texture detail UV map obtained after the refinement.
[0025] It should be noted that Figure 2 The overall architecture diagram of the 3D face generation system shown is only an example and does not limit the actual application scenario type, deployment method, etc. In actual applications, the system can be customized according to specific application scenarios and actual needs. Figure 2 The overall architecture diagram of the 3D face generation system shown is adaptively adjusted.
[0026] Combine the following Figure 2 The overall architecture diagram shown illustrates the 3D face generation method provided by the embodiment of the present application. Figure 1 This embodiment will be specifically described from the following steps.
[0027] S101, based on the initial three-dimensional face, obtain a face geometry UV map and a face texture UV map; the initial three-dimensional face is obtained by three-dimensionally reconstructing a two-dimensional face uploaded by a user.
[0028] Specifically, the initial three-dimensional face is the initial reconstruction result of the first stage obtained by three-dimensional reconstruction of the two-dimensional face uploaded by the user during the three-dimensional face creation process. It provides the most basic structure and proportion of the three-dimensional face and contains the specific features of the user, but the model is relatively rough and lacks details. UV mapping is the process and result of unfolding the surface of the three-dimensional face model into two-dimensional texture coordinates. To add texture to the initial three-dimensional face that lacks details, the mapping position of the texture on the three-dimensional face surface can be determined by UV texture mapping. The face geometry UV map is a UV map generated by the three-dimensional face geometry, which is used to accurately display the structure and shape of the three-dimensional face in the UV space. The face texture UV map is used to allow the texture to be displayed on the model as expected. The face geometry UV map and the face texture UV map can be obtained by model unfolding, adjusting and optimizing the initial three-dimensional face and texture mapping, and this application does not limit it.
[0029] For example, the initial three-dimensional face can be obtained through three-dimensional scanning technology such as structured light scanning, laser scanning, or sensor technology such as depth camera, or three-dimensional reconstruction technology based on two-dimensional face, which is not limited in this application.
[0030] S102: Inputting the face geometry UV map and the face texture UV map into a three-dimensional face detail generation model to obtain a face mesh and a face texture UV map whose clarity is greater than a first threshold.
[0031] Specifically, the 3D face detail generation model mainly generates the details of the 3D face based on the initial 3D face. The model learns a large number of face geometry UV maps and face texture UV maps during the training stage, and can extract key detail features from the input face geometry UV maps and face texture UV maps for learning and analysis. Then, on the one hand, the face model is optimized and the details are enhanced for the input face geometry UV maps, and on the other hand, the texture authenticity and delicacy of the input face texture UV maps are enhanced and optimized. Finally, the 3D face detail generation model outputs a face mesh and face texture UV map with a clarity greater than a first threshold. Among them, clarity can be represented by resolution, pixels, color saturation and accuracy, etc., which are not limited here.
[0032] For example, the details of a 3D face may include skin texture, hair details, precise shapes and proportions of facial features, etc. Skin texture may include skin roughness and skin glossiness; hair details may include the shape and distribution of eyebrows, eyelashes, or beards; precise shapes and proportions of facial features may include eye size, shape, spacing, nose height, etc., which are not limited in this application.
[0033] S103, inputting the face normal map and the face texture UV map corresponding to the face mesh into a high-definition face texture map generation model to obtain a target face texture UV map with a clarity greater than a second threshold; the second threshold is greater than the first threshold.
[0034] Specifically, the face normal map is a map that records the change in the normal direction of the three-dimensional face surface, which can make the face look more real and three-dimensional. The high-definition face texture map generation model is used to generate the texture details of the face texture in high definition. The high-definition face texture map generation model makes the clarity of the high-definition generated texture details greater than the clarity of the face texture UV map output by the three-dimensional face detail generation model. Among them, the clarity can be represented by resolution, pixels, color saturation and accuracy. By combining the face normal map and the face texture UV map, the rendering effect of the face can be improved. Therefore, the refined face normal map and the face texture UV map are input into the trained high-definition face texture map generation model, and the model is used to learn the features of the input face geometry UV map and normal map, and then the face texture details are generated, and finally the target face texture UV map with a clarity greater than the second threshold is obtained, so as to achieve the purpose of further optimizing the face texture UV map. Among them, the second threshold is greater than the first threshold.
[0035] S104, obtaining a target three-dimensional face according to the face mesh and the target texture UV map.
[0036] Specifically, the target three-dimensional face is a more refined face than the initial three-dimensional face. After obtaining the target texture UV map, the target texture UV map can be mapped to the face mesh so that the texture information and the mesh correspond to each other. The preset rendering engine can be used to render a specific target three-dimensional face corresponding to the two-dimensional face based on the mesh and texture information.
[0037] Exemplarily, the preset rendering engines may include Unity, CryEngine, and Unreal Engine, but this application does not limit this.
[0038] It is understandable that in the embodiment of the present application, the face geometry UV map and face texture UV map corresponding to the initial three-dimensional face are input into the three-dimensional face detail generation model, and the texture details of the face and the geometric structure and details of the face are generated by the three-dimensional face detail generation model to obtain an optimized face mesh and face texture UV map. A face normal map is obtained from the face mesh, and the face normal map and face texture UV map are input into the high-definition face texture map generation model, and the face texture is generated by the model. Texture details of the face texture are generated, and a more refined and more realistic target face texture UV map is output by jointly learning the normal texture map and the face texture UV map. Finally, the target face texture UV map and the face mesh are merged to obtain a real three-dimensional target three-dimensional face, thereby improving the imaging quality of the three-dimensional face.
[0039] The following further describes the three-dimensional face generation method provided by the embodiment of the present application. Figure 3 As shown, Figure 3 This is a schematic diagram of a three-dimensional face generation method provided in an embodiment of the present application. Figure 2 The method may specifically include the following steps:
[0040] S201, extracting the key points of the facial features of the uploaded two-dimensional face to obtain the extracted key points of the facial features.
[0041] Specifically, the uploaded two-dimensional face is the original two-dimensional face that has not undergone any preprocessing. The key points of the facial features are the nose, mouth, eyes, eyebrows, etc. The face detection algorithm can be used on the uploaded two-dimensional face to detect the specific face position, and the facial features position can be analyzed for the specific face position to obtain the relative position of each organ. Finally, the coordinate position of the key points of the facial features is returned to achieve the purpose of extracting the key points of the facial features.
[0042] For example, user A uploads the original two-dimensional face in different postures (such as 45 degrees to the left, 45 degrees to the right, lowering the head and raising the head, etc.), lighting (such as cloudy day, sunny day and indoor lighting, etc.), and expressions (smiling, frowning, closing eyes and dazed, etc.). Taking the trained facial key point extraction model as an example, the uploaded original two-dimensional face can be preprocessed first, such as image enhancement, cropping and scaling, etc., and the preprocessed two-dimensional face is input into the facial key point extraction model (such as a convolutional neural network) to perform key point prediction, extract the facial key points of the face according to the prediction results, denoise or smooth the extracted facial key points, etc., and finally output the extracted facial key points.
[0043] S202, calculating an affine change matrix for the key points of the facial features of the two-dimensional human face to obtain a calculated affine change matrix.
[0044] Specifically, the affine transformation matrix can be used to perform affine transformation on a two-dimensional face, which will change the position, size and orientation of the face in the image to make it closer to the preset standard layout. Based on the detected coordinates of the key points of the facial features, the affine transformation matrix required to map these key points of the facial features to the preset standard layout can be calculated. The standard layout is a theoretical reference frame.
[0045] For example, a point pair set consisting of the coordinates of the key points of the facial features of a 2D face and the coordinates of the key points of the facial features of a target 2D face can be established. The coordinates of the key points of the facial features of the target 2D face usually correspond to the ideal 2D face alignment positions, such as the center points of both eyes on the horizontal line with a fixed distance, the mouth below both eyes, and other standard layouts. Then, using these point pair sets, the affine transformation matrix is calculated according to the affine transformation formula, such as the getAffineTransform() function of opencv.
[0046] S203, performing affine transformation processing on the two-dimensional face using an affine transformation matrix to obtain a processed face.
[0047] Specifically, affine transformation can be used to adjust the layout of key points of facial features so that the face image can adapt to different display requirements, wherein affine transformation can include operations such as translation, rotation, and scaling. The affine transformation matrix is calculated using the key points of the facial features of a two-dimensional face, and the two-dimensional face is affinely transformed using the affine matrix to adjust facial images of different postures to a standard posture to obtain a processed face.
[0048] Exemplarily, an affine transformation matrix is calculated based on the key points of the facial features, such as the center point of the left eye, the center point of the right eye, the key point of the nose wing, and the leftmost key point of the mouth. The two-dimensional face uploaded by the user is processed according to the calculated affine transformation matrix to obtain a facial image area that is captured, corrected, and normalized to a fixed size of 512*512.
[0049] S204: Input the processed face into a second encoder to obtain a second new latent space feature vector.
[0050] Specifically, after the processed face is obtained through affine transformation, it is necessary to remove non-identity information from the processed face for subsequent reconstruction and optimization of the three-dimensional face. Non-identity information is information that cannot be used to identify a person's identity. The non-identity information of the processed two-dimensional face is information that cannot be used to identify a person's identity through information in the face image. The non-identity information can be removed by a trained face reconstruction model. The face reconstruction model includes a second encoder. The processed two-dimensional face is input into the second encoder. The second encoder converts the input two-dimensional face into a low-dimensional compact vector to obtain a second new latent space feature vector.
[0051] For example, the two-dimensional face uploaded by the user includes not only the facial features but also various lighting, occlusions, and expressions, among which the lighting, occlusions, and expressions are all non-identity information. The processed two-dimensional face of user A is input into the second encoder, and the features are extracted through convolution, pooling and other operations to obtain a low-dimensional vector, namely, the latent space feature vector.
[0052] S205 , combining the second new latent space feature vector and the initialized latent space reconstructed image vector to obtain a second combined feature vector.
[0053] Specifically, the second new latent space feature vector and the initialized latent space reconstructed image vector may be combined to obtain a second combined feature vector.
[0054] Exemplarily, the second new latent space feature vector and the initialized latent space reconstructed image vector may be combined by vector addition, dot product or merging, which is not limited in the present application.
[0055] S206 , inputting the second combined feature vector into a second latent space diffusion model to obtain a second denoised latent space feature vector.
[0056] Specifically, the face reconstruction model also includes a second latent space diffusion model. In order to generate a high-quality image, the second combined feature vector can be input into the second latent space diffusion model, and noise can be added first, and then gradually denoised to obtain the second denoised latent space feature vector.
[0057] S207: Input the second denoised latent space feature vector into a second decoder to remove non-identity information, thereby obtaining a target two-dimensional human face.
[0058] Specifically, the face reconstruction model further includes a second decoder, which removes non-identity information based on the second denoised latent space feature vector to obtain a target two-dimensional face. The target two-dimensional face only contains various types of information that directly or indirectly identifies a specific individual identity.
[0059] For example, Figure 4 As shown, Figure 4 An architecture diagram of a two-dimensional face reconstruction provided for an embodiment of the present application. The flow chart includes a second encoder, a second decoder, and a second latent space diffusion model, and the face reconstruction model is formed by these three models. The specific processing process is that the user uploads a face image (i.e., a two-dimensional face image that has undergone an affine transformation), the uploaded two-dimensional face is input into the second encoder, the second encoder converts the two-dimensional face into a low-dimensional vector, obtains a latent space feature vector, and injects noise into the latent space feature vector to help the second latent space diffusion model enhance the details on the face image and improve the clarity of the face. Then the data after the latent space feature vector and the noise are combined are input into the second latent space diffusion model for step-by-step denoising to obtain the denoised latent space feature vector, and finally the denoised latent space vector is input into the second decoder for face reconstruction to obtain a uniformly illuminated expressionless face image, that is, a two-dimensional face image after non-identity information is removed.
[0060] In the embodiment of the present application, S204 to S207 are the process of reconstructing the facial image of the processed two-dimensional face provided by the present embodiment, that is, the process of removing non-identity information in the two-dimensional facial image. Among them, the face reconstruction model includes a variational autoencoder VAE and a latent space diffusion model LatentDiffusion with the image as condition control information, and the variational encoder VAE includes a second encoder and a second decoder. Before using the face reconstruction model, the model needs to be trained, and the specific training process is as follows:
[0061] S1. Obtain a two-dimensional face training sample, and input the two-dimensional face training sample into a second encoder to obtain a latent space feature vector.
[0062] Specifically, the 2D face training samples include 2D faces in any posture, any lighting, and any expression, and 2D frontal faces with the same ID but without any non-identity information, that is, source face samples of the same person and target face samples obtained by removing non-identity information from the source face samples. The source face samples are input into the second encoder to obtain a latent space feature vector.
[0063] S2. Input the latent space feature vector into the second decoder to obtain a reconstructed two-dimensional face, and train the second decoder and the second encoder based on the reconstructed two-dimensional face and the target face.
[0064] Exemplarily, the source face training samples are user A in different postures (such as 45 degrees to the left, 45 degrees to the right, lowering the head and raising the head, etc.), lighting (such as cloudy, sunny and indoor lighting, etc.), and expressions (smiling, frowning, closing eyes and being in a daze, etc.), and the target face training samples are frontal face images of user A with non-identity information features such as lighting, posture, expression and occlusion removed. The two-dimensional face X of user A in a specific posture, lighting and expression is input into the second encoder, and the features are extracted through operations such as convolution and pooling to obtain a low-dimensional vector, i.e., the latent space feature vector Z. The obtained latent space feature vector Z is input into the second decoder, and the second decoder reconstructs the two-dimensional face according to the latent space feature vector Z to obtain the reconstructed two-dimensional face Y, calculates the first loss through X and Y, calculates the second loss through Z and the feature vector of the target face sample, calculates the total loss according to the first loss and the second loss, and adjusts the parameters of the second encoder and the second decoder according to the total loss until the iteration condition is met, and obtains the trained second encoder and the second decoder.
[0065] S2. Input the source face into the second encoder to obtain a latent space feature vector; obtain the denoised latent space feature vector based on the latent space feature vector and the second latent space diffusion model; obtain the predicted two-dimensional face based on the denoised latent space feature vector and the second decoder.
[0066] Specifically, the source face is input into the second encoder to obtain the latent space feature vector, and then the latent space feature vector and the randomly initialized latent space reconstructed image are combined to obtain a combined feature vector, and the combined feature vector is input into the second latent space diffusion model. In order to enhance the diversity of the data and the robustness of the model, noise can be added to the input data, that is, the combined feature vector. After being processed by the second latent space diffusion model, a denoised latent space feature vector is obtained. The denoised latent space feature vector is input into the second decoder to reconstruct the two-dimensional face and obtain a predicted two-dimensional face.
[0067] Exemplarily, a training sample pair is constructed, where the source two-dimensional face training sample is user A in different postures (such as 45 degrees to the left, 45 degrees to the right, lowering the head and raising the head, etc.), lighting (such as cloudy, sunny, and indoor lighting, etc.), and expression (smiling, frowning, closing eyes, and being in a daze, etc.), and the target two-dimensional face training sample is the frontal face image of user A with non-identity information features such as lighting, posture, expression, and occlusion removed. The source two-dimensional face is input into the second encoder to obtain a latent space feature vector Z, and the latent space feature vector is input into the second latent space diffusion model. In order to enhance the diversity of data and the robustness of the model, the initial noise W can be determined according to the determined noise type and noise size, and the initial noise W is added to the latent space feature vector. Specifically, the initial noise W and the latent space feature vector Z can be added to achieve the purpose of adding the initial noise to the latent space feature vector. The second latent space diffusion model is used to analyze and process the latent space feature vector with added noise to obtain the latent space feature vector Y generated by denoising, and the latent space feature vector Y generated by denoising is input into the second decoder. The second decoder is used to reconstruct the two-dimensional face based on the analysis of the latent space feature vector Y generated by denoising, and obtain the predicted frontal face N that eliminates non-identity information features such as lighting, posture, expression and occlusions.
[0068] S3. Determine the loss based on the predicted two-dimensional face, the target two-dimensional face and the face recognition model, and adjust the parameters of the second latent space diffusion model based on the loss to obtain the trained second latent space diffusion model.
[0069] Specifically, the predicted two-dimensional face and the target two-dimensional face are respectively input into the face recognition model to obtain the first face feature vector and the second face feature vector corresponding to each other, and the first loss of face recognition is calculated according to the first face feature vector and the second face feature vector. The second loss is obtained according to the input initial noise and the predicted noise, the total loss is obtained according to the first loss and the second loss, and the parameters of the second latent space diffusion model are adjusted according to the total loss until a trained second latent space diffusion model is obtained.
[0070] Exemplarily, the predicted two-dimensional face N without non-identity information features such as lighting, posture, expression and occlusions is input into the face recognition model to obtain the corresponding first face feature vector, and the target two-dimensional face without non-identity information features such as lighting, posture, expression and occlusions is input into the face recognition model to obtain the corresponding second face feature. The mean square error can be calculated based on the first face feature vector and the second face feature vector to obtain the first loss; the mean square error can be calculated based on the predicted noise and the initial noise to obtain the second loss, the first loss and the second loss are summed to obtain the total loss, and the total loss is used to adjust the parameters of the second latent space diffusion model. After reaching the number of iterations or the preset iteration condition, a trained second latent space diffusion model is obtained.
[0071] S208: Perform dimensionality reduction processing on the acquired three-dimensional face data set to obtain a preset number of face shape basis vectors and face texture basis vectors.
[0072] Specifically, the face shape basis vector mainly describes the geometric structure and morphological features of the face, including the relative positions and size ratios between the key points of the facial features. The three-dimensional structure of the three-dimensional face can be reconstructed through the face shape basis vector. The face texture basis vector mainly describes the skin texture and color of the three-dimensional face surface, which is specifically associated with detailed features such as skin color, wrinkles, and beard. The unique appearance features of the face can be reconstructed through the face texture basis vector. A large-scale three-dimensional face dataset is obtained, and the clarity of the three-dimensional face is greater than a first threshold. By performing dimensionality reduction analysis on the three-dimensional face dataset, face shape basis vectors and face texture basis vectors that can represent general face shapes and general face textures are extracted.
[0073] Exemplarily, a large number of three-dimensional face data sets with clarity greater than a first threshold are collected, and this data set contains different individuals, ages, genders, facial expressions, etc. PCA is used to reduce the dimension of the data set to obtain a set of feature vectors sorted by importance, and the first K feature vectors are selected as the face shape basis vectors. The color information of each three-dimensional face surface is mapped to a two-dimensional face plane, a texture matrix is constructed based on the mapping data, and the texture matrix is processed using PCA technology to obtain a set of feature vectors sorted by importance, and the first K feature vectors are selected as face texture vectors.
[0074] S209: Determine a general 3D face model based on the face shape basis vectors and the face texture basis vectors.
[0075] Specifically, the general 3D face model is an average face shape model, which includes the average shape of the face and the main mode of shape change, but does not include specific personal features. Based on a certain number of sets of extracted face shape basis vectors and face texture basis vectors, a general 3D face model is constructed. The face shape parameters describe the geometric structure of the face, such as position, size and shape, and the face texture parameters describe the appearance characteristics of the face, such as skin color and texture. By adjusting the values of these parameters, 3D face models with different shapes and textures can be generated.
[0076] Specifically, Figure 5 As shown, Figure 5 A schematic diagram of a general three-dimensional face acquisition system provided in an embodiment of the present application. Figure 5 In the process, a large-scale three-dimensional face dataset with accuracy meeting the requirements is collected, a preset number of face shape basis vectors and a preset number of face texture basis vectors are obtained through dimensionality reduction technology, and a universal three-dimensional face model is constructed through the preset number of face basis vectors and the preset number of face texture basis vectors.
[0077] S210: Input the target two-dimensional face into a universal three-dimensional face model for iterative optimization to obtain an initial three-dimensional face.
[0078] Specifically, the target two-dimensional face is input into the general three-dimensional face model, and the three-dimensional face model corresponding to the target two-dimensional face is generated by adjusting the values of the face shape basis vectors and the face texture basis vector parameters.
[0079] For example, Figure 6 As shown, Figure 6 This is a schematic diagram of an initial three-dimensional face generation provided in an embodiment of the present application. Figure 6 In the method, the preprocessed face image, i.e., the target two-dimensional face, is input into the three-dimensional face initial model, i.e., the general three-dimensional face model. By iteratively optimizing the parameter values of the face shape basis vector and the face texture basis vector, the three-dimensional face corresponding to the target two-dimensional face is output. The corresponding three-dimensional face is rendered using a preset renderer to obtain a rendered two-dimensional face. The loss between the rendered two-dimensional face and the target two-dimensional face is calculated. Then, the parameter values of the face shape basis vector and the face texture basis vector are optimized. When the loss reaches a preset threshold, the initial three-dimensional face corresponding to the target two-dimensional face is obtained. The loss setting is shown in the following formula (1):
[0080] L diff =L lms +L photo +L reg (1)
[0081] In the above formula (1), L lmsThe mean square error between the facial key points detected for the uploaded 2D face and the facial key points of the 2D face projected by the 3D face model during the iterative optimization process; L photo The mean square error between the two-dimensional face uploaded by the user and the two-dimensional face rendered by the three-dimensional face model during iterative optimization; L reg The L2 regularization term of the basic face shape basis vector and the basic face texture basis vector of the three-dimensional face solved by iterative optimization.
[0082] S211. Based on the initial three-dimensional face, obtain the corresponding face geometry UV map and face texture UV map.
[0083] S212. Up-sample the face geometry UV map and the face texture UV map to obtain a first face geometry UV map and a first face texture UV map.
[0084] Specifically, upsampling mainly samples a low-resolution image into a high-resolution image. After obtaining the initial three-dimensional face, the initial three-dimensional face is unfolded to obtain the corresponding face geometry UV map and face texture UV map. The face geometry UV map and face texture UV map are upsampled, that is, the resolution is improved, to obtain a first face geometry UV map and a first face texture UV map.
[0085] For example, if the resolution of the face geometry UV map and face texture UV map corresponding to the initial three-dimensional face is 512*512, in order to make the face image clearer or for the subsequent image fusion, the face geometry UV map and face texture UV map with a resolution of 512*512 can be upsampled to make the image clearer and match the size. The resolution can be improved by an interpolation algorithm, a super-resolution algorithm or an image fusion method (not limited in this application), such as using an interpolation algorithm to increase the resolution of the face geometry UV map and face texture UV map with a resolution of 512*512 to a face geometry UV map and face texture UV map with a resolution of 1024*1024.
[0086] S213: splicing the first face geometry UV map and the first face texture UV map according to preset channels to obtain a spliced first multi-channel face image.
[0087] Specifically, the channel dimension stitching is to stitch different feature maps in the channel dimension to integrate feature information of different perspectives or scales. In order to enhance feature expression, reduce information loss, and complement features extracted at different scales to generate a higher quality three-dimensional face, the first face geometry UV map and the first face texture UV map can be stitched according to the preset channel to obtain a stitched first multi-channel face image.
[0088] Exemplarily, the first face geometry UV map and the first face texture UV map may be spliced by channel to form a 6-channel matrix, that is, to obtain a spliced first multi-channel face image.
[0089] S214: Combine the first multi-channel face image, the initialized latent code, and the noise image to obtain a combined input face image.
[0090] Specifically, latent code is a code that represents the potential features or information of data, and the initialized latent code is to set an initial value for the code vector in the latent space. Combining the first multi-channel face image with the initialized latent code and the noise image can enhance the data diversity of the first multi-channel face image and simulate the uncertainty of the real world, thereby obtaining an input face image with higher details and clarity.
[0091] Exemplarily, the initialized latent code can be initialized randomly, initialized with a normal distribution, or initialized randomly, and there is no limitation here. When determining the noise image, determine the type of noise, such as Gaussian noise, set the size of the noise, obtain noise data according to the selected noise type and noise size, add the first multi-channel face image and the initialized latent code and the noise image or perform other set operations to obtain a combined input face image.
[0092] S215, inputting the combined input face image into a three-dimensional face detail generation model to obtain a face mesh and a face texture UV map.
[0093] Specifically, the combined input face image is analyzed using a three-dimensional face detail generation model to obtain a face mesh and a face texture UV map.
[0094] In the embodiment of the present application, S211 and S215 are the process of generating a face mesh and a face texture UV map with a clarity greater than a first threshold based on the initial three-dimensional face and the three-dimensional face detail generation model provided by the embodiment of the present application. Before using the three-dimensional face detail generation model, the model needs to be trained. Figure 7 As shown, Figure 7 A training architecture diagram of a 3D face detail generation model provided in an embodiment of the present application. The 3D face detail generation model is used as a generator and combined with two discriminators to form a generative adversarial network for training. In addition, Figure 7It also includes an encoder and a mapping network. The initial three-dimensional face is flattened to obtain a face geometry UV map and a face texture UV map, which are then spliced according to preset channels to obtain a spliced multi-channel face image. The encoder encodes the spliced multi-channel face image into a feature vector, and the mapping network converts the encoded feature vector into a representation suitable for the latent space of the generator. The generator generates a new face geometry UV map and face texture UV map of the preset channel based on the latent space representation and the added noise image. The face geometry UV map and face texture UV map of the input preset channel and the face geometry UV map and face texture UV map of the output preset channel are spliced through channels, such as forming a 12-channel matrix, and the face image spliced into 12 channels is input into the discriminator 1 to control the output of more details and make the input and output face geometry UV maps and face texture UV maps more similar. The input received by the second discriminator is the 3D face normal map calculated based on the face geometry UV map output by the generator. The second discriminator is used to control the output of more face geometry details and make the adjacent vertices of the 3D face have a more reasonable adjacent relationship. In addition, the architecture diagram also shows that the generator includes style noise injection, fully connected layers, and mapping networks.
[0095] S216 , splicing the face normal map and the face texture UV map according to preset channels to obtain a spliced second multi-channel face image.
[0096] S217: Input the second multi-channel face image into the first encoder to obtain a first new latent space feature vector.
[0097] S218 , combining the first new latent space feature vector and the latent space initial UV texture map feature vector to obtain a combined feature vector.
[0098] S219, inputting the combined feature vector into the first latent space diffusion model to obtain a first denoised latent space feature vector;
[0099] S220: Input the first denoised latent space feature vector into a first decoder to obtain a reconstructed target face texture UV map.
[0100] Specifically, the high-definition face texture map generation model includes a first encoder, a first decoder and a first latent space diffusion model. The face normal map and the face texture UV map are spliced according to the preset channels to obtain a spliced multi-channel face image, and the spliced multi-channel face image is converted into a low-dimensional vector using the trained first encoder to obtain a first latent space feature vector. The first latent space feature vector and the latent space initial UV texture map feature vector are combined to obtain a combined feature vector. The combined feature vector is input into the first latent space diffusion model, and the first latent space diffusion model is used for step-by-step denoising to obtain a first denoised latent space feature vector. The first denoised latent space feature vector is input into the first decoder for image reconstruction to obtain a reconstructed target face texture UV map.
[0101] For example, Figure 8 As shown, Figure 8 An architecture diagram for generating a target face texture UV map provided in an embodiment of the present application. The flow chart includes a first encoder, a first decoder, and a first latent space diffusion model, and a high-definition face texture map generation model is formed by these three models. In the specific processing process, the face normal map and face texture UV map obtained above are input into the first encoder, and the first encoder converts the low-dimensional vector to obtain a latent space feature vector, and injects noise into the latent space feature vector to help the first latent space diffusion model enhance the details on the image and improve the clarity of the face. Then, the data after combining the latent space feature vector and the noise is input into the first latent space diffusion model for step-by-step denoising to obtain the denoised latent space feature vector, and finally the denoised latent space vector is input into the first decoder for face reconstruction to obtain a high-quality target face texture UV map.
[0102] In the embodiment of the present application, the face reconstruction model and the high-definition face texture map generation model are both composed of an encoder, a decoder, and a latent space diffusion model. During the training phase, the face reconstruction model is trained with two-dimensional face samples, and the high-definition face texture map generation model is trained with three-dimensional face samples. The internal processing of the input data by the face reconstruction model and the high-definition face texture map generation model is similar and will not be elaborated here.
[0103] S221. Obtain a target three-dimensional face according to the face mesh and the target texture UV map.
[0104] Specifically, after obtaining the target texture UV map, the target texture UV map can be mapped to the face mesh so that the texture information and the mesh correspond to each other. The preset rendering engine can be used to render a specific target three-dimensional face corresponding to the two-dimensional face based on the mesh and texture information.
[0105] Exemplarily, the preset rendering engines may include Unity, CryEngine, and Unreal Engine, but this application does not limit this.
[0106] It can be understood that in this embodiment, the key points of the facial features of the uploaded two-dimensional face are affinely changed to obtain a processed two-dimensional face, so that the face images of different postures are adjusted to a standard posture, thereby improving the accuracy and effect of three-dimensional face reconstruction. The processed two-dimensional face is removed by the second encoder, the second latent space diffusion model and the second decoder for non-identity information, thereby improving the generation quality of the face mesh and face texture UV map corresponding to the three-dimensional face. The two-dimensional face after non-identity information is removed is used for face reconstruction to obtain the corresponding initial three-dimensional face containing specific features of the two-dimensional face, and the face details of the initial three-dimensional face are generated by the three-dimensional face detail generation model to obtain the face mesh and face texture UV map after the face details are generated, and finally the face normal map and face texture UV map corresponding to the face mesh are generated by the high-definition face texture map generation model to obtain the target face texture UV map, and the target face texture UV map and the face mesh are merged to obtain a three-dimensional face with higher refinement than the initial three-dimensional face, thereby improving the imaging quality of the three-dimensional face.
[0107] Fig. 9 is a schematic diagram of the structure of the three-dimensional face generation device provided by the present application, such as Fig. 9 As shown, the device may specifically include:
[0108] The initial 3D face reconstruction module 901 is used to obtain the corresponding face geometry UV map and face texture UV map based on the initial 3D face; the initial 3D face is obtained by 3D reconstruction of the 2D face uploaded by the user.
[0109] A 3D face detail generation module 902, used to input the face geometry UV map and the face texture UV map into a 3D face detail generation model to obtain a face mesh and a face texture UV map with a clarity greater than a first threshold;
[0110] A 3D face high-definition texture generation module 903 is used to input the face normal map corresponding to the face mesh and the face texture UV map into a high-definition face texture map generation model to obtain a target face texture UV map with a clarity greater than a second threshold; the second threshold is greater than the first threshold;
[0111] The three-dimensional face generation module 904 is used to obtain a target three-dimensional face according to the face mesh and the target texture UV map.
[0112] In one embodiment, the 3D face detail generation module 902 is specifically used to:
[0113] Upsampling the face geometry UV map and the face texture UV map to obtain a first face geometry UV map and a first face texture UV map;
[0114] splicing the first face geometry UV map and the first face texture UV map according to preset channels to obtain a spliced first multi-channel face image;
[0115] combining the first multi-channel face image, the initialized latent code and the noise image to obtain a combined input face image;
[0116] The combined input face image is input into the three-dimensional face detail generation model to obtain the face mesh and the face texture UV map.
[0117] In one embodiment, the high-definition face texture map generation model includes a variational autoencoder and a first latent space diffusion model; the variational autoencoder includes a first decoder and a first encoder, and a three-dimensional face high-definition texture generation module 903 is specifically used to:
[0118] Splicing the face normal map and the face texture UV map according to a preset channel to obtain a spliced second multi-channel face image;
[0119] Inputting the second multi-channel face image into the first encoder to obtain a first new latent space feature vector;
[0120] Combining the first new latent space feature vector with the initial UV texture map feature vector of the latent space to obtain a combined feature vector;
[0121] The target face texture UV map is determined based on the combined feature vector, the first latent space diffusion model and the first decoder.
[0122] In one embodiment, the 3D face high-definition texture generation module 903 is specifically used to:
[0123] Inputting the combined feature vector into the first latent space diffusion model to obtain a first denoised latent space feature vector;
[0124] The first denoised latent space feature vector is input into the first decoder to obtain the reconstructed target face texture UV map.
[0125] In one embodiment, the 3D face generation module 904, before flattening the initial 3D face to obtain the face geometry UV map and the face texture UV map, is specifically used to:
[0126] Performing dimensionality reduction processing on the acquired three-dimensional face to obtain a preset number of face shape basis vectors and face texture basis vectors;
[0127] Determine a general three-dimensional face model based on the face shape basis vectors and the face texture basis vectors;
[0128] The target two-dimensional human face is input into the general three-dimensional human face model for iterative optimization to obtain the initial three-dimensional human face.
[0129] In one embodiment, the three-dimensional face generation device also includes a face reconstruction model, which is used to calculate the affine change matrix of the key points of the facial features of the two-dimensional face to obtain the calculated affine change matrix; use the affine change matrix to perform affine change processing on the two-dimensional face to obtain a processed face; input the processed face into the face reconstruction model to eliminate non-identity information to obtain the target two-dimensional face.
[0130] In one embodiment, the face reconstruction model includes a second encoder, a second decoder and a second latent space diffusion model; the three-dimensional face generation device also includes a face reconstruction model, which is specifically used to:
[0131] The step of inputting the processed human face into a human face reconstruction model to remove non-identity information to obtain the target two-dimensional human face comprises:
[0132] Inputting the processed face into the second encoder to obtain a second new latent space feature vector;
[0133] Combining the second new latent space feature vector with the initialized latent space reconstructed image vector to obtain a second combined feature vector;
[0134] Inputting the second combined feature vector into the second latent space diffusion model to obtain a second denoised latent space feature vector;
[0135] The second denoised latent space feature vector is input into the second decoder to remove non-identity information, thereby obtaining the target two-dimensional human face.
[0136] In one embodiment, the 3D face generation device further includes a model training module, which is used to flatten the 3D face training sample to obtain a second face geometry UV map and a second face texture UV map before inputting the face geometry UV map and the face texture UV map into the 3D face detail generation model to obtain the face mesh and face texture UV map with face clarity greater than a first threshold;
[0137] Upsampling the face normal map corresponding to the second face geometry UV map and the second face texture UV map to obtain a third face geometry UV map and a third face texture UV map;
[0138] Splicing the third face geometry UV map and the third face texture UV map in the first preset channel to obtain a spliced second multi-channel face;
[0139] The three-dimensional face detail generation model to be trained is trained based on the second multi-channel face and the preset discriminator to obtain the three-dimensional face detail generation model.
[0140] In one embodiment, the model training module is specifically used to:
[0141] Inputting the second multi-channel face into the three-dimensional face detail generation model to be trained to obtain a third multi-channel face;
[0142] splicing the second multi-channel face and the third multi-channel face to obtain a fourth multi-channel face;
[0143] The preset discriminator and the three-dimensional face detail generation model to be trained are combined into a generative adversarial network, and the third multi-channel face and the fourth multi-channel face are used to train the generative adversarial network to obtain the three-dimensional face detail generation model.
[0144] In this device, the face geometry UV map and face texture UV map corresponding to the initial three-dimensional face are input into the three-dimensional face detail generation model, and the face details of the initial three-dimensional face are generated through the three-dimensional face detail generation model to obtain a refined face mesh and face texture UV map. Then, the face normal map and face texture UV map corresponding to the refined face mesh are input into the high-definition face texture map generation model, and the face texture map is analyzed and processed to generate the texture details of the face texture map to obtain a more refined target face texture UV map, and the face mesh and the target texture UV map are merged to obtain the target three-dimensional face. By refining the initial three-dimensional face twice, the imaging quality of the three-dimensional face is improved.
[0145] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided in any of the above embodiments when executing the program.
[0146] The present application also provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method provided in any of the above embodiments is implemented.
[0147] Reference Fig.10 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0148] like Fig.10 As shown, the electronic device may include: a processor (processor) 1002 , a communication interface (Communications Interface) 1004 , a memory (memory) 1006 , and a communication bus 1008 .
[0149] in:
[0150] The processor 1002 , the communication interface 1004 , and the memory 1006 communicate with each other via a communication bus 1008 .
[0151] The communication interface 1004 is used to communicate with other electronic devices or servers.
[0152] The processor 1002 is used to execute the program 1010, and specifically can execute the relevant steps in the above method embodiment.
[0153] Specifically, the program 1010 may include program codes, which include computer operation instructions.
[0154] The processor 1002 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0155] The memory 1006 is used to store the program 1010. The memory 1006 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0156] The program 1010 may be specifically used to enable the processor 1002 to execute operations corresponding to the methods described in the above method embodiments.
[0157] The specific implementation of each step in program 1010 can refer to the corresponding description of the corresponding steps and units in the above method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.
[0158] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0159] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the method shown here.
[0160] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0161] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A three-dimensional face generation method, characterized in that: include: Based on the initial three-dimensional face, the corresponding face geometry UV map and face texture UV map are obtained; The initial three-dimensional face is obtained by three-dimensionally reconstructing the two-dimensional face uploaded by the user; Inputting the face geometry UV map and the face texture UV map into a three-dimensional face detail generation model to obtain a face mesh and a face texture UV map with a clarity greater than a first threshold; Inputting the face normal map corresponding to the face mesh and the face texture UV map into a high-definition face texture map generation model to obtain a target face texture UV map with a clarity greater than a second threshold; The second threshold is greater than the first threshold; A target three-dimensional face is obtained according to the face mesh and the target texture UV map.
2. The method according to claim 1, characterized in that The step of inputting the face geometry UV map and the face texture UV map into a three-dimensional face detail generation model to obtain a face mesh and a face texture UV map with a clarity greater than a first threshold comprises: Upsampling the face geometry UV map and the face texture UV map to obtain a first face geometry UV map and a first face texture UV map; splicing the first face geometry UV map and the first face texture UV map according to preset channels to obtain a spliced first multi-channel face image; combining the first multi-channel face image, the initialized latent code and the noise image to obtain a combined input face image; The combined input face image is input into the three-dimensional face detail generation model to obtain the face mesh and the face texture UV map.
3. The method according to claim 1, characterized in that: The high-definition face texture map generation model includes a variational autoencoder and a first latent space diffusion model; the variational autoencoder includes a first decoder and a first encoder; The step of inputting the face normal map corresponding to the face mesh and the face texture UV map into a high-definition face texture map generation model to obtain a target face texture UV map whose face definition is greater than a second threshold value comprises: Splicing the face normal map and the face texture UV map according to a preset channel to obtain a spliced second multi-channel face image; Inputting the second multi-channel face image into the first encoder to obtain a first new latent space feature vector; Combining the first new latent space feature vector with the initial UV texture map feature vector of the latent space to obtain a combined feature vector; The target face texture UV map is determined based on the combined feature vector, the first latent space diffusion model and the first decoder.
4. The method according to claim 3, characterized in that The determining the target face texture UV map based on the combined feature vector, the first latent space diffusion model and the first decoder includes: Inputting the combined feature vector into the first latent space diffusion model to obtain a first denoised latent space feature vector; The first denoised latent space feature vector is input into the first decoder to obtain the reconstructed target face texture UV map.
5. The method according to claim 1, characterized in that Before flattening the initial three-dimensional face to obtain the face geometry UV map and the face texture UV map, the method further includes: Performing dimensionality reduction processing on the acquired three-dimensional face to obtain a preset number of face shape basis vectors and face texture basis vectors; Determine a general three-dimensional face model based on the face shape basis vectors and the face texture basis vectors; The target two-dimensional human face is input into the general three-dimensional human face model for iterative optimization to obtain the initial three-dimensional human face.
6. The method according to claim 5, characterized in that Before inputting the target two-dimensional human face into the general three-dimensional human face model for iterative optimization to obtain the initial three-dimensional human face, the method further includes: Calculate the affine change matrix for the key points of the facial features of the two-dimensional face to obtain the calculated affine change matrix; Performing affine transformation processing on the two-dimensional human face using the affine transformation matrix to obtain a processed human face; The processed human face is input into a human face reconstruction model to remove non-identity information, thereby obtaining the target two-dimensional human face.
7. The method according to claim 6, characterized in that The face reconstruction model includes a second encoder, a second decoder and a second latent space diffusion model; The step of inputting the processed human face into a human face reconstruction model to remove non-identity information to obtain the target two-dimensional human face comprises: Inputting the processed face into the second encoder to obtain a second new latent space feature vector; Combining the second new latent space feature vector with the initialized latent space reconstructed image vector to obtain a second combined feature vector; Inputting the second combined feature vector into the second latent space diffusion model to obtain a second denoised latent space feature vector; The second denoised latent space feature vector is input into the second decoder to remove non-identity information, thereby obtaining the target two-dimensional human face.
8. The method according to claim 1 or 2, characterized in that: Before inputting the face geometry UV map and the face texture UV map into the three-dimensional face detail generation model to obtain the face mesh and face texture UV map whose face definition is greater than a first threshold, the method further includes: Flatten the three-dimensional face training sample to obtain a second face geometry UV map and a second face texture UV map; Upsampling the face normal map corresponding to the second face geometry UV map and the second face texture UV map to obtain a third face geometry UV map and a third face texture UV map; Splicing the third face geometry UV map and the third face texture UV map in the first preset channel to obtain a spliced second multi-channel face; The three-dimensional face detail generation model to be trained is trained based on the second multi-channel face and the preset discriminator to obtain the three-dimensional face detail generation model.
9. The method according to claim 8, characterized in that The step of training the 3D face detail generation model to be trained based on the second multi-channel face and the preset discriminator to obtain the 3D face detail generation model includes: Inputting the second multi-channel face into the three-dimensional face detail generation model to be trained to obtain a third multi-channel face; splicing the second multi-channel face and the third multi-channel face to obtain a fourth multi-channel face; The preset discriminator and the three-dimensional face detail generation model to be trained are combined into a generative adversarial network, and the third multi-channel face and the fourth multi-channel face are used to train the generative adversarial network to obtain the three-dimensional face detail generation model.
10. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Model head portrait creation method and device, electronic equipment and storage medium
CN112669447A
Image-based three-dimensional reconstruction and model training method and device, and storage medium
CN115908712A
Three-dimensional face reconstruction method and device, electronic equipment and storage medium
CN116091687A
Three-dimensional face model reconstruction method and device, electronic equipment and storage medium
CN117237534A
