Model generation method and apparatus, electronic device, and storage medium

By acquiring and preprocessing the original painting image, combined with the preset template library to construct the initial 3D face model and texture map, and performing fitting, the problem of low efficiency in character face model generation in the game is solved, and an efficient and accurate 3D face is achieved Model generation.

WO2024174422A1PCT designated stage expired Publication Date: 2024-08-29NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/100516
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-20
Filing Date
2023-06-15
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

The generation efficiency of character face models in games is low, resulting in high development costs, and existing technology cannot effectively solve this problem.

Method used

By obtaining the original painting image, preprocessing is performed to obtain facial feature data, an initial three-dimensional face model and texture map are constructed based on the preset template library and facial feature data, and fitting is performed to generate the target three-dimensional face model.

Benefits of technology

It improves the generation efficiency and accuracy of three-dimensional face models, reduces development costs, and increases the diversity of template data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023100516_29082024_PF_FP_ABST
    Figure CN2023100516_29082024_PF_FP_ABST
Patent Text Reader

Abstract

A model generation method, comprising: acquiring a concept art image (S210); preprocessing a face picture to obtain face feature data (S220); according to a preset template library and the face feature data, obtaining an initial three-dimensional face model corresponding to the face picture (S230); extracting an initial texture map from the face picture on the basis of the face feature data and the preset template library (S240); and fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model (S250). The technical solution of embodiments of the present disclosure can solve the problem of relatively high development costs caused by relatively low efficiency of generating character face models.
Need to check novelty before this filing date? Find Prior Art

Description

Model generation method and device, electronic device, and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This disclosure claims priority to Chinese patent application number 202310180578.9, filed on February 20, 2023, entitled “Model generation method and device, electronic device, and storage medium,” and the entire contents of this Chinese patent application are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to the technical field of three-dimensional modeling, and in particular to a model generation method, a model generation device, an electronic device, and a computer-readable storage medium. Background Art

[0004] Gamers are increasingly demanding the beauty and diversity of characters in game scenes. This requires developers to design and create a large number of character models with diverse personalities to enhance player enjoyment. Specifically, the demand for stylized facial models for game characters varies greatly, as games have different styles—classical, traditional Chinese, martial arts, handsome realism, and anime—and each style has its own distinct requirements for facial models. Furthermore, the limited number of facial models available in games makes it difficult to obtain a large number of similar facial models through scanning or open-source databases, as is the case with real human faces. Therefore, creating facial models that closely resemble the original characters in games presents challenges such as high development requirements, difficulty, and a long production cycle.

[0005] Currently, no solution has been proposed to the problems of low efficiency and high development cost in generating character face models.

[0006] Summary of the Invention

[0007] The embodiments of the present disclosure provide a model generation method, a model generation device, an electronic device, and a computer-readable storage medium, thereby overcoming, at least to a certain extent, the problem of low efficiency in generating character face models, which leads to high development costs.

[0008] According to one aspect of the present disclosure, a model generation method is provided, comprising: obtaining an original painting image, wherein the original painting image includes a face picture having the same artistic style; preprocessing the face picture to obtain facial feature data; obtaining an initial three-dimensional face model corresponding to the face picture based on a preset template library and the facial feature data; extracting an initial texture map from the face picture based on the facial feature data and the preset template library; and fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model.

[0009] According to one aspect of the present disclosure, a model generation device is also provided, including a first acquisition unit for acquiring an original painting image, wherein the original painting image includes a face picture with the same artistic style; a processing unit for preprocessing the face picture to obtain facial feature data; a determination unit for obtaining an initial three-dimensional face model corresponding to the face picture based on a preset template library and the facial feature data; an extraction unit for extracting an initial texture map from the face picture based on the facial feature data and the preset template library; and a fitting unit for fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model.

[0010] According to one aspect of the present disclosure, an electronic device is also provided, including: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the above-mentioned model generation methods is implemented.

[0011] According to one aspect of the present disclosure, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the method for generating a model according to any one of the above items is implemented.

[0012] The model generation method in the example embodiment of the present disclosure obtains an original image, wherein the original image includes a facial image with the same artistic style; preprocesses the facial image to obtain facial feature data; obtains an initial three-dimensional facial model corresponding to the facial image based on a preset template library and the facial feature data; extracts an initial texture map from the facial image based on the facial feature data and the preset template library; and fits the initial three-dimensional facial model and the initial texture map to obtain a target three-dimensional facial model. On the one hand, by obtaining the initial three-dimensional facial model corresponding to the facial image based on the preset template library and the facial feature data, the diversity of template data in the open source database is increased, while also improving the efficiency of generating the initial three-dimensional facial model and saving related computing resources. On the other hand, by fitting the initial three-dimensional facial model and the initial texture map, the accuracy of the target three-dimensional facial model is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] FIG1 is a schematic diagram showing an exemplary system architecture of a method and apparatus for generating a model to which the present disclosure may be applied in an exemplary embodiment;

[0014] FIG2 schematically shows a schematic diagram of a method for generating a model according to some embodiments of the present disclosure;

[0015] FIG3 schematically shows a diagram of facial feature points according to some embodiments of the present disclosure;

[0016] FIG4 schematically shows an example of a target three-dimensional face model according to some embodiments of the present disclosure;

[0017] FIG5 schematically shows a second example of a target three-dimensional face model according to some embodiments of the present disclosure;

[0018] FIG6 schematically shows a schematic diagram of a device for generating a model according to some embodiments of the present disclosure;

[0019] FIG7 schematically shows a structural diagram of a computer system of an electronic device according to some embodiments of the present disclosure. DETAILED DESCRIPTION

[0020] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0021] In addition, the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present disclosure.

[0022] Furthermore, the drawings are schematic illustrations only and are not necessarily drawn to scale. The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically separate entities. In other words, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0023] FIG1 is a schematic diagram showing an exemplary system architecture of a method and apparatus for generating a model to which an embodiment of the present disclosure can be applied.

