Expression model generation method, device, equipment and medium
By generating a set of target expression models and utilizing the difference in mesh deformation, the problem of poor expression effects caused by the small similarity between the target object and the sample object is solved, and a more natural and realistic expression effect is achieved.
Patent Information
- Application Number
- CN202210237344.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-03-11
AI Technical Summary
When the similarity between the target object and the sample objects in the sample expression model set is small, the expression effect of the generated second expression model of the target object is poor.
By generating a target expression model set, which includes expression models of similar objects, and using the mesh deformation difference between the first expression model and the second expression model in the target model set, the first expression model of the target object is meshed Deformation to generate a second expression model of the target object.
Due to the high similarity between the similar object and the target object, the mesh deformation difference of the expression model of the similar object can be transferred to the expression model of the target object, making the expression effect of the second expression model of the target object better and closer to the actual situation.
Smart Images

Figure CN116778107B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of modeling, and in particular to a method, device, equipment and medium for generating an expression model. Background Art
[0002] Blend Shape technology can deform a single mesh to achieve many predefined shapes and any number of combinations. For facial models, Blend Shape technology can deform a single mesh within a facial model to obtain facial models with different expressions.
[0003] In the related technology, after obtaining the first expression model of the target object, a sample expression model corresponding to the first expression is selected from a sample expression model set, and a sample expression model corresponding to the second expression is selected. According to the mesh deformation difference between the two sample expression models, the first expression model of the target object is mesh deformed to obtain the second expression model of the target object.
[0004] However, when the similarity between the target object and the sample objects in the sample expression model set is small, the expression effect of the generated second expression model of the target object is poor. Summary of the invention
[0005] The embodiment of the present application provides a method, apparatus, device and medium for generating an expression model. The method can first generate a sample expression model set of a sample object, the sample object has a high similarity with a target object, and the generated second expression model of the target object has a good expression effect. The technical solution is as follows:
[0006] According to one aspect of the present application, a method for generating an expression model is provided, the method comprising:
[0007] Acquire a first expression model of the target object, where the first expression model is a facial model corresponding to the first expression;
[0008] The sample expression model set is subjected to model transformation with reference to the first expression model of the target object to obtain a target expression model set; the sample expression model set includes n sample expression models of the sample object, and the target expression model set includes n expression models of similar objects, wherein the similar objects are obtained by performing facial reconstruction on the sample object with reference to the target object;
[0009] According to the mesh deformation difference between the first expression model and the second expression model in the target expression model set, mesh deforming the first expression model of the target object to generate the second expression model of the target object;
[0010] Among them, the first expression model is a facial model corresponding to the first expression, the second expression model is a facial model corresponding to the second expression, the second expression is different from the first expression, the sample expression model is a facial model corresponding to the sample expression, and n is a positive integer greater than 1.
[0011] According to another aspect of the present application, a device for generating an expression model is provided, the device comprising:
[0012] An acquisition module, used for acquiring a first expression model of a target object, wherein the first expression model is a facial model corresponding to the first expression;
[0013] A model generation module is used to perform model transformation on a sample expression model set with reference to the first expression model of the target object to obtain a target expression model set; the sample expression model set includes n sample expression models of the sample object, and the target expression model set includes n expression models of similar objects, and the similar objects are obtained by performing facial reconstruction on the sample object with reference to the target object;
[0014] The model generation module is also used to perform mesh deformation on the first expression model of the target object according to the mesh deformation difference between the first expression model and the second expression model in the target expression model set to generate the second expression model of the target object; wherein the first expression model is a facial model corresponding to the first expression, the second expression model is a facial model corresponding to the second expression, the second expression is different from the first expression, the sample expression model is a facial model corresponding to the sample expression, and n is a positive integer greater than 1.
[0015] According to another aspect of the present application, a computer device is provided, comprising: a processor and a memory, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the method for generating an expression model as described above.
[0016] According to another aspect of the present application, a computer storage medium is provided, in which at least one program code is stored. The program code is loaded and executed by a processor to implement the method for generating an expression model as described above.
[0017] According to another aspect of the present application, a computer program product or a computer program is provided, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for generating an expression model as described in the above aspect.
[0018] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0019] After obtaining the first expression model of the target object, a target expression model set will be generated first, and the target expression model set includes expression models of similar objects. Then, the second expression model of the target object is generated by the mesh deformation difference between the first expression model and the second expression model in the target model set. Since the similarity between the similar object and the target object is high, the mesh deformation difference of the expression model of the similar object can be transferred to the expression model of the target object, so that the expression effect of the second expression model of the target object is good and closer to the actual situation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a schematic diagram of a method for generating an expression model provided by an exemplary embodiment of the present application;
[0022] Figure 2 is a schematic diagram of the structure of a computer system provided by an exemplary embodiment of the present application;
[0023] Figure 3 It is a flowchart of a method for generating an expression model provided by an exemplary embodiment of the present application;
[0024] Figure 4 It is a flowchart of a method for generating an expression model provided by an exemplary embodiment of the present application;
[0025] Figure 5 is a schematic diagram of a flow chart of calculating a target identity vector provided by an exemplary embodiment of the present application;
[0026] Figure 6 is a schematic diagram of a process of generating a first deformation matrix provided by an exemplary embodiment of the present application;
[0027] Figure 7 It is a flowchart of a method for generating an expression video provided by an exemplary embodiment of the present application;
[0028] Figure 8 is a flowchart of a method for generating a whole body model provided by an exemplary embodiment of the present application;
[0029] Fig. 9 is a model comparison diagram provided by an exemplary embodiment of the present application;
[0030] Fig.10 is a schematic diagram of a smiling expression model provided by an exemplary embodiment of the present application;
[0031] Fig.11 is a schematic diagram of a smiling expression model provided by an exemplary embodiment of the present application;
[0032] Fig.12 is a schematic diagram of an open-mouth expression model provided by an exemplary embodiment of the present application;
[0033] Fig.13 is a schematic diagram of an open-mouth expression model provided by an exemplary embodiment of the present application;
[0034] Fig.14 It is a flowchart of a method for generating an expression model provided by an exemplary embodiment of the present application;
[0035] Fig.15 It is a flowchart of a method for generating an expression model provided by an exemplary embodiment of the present application;
[0036] Fig.16 It is a flowchart of a method for generating an expression model provided by an exemplary embodiment of the present application;
[0037] Fig.17 is a schematic diagram of a device for generating an expression model provided by an exemplary embodiment of the present application;
[0038] Fig.18 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0040] First, the nouns involved in the embodiments of the present application are introduced:
[0041] Artificial Intelligence (AI): It is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0042] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0043] Computer Vision (CV): Computer vision is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further processing graphics so that computer processing becomes an image that is more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and mapping, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0044] Deformation transfer: The process of transferring the motion changes of one polygon mesh vertex position to the vertices of other polygon meshes.
[0045] Polygon mesh: In three-dimensional computer graphics, a collection of vertices and polygons that represents a polyhedral shape, consisting of triangles, quadrilaterals, or other simple convex polygons.
[0046] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the expression models and user information involved in this application are obtained with full authorization.
[0047] Figure 1 A schematic diagram of a method for generating an expression model provided by an exemplary embodiment of the present application is shown.
[0048] The first expression model 101 is a facial model of the target object corresponding to the first expression. The sample expression model set 102 includes n sample expression models of the sample object, where n is a positive integer greater than 1. The sample object can refer to one object or multiple objects. In the embodiment of the present application, the sample object refers to multiple objects as an example. Exemplarily, the sample expression model set 103 includes n expression models of the sample object A, and the sample expression model set 104 includes n expression models of the sample object B. The sample object A and the sample object B are different objects.
[0049] Taking the target object of the first expression model 101 as the generation target, the sample expression model set 102 is transformed to obtain a target expression model set 105. The target expression model set 105 includes n expression models of similar objects. The similarity between the similar objects obtained in this way and the target object is high, but the similar objects are not completely the same as the target object.
[0050] Determine the mesh deformation difference between the first expression model 106 and the second expression model 107 in the target expression model set 105, perform mesh deformation on the first expression model 101 according to the mesh deformation difference, and obtain the second expression model 108 of the target object. The first expression model 106 is a facial model corresponding to the first expression of the similar object, and the second expression model 107 is a facial model corresponding to the second expression of the similar object. For example, when the first expression model 101 is used to represent the happy expression of the target object, the first expression model 106 is used to represent the happy expression of the similar object, and the second expression model 107 is used to represent the sad expression of the similar object, the first expression model 101 is mesh deformed according to the mesh deformation difference between the first expression model 106 and the second expression model 107 to obtain the second expression model 108, and the second expression model 108 is used to represent the sad expression of the target object.
[0051] Figure 2The schematic diagram of the structure of a computer system provided by an exemplary embodiment of the present application is shown. The computer system 200 includes: a terminal 220 and a server 240 .
[0052] An application program related to expression model generation is installed on the terminal 220. The application program may be a small program in an app (application), a dedicated application program, or a web client. The terminal 220 is at least one of a smart phone, a tablet computer, an e-book reader, an MP3 player, an MP4 player, a laptop computer, and a desktop computer.
[0053] The terminal 220 is connected to the server 240 via a wireless network or a wired network.
[0054] The server 240 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server 240 is used to provide background services for the model generation application and send information related to the model generation to the terminal 220. Optionally, the server 240 undertakes the main computing work and the terminal 220 undertakes the secondary computing work; or, the server 240 undertakes the secondary computing work and the terminal 220 undertakes the main computing work; or, the server 240 and the terminal 220 both adopt a distributed computing architecture for collaborative computing.
[0055] Figure 3 FIG. 1 is a flow chart showing a method for generating an expression model provided by an exemplary embodiment of the present application. Figure 1 The computer system 100 shown is executed, and the method includes:
[0056] Step 302: Acquire a first expression model of the target object, where the first expression model is a facial model corresponding to a first expression.
[0057] Optionally, the display terminal displays a dialog box; in response to an authorization operation on the dialog box, the terminal obtains a first expression model of the target object.
[0058] The target object is at least one of a human, an animal, a cartoon character, and a robot.
[0059] Optionally, the first expression model of the target object is a three-dimensional model stored locally.
[0060] Optionally, the first expression model of the target object is obtained through a camera. For example, the terminal obtains an expression image of the target object through a camera; the terminal displays a dialog box; in response to a confirmation operation on the dialog box, the terminal converts the expression image of the target object into the first expression model of the target object.
[0061] Optionally, the first expression model is composed of polygonal meshes (also referred to as primitives). The first expression model may be composed of one polygonal mesh or multiple polygonal meshes. For example, the first expression model is composed of only quadrilateral meshes, or the first expression model is composed of quadrilateral meshes and triangular meshes. The first expression model is only used to represent the first expression, and the object corresponding to the first expression model may be any object, and is not limited to the target object.
[0062] Optionally, the first expression models of different objects have the same expression state. Exemplarily, the first expression models of different objects have the same expression features. For example, the expression features of the expression model 1 of object A include eye expression features and mouth corner expression features, and the expression features of the expression model 2 of object B also include eye expression features and mouth corner expression features. The eye expression features of object A and object B are both used to indicate that the upper eyelid at the inner corner of the eye is raised, and the mouth corner expression features of object A and object B are both used to indicate that the corner of the mouth is pulled down, which means that the expression features of object A and object B are the same, and the expression model 1 of object A and the expression model 2 of object B express the same expression.
[0063] Optionally, the first expression includes but is not limited to at least one of an open mouth expression, a closed mouth expression, a smiling expression, a neutral expression, an angry expression, and a sad expression. It is understandable that the first expression may also be other expressions, and the present application does not specifically limit the type of the first expression.
[0064] Step 304: Perform model transformation on the sample expression model set with reference to the first expression model of the target object to obtain a target expression model set.
[0065] The sample expression model set includes n sample expression models of sample objects, where n is a positive integer greater than 1. The sample object may refer to one object or multiple objects. In the embodiment of the present application, the sample object refers to multiple objects as an example for explanation.
[0066] Exemplarily, the sample expression model set includes A sample objects, and each sample object corresponds to n sample expression models. Exemplarily, the sample expression model includes A sample objects, and the expression union of the A sample objects is taken. There are n sample expression models in the expression union. For example, the sample expression model includes sample object 1 and sample object 2. Sample object 1 corresponds to a sad expression model and a closed mouth expression model, and sample object 2 corresponds to an open mouth expression model and a closed mouth expression model. Then the sample expression model set includes 3 expression models of the sample objects, and these 3 expression models are a sad expression model, a closed mouth expression model, and an open mouth expression model.
[0067] Optionally, the sample expression models in the sample expression model set have the same topological structure, that is, the sample expression models in the sample expression model set have the same number of vertices and connection relationships.
[0068] The sample expression model is a facial model corresponding to the sample expression. Exemplarily, the sample expression model A is a facial model corresponding to the open mouth expression, and the sample expression model B is a facial model corresponding to the closed mouth expression. The sample expression includes at least a first expression and a second expression. Optionally, the sample expression also includes expressions other than the first expression and the second expression.
[0069] The target expression model set includes n expression models of similar objects. The similarity between the similar objects and the target object is greater than a similarity threshold.
[0070] It should be noted that the embodiment of the present application obtains a high similarity between the close object and the target object, but the close object is not the same as the target object. Optionally, the similarity between the close object and the target object is greater than a similarity threshold. In an actual case, the similarity between the facial feature points of the close object and the target object is greater than the similarity threshold. Exemplarily, the facial feature points include but are not limited to at least one of the eyes, the tip of the nose, the corners of the mouth, and the eyebrows, and the similarity between the facial feature points of the close object and the facial feature points of the target object is greater than the similarity threshold. Exemplarily, the number of facial feature points whose similarity between the close object and the target object is greater than the similarity threshold is counted; when the number of facial feature points is greater than the number threshold, it is determined that the similarity between the facial feature points of the close object and the target object is greater than the similarity threshold.
[0071] Optionally, the sample expression models in the sample expression model set are composed of polygonal meshes.
[0072] Optionally, the expression models in the target expression model set are composed of polygonal meshes.
[0073] Optionally, the similar object is obtained by reconstructing the face of the sample object with reference to the target object. Exemplarily, the target object is converted into a target feature vector, and the sample object is converted into a sample feature vector; a target facial feature vector is extracted from the target feature vector, and the target facial feature vector is a feature vector related to the facial features of the target object; the target facial feature vector and the sample feature vector are fused to obtain a similar feature vector of the similar object; and a facial model is reconstructed according to the similar feature vector to obtain the similar object.
[0074] Step 306: mesh deforming the first expression model of the target object according to the mesh deformation difference between the first expression model and the second expression model in the target expression model set to generate the second expression model of the target object.
[0075] The second expression model is a facial model corresponding to a second expression, and the second expression is different from the first expression. The second expression model is only used to represent the second expression, and the object corresponding to the second expression model can be any object.
[0076] Optionally, the sample expressions in the target expression model set include at least the first expression and the second expression. The sample expressions in the target expression model set may also be expressions other than the first expression and the second expression.
[0077] The first expression model and the second expression model are both composed of polygonal meshes. Although the first expression model and the second expression model correspond to the same similar object, the first expression model and the second expression model correspond to different expressions, so there are differences in the polygonal meshes constituting the first expression model and the second expression model. For example, the first expression model corresponds to a happy expression and the second expression model corresponds to a neutral expression, so there are differences in the polygonal meshes at the corners of the mouth of the first expression model and the second expression model.
[0078] It should be noted that the mesh deformation difference between the first expression model and the second expression model in the target expression model set is transferable. In other words, for the first expression model and the second expression model of different objects, the mesh deformation difference between the first expression model and the second expression model is similar. For example, there is a mesh deformation difference 1 between the first expression model and the second expression model of object A, and there is a mesh deformation difference 2 between the first expression model and the second expression model of object B. The similarity between the mesh deformation difference 1 and the mesh deformation difference 2 is greater than the similarity difference threshold.
[0079] In summary, after obtaining the first expression model of the target object, this embodiment will first generate a target expression model set, which includes expression models of similar objects. Then, the second expression model of the target object is generated by the mesh deformation difference between the first expression model and the second expression model in the target model set. Since the similarity between the similar object and the target object is high, the mesh deformation difference of the expression model of the similar object can be transferred to the expression model of the target object, so that the expression effect of the second expression model of the target object is good and closer to the actual situation.
[0080] Figure 4 FIG. 1 is a flow chart showing a method for generating an expression model provided by an exemplary embodiment of the present application. Figure 1 The computer system 100 shown is executed, and the method includes:
[0081] Step 401: Acquire a first expression model of a target object.
[0082] The target object is at least one of a human, an animal, a cartoon character, and a robot.
[0083] Optionally, the first expression model of the target object is a three-dimensional model stored locally.
[0084] Optionally, the first expression model of the target object is obtained through a camera. For example, the terminal obtains an expression image of the target object through a camera; the terminal displays a dialog box; in response to a confirmation operation on the dialog box, the terminal converts the expression image of the target object into the first expression model of the target object.
[0085] Optionally, the first expression model is composed of polygonal meshes (also referred to as primitives). The first expression model may be composed of one polygonal mesh or multiple polygonal meshes. For example, the first expression model is composed of only quadrilateral meshes, or the first expression model is composed of quadrilateral meshes and triangular meshes. The first expression model is only used to represent the first expression, and the object corresponding to the first expression model may be any object, and is not limited to the target object.
[0086] Optionally, the first expression includes but is not limited to at least one of an open mouth expression, a closed mouth expression, a smiling expression, a neutral expression, an angry expression, and a sad expression. It is understandable that the first expression may also be other expressions, and the present application does not specifically limit the type of the first expression.
[0087] Step 402: Determine the model tensor corresponding to the sample expression model set.
[0088] Exemplarily, the sample expression model set includes m sample objects, each sample object corresponds to n sample expression models, each sample expression model has V vertices, then each sample expression model can be represented as a vector of length V*3, and the sample expression model set can be represented as a model tensor of T=(V*3)*m*n.
[0089] The model tensor includes a core tensor, an identity matrix and an expression matrix. Optionally, the model tensor is decomposed using the Tucker tensor decomposition method (also known as high-order singular value decomposition) to obtain a core tensor (also known as a core tensor), an identity matrix and an expression matrix. For example, the model tensor: Among them, C r is the core tensor, is the identity matrix, is an expression matrix, the core tensor is a subtensor of the model tensor, the identity matrix is a coefficient matrix used to represent the identity of the sample object in the sample expression model set, and the expression matrix is a coefficient matrix used to represent the expression of the sample object in the sample expression model set. Optionally, each row vector of the identity matrix is used to represent the identity of a sample object, or each column vector of the identity matrix is used to represent the identity of a sample object. Further, each row vector of the identity matrix is used to represent the shape and position of the facial features of the sample object, or each column vector of the identity matrix is used to represent the shape and position of the facial features of the sample object. Optionally, each row vector of the expression matrix is used to represent an expression, or each column vector of the expression matrix is used to represent an expression.
[0090] The identity matrix includes the identity vector corresponding to the sample object, and the expression matrix includes n expression vectors. When a set of clear identity vectors is given and emoticon vector After that, a facial model with clear identity and expression can be obtained. For example, the facial model: The identity corresponding to the facial model V is The corresponding identity and expression of the facial model V are The corresponding expression.
[0091] Step 403: Taking the target object as the generation target, a target identity vector is generated according to the model tensor and the first expression model of the target object.
[0092] In the next step, if you want to get the second expression model of the target object, you need to generate similar objects in a targeted manner so that the similarity between the similar objects and the target object is greater than the similarity threshold, and migrate the first expression model of the target object through the mesh deformation difference of the expression model of the similar objects, and then get the second expression model of the target object. Therefore, the next step requires fixing the expression vector Estimating identity vector At this point, solving the identity vectors corresponding to similar objects can be optimized to the following problem:
[0093]
[0094] Where argmin[] represents the value of w when the formula in the square brackets takes the minimum value, w is the identity vector corresponding to the similar object, b represents the target object vector corresponding to the target object, and σ is the identity matrix The coefficient variance of λ is a parameter in the interval [0, 1].
[0095] To solve the above problem, this step can be divided into the following sub-steps:
[0096] Sub-step 51: determining a target object vector corresponding to the target object according to a first expression model of the target object.
[0097] Optionally, a facial feature vector of a first expression model of the target object is extracted; and the aforementioned facial feature vectors are combined to obtain a target object vector corresponding to the target object.
[0098] Sub-step 52: Determine a first expression vector corresponding to the first expression from the expression matrix.
[0099] Optionally, the expression matrix includes expression vectors distributed in rows, and expression vectors in different rows correspond to different expressions. Optionally, the expression matrix includes expression vectors distributed in columns, and expression vectors in different columns correspond to different expressions.
[0100] Sub-step 53: Calculate the target identity vector according to the kernel tensor, the target object vector and the first expression vector.
[0101] Optionally, a vector product of the core tensor and the first expression vector is calculated; and a target identity vector is generated based on the product of the vector product and the target object vector. Exemplarily, the vector product is C r represents the kernel tensor, represents the first expression vector, then the target identity vector:
[0102]
[0103] Among them, λ is a parameter in the interval [0, 1], is a diagonal matrix consisting of 1 / σ, where σ is the identity matrix The coefficient variance of , b represents the target object vector corresponding to the target object.
[0104] Step 404: Generate the i-th expression model in the target expression model set according to the kernel tensor, the target identity vector and the i-th expression vector.
[0105] Optionally, the i-th expression model in the target expression model set is generated according to the product of the kernel tensor, the target identity vector and the i-th expression vector. Exemplarily, the i-th expression model of the sample object is: Among them, C r represents the kernel tensor, w is the target identity vector, is the i-th expression vector, i is a positive integer and its initial value is 1.
[0106] Step 405: if i is not equal to n, update i to i+1, and repeat the previous step until the target expression model set is obtained.
[0107] The target expression model set includes n sample expression models of the sample object, where n is a positive integer greater than 1. When i is not equal to n, i is updated to i+1, and each expression vector in the expression matrix is traversed to obtain the target expression model set.
[0108] Step 406: Determine a first deformation matrix of the first expression model of the target object according to the mesh deformation difference between the first expression model and the second expression model in the target expression model set.
[0109] The first deformation matrix is used to perform coordinate transformation on mesh vertices on the first expression model of the target object.
[0110] Exemplarily, this step includes the following sub-steps:
[0111] Sub-step 61: determining a second deformation matrix of the first expression model in the target expression model set according to a mesh deformation difference between the first expression model and the second expression model in the target expression model set.
[0112] The second deformation matrix is used to perform coordinate transformation on mesh vertices on the first expression model in the target expression model set to obtain a second expression model in the target expression model set.
[0113] Sub-step 62: When the mesh vertex alignment condition is met, j candidate deformation matrices of the first expression model of the target object are generated based on the first expression model in the target expression model set, the first expression model of the target object and the second deformation matrix.
[0114] The mesh vertex alignment condition is used to indicate that the common vertices of the mesh on the first expression model are located at the same position before and after the mesh deformation of the first expression model, and j is a positive integer. The mesh vertex alignment condition is:
[0115]
[0116] Among them, v iis the common vertex of mesh j and mesh k, T j is the deformation matrix of mesh j, T k is the deformation matrix of mesh k, d j is the translation parameter of grid j, d k is the translation parameter of grid k. is the common vertex v i The vertices after the mesh has been deformed.
[0117] Optionally, a mesh mapping relationship between a first expression model in the target expression model set and a first expression model of the target object is obtained; and when a mesh vertex alignment condition is met, a candidate deformation matrix is generated according to the second deformation matrix and the mesh mapping relationship.
[0118] Sub-step 63: Calculate j differences between the second deformation matrix and the j candidate deformation matrices respectively.
[0119] Exemplarily, the difference between the second deformation matrix and the candidate deformation matrix is calculated as
[0120] Sub-step 64: taking the candidate deformation matrix corresponding to the minimum value among the j differences as the first deformation matrix.
[0121] Exemplarily, the minimum value among j differences is calculated as follows:
[0122] And, T j v i +d j =T k v i +d k ;
[0123] in, is the second deformation matrix of the mesh j of the first expression model in the target expression model set, is the candidate deformation matrix of mesh j of the first expression model of the target object.
[0124] Step 407: performing coordinate transformation on mesh vertices in the first expression model of the target object according to the first deformation matrix to generate a second expression model of the target object.
[0125] The coordinate transformation is used to change the coordinates of the mesh vertices in the first expression model of the target object. For example, the coordinates of mesh vertex A are (2, 5, 4), and after the coordinate transformation of mesh vertex A according to the first deformation matrix, the obtained mesh vertex B is (5, 7, 8).
[0126] Optionally, in addition to generating the second expression model of the target object, multiple expression models of the target object may also be generated. Exemplarily, according to the mesh deformation difference between the first expression model in the target expression model set and other expression models in the target expression model set, the first expression model in the target expression model set is mesh deformed to generate the expression model set of the target object.
[0127] Exemplarily, the expression models in the expression model set are arranged to generate an expression model sequence; and the expression model sequence is rendered to obtain a facial video of the target object.
[0128] In summary, after obtaining the first expression model of the target object, this embodiment will first generate a target expression model set, which includes expression models of similar objects. Then, the second expression model of the target object is generated by the mesh deformation difference between the first expression model and the second expression model in the target model set. Since the similarity between the similar object and the target object is high, the mesh deformation difference of the expression model of the similar object can be transferred to the expression model of the target object, so that the expression effect of the second expression model of the target object is good and closer to the actual situation.
[0129] This embodiment obtains a target expression model set corresponding to the target object through the target identity vector. Since the information provided by the first expression model of the target object is used in the facial reconstruction process, the similar objects have more characteristics of the target object, so the similar objects have a high degree of similarity with the target object, making the second expression model of the target object more natural and the face more realistic.
[0130] In the following embodiment, the generated expression model is used to implement facial driving and generate facial video. Figure 7 A flowchart of a method for generating an expression video provided by an exemplary embodiment of the present application is shown.
[0131] This method can be Figure 1 The computer system 100 shown is executed, and the method includes:
[0132] Step 701: Acquire a first expression model of a target object.
[0133] The target object is at least one of a human, an animal, a cartoon character, and a robot.
[0134] Optionally, the first expression model of the target object is a model stored locally.
[0135] Optionally, the first expression model of the target object is obtained through a camera. For example, the terminal obtains an expression image of the target object through a camera; the terminal displays a dialog box; in response to a confirmation operation on the dialog box, the terminal converts the expression image of the target object into the first expression model of the target object.
[0136] Optionally, the first expression model is composed of polygonal meshes. The first expression model can be composed of one type of polygonal meshes or multiple types of polygonal meshes.
[0137] Step 702: Perform model transformation on the sample expression model set with reference to the first expression model of the target object to obtain a target expression model set.
[0138] The sample expression model set includes n sample expression models of sample objects, where n is a positive integer greater than 1. The sample object may refer to one object or multiple objects. In the embodiment of the present application, the sample object refers to multiple objects as an example for explanation.
[0139] The sample expression model is a facial model corresponding to the sample expression. For example, the sample expression model A is a facial model corresponding to an open-mouth expression, and the sample expression model B is a facial model corresponding to a closed-mouth expression.
[0140] The target expression model set includes n expression models of similar objects. The similarity between the similar objects and the target object is greater than a similarity threshold.
[0141] Optionally, the similarity between the facial feature points of the close object and the target object is greater than a similarity threshold.
[0142] The similar object is obtained by reconstructing the face of the sample object.
[0143] Step 703: mesh deforming the first expression model in the target expression model set according to the mesh deformation difference between the first expression model in the target expression model set and other expression models in the target expression model set, to generate an expression model set of the target object.
[0144] The expression model set of the target object includes at least two expression models of the target object, and the expression models in the expression model set of the target object are used to express different expressions.
[0145] Step 704: Arrange the expression models in the expression model set to generate an expression model sequence.
[0146] Optionally, expression models are extracted from the expression model set according to the model sorting; the aforementioned extracted expression models are arranged according to the model sorting to generate an expression model sequence. The model sorting includes the expression models in the expression model sequence and the arrangement order of the expression models. Exemplarily, the model sorting is "expression model A-expression model C-expression model T", then expression model A, expression model C and expression model T are extracted from the expression model set according to the model sorting, and the extracted expression models are arranged according to the model sequence.
[0147] Optionally, some expression models in the expression model set are arranged to generate an expression model sequence, wherein there are repeated expression models in the expression model sequence, or there are no repeated expression models in the expression model sequence.
[0148] Optionally, all expression models in the expression model set are arranged to generate an expression model sequence, wherein there are repeated expression models in the expression model sequence, or there are no repeated expression models in the expression model sequence.
[0149] Step 705: Render the expression model sequence to obtain the facial video of the target object.
[0150] Exemplarily, the expression models in the expression model sequence are rendered frame by frame to obtain a video of the target object.
[0151] In summary, after obtaining the first expression model of the target object, this embodiment will first generate a target expression model set, which includes expression models of similar objects. Then, the expression model set of the target object is generated by the mesh deformation difference between the first expression model and other expression models in the target model set, and the facial video of the target object is generated based on the expression model set. Since the similarity between the similar object and the target object is high, the mesh deformation difference of the expression model of the similar object can be transferred to the expression model of the target object, so that the facial video appears natural.
[0152] It should be noted that the method for generating the expression model provided in the above embodiment can also be used to generate other types of models, for example, to generate a full-body model.
[0153] Figure 8 FIG. 1 is a flow chart showing a method for generating a whole body model provided by an exemplary embodiment of the present application. Figure 1 The computer system 100 shown is executed, and the method includes:
[0154] Step 801: Acquire a first posture model of a target object, where the first posture model is a facial model corresponding to a first posture.
[0155] The target object is at least one of a human, an animal, and a robot.
[0156] Optionally, the first posture model of the target object is a locally stored model.
[0157] Optionally, the first posture model of the target object is obtained through a camera. For example, the terminal obtains a posture image of the target object through a camera; the terminal displays a dialog box; in response to a confirmation operation on the dialog box, the terminal converts the posture image of the target object into the first posture model of the target object.
[0158] Optionally, the first posture model is composed of polygonal meshes. The first posture model can be composed of one polygonal mesh or multiple polygonal meshes. For example, the first posture model is composed of only quadrilateral meshes, or the first posture model is composed of quadrilateral meshes and triangular meshes. The first posture model is only used to represent the first posture, and the object corresponding to the first posture model can be any object and is not limited to the target object.
[0159] Step 802: Perform model transformation on the sample gesture model set with reference to the first expression model of the target object to obtain a target gesture model set.
[0160] The sample posture model set includes n sample posture models of sample objects, where n is a positive integer greater than 1. The sample object may refer to one object or multiple objects. In the embodiment of the present application, the sample object refers to multiple objects as an example for description.
[0161] Optionally, the sample gesture models in the sample gesture model set have the same topological structure, that is, the sample gesture models in the sample gesture model set have the same number of vertices and connection relationships.
[0162] The sample posture model is a full-body model corresponding to the sample posture. For example, the sample posture model A is a full-body model corresponding to a jumping posture, and the sample posture model B is a full-body posture corresponding to a squatting posture.
[0163] The target posture model set includes n posture models of similar objects. The similarity between the similar objects and the target object is greater than a similarity threshold.
[0164] Optionally, the similarity between the whole body feature points of the close object and the target object is greater than a similarity threshold. Exemplarily, the whole body feature points include but are not limited to at least one of the nose, neck, extremities, elbows and knees, and the similarity between the whole body feature points of the close object and the whole body feature points of the target object is greater than the similarity threshold. Exemplarily, the number of whole body feature points whose similarity between the close object and the target object is greater than the similarity threshold is counted; when the number of whole body feature points is greater than the number threshold, it is determined that the similarity between the whole body feature points of the close object and the target object is greater than the similarity threshold.
[0165] Optionally, the sample posture models in the sample posture model set are composed of polygonal meshes.
[0166] Optionally, the pose models in the target pose model set are composed of polygonal meshes.
[0167] The similar object is obtained by performing full body reconstruction on the sample object. Exemplarily, the target object is used as the full body reconstruction target, and the sample object is fully reconstructed.
[0168] Step 803: According to the mesh deformation difference between the first posture model and the second posture model in the target posture model set, mesh deform the first posture model of the target object to generate a second posture model of the target object.
[0169] The second posture model is a full-body model corresponding to a second posture, and the second posture is different from the first posture. The second posture model is only used to represent the second posture, and the object corresponding to the second posture model can be any object.
[0170] Optionally, the sample poses in the target pose model set include at least a first pose and a second pose. The sample poses in the target pose model set may also be poses other than the first pose and the second pose.
[0171] The first posture model and the second posture model are both composed of polygonal meshes. Although the first posture model and the second posture model correspond to the same similar object, the first posture model and the second posture model correspond to different postures, so there are differences in the polygonal meshes constituting the first posture model and the second posture model. For example, the first posture model corresponds to a standing posture, and the second posture model corresponds to a squatting posture, so there are differences in the polygonal meshes of the legs of the first posture model and the second posture model.
[0172] It should be noted that the mesh deformation difference between the first posture model and the second posture model in the target posture model set is transferable. In other words, for the first posture model and the second posture model of different objects, the mesh deformation difference between the first posture model and the second posture model is similar.
[0173] In summary, after obtaining the first posture model of the target object, this embodiment will first generate a target posture model set, which includes posture models of similar objects. Then, the second posture model of the target object is generated by the mesh deformation difference between the first posture model and the second posture model in the target model set. Since the similarity between the similar object and the target object is high, the mesh deformation difference of the posture model of the similar object can be transferred to the posture model of the target object, so that the posture effect of the second posture model of the target object is good and closer to the actual situation.
[0174] Fig. 9 A model comparison diagram provided by an embodiment of the present application is shown.
[0175] exist Fig. 9 In FIG. 9 , the left side is the input target object 901, and the right side is the similar object 902 obtained by performing facial reconstruction on the sample object according to the method for generating the expression model provided in the embodiment of the present application. Fig. 9It can be seen from the comparison that the facial features and face shapes of the target object 901 and the similar object 902 are highly similar. The target object 901 is processed according to the method for generating the expression model provided in the embodiment of the present application to obtain a smiling expression model 903 and an open-mouth expression model 905 of the target object 901. The target object 901 is processed using related technologies to obtain a smiling expression model 904 and an open-mouth expression model 906 of the target object 901.
[0176] Comparing the smiling expression model 903 and the smiling expression model 904, it can be seen that the lip region of the smiling expression model 904 has a poor deformation curve, and the mouth corners are stretched to the sides unnaturally. However, the mouth region of the smiling expression model 903 has a better deformation curve, and the mouth corners are stretched to the sides more naturally.
[0177] Comparing the open mouth expression model 905 and the open mouth expression model 906, it can be seen that the open mouth expression model 906 has unnatural depressions on both cheeks, and the expression effect is poor. However, the open mouth expression model 905 does not have the aforementioned depressions, and the expression is more natural.
[0178] In summary, compared with the related art, the method for generating an expression model provided in the embodiment of the present application can provide more natural expressions.
[0179] Fig.14 A flow chart of a method for generating an expression model provided by an exemplary embodiment of the present application is shown. The method comprises:
[0180] Step 1401: Display the application interface.
[0181] The application interface is the interface of the application program related to expression model generation.
[0182] Optionally, a camera control is displayed on the application interface; in response to a trigger operation on the camera control, a camera dialog box is displayed, and the camera dialog box is used to determine whether to turn on the terminal's camera; in response to a confirmation operation on the camera dialog box, the terminal's camera is turned on.
[0183] Optionally, a model selection control is displayed on the application interface; in response to a trigger operation on the model selection control, a model selection dialog box is displayed, and the model selection dialog box is used to determine whether to allow querying candidate expression models, and the candidate expression models are stored in the terminal; in response to a confirmation operation on the model selection dialog box, the candidate expression models are displayed; in response to a selection operation on the first expression model in the candidate expression models, the first expression model of the target object is determined.
[0184] Step 1402: In response to the model input operation, obtain a first expression model of the target object.
[0185] Exemplarily, a dialog box is displayed on an application interface; in response to a model input operation on the dialog box, a first expression model of the target object is acquired.
[0186] Optionally, the first expression model of the target object is obtained through a camera. For example, the terminal obtains an expression image of the target object through a camera; the terminal displays a dialog box; in response to a confirmation operation on the dialog box, the terminal converts the expression image of the target object into the first expression model of the target object.
[0187] Optionally, the first expression model of the target object is a three-dimensional model stored locally.
[0188] The first expression model is a face model corresponding to the first expression.
[0189] Step 1403: Taking the first expression model of the target object as a reference, perform model transformation on the sample expression model set to obtain a target expression model set.
[0190] The sample expression model set includes n sample expression models of a sample object, where n is a positive integer greater than 1. The sample object may refer to one object or multiple objects.
[0191] Optionally, the sample expression models in the sample expression model set have the same topological structure, that is, the sample expression models in the sample expression model set have the same number of vertices and connection relationships.
[0192] Step 1404: mesh deforming the first expression model of the target object according to the mesh deformation difference between the first expression model and the second expression model in the target expression model set to generate the second expression model of the target object.
[0193] The sample expression model set includes n sample expression models of the sample object, and the target expression model set includes n expression models of similar objects. The similar objects are obtained by reconstructing the faces of the sample objects with reference to the target objects.
[0194] Optionally, the sample expressions in the target expression model set include at least the first expression and the second expression. The sample expressions in the target expression model set may also be expressions other than the first expression and the second expression.
[0195] The second expression model is a facial model corresponding to a second expression. The second expression is different from the first expression. The second expression is an expression selected by the subject.
[0196] Step 1405: Display the second expression model of the target object.
[0197] Exemplarily, the first expression model of the target object is used to represent the target object's open-mouth expression, and the second expression model of the target object is used to represent the target object's smiling expression.
[0198] In summary, after obtaining the first expression model of the target object, this embodiment will first generate a target expression model set, which includes expression models of similar objects. Then, the second expression model of the target object is generated by the mesh deformation difference between the first expression model and the second expression model in the target model set. This embodiment can be applied in an application program to generate other expressions of the target object through an expression of the target object, and the generated expressions are more realistic and have good expression effects.
[0199] In an optional implementation of the present application, the method for generating an expression model provided in the embodiment of the present application can be applied to a game scene. For example, the method for generating an expression model is applied to a "face pinching" system, image generation of a game object, and the like.
[0200] Fig.15 A flow chart of a method for generating an expression model provided by an exemplary embodiment of the present application is shown. The method comprises:
[0201] Step 1501: Display the game interface.
[0202] Optionally, the game interface includes an initial model of the game object, and the initial model is a preset face model.
[0203] Optionally, the game interface includes a game model editing tab, which is used to adjust the parameters of the initial model of the game object. Exemplarily, the game interface includes a face shape editing tab, in which the object can adjust the face shape of the initial model, the aforementioned face shape includes but is not limited to at least one of a square face, a round face, a long face, a melon seed face, and an oval face. Exemplarily, the game interface includes an eye editing tab, in which the object can adjust at least one of the size, shape, and pupil color of the initial model's eyes. Exemplarily, the game interface includes a nose editing tab, in which the object can adjust at least one of the type, shape, size, height, and length of the initial model's nose.
[0204] Step 1502: In response to the model editing operation, display the first expression model of the game object.
[0205] Model editing operations are used to adjust the appearance of the initial model of the game object.
[0206] Optionally, the content of the mouth tab is displayed; in response to the mouth adjustment operation, the arc of the mouth corner of the initial model of the game object is adjusted to obtain the first expression model of the game object. Exemplarily, when the mouth corner of the initial model of the game object is pulled up, a smiling expression model of the game object is obtained.
[0207] Optionally, the contents of the eyebrow tab are displayed; in response to the eyebrow adjustment operation, the eyebrow shape of the initial model of the game object is adjusted to obtain the first expression model of the game object. Exemplarily, when the eyebrows of the initial model of the game object are raised, the angry expression model of the game object is obtained.
[0208] Step 1503: In response to the expression generation operation, display a second expression model of the game object.
[0209] Optionally, an expression generation tab is also displayed on the game interface. The expression generation tab includes expression generation controls corresponding to at least two second expressions. Exemplarily, the expression generation controls include but are not limited to at least one of a smiling expression generation control, an angry expression generation control, a sad expression generation control, and a disgusted expression generation control. In a specific example, the first expression model is a smiling expression model, and the object clicks the angry expression generation control, and the angry expression model of the game object is displayed on the game interface.
[0210] Optionally, in response to an expression generation operation on a target expression generation control in the expression generation controls, a second expression model of the game object is displayed, the second expression model corresponding to the target expression generation control.
[0211] Optionally, this step includes the following sub-steps:
[0212] 1. Taking the first expression model of the game object as a reference, perform model transformation on the sample expression model set to obtain the target expression model set.
[0213] 2. According to the mesh deformation difference between the first expression model and the second expression model in the target expression model set, the first expression model of the game object is mesh deformed to generate the second expression model of the game object.
[0214] Please refer to the above for details. Figures 3 to 8 The embodiments shown will not be described in detail here.
[0215] In summary, this embodiment provides a method for generating an expression model of a game object with one click. Only one expression model of a game object needs to be provided to obtain other expression models of the game object. On the one hand, players can directly obtain multiple expression models of game objects, making the game objects more realistic and enhancing the player's gaming experience. On the other hand, on the basis of providing personalized design for players, the expression models of game objects are generated in batches.
[0216] In an optional implementation of the present application, the method for generating an expression model provided in the embodiment of the present application can be applied to designing a virtual human scene. For example, the method for generating an expression model is applied to a virtual anchor, a virtual idol, etc. Here, a virtual anchor is used as an example for explanation:
[0217] Fig.16 A flow chart of a method for generating an expression model provided by an exemplary embodiment of the present application is shown. The method comprises:
[0218] Step 1601: Display the design interface of the virtual anchor.
[0219] Optionally, the above-mentioned design interface includes a model import control, and the model import control is used to import the first expression model of the virtual anchor.
[0220] Step 1602: In response to the model import operation, the first expression model of the virtual anchor is displayed.
[0221] Optionally, in response to the model import operation, the model parameters of the first expression model of the virtual anchor are obtained; and the first expression model of the virtual anchor is displayed according to the model parameters. Exemplarily, the model parameters are (w, i, y), where w indicates that the corners of the mouth of the first expression model of the virtual anchor are raised, i indicates that the eyes of the first expression model of the virtual anchor are open, and y indicates that the hair of the first expression model of the virtual anchor is black.
[0222] Optionally, in response to the model editing operation, the first expression model of the virtual anchor is adjusted. Exemplarily, the design interface further includes an anchor model editing tab, which is used to adjust the model parameters of the first expression model of the virtual anchor.
[0223] Step 1603: In response to the expression generation operation, display a second expression model of the virtual anchor.
[0224] Optionally, an expression generation tab is also displayed on the design interface. The expression generation tab includes expression generation controls corresponding to at least two second expressions. Exemplarily, the expression generation controls include but are not limited to at least one of a smile expression generation control, an angry expression generation control, a sad expression generation control, and a disgust expression generation control.
[0225] Optionally, in response to an expression generation operation on a target expression generation control in the expression generation controls, a second expression model of the virtual anchor is displayed, and the second expression model corresponds to the target expression generation control.
[0226] Optionally, the expression generation operation displays an expression model set of the virtual anchor, and the expression model set of the virtual anchor includes at least two second expression models of the virtual anchor.
[0227] In an optional implementation, a facial image of a host is obtained; a target expression corresponding to the facial image is identified; a target expression model corresponding to the target expression is determined from a set of expression models; the target expression model is rendered to obtain a facial image of a virtual host, and the facial image is used in the live broadcast of the above-mentioned host.
[0228] Optionally, this step includes the following sub-steps:
[0229] 1. Taking the first expression model of the game object as a reference, perform model transformation on the sample expression model set to obtain the target expression model set.
[0230] 2. According to the mesh deformation difference between the first expression model and the second expression model in the target expression model set, the first expression model of the game object is mesh deformed to generate the second expression model of the game object.
[0231] Please refer to the above for details. Figures 3 to 8 The embodiments shown will not be described in detail here.
[0232] In summary, this embodiment provides a method for quickly generating an expression model of a virtual anchor. The method can generate multiple expression models with one click, does not require manual operation by technicians, improves efficiency, and generates expression models with good effect and high simulation degree.
[0233] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0234] Please refer to Fig.17 , which shows a block diagram of an apparatus for generating an expression model provided by an embodiment of the present application. The above functions can be implemented by hardware, or by hardware executing corresponding software. The apparatus 1700 includes:
[0235] An acquisition module 1701 is used to acquire a first expression model of a target object, where the first expression model is a facial model corresponding to a first expression;
[0236] The model generation module 1702 is used to perform model transformation on the sample expression model set with the first expression model of the target object as a reference to obtain a target expression model set; the sample expression model set includes n sample expression models of the sample object, and the target expression model set includes n expression models of similar objects, and the similar objects are obtained by performing facial reconstruction on the sample object with the target object as a reference;
[0237] The model generation module 1702 is also used to perform mesh deformation on the first expression model of the target object according to the mesh deformation difference between the first expression model and the second expression model in the target expression model set to generate the second expression model of the target object; wherein the first expression model is a facial model corresponding to the first expression, the second expression model is a facial model corresponding to the second expression, the second expression is different from the first expression, the sample expression model is a facial model corresponding to the sample expression, and n is a positive integer greater than 1.
[0238] In an optional design of the present application, the model generation module 1702 is also used to determine a model tensor corresponding to the sample expression model set, the model tensor including a core tensor, an identity matrix and an expression matrix, the core tensor being a sub-tensor of the model tensor, the identity matrix including an identity vector corresponding to the sample object, and the expression matrix including n expression vectors; taking the first expression model of the target object as a reference, generating a target identity vector according to the model tensor and the first expression model of the target object; generating the i-th expression model in the target expression model set according to the core tensor, the target identity vector and the i-th expression vector, where i is a positive integer and the starting value is 1; when i is not equal to n, updating i to i+1, and repeating the previous step until the target expression model set is obtained.
[0239] In an optional design of the present application, the model generation module 1702 is also used to determine the target object vector corresponding to the target object based on the first expression model of the target object; determine the first expression vector corresponding to the first expression from the expression matrix; and calculate the target identity vector based on the product of the core tensor, the target object vector and the first expression vector.
[0240] In an optional design of the present application, the model generation module 1702 is also used to calculate the vector product of the core tensor and the first expression vector; and generate the target identity vector based on the product of the vector product and the target object vector.
[0241] In an optional design of the present application, the model generation module 1702 is also used to generate the i-th expression model in the target expression model set according to the product of the core tensor, the target identity vector and the i-th expression vector.
[0242] In an optional design of the present application, the model generation module 1702 is also used to determine the first deformation matrix of the first expression model of the target object based on the mesh deformation difference between the first expression model and the second expression model in the target expression model set; and to perform coordinate transformation on the mesh vertices within the first expression model of the target object according to the first deformation matrix to generate the second expression model of the target object.
[0243] In an optional design of the present application, the model generation module 1702 is also used to determine the second deformation matrix of the first expression model in the target expression model set based on the mesh deformation difference between the first expression model and the second expression model in the target expression model set; when the mesh vertex alignment condition is met, j candidate deformation matrices of the first expression model of the target object are generated based on the first expression model in the target expression model set, the first expression model of the target object and the second deformation matrix, wherein the mesh vertex alignment condition is used to indicate that before and after the mesh deformation of the first expression model, the common vertices of the mesh on the first expression model are located at the same position, and j is a positive integer; j differences between the second deformation matrix and the j candidate deformation matrices are respectively calculated; and the candidate deformation matrix corresponding to the minimum value of the j differences is used as the first deformation matrix.
[0244] In an optional design of the present application, the model generation module 1702 is also used to obtain a mesh mapping relationship between the first expression model in the target expression model set and the first expression model of the target object; when the mesh vertex alignment condition is met, the candidate deformation matrix is generated according to the second deformation matrix and the mesh mapping relationship.
[0245] In an optional design of the present application, the model generation module 1702 is also used to perform mesh deformation on the first expression model in the target expression model set according to the mesh deformation difference between the first expression model in the target expression model set and other expression models in the target expression model set, so as to generate an expression model set of the target object.
[0246] In an optional design of the present application, the apparatus further includes: a rendering module 1703;
[0247] The rendering module is further used to arrange the expression models in the expression model set to generate an expression model sequence; and render the expression model sequence to obtain the facial video of the target object.
[0248] In summary, after obtaining the first expression model of the target object, this embodiment will first generate a target expression model set, which includes expression models of similar objects. Then, the second expression model of the target object is generated by the mesh deformation difference between the first expression model and the second expression model in the target model set. Since the similarity between the similar object and the target object is high, the mesh deformation difference of the expression model of the similar object can be transferred to the expression model of the target object, so that the expression effect of the second expression model of the target object is good and closer to the actual situation.
[0249] Fig.18 1 is a schematic diagram of the structure of a computer device according to an exemplary embodiment. The computer device 1800 includes a central processing unit (CPU) 1801, a system memory 1804 including a random access memory (RAM) 1802 and a read-only memory (ROM) 1803, and a system bus 1805 connecting the system memory 1804 and the central processing unit 1801. The computer device 1800 also includes a basic input / output system (I / O system) 1806 that helps transmit information between various devices in the computer device, and a large-capacity storage device 1807 for storing an operating system 1813, an application program 1814, and other program modules 1815.
[0250] The basic input / output system 1806 includes a display 1808 for displaying information and an input device 1809 such as a mouse and a keyboard for user inputting information. The display 1808 and the input device 1809 are connected to the central processing unit 1801 through an input / output controller 1810 connected to the system bus 1805. The basic input / output system 1806 may also include an input / output controller 1810 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1810 also provides output to a display screen, a printer, or other types of output devices.
[0251] The mass storage device 1807 is connected to the central processing unit 1801 through a mass storage controller (not shown) connected to the system bus 1805. The mass storage device 1807 and its associated computer device readable medium provide non-volatile storage for the computer device 1800. That is, the mass storage device 1807 may include a computer device readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.
[0252] Without loss of generality, the computer device readable medium may include computer device storage media and communication media. Computer device storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer device readable instructions, data structures, program modules or other data. Computer device storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), CD-ROM, Digital Video Disc (DVD) or other optical storage, cassette, tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer device storage medium is not limited to the above. The above-mentioned system memory 1804 and mass storage device 1807 can be collectively referred to as memory.
[0253] According to various embodiments of the present disclosure, the computer device 1800 can also be connected to a remote computer device on a network through a network such as the Internet. That is, the computer device 1800 can be connected to the network 1811 through the network interface unit 1812 connected to the system bus 1805, or the network interface unit 1812 can be used to connect to other types of networks or remote computer device systems (not shown).
[0254] The memory also includes one or more programs, which are stored in the memory. The central processing unit 1801 implements all or part of the steps of the above-mentioned method for generating the expression model by executing the one or more programs.
[0255] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method for generating an expression model provided by the above-mentioned method embodiments.
[0256] The present application also provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for generating an expression model provided in the above method embodiment.
[0257] The present application also provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for generating an expression model provided in the above embodiment.
[0258] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0259] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0260] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating an expression model, characterized in that: The method comprises: Obtaining a first expression model of a target object; Determine a model tensor corresponding to the sample expression model set, the model tensor includes a core tensor, an identity matrix and an expression matrix, the core tensor is a sub-tensor of the model tensor, the identity matrix includes an identity vector corresponding to the sample object, and the expression matrix includes n expression vectors; the sample expression model set includes n sample expression models of the sample object; Taking the first expression model of the target object as a reference, generating a target identity vector according to the model tensor and the first expression model of the target object; Generate an i-th expression model in a target expression model set according to the core tensor, the target identity vector and the i-th expression vector, where i is a positive integer and a starting value of 1; If i is not equal to n, update i to i+1, and repeat the previous step until the target expression model set is obtained; the target expression model set includes n expression models of similar objects, and the similar objects are obtained by reconstructing the face of the sample object with reference to the target object; According to the mesh deformation difference between the first expression model and the second expression model in the target expression model set, mesh deforming the first expression model of the target object to generate the second expression model of the target object; Among them, the first expression model is a facial model corresponding to the first expression, the second expression model is a facial model corresponding to the second expression, the second expression is different from the first expression, the sample expression model is a facial model corresponding to the sample expression, and n is a positive integer greater than 1.
2. The method according to claim 1, characterized in that The step of taking the first expression model of the target object as a reference and generating a target identity vector according to the model tensor and the first expression model of the target object comprises: Determine a target object vector corresponding to the target object according to a first expression model of the target object; Determining a first expression vector corresponding to the first expression from the expression matrix; The target identity vector is calculated based on the product of the kernel tensor, the target object vector and the first expression vector.
3. The method according to claim 2, characterized in that The calculating the target identity vector based on the product of the core tensor, the target object vector and the first expression vector comprises: Calculating a vector product of the core tensor and the first expression vector; The target identity vector is generated based on the product of the cross product and the target object vector.
4. The method according to claim 1, characterized in that: The step of generating the i-th expression model in the target expression model set according to the core tensor, the target identity vector and the i-th expression vector comprises: The i-th expression model in the target expression model set is generated according to the product of the core tensor, the target identity vector and the i-th expression vector.
5. The method according to any one of claims 1 to 4, characterized in that: The method of performing mesh deformation on the first expression model of the target object according to the mesh deformation difference between the first expression model and the second expression model in the target expression model set to generate the second expression model of the target object comprises: Determining a first deformation matrix of a first expression model of the target object according to a mesh deformation difference between a first expression model and a second expression model in the target expression model set; Coordinate transformation is performed on mesh vertices in a first expression model of the target object according to the first deformation matrix to generate a second expression model of the target object.
6. The method according to claim 5, characterized in that The step of determining a first deformation matrix of a first expression model of the target object according to a mesh deformation difference between a first expression model and a second expression model in the target expression model set comprises: Determining a second deformation matrix of the first expression model in the target expression model set according to a mesh deformation difference between the first expression model and the second expression model in the target expression model set; Under the condition that a mesh vertex alignment condition is met, j candidate deformation matrices of the first expression model of the target object are generated based on the first expression model in the target expression model set, the first expression model of the target object and the second deformation matrix, wherein the mesh vertex alignment condition is used to indicate that the common vertices of the mesh on the first expression model are located at the same position before and after the mesh deformation of the first expression model, and j is a positive integer; respectively calculating j differences between the second deformation matrix and the j candidate deformation matrices; The candidate deformation matrix corresponding to the minimum value among the j differences is used as the first deformation matrix.
7. The method according to claim 6, characterized in that The method of generating j candidate deformation matrices of the first expression model of the target object based on the first expression model in the target expression model set, the first expression model of the target object and the second deformation matrix when the mesh vertex alignment condition is met includes: Acquire a grid mapping relationship between a first expression model in the target expression model set and a first expression model of the target object; When the mesh vertex alignment condition is met, the candidate deformation matrix is generated according to the second deformation matrix and the mesh mapping relationship.
8. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: According to the mesh deformation difference between the first expression model in the target expression model set and other expression models in the target expression model set, the first expression model in the target expression model set is mesh deformed to generate the expression model set of the target object.
9. The method according to claim 8, characterized in that The method further comprises: Arranging the expression models in the expression model set to generate an expression model sequence; The expression model sequence is rendered to obtain a facial video of the target object.
10. A device for generating an expression model, characterized in that: The device comprises: An acquisition module, used for acquiring a first expression model of a target object, wherein the first expression model is a facial model corresponding to the first expression; A model generation module is used to determine a model tensor corresponding to a sample expression model set, wherein the model tensor includes a core tensor, an identity matrix and an expression matrix, wherein the core tensor is a sub-tensor of the model tensor, the identity matrix includes an identity vector corresponding to a sample object, and the expression matrix includes n expression vectors; the sample expression model set includes n sample expression models of the sample object; taking the first expression model of the target object as a reference, generating a target identity vector according to the model tensor and the first expression model of the target object; generating an i-th expression model in the target expression model set according to the core tensor, the target identity vector and the i-th expression vector, wherein i is a positive integer and a starting value of 1; updating i to i+1 when i is not equal to n, and repeating the previous step until the target expression model set is obtained; the target expression model set includes n expression models of similar objects, wherein the similarity between the similar object and the target object is greater than a similarity threshold, and the similar object is obtained by performing facial reconstruction on the sample object with reference to the target object; The model generation module is also used to perform mesh deformation on the first expression model of the target object according to the mesh deformation difference between the first expression model and the second expression model in the target expression model set to generate the second expression model of the target object; wherein the first expression model is a facial model corresponding to the first expression, the second expression model is a facial model corresponding to the second expression, the second expression is different from the first expression, the sample expression model is a facial model corresponding to the sample expression, and n is a positive integer greater than 1.
11. A computer device, characterized in that: The computer device includes: a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for generating an expression model as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: At least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by the processor to implement the method for generating an expression model according to any one of claims 1 to 9.
13. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method for generating an expression model according to any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Expression model generation method and apparatus, device, and medium
EP4456001A1