[0024] As shown in Figure 1, system architecture 100 may include one or more of terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 is used to provide a medium for communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. Terminal devices 101, 102, and 103 may be various electronic devices with display screens, including but not limited to desktop computers, portable computers, smartphones, and tablet computers. It should be understood that the number of terminal devices, networks, and servers in Figure 1 is merely illustrative. Depending on implementation requirements, any number of terminal devices, networks, and servers may be provided. For example, server 105 may be a server cluster consisting of multiple servers.

[0025] The model generation method provided in the embodiment of the present disclosure can be executed by the terminal devices 101, 102, and 103, and accordingly, the model generation device can also be set in the terminal devices 101, 102, and 103. The model generation method provided in the embodiment of the present disclosure can also be jointly executed by the terminal devices 101, 102, and 103 and the server 105, and accordingly, the model generation device can be set in the terminal devices 101, 102, and 103 and the server 105. In addition, the model generation method provided in the embodiment of the present disclosure can also be executed by the server 105, and accordingly, the model generation device can be set in the server 105, which is not particularly limited in this exemplary embodiment.

[0026] For example, in this example embodiment, an original image input through terminal devices 101, 102, and 103 can be obtained from a server 105 deployed on a game platform; then, the face image is preprocessed to obtain facial feature data; an initial three-dimensional face model corresponding to the face image is obtained based on a preset template library and the facial feature data; thereafter, the server 105 continues to extract an initial texture map from the face image based on the facial feature data and the preset template library; the initial three-dimensional face model and the initial texture map are fitted to obtain a target three-dimensional face model.

[0027] However, it is easy for those skilled in the art to understand that the above operations are only for example purposes and are not limited to this in this exemplary embodiment. In one embodiment of the present disclosure, the method for generating a model can be run on a terminal device or a server. The following is an example of a server executing the method for generating a model in the present disclosure. Figure 2 schematically shows a schematic diagram of a method for generating a model according to some embodiments of the present disclosure. Referring to Figure 2, the method for generating a model may include the following steps:

[0028] Step S210: obtaining an original image, wherein the original image includes face pictures with the same art style.

[0029] Among them, the original image obtained from the computer web page or mobile phone client can be the original image in the game scene, the original image in the animation scene, or the original image in the two-dimensional scene, and this disclosure does not limit it.

[0030] Specifically, the art style can be traditional Chinese style, martial arts style, handsome realistic style, and two-dimensional style.

[0031] For example, the original painting images obtained may be of Chinese traditional style in the game scene. Of course, the original painting images obtained may also be of martial arts style in the animation scene, or of two-dimensional style in the two-dimensional scene. For another example, the original painting images may include face pictures of people in the game scene with Chinese traditional style, or of people in the two-dimensional style in the two-dimensional scene. The present disclosure does not limit this.

[0032] Next, the present disclosure takes obtaining a face image of a game character in an original game painting in a game scene as an example to elaborate on the process.

[0033] Step S220: pre-process the face image to obtain facial feature data.

[0034] The facial image of the game scene's original painting image received from a computer or mobile phone is preprocessed to obtain facial feature data. The preprocessing operation may include: detecting feature points of the face in the game original painting, cropping the face in the game original painting, and segmenting the face in the game original painting. The facial feature data may be data with facial features or feature points of the face. It should be noted that depending on the type of original painting image, the preprocessing operation disclosed herein is not limited to the above-mentioned operation method and is not described in detail here.

[0035] In an exemplary embodiment of the present disclosure, facial feature data includes facial feature points of a face image, and the face image is preprocessed to obtain facial feature data, including: labeling the facial feature points of the face image according to topological wiring of the same artistic style to obtain labeled data; adjusting a pre-trained initial facial feature point detection model according to the labeled data to obtain an adjusted target facial feature point detection model; and inputting the face image into the target facial feature point detection model to obtain facial feature points.

[0036] For example, first, a basic real-time facial feature point detection model (corresponding to the initial facial feature point detection model in the present disclosure) is pre-trained based on the 300W-LP dataset and MobileNet, and the feature points corresponding to the facial picture of the original image are annotated according to the topological wiring of the game character to obtain the annotated data. Then, an annotated dataset is constructed based on the annotated data, and the initial facial feature point detection model is re-trained and adjusted based on the annotated dataset to obtain the target facial feature point detection model. Finally, the facial picture is input into the target facial feature point detection model to obtain the facial feature points required by the present disclosure, wherein the picture of the facial feature points can be shown as the points on the face of the person in the example of Figure 3. The present disclosure achieves more accurate detection of facial feature points in the original image by adjusting the pre-trained initial facial feature point detection model.

[0037] It should be noted that the facial feature points automatically detected in the present disclosure can support manual adjustment by operation and maintenance personnel to make the obtained facial feature points more accurate. The higher the accuracy of the feature points, the more accurate the shape of the target three-dimensional face model subsequently reconstructed will be.

[0038] In an exemplary embodiment of the present disclosure, facial feature data includes facial feature data of a face image, and the face image is preprocessed to obtain the facial feature data, including: cropping the face image according to facial feature points to obtain a cropped face image; detecting pixel coordinate information of the facial features in the cropped face image; and using the pixel coordinate information as facial feature data.

[0039] For example, after the present disclosure detects facial feature points through the target facial feature point detection model, a unified facial area is deducted based on the obtained facial feature points in combination with the cropping rules, and the facial area is scaled to a size of 300*300 pixels to obtain the cropped facial image in the present disclosure. Afterwards, by using the existing open source facial semantic segmentation algorithm, the pixel coordinates corresponding to the pixel positions of different facial features in the cropped facial image are detected and recorded, and the pixel positions corresponding to the different facial features are used as facial feature feature data, wherein the facial feature feature data mainly includes the pixel positions of the left and right eyes, the pixel positions of the unobstructed skin area of ​​the face, the pixel positions of the upper and lower lips, the pixel positions of the left and right eyebrows, the pixel positions of other obstructed areas such as hair, and the pixel positions of the background area. By detecting the facial feature data, the present disclosure makes the subsequent generation of the target three-dimensional facial model more efficient and accurate, and reduces development costs.

[0040] Step S230 , obtaining an initial three-dimensional face model corresponding to the face image based on a preset template library and facial feature data.

[0041] Among them, in order to improve the generation efficiency of the target three-dimensional face model and reduce development costs, before obtaining the initial three-dimensional face model corresponding to the face picture based on the preset template library and facial feature data, the construction of the preset template library is also one of the invention points of the present invention. The specific implementation steps include: obtaining historical character face model data, and retopologically retopologically wiring in the historical character face model data to obtain the retopologically retopologically character face model data; calculating the character facial area in the topologically retop ...

[0042] For example, the historical face model data with a handsome realistic style in the game scene can be obtained, and the historical face model data with a Chinese style in the game scene can also be obtained. The present disclosure is not limited to this. Taking the historical face model data with a Chinese style as an example, the historical face model data includes 20 small sample face model data sets. By topologically aligning the facial topology wiring in the 20 small sample face model data sets, the face model wiring is unified to obtain the 20 small sample character face model data after topology, and according to the corresponding relationship between the point cloud positions, the texture map under the unified new wiring is generated by re-rendering. The Platts analysis aligns the existing model and divides the texture map (i.e., UV map) The facial feature areas are retrieved and reverse indexed to find the meshes of the corresponding facial features in the three-dimensional point cloud. The meshes of different facial feature areas are cross-spliced ​​through different rules to expand the original 20 small sample face model data sets into multiple expanded character face model data of the same national style. At the same time, the facial feature areas in the map are divided and cross-blended and seamlessly spliced ​​to generate more new texture maps to expand the diversity, so that the character art style of the historical character face model data is the same as the character art style of the expanded character face model data. The present disclosure improves the diversity of face model resources while enhancing the subsequent generation efficiency of the target three-dimensional face model and reducing development costs through the construction of a preset template library.

[0043] For example, the specific reassembly and splicing technology can be implemented through the following steps: calculating the symmetry points of the small sample face model data to correct the symmetry of the model after retopology, using all the face models of the small sample face model data to calculate the average face model (corresponding to the average face model in this disclosure), marking the semantically corresponding 86 three-dimensional feature points, determining the variable and immutable areas of the small sample face model data to facilitate the reuse of accessories such as the body neck or hairstyle to reduce seams, extracting the principal components based on the enhanced model PCA (principal component analysis) to construct a 3dmm (3D Morphable Face Model, i.e., a deformable face model, hereinafter referred to as 3dmm) shape basis, removing the eyes and other parts to define the UV mask (i.e., UV Mask) that only affects the face, and counting the texture pixel positions at specified high and low resolutions, extracting the principal components based on the expanded texture map PCA processing at these pixel positions, and constructing a 3dmm texture basis to obtain the expanded character face model data. This disclosure improves the diversity of face model resources while enhancing the subsequent generation efficiency of the target three-dimensional face model and reducing development costs by constructing a preset template library.

[0044] In an exemplary embodiment of the present disclosure, the preset template library includes: a shape base and an average face model. Obtaining an initial three-dimensional face model corresponding to a face picture based on the preset template library and facial feature data includes: obtaining the shape base and the average face model in the preset template library; fitting the shape base and the facial feature points to obtain a target shape base; and iteratively calculating the target shape base and the average face model to obtain an initial three-dimensional face model.

[0045] For example, the shape basis in the present disclosure is used to characterize the shape of the face model, and the coefficients of the shape basis are used to control the face shape of the character. The texture basis is used to characterize the texture color of the face, and the coefficients of the texture basis are used to render the face in different colors. The present disclosure is based on the Gauss-Newton iteration method, and first calculates the shape and posture parameters of the face model based on the detected facial feature points and the preset template library. For example, the shape basis and texture basis can be calculated based on the face model data in the preset template library, as well as facial features such as the average face model, grid symmetry points, variable and fixed areas, connection areas, and junction point sequence, and these facial features are added to the template library. Obtain the shape basis and average face model in the preset template library; fit the shape basis in the preset template library with the facial feature points to obtain the target shape basis, and iteratively calculate based on the average face model to obtain the initial three-dimensional face model. The specific fitting principle is to iteratively calculate the coefficients of the shape basis and the projection posture parameters. When calculating the posture, the perspective or orthogonal projection mode can be specified so that the feature point positions of the reconstructed shape projection are as close as possible to the facial feature point positions directly detected in the original painting. The initial three-dimensional face model obtained by the present invention includes at least parameters such as the initial face model shape and projection posture. The shape of the model already has a good correspondence with the original painting, which further improves the subsequent generation efficiency of the target three-dimensional face model.

[0046] Step S240: extracting an initial texture map from the face image based on the facial feature data and a preset template library.

[0047] Specifically, the texture base coefficients of the initial texture are obtained through the facial feature data in the facial feature data and a preset template library, and the initial texture map is further obtained.

[0048] In an exemplary embodiment of the present disclosure, the preset template library also includes: a texture base, and extracting an initial texture map from a face picture based on facial feature data and the preset template library includes: performing projection mapping in the face picture based on an initial three-dimensional face model and facial feature data to extract a two-dimensional texture map in the face picture; calculating an initial texture base coefficient based on the two-dimensional texture map and the texture base in the preset template library; and determining an initial texture map based on the initial texture base coefficient.

[0049] Among them, this scheme first projects the initial three-dimensional model onto the face picture of the original image to extract the two-dimensional texture map in the face picture, and extracts the face area through the mask of the facial feature data obtained by the above steps. Then, the texture base coefficient of the initial texture map is obtained by gradually calculating the texture base in the two-dimensional texture map and the preset template library through an iterative fitting method, so that the pixels at the corresponding positions of the fitted texture and the input extracted two-dimensional texture are as consistent as possible. By obtaining a better initial texture base coefficient, the present disclosure ensures that the texture refinement step in the subsequent differentiable rendering optimization step can be completed efficiently.

[0050] Step S250 , fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model.

[0051] In an exemplary embodiment of the present disclosure, an initial three-dimensional face model includes a three-dimensional face shape, and fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model includes: calculating the shape image loss between the three-dimensional face shape and the face picture; calculating the texture image loss between the initial texture map and the face picture; determining the shape basis coefficients of the target three-dimensional face model based on the shape image loss and the texture image loss; updating the three-dimensional face shape and the initial texture map based on the shape basis coefficients to obtain refined texture basis coefficients; and determining the target three-dimensional face model based on the refined texture basis coefficients.

[0052] For example, based on the refined shape reconstruction of the differentiable rendering framework, the step of obtaining the target three-dimensional face model is mainly based on the 3DMM basis coefficients of the results calculated in steps S230 and S240 as input, and the image pixel loss (loss, the same below) of the visible area of ​​the face shape of the three-dimensional face is combined with the differentiable rendering method. For example, the three-dimensional face shape is compared with the original face image after lighting rendering to obtain the texture image loss and shape image loss, among which the texture image loss is used to compare the texture consistency of the initial three-dimensional face model with the original face image. The smaller the texture image loss, the better the initial three-dimensional face model. The more robust the face model is, the better it is. Therefore, the original face image needs to be slightly blurred to prevent overfitting losses. The shape image loss is used to compare the consistency of the face shape between the initial three-dimensional face model and the original face image. The smaller the shape image loss, the better the robustness of the initial three-dimensional face model. In addition, the relevant loss of the 3DMM basis regularization term is obtained, and the relevant loss and the above-obtained shape image loss and texture image loss are weighted with different weights to construct the final loss to fit and solve a more refined texture basis coefficient. That is, the refined texture basis coefficient in the present disclosure is obtained based on the weighted loss of different weights. Afterwards, the target three-dimensional face model is obtained according to the refined texture basis coefficient. The present disclosure improves the matching of the target three-dimensional face model with the two-dimensional original painting by solving the shape basis coefficient and the texture basis coefficient.

[0053] In an exemplary embodiment of the present disclosure, the face picture includes a face picture at at least one viewing angle, the shape image loss includes a shape image loss corresponding to the face picture at at least one viewing angle, and the texture image loss includes a texture image loss corresponding to the face picture at at least one viewing angle, wherein the viewing angle includes at least one of the following: a front view angle, a left view angle, and a right view angle.

[0054] For example, when the face image in the original painting image can include not only a face image from a front view angle, but also a face image from a left view angle and a face image from a right view angle, in the initial texture fitting stage, the textures corresponding to the three images are extracted respectively, and the corresponding regions are calculated by visibility to obtain the initial texture map, and then the map is fitted. In the differentiable rendering fitting stage, it is necessary to calculate the shape image loss and texture image loss under different viewing angles respectively, and increase the pixel loss and face recognition loss of the images corresponding to other viewing angles and the original image when rendering simultaneously. In addition, the more original paintings containing visual angles are input, the higher the accuracy of the fitting reconstruction. Therefore, the present disclosure can obtain a more accurate target three-dimensional face model through multiple constraints of multiple original paintings.

[0055] In an exemplary embodiment of the present disclosure, the preset template library also includes a fixed area, and the initial three-dimensional face model and the initial texture map are fitted to obtain a target three-dimensional face model, including: fitting the initial three-dimensional face model and the initial texture map to obtain an intermediate three-dimensional face model; connecting the fixed facial area and the fixed human body model in the intermediate three-dimensional face model to obtain a connected area, and deforming the connected area to obtain a target intermediate three-dimensional face model; determining the moving position of the facial organ model in the target intermediate three-dimensional face model to obtain posture data of the facial organ model; adjusting the target intermediate three-dimensional face model according to the connected area and posture data to obtain a target three-dimensional face model.

[0056] For example, the initial three-dimensional face model and the initial texture map are optimized and fitted, and the intermediate three-dimensional face model obtained belongs to the upper-level model optimization processing of the target three-dimensional face model step. Specifically, the fixed facial area and the fixed human body model in the intermediate three-dimensional face model are connected, and the connected area is deformed to obtain a target intermediate three-dimensional face model with a unified connected area, wherein the above-mentioned fixed area includes a fixed facial area and a fixed human body model, which can be a skull area (or skull area), a neck area, or a hair area, wherein a circle of points where the skull and the face meet is used through general After Laplace analysis and alignment, the anchor points corresponding to the seam points are designated, and the deformation of the facial area is directly pulled to complete the deformation, and then the unchangeable areas are spliced. In this process, to reduce the impact on the facial organ model, the facial organ model area is pre-designated to increase the shape constraint weight during Laplace pull. The facial organ model includes organ features such as eyes, eyeballs, eyelashes, eyebrows, ears, and nose. For example, the translation position is calculated using the center point of the eyeball, and the rotation and scaling of the eyeball are calculated using the edge points of the eyeball frame and the orbital point to place the eyeball pose data. The present disclosure can also preliminarily place the upper and lower eyelashes based on the iterative closest point (ICP) registration method of the corresponding feature points. In addition, by removing defects in the invisible area, the texture of the eyeball and other components is seamlessly spliced ​​for refined post-processing of the mapping, and the color tone of the unified texture map is changed. The intermediate 3D facial model is adjusted based on the deformed connection area and eyeball displacement data, eyelash processing, and texture processing. This not only obtains a more refined target 3D facial model, but also improves the efficiency of generating the target 3D facial model.

[0057] In an exemplary embodiment of the present disclosure, fitting an initial three-dimensional face model and an initial texture map to obtain a target three-dimensional face model includes: obtaining an initial texture base coefficient; determining an initial texture map through the initial texture base coefficient; fitting the initial texture map and the initial three-dimensional face model to obtain a target texture map; if the style of the target three-dimensional face model is a preset style, refining the target texture map according to the texture model to obtain a refined texture map, wherein the accuracy of the refined texture map is higher than that of the target texture map; and determining the target three-dimensional face model based on the refined texture map.

[0058] Specifically, an initial texture map is generated by an initial texture base coefficient, and the initial texture map is fitted with an initial three-dimensional face model to obtain a target texture map. When the preset game style is a non-two-dimensional style (corresponding to the preset style in the present disclosure), the target texture map is iteratively optimized based on a pix2pix (an image-to-image network structure for image generation) model (i.e., a texture model). Specifically, the target texture map is refined by constructing corresponding paired data to obtain a refined texture map, wherein the iterative optimization process of the refined processing can be processed by the texture clarity of the target texture map to obtain a higher-definition refined texture map. The target three-dimensional face model and the obtained refined texture map are then combined to make the efficiently generated target three-dimensional face model more accurate.

[0059] It should be noted that the target 3D face model in the present disclosure can be a face model from a frontal perspective as shown in FIG4 , or a face model from a side perspective as shown in FIG5 , and is not limited thereto. FIG5 includes the topological wiring of the model.

[0060] In summary, according to the model generation method of this example embodiment, an original image is obtained, wherein the original image includes a facial image having the same artistic style; the facial image is preprocessed to obtain facial feature data; an initial three-dimensional facial model corresponding to the facial image is obtained based on a preset template library and the facial feature data; an initial texture map is extracted from the facial image based on the facial feature data and the preset template library; and the initial three-dimensional facial model and the initial texture map are fitted to obtain a target three-dimensional facial model. On the one hand, by obtaining the initial three-dimensional facial model corresponding to the facial image based on the preset template library and the facial feature data, parameters and image feature point positions can be quickly adjusted according to the initial model, thereby improving the efficiency of generating the initial three-dimensional facial model; on the other hand, by fitting the initial three-dimensional facial model and the initial texture map, the accuracy of the target three-dimensional facial model is improved.

[0061] It should be noted that although the steps of the method disclosed herein are depicted in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in that particular order, or that all steps must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one, and / or one step may be decomposed into multiple steps.

[0062] In addition, in this exemplary embodiment, a model generation device is also provided. Referring to FIG6 , the model generation device 600 includes a first acquisition unit 610 , a processing unit 620 , a determination unit 630 , an extraction unit 640 , and a fitting unit 650 .

[0063] Specifically, the first acquisition unit 610 is configured to acquire an original image, wherein the original image includes a face image having the same art style;

[0064] Processing unit 620, used to pre-process the face image to obtain facial feature data;

[0065] A determination unit 630 is configured to obtain an initial three-dimensional face model corresponding to the face image based on a preset template library and facial feature data;

[0066] An extraction unit 640 is configured to extract an initial texture map from a face image based on facial feature data and a preset template library;

[0067] The fitting unit 650 is configured to fit the initial 3D face model and the initial texture map to obtain a target 3D face model.

[0068] In summary, the present disclosure obtains the original painting image through the first acquisition unit 610, wherein the original painting image includes a face picture with the same artistic style; the processing unit 620 pre-processes the face picture to obtain facial feature data; the determination unit 630 obtains the initial three-dimensional face model corresponding to the face picture based on the preset template library and the facial feature data; the extraction unit 640 extracts the initial texture map from the face picture based on the facial feature data and the preset template library; the fitting unit 650 fits the initial three-dimensional face model and the initial texture map to obtain the target three-dimensional face model. On the one hand, by obtaining the initial three-dimensional face model corresponding to the face picture based on the preset template library and the facial feature data, the template data diversity of the open source database is increased, and the generation efficiency of the initial three-dimensional face model is also improved, the processing efficiency of the model generation device is improved, and related computing resources are saved; on the other hand, by fitting the initial three-dimensional face model and the initial texture map, the accuracy of the target three-dimensional face model is improved.

[0069] Optionally, the facial feature data includes facial feature points of a face image, and the processing unit includes: a labeling module for labeling the facial feature points of the face image according to the topological wiring of the same artistic style to obtain labeled data; an adjustment module for adjusting the pre-trained initial facial feature point detection model according to the labeled data to obtain an adjusted target facial feature point detection model; and an input module for inputting the face image into the target facial feature point detection model to obtain facial feature points.

[0070] Optionally, the facial feature data includes facial feature data of the facial image, and the processing unit includes: a cropping module, used to crop the facial image according to facial feature points to obtain a cropped facial image; a detection module, used to detect pixel coordinate information of the facial features in the cropped facial image; and a first determination module, used to use the pixel coordinate information as facial feature data.

[0071] Optionally, the device also includes: a second acquisition unit, used to obtain historical character face mold data before obtaining the initial three-dimensional face model corresponding to the face picture based on the preset template library and facial feature data, and retopologize the topological wiring in the historical character face mold data to obtain the retopologized character face mold data; a calculation unit, used to calculate the character facial area in the topological character face mold data; a reorganization unit, used to reorganize and splice the historical character face mold data through the character facial area grid to obtain expanded character face mold data, wherein the character art style of the historical character face mold data is the same as the character art style of the expanded character face mold data; a construction unit, used to construct a preset template library based on the historical character face mold data and the expanded character face mold data.

[0072] Optionally, the preset template library includes: a shape base and an average face model, and the determination unit includes: a first acquisition module, used to obtain the shape base and the average face model in the preset template library; a first fitting module, used to fit the shape base and the facial feature points to obtain a target shape base; and an iteration module, used to iteratively calculate the target shape base and the average face model to obtain an initial three-dimensional face model.

[0073] Optionally, the preset template library also includes: a texture base, and the extraction unit includes: an extraction module, which is used to perform projection mapping in the face image based on the initial three-dimensional face model and facial feature data to extract the two-dimensional texture map in the face image; a first calculation module, which is used to calculate the initial texture base coefficient based on the two-dimensional texture map and the texture base in the preset template library; and a second determination module, which is used to determine the initial texture map based on the initial texture base coefficient.

[0074] Optionally, the initial three-dimensional face model includes a three-dimensional face shape, and the fitting unit includes: a second calculation module, used to calculate the shape image loss between the three-dimensional face shape and the face picture; a third calculation module, used to calculate the texture image loss between the initial texture map and the face picture; determining the shape basis coefficient of the target three-dimensional face model based on the shape image loss and the texture image loss; an updating module, used to update the three-dimensional face shape and the initial texture map according to the shape basis coefficient to obtain a refined texture basis coefficient; a third determination module, used to determine the target three-dimensional face model based on the refined texture basis coefficient.

[0075] Optionally, the face image includes a face image at at least one viewing angle, the shape image loss includes a shape image loss corresponding to the face image at at least one viewing angle, and the texture image loss includes a texture image loss corresponding to the face image at at least one viewing angle, wherein the viewing angle includes at least one of the following: a front view angle, a left view angle, and a right view angle.

[0076] Optionally, the preset template library also includes a fixed area, a fitting unit, including: a second fitting module, used to fit the initial three-dimensional face model and the initial texture map to obtain an intermediate three-dimensional face model; a first processing module, used to connect the fixed facial area and the fixed human body model in the intermediate three-dimensional face model to obtain a connected area, and perform deformation processing on the connected area to obtain a target intermediate three-dimensional face model; a fourth determination module, used to determine the moving position of the facial organ model in the target intermediate three-dimensional face model to obtain the posture data of the facial organ model; an adjustment module, used to adjust the target intermediate three-dimensional face model according to the connected area and posture data to obtain the target three-dimensional face model.

[0077] Optionally, the fitting unit includes: a second acquisition module for acquiring an initial texture base coefficient; a fifth determination module for determining an initial texture map using the initial texture base coefficient; a third fitting module for fitting the initial texture map and the initial three-dimensional face model to obtain a target texture map; a second processing module for refining the target texture map according to the texture model to obtain a refined texture map if the style of the target three-dimensional face model is a preset style, wherein the accuracy of the refined texture map is higher than that of the target texture map; and a fourth fitting module for determining the target three-dimensional face model based on the refined texture map.

[0078] The specific details of each module of the above-mentioned model generation device have been described in detail in the corresponding model generation method, so they will not be repeated here.

[0079] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0080] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0081] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0082] In an exemplary embodiment of the present disclosure, a computer storage medium capable of implementing the above-mentioned method is also provided. A program product capable of implementing the above-mentioned method of this specification is stored thereon. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure, such as the following steps can be performed: obtaining an original painting image, wherein the original painting image includes a face picture with the same artistic style; preprocessing the face picture to obtain facial feature data; obtaining an initial three-dimensional face model corresponding to the face picture based on a preset template library and facial feature data; extracting an initial texture map from the face picture based on the facial feature data and the preset template library; fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model.

[0083] On the one hand, by obtaining the initial three-dimensional face model corresponding to the face image based on the preset template library and facial feature data, the template data diversity of the open source database is increased. At the same time, the generation efficiency of the initial three-dimensional face model is improved, the processing efficiency of the computer storage medium is improved, and related computing resources are saved; on the other hand, by fitting the initial three-dimensional face model and the initial texture map, the accuracy of the target three-dimensional face model is improved.

[0084] Optionally, the facial feature data includes facial feature points of a face image, and the face image is preprocessed to obtain the facial feature data, including: labeling the facial feature points of the face image according to the topological wiring of the same artistic style to obtain labeled data; adjusting the pre-trained initial facial feature point detection model according to the labeled data to obtain an adjusted target facial feature point detection model; and inputting the face image into the target facial feature point detection model to obtain facial feature points.

[0085] Optionally, the facial feature data includes facial feature data of a facial image, and the facial image is preprocessed to obtain the facial feature data, including: cropping the facial image according to facial feature points to obtain a cropped facial image; detecting pixel coordinate information of the facial features in the cropped facial image; and using the pixel coordinate information as facial feature data.

[0086] Optionally, before obtaining the initial three-dimensional face model corresponding to the face image based on the preset template library and facial feature data, the method also includes: obtaining historical character face model data, and retopologically wiring the historical character face model data to obtain the retopologically retopologically character face model data; calculating the character facial area in the topologically retopologically character face model data; reorganizing and splicing the historical character face model data through the character facial area grid to obtain expanded character face model data, wherein the character art style of the historical character face model data is the same as the character art style of the expanded character face model data; and constructing a preset template library based on the historical character face model data and the expanded character face model data.

[0087] Optionally, the preset template library includes: a shape base and an average face model. Obtaining an initial three-dimensional face model corresponding to the face image based on the preset template library and facial feature data includes: obtaining the shape base and the average face model in the preset template library; fitting the shape base and the facial feature points to obtain a target shape base; iteratively calculating the target shape base and the average face model to obtain the initial three-dimensional face model.

[0088] Optionally, the preset template library also includes: a texture base, and extracting an initial texture map from a face image based on facial feature data and the preset template library includes: performing projection mapping in the face image based on an initial three-dimensional face model and facial feature data to extract a two-dimensional texture map in the face image; calculating an initial texture base coefficient based on the two-dimensional texture map and the texture base in the preset template library; and determining an initial texture map based on the initial texture base coefficient.

[0089] Optionally, the initial three-dimensional face model includes a three-dimensional face shape, and fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model includes: calculating the shape image loss between the three-dimensional face shape and the face picture; calculating the texture image loss between the initial texture map and the face picture; determining the shape basis coefficients of the target three-dimensional face model based on the shape image loss and the texture image loss; updating the three-dimensional face shape and the initial texture map according to the shape basis coefficients to obtain refined texture basis coefficients; and determining the target three-dimensional face model based on the refined texture basis coefficients.

[0090] Optionally, the face image includes a face image at at least one viewing angle, the shape image loss includes a shape image loss corresponding to the face image at at least one viewing angle, and the texture image loss includes a texture image loss corresponding to the face image at at least one viewing angle, wherein the viewing angle includes at least one of the following: a front view angle, a left view angle, and a right view angle.

[0091] Optionally, the preset template library also includes a fixed area, and the initial three-dimensional face model and the initial texture map are fitted to obtain a target three-dimensional face model, including: fitting the initial three-dimensional face model and the initial texture map to obtain an intermediate three-dimensional face model; connecting the fixed facial area and the fixed human body model in the intermediate three-dimensional face model to obtain a connected area, deforming the connected area to obtain a target intermediate three-dimensional face; determining the moving position of the facial organ model in the target intermediate three-dimensional face model to obtain the posture data of the facial organ model; adjusting the target intermediate three-dimensional face model according to the connected area and posture data to obtain the target three-dimensional face model.

[0092] Optionally, fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model includes: obtaining initial texture base coefficients; determining an initial texture map through the initial texture base coefficients; fitting the initial texture map and the initial three-dimensional face model to obtain a target texture map; if the style of the target three-dimensional face model is a preset style, refining the target texture map according to the texture model to obtain a refined texture map, wherein the precision of the refined texture map is higher than the precision of the target texture map; and determining the target three-dimensional face model based on the refined texture map.

[0093] Optionally, embodiments of the present disclosure may further include a program product for implementing the above-described method, which may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0094] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0095] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0096] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0097] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and the like, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0098] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0099] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods, or program products. Therefore, various aspects of the present disclosure may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."

[0100] The electronic device 700 according to this embodiment of the present disclosure is described below with reference to Figure 7. The electronic device 700 shown in Figure 7 is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0101] As shown in FIG7 , electronic device 700 is implemented as a general-purpose computing device. Components of electronic device 700 may include, but are not limited to, the aforementioned at least one processing unit 710, the aforementioned at least one storage unit 720, a bus 730 connecting various system components (including storage unit 720 and processing unit 710), and a display unit 740.

[0102] The storage unit stores program code, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps described in the "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 710 can perform the following steps: obtaining an original image, wherein the original image includes a face image with the same artistic style; preprocessing the face image to obtain facial feature data; obtaining an initial three-dimensional face model corresponding to the face image based on a preset template library and the facial feature data; extracting an initial texture map from the face image based on the facial feature data and the preset template library; and fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model.

[0103] Optionally, the facial feature data includes facial feature points of a face image, and the face image is preprocessed to obtain the facial feature data, including: labeling the facial feature points of the face image according to the topological wiring of the same artistic style to obtain labeled data; adjusting the pre-trained initial facial feature point detection model according to the labeled data to obtain an adjusted target facial feature point detection model; and inputting the face image into the target facial feature point detection model to obtain facial feature points.

[0104] Optionally, the facial feature data includes facial feature data of a facial image, and the facial image is preprocessed to obtain the facial feature data, including: cropping the facial image according to facial feature points to obtain a cropped facial image; detecting pixel coordinate information of the facial features in the cropped facial image; and using the pixel coordinate information as facial feature data.

[0105] Optionally, before obtaining the initial three-dimensional face model corresponding to the face image based on the preset template library and facial feature data, the method also includes: obtaining historical character face model data, and retopologically wiring the historical character face model data to obtain the retopologically retopologically character face model data; calculating the character facial area in the topologically retopologically character face model data; reorganizing and splicing the historical character face model data through the character facial area grid to obtain expanded character face model data, wherein the character art style of the historical character face model data is the same as the character art style of the expanded character face model data; and constructing a preset template library based on the historical character face model data and the expanded character face model data.

[0106] Optionally, the preset template library also includes: a texture base, and extracting an initial texture map from a face image based on facial feature data and the preset template library includes: performing projection mapping in the face image based on an initial three-dimensional face model and facial feature data to extract a two-dimensional texture map in the face image; calculating an initial texture base coefficient based on the two-dimensional texture map and the texture base in the preset template library; and determining an initial texture map based on the initial texture base coefficient.

[0107] Optionally, the initial three-dimensional face model includes a three-dimensional face shape, and fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model includes: calculating the shape image loss between the three-dimensional face shape and the face picture; calculating the texture image loss between the initial texture map and the face picture; determining the shape basis coefficients of the target three-dimensional face model based on the shape image loss and the texture image loss; updating the three-dimensional face shape and the initial texture map according to the shape basis coefficients to obtain refined texture basis coefficients; and determining the target three-dimensional face model based on the refined texture basis coefficients.

[0108] Optionally, the face image includes a face image at at least one viewing angle, the shape image loss includes a shape image loss corresponding to the face image at at least one viewing angle, and the texture image loss includes a texture image loss corresponding to the face image at at least one viewing angle, wherein the viewing angle includes at least one of the following: a front view angle, a left view angle, and a right view angle.

[0109] Optionally, the preset template library also includes a fixed area, and the initial three-dimensional face model and the initial texture map are fitted to obtain a target three-dimensional face model, including: fitting the initial three-dimensional face model and the initial texture map to obtain an intermediate three-dimensional face model; connecting the fixed facial area and the fixed human body model in the intermediate three-dimensional face model to obtain a connected area, determining the moving position of the facial organ model in the target intermediate three-dimensional face model for the connected area, and obtaining the posture data of the facial organ model; adjusting the target intermediate three-dimensional face model according to the connected area and posture data to obtain the target three-dimensional face model.

[0110] Optionally, fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model includes: obtaining initial texture base coefficients; determining an initial texture map through the initial texture base coefficients; fitting the initial texture map and the initial three-dimensional face model to obtain a target texture map; if the style of the target three-dimensional face model is a preset style, refining the target texture map according to the texture model to obtain a refined texture map, wherein the precision of the refined texture map is higher than the precision of the target texture map; and determining the target three-dimensional face model based on the refined texture map.

[0111] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 7201 and / or a cache memory unit 7202 , and may further include a read-only memory unit (ROM) 7203 .

[0112] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 8205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0113] Bus 730 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0114] The electronic device 700 can also communicate with one or more external devices 800 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and / or any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 750. Furthermore, the electronic device 700 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 700, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0115] According to the electronic device provided by the optional embodiment of the present disclosure, on the one hand, by obtaining the initial three-dimensional face model corresponding to the face picture based on the preset template library and facial feature data, the template data diversity of the open source database is increased, while the generation efficiency of the initial three-dimensional face model is improved, the processing efficiency of the electronic device is improved, and related computing resources are saved; on the other hand, by fitting the initial three-dimensional face model and the initial texture map, the accuracy of the target three-dimensional face model is improved.

[0116] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0117] Furthermore, the figures above are merely illustrative of the processes included in the methods according to exemplary embodiments of the present disclosure and are not intended to be limiting. It is readily understood that the processes illustrated in the figures above do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0118] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

Claims

1. A method for generating a model, comprising: Acquire an original image, wherein the original image includes a face picture with the same art style; Preprocessing the face image to obtain facial feature data; Obtaining an initial three-dimensional face model corresponding to the face picture according to a preset template library and the face feature data; Extracting an initial texture map from the face picture based on the facial feature data and the preset template library; The initial three-dimensional face model and the initial texture map are fitted to obtain a target three-dimensional face model.

2. The method according to claim 1, wherein: The facial feature data includes facial feature points of the face image. The face image is preprocessed to obtain the facial feature data, including: Marking the facial feature points of the face image according to the topological wiring of the same art style to obtain marked data; Adjusting the pre-trained initial facial feature point detection model according to the labeled data to obtain an adjusted target facial feature point detection model; The face image is input into the target face feature point detection model to obtain the facial feature points.

3. The method according to claim 2, wherein: The facial feature data includes the facial features of the face image. The face image is preprocessed to obtain the facial feature data, including: Cropping the face image according to the facial feature points to obtain a cropped face image; Detecting pixel coordinate information of facial features in the cropped face image; The pixel coordinate information is used as the facial feature data.

4. The method according to claim 2, wherein: Before obtaining the initial three-dimensional face model corresponding to the face picture according to the preset template library and the face feature data, the method further includes: Acquire historical character face mold data, and retopologize the topological wiring in the historical character face mold data to obtain retopological character face mold data; Calculating the character's facial area in the topologically modified character face model data; Reorganizing and splicing the historical character face mold data through the character face area grid to obtain extended character face mold data, wherein the character art style of the historical character face mold data is the same as the character art style of the extended character face mold data; The preset template library is constructed based on the historical character face model data and the expanded character face model data.

5. The method according to claim 4, wherein: The preset template library includes: a shape base and an average face template. The initial three-dimensional face model corresponding to the face picture is obtained according to the preset template library and the facial feature data, including: Acquire the shape base and the average face template in the preset template library; Fitting the shape basis and the facial feature points to obtain a target shape basis; The target shape base and the average face model are iteratively calculated to obtain the initial three-dimensional face model.

6. The method according to claim 3, wherein: The preset template library also includes: a texture base, and extracting an initial texture map from the face image based on the facial feature data and the preset template library includes: Performing projection mapping in the face picture based on the initial three-dimensional face model and the facial features data to extract a two-dimensional texture map in the face picture; Calculate an initial texture base coefficient according to the two-dimensional texture map and the texture base in the preset template library; The initial texture map is determined according to the initial texture base coefficients.

7. The method according to claim 1, wherein: The initial three-dimensional face model includes a three-dimensional face shape, and fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model includes: Calculating a shape image loss between the three-dimensional face shape and the face picture; Calculating the texture image loss between the initial texture map and the face picture; determining the shape basis coefficients of the target three-dimensional face model according to the shape image loss and the texture image loss; The three-dimensional face shape and the initial texture map are updated according to the shape basis coefficients to obtain refined texture basis coefficients; The target three-dimensional face model is determined according to the refined texture basis coefficients.

8. The method according to claim 7, wherein: The face image includes a face image at at least one viewing angle, the shape image loss includes a shape image loss corresponding to the face image at at least one viewing angle, and the texture image loss includes a texture image loss corresponding to the face image at at least one viewing angle, wherein the viewing angle includes at least one of the following: a front view angle, a left view angle, and a right view angle.

9. The method according to claim 1, wherein: The preset template library also includes a fixed area, and the initial three-dimensional face model and the initial texture map are fitted to obtain a target three-dimensional face model, including: Fitting the initial three-dimensional face model and the initial texture map to obtain an intermediate three-dimensional face model; The fixed facial region in the intermediate three-dimensional face model and the fixed human body model are connected to obtain a connected region, and the connected region is deformed to obtain a target Determine the moving position of the facial organ model in the target intermediate three-dimensional human face model to obtain the position and posture data of the facial organ model; The target intermediate three-dimensional face model is adjusted according to the connected area and the posture data to obtain the target three-dimensional face model.

10. The method according to claim 6, wherein: Fitting the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model includes: Obtaining the initial texture base coefficient; Determine the initial texture map by using the initial texture base coefficients; Fitting the initial texture map and the initial three-dimensional face model to obtain a target texture map; If the style of the target 3D face model is a preset style, the target texture map is refined according to the texture model to obtain a refined texture map, wherein the precision of the refined texture map is higher than the precision of the target texture map; The target three-dimensional face model is determined according to the refined texture map.

11. A model generation device, comprising: A first acquisition unit is used to acquire an original image, wherein the original image includes a face image with the same art style; A processing unit, used for preprocessing the face image to obtain facial feature data; A determination unit, configured to obtain an initial three-dimensional face model corresponding to the face image according to a preset template library and the face feature data; An extraction unit, configured to extract an initial texture map from the face image based on the facial feature data and the preset template library; The fitting unit is used to fit the initial three-dimensional face model and the initial texture map to obtain a target three-dimensional face model.

12. An electronic device comprising: processor; as well as A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the method for generating a model as claimed in any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for generating a model according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Face three-dimensional image generation method, device and readable medium

    CN109377544A

  • Three-dimensional face reconstruction method, system and device for fine structure

    CN112002014A

  • Game face model generation method and device, storage medium and electronic equipment

    CN112221145A

  • Face recognition method and device and electronic equipment

    CN112270747A

  • Model generation method and device, electronic equipment and storage medium

    CN116229548A