A method, device and medium for generating stable head posture of digital human

Through a four-stage 3DMM reconstruction method, using dense facial and head key points, optical flow tracking and depth estimation, the problem of unstable head posture of digital humans is solved, and a synchronization effect of high precision and naturalness is achieved.

CN118429869BActive Publication Date: 2024-09-10SHANDONG INSPUR ULTRA HD INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410896101.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-09-10
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

Existing NeRF-based digital human head pose generation technology has problems such as insufficient sparse facial and head key points, unsmooth inter-frame motion information, and only using 2D spatial supervision, resulting in unstable digital human head poses.

Method used

Adopting a four-stage coarse-to-fine 3DMM reconstruction method, through dense facial and head key point detection, optical flow tracking, iterative training and depth estimation, dense 2D and 3D spatial supervision signals are obtained to achieve high accuracy of digital human head poses synchronous.

Benefits of technology

It achieves stable synchronization of digital human head postures, enhances naturalness and continuity, overcomes the weakness of only 2D space supervision, and supports high-precision calculation of head postures in 3D space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429869B
    Figure CN118429869B
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence, and specifically to a method, device and medium for generating a stable head posture of a digital human. The present invention adopts a four-stage coarse-to-fine 3DMM reconstruction method to achieve stable synchronization of the head of a digital human. Dense supervision signals are obtained through dense facial and head key point detection, and the key points that have a greater influence on the head posture are focused on, and interference points are removed to support the high-precision calculation of the digital human 3DMM and the joint head posture; the signal jitter existing in the long time series of the face and head key points in each frame of the video is smoothed by a smoothing method, which is more in line with the naturalness and continuity of the real head movement; the corresponding coordinates of the 2D space key points in the 3D space are obtained by depth estimation, and 3D supervision is performed using key points with coordinate value marks in both 2D and 3D spaces to overcome the weak supervision brought by using only projection key points and tracking key points for supervision in 2D space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device and medium for generating a stable head posture of a digital human. Background Art

[0002] At present, digital human technology has been widely used in some fields. For example, in the field of customer service agents, some companies have begun to use digital humans to replace human customer service to interact with users; in the field of virtual assistants, some smartphones and smart speakers are already equipped with digital human assistants to help users complete various tasks; in the field of education and training, some educational institutions have begun to use digital humans as teaching assistants to provide students with personalized teaching services.

[0003] Some mainstream digital human products, such as Silicon Intelligence, Fengping Intelligence, Baidu Xiling, Tencent Zhiying, etc., use two technology stacks for digital human speech portrait synthesis technology, namely GAN-based TFG technology, such as wav2lip, DINet, etc., and NeRF-based TPS technology, such as GeneFace++, ER-NeRF, etc. The former can realize the generalized digital human lip movement, and the latter can realize the customized digital human lip movement and the driving of facial expressions, head postures, and upper body movements.

[0004] Since the NeRF-based TPS technology has a clear 3D structure representation, it has advantages over the GAN-based TFG technology in terms of the naturalness and consistency of digital human head posture control. Even so, existing NeRF-based SOTA methods such as ER-NeRF and SyncTalk still have the problem of unstable digital human head posture. The root cause is that ER-NeRF uses sparse 51 facial landmarks for 2D loss calculation in 3DMM reconstruction, while SyncTalk uses co-tracker optical flow tracking to obtain significant dense head key points for 2D loss calculation in 3DMM reconstruction, but lacks clear 3D key point coordinate information. Therefore, in terms of stable head posture control of digital humans, we focus on the following issues:

[0005] First, the sparse facial and head key point coordinates as supervision signals are not sufficient to support the high-precision fitting of the shape and expression coefficients of the digital human 3DMM and the rotation angle of the head in 3D space (rotation R and translation T);

[0006] Second, the facial key points generated by frame-by-frame face pose estimation do not consider the motion information between frames, and the resulting supervision signal is not smooth enough;

[0007] Third, only 2D space supervision is used, ignoring the more important 3D space loss. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a method for generating a stable head posture of a digital human, and a four-stage coarse-to-fine 3DMM reconstruction method is adopted to achieve stable digital human head synchronization.

[0009] In order to solve the technical problem, the technical solution adopted by the present invention is: a method for generating a stable head posture of a digital human, the method comprising:

[0010] S01), collect original training videos;

[0011] S02), preprocessing the original training video to obtain an audio file, a video file of the upper half of the human body, and an image frame of the upper half of the human body;

[0012] S03), obtaining a 3D face model, and obtaining 3D key points on the 3D face model that have a perspective projection relationship with the 2D upright face key points;

[0013] S04), detecting K sparse facial key points on the image frame of the upper half of the human body, and smoothing the K sparse facial key points, taking the coordinate values ​​of the last M key points as 2D space supervision coordinate marks, where M is equal to the number of 3D key points obtained in step S03), and K is greater than M;

[0014] S05), performing optical flow tracking on the video file of the upper part of the human body to obtain the facial motion optical flow, selecting N key points with significant optical flow changes, and tracking the motion trajectories of the N key points in the flow sequence as dense 2D space supervision coordinate markers;

[0015] S06), obtain the best focal length, the acquisition process is: set the training data of the rough 3DMM reconstruction, including the training frame, the 2D space supervision coordinate mark corresponding to each training frame, set the interval and step size of the candidate focal length, set the optimization parameters including: the shape coefficient of the rough 3DMM, the expression coefficient of the rough 3DMM, the Euler angle of the head rotation in the rough 3D space, the translation vector of the head rotation in the rough 3D space, set the output value to rotate and translate the 3D space key points using the Euler angle and translation vector of the head rotation in the rough 3D space, and perspective project it into the 2D space to obtain the projection point coordinates, and set the loss function , loss function The mathematical expression is:

[0016] ;

[0017] in Indicates the 2D spatial supervision coordinate label corresponding to each training frame, Represents the coordinates of the projection point set as the output value, represents the candidate focal length, The Euler angles representing the rotation of the head in rough 3D space, The translation vector representing the head rotation in rough 3D space;

[0018] For each candidate focal length, set the iteration step size P and perform iterative training, using the loss function Perform BP update gradient with the optimizer, fix the shape coefficient and expression coefficient of the rough 3DMM for the first P / 2 iterations, optimize the Euler angle and translation vector of the head rotation in the rough 3D space, and jointly optimize the shape coefficient and expression coefficient of the rough 3DMM, the Euler angle and translation vector of the head rotation in the rough 3D space for the next P / 2 iterations, and compare the loss function of each candidate focal length after P-step iterative training , take the candidate focal length corresponding to the minimum loss as the optimal focal length;

[0019] S07), obtain the shape coefficient and expression coefficient of the detailed 3DMM, the Euler angle and translation vector of the head rotation in the 3D space, set the training data for detailed 3DMM reconstruction: training frame, 2D space supervision coordinate mark corresponding to each training frame, set the optimization parameters including: the shape coefficient of the detailed 3DMM, the expression coefficient of the detailed 3DMM, the Euler angle of the head rotation in the detailed 3D space, the translation vector of the head rotation in the detailed 3D space, set the output value to rotate and translate the 3D space key points using the Euler angle and translation vector of the head rotation in the detailed 3D space, and perspective project them into the 2D space, obtain the projection point coordinates, and set the loss function , loss function The mathematical expression is:

[0020] ;

[0021] in Indicates the 2D spatial supervision coordinate label corresponding to each training frame, The coordinates of the projection point set as the output value of this step, is the optimal focal length obtained in step S06), The Euler angles for head rotation in detailed 3D space, is the translation vector of the head rotation in detailed 3D space;

[0022] Set the iteration step size P and perform iterative training, fix the focal length to the optimal focal length obtained in step S06), and use the loss function Perform BP update gradient with the optimizer, fix the shape coefficient and expression coefficient of the detailed 3DMM for the first P / 2 iterations, optimize the Euler angles and translation vectors of the head rotation in the detailed 3D space, and iterate for the next P / 2 steps to jointly optimize the shape coefficient and expression coefficient of the detailed 3DMM, the Euler angles and translation vectors of the head rotation in the detailed 3D space, and finally obtain the shape coefficient, expression coefficient, and Euler angles and translation vectors of the head rotation in the detailed 3D space of the detailed 3DMM;

[0023] S08), obtain the coarse 3D key points corresponding to the dense 2D space supervision coordinate marks on the 3D upright face model, set the training data: training frame, the dense 2D space supervision coordinate marks corresponding to each training frame, set the optimization parameters to the coarse 3D key points, set the output value to use the Euler angles and translation vectors of the head rotation in the detailed 3D space to rotate and translate the coarse 3D key points to be obtained, and perspectively project them into the 2D space to obtain the projection point coordinates, and set the 2D space loss function , 2D space loss function The mathematical expression is:

[0024] in To supervise coordinate labeling in dense 2D space, Set the projection point coordinates as output for this step, is the optimal focal length obtained in step S06), The Euler angles for head rotation in detailed 3D space, is the translation vector of the head rotation in detailed 3D space;

[0025] Set the iteration step size Q and perform iterative training, fix the focal length to the optimal focal length obtained in step S06), fix the shape coefficient and expression coefficient of the detailed 3DMM, the Euler angle and translation vector of the head rotation in the detailed 3D space, and use Perform BP update gradient with the optimizer to obtain rough 3D key points;

[0026] S09), obtain the fine 3D key points corresponding to the dense 2D space supervision coordinate marks on the 3D upright face model, the Euler angles of the head rotation in the 3D space, and the translation vector of the head rotation in the 3D space, set the training data: training frame, the dense 2D space supervision coordinate marks corresponding to each training frame, set the first output value to rotate and translate the 3D space key points using the Euler angles and translation vectors, and perspective project them into the 2D space, obtain the projection point coordinates, and set the 2D space loss function , 2D space loss function The mathematical expression is:

[0027] ,

[0028] in represents the dense 2D space supervision coordinate label, Indicates the coordinates of the projection point set as the output value of this step, represents the best focal length, represents the Euler angles of head rotation in 3D space for dense 2D space supervisory coordinate markers, Represents the translation vector of the head rotation in 3D space of the dense 2D space supervision coordinate marker;

[0029] Set the second output value: Use the shape coefficient, expression coefficient and fine 3D key points of the detailed 3DMM to calculate the geometric shape of the 3DMM, use the geometric shape, optimal focal length, fine 3D key points and projection point coordinates of the 3DMM to calculate the mapping matrix from 2D to 3D space, use the mapping matrix to map the 2D space supervision coordinate markers upward to the 3D face model space, obtain the 3D mapping key point coordinates, use the Euler angle and translation vector to rotate and translate the 3D space key points, obtain the 3D supervision key points, and set the 3D space loss function , The mathematical expression is:

[0030] ,

[0031] in represents 3D supervision key points, Represents the mapping matrix, represents the 3D mapping key points, The Euler angles representing the rotation of the head in 3D space, The translation vector of the head rotation in 3D space;

[0032] Set the iteration step size R and perform iterative training. The loss function is used in the first few steps. and optimizer, fix the best focal length, the shape coefficient and expression coefficient of the detailed 3DMM, the Euler angles and translation vectors of the head rotation in the detailed 3D space; optimize the 3D key points, and use the loss function in the last few steps , fix the optimal focal length, the shape coefficient and expression coefficient of the detailed 3DMM, bundle and jointly optimize the 3D key points, the Euler angles of the head rotation in the detailed 3D space, and the translation vector of the head rotation in the 3D space to obtain the detailed 3D key points, the Euler angles of the head rotation in the 3D space, and the translation vector of the head rotation in the 3D space.

[0033] Furthermore, in step S02), the FFmpeg tool is used to capture a video file of the upper half of the human body from the original training video. The resolution of the video file of the upper half of the human body is 400×400 pixels to 512×512 pixels. The picture includes all parts of the human body above the chest, and the head is located in the upper middle part of the picture.

[0034] Furthermore, in step S04), OpenFace is used to detect key points of the upper half of the human body image frame and smooth the key points. The index value of the 2D spatial supervision coordinate marker is consistent with the index value of the upper half of the human body image frame, that is, each frame of the upper half of the human body image corresponds to a set of key point coordinates.

[0035] Furthermore, in step S05), Co-Tracker is used to estimate the optical flow of the upper part of the human body video file, and a Laplace filter is used to select the parts with significant optical flow changes. The index value of the dense 2D space supervision coordinate marker is consistent with the index value of the image frame of the upper half of the human body, that is, each frame of the image corresponds to a set of The coordinates of key points.

[0036] Furthermore, in the setting output values ​​of steps S06), S07), S08), and S09), the method of obtaining the projection of the 3D to 2D key points is consistent, and includes:

[0037] A. Call the forward_geo_sub method of 3DMM, with shape coefficient, expression coefficient and 3D key points as input, and output the geometric shape of the key points of the 3D face with expression;

[0038] B. Change the Euler angle and convert it into a rotation matrix in the XYZ direction in 3D space;

[0039] C. Use the rotation matrix to perform spatial rotation and translation on the translation coefficient and geometric shape to obtain the spatial coordinates of M key points of the 3D face with expression and head posture;

[0040] D. Use the focal length, the spatial coordinates of the M key points of the 3D face with expression and head posture, and the 1 / 2 resolution value of the video file of the upper half of the human body to perform perspective projection calculation to obtain the final projection point coordinates.

[0041] Further, in setting the second output value in step S09), the detailed steps of calculating the mapping matrix from 2D to 3D space using the geometric shape, optimal focal length, Euler angles, translation coefficients and projection point coordinates of the 3DMM are:

[0042] S9-1) Use Euler angles and translation coefficients to perform spatial rotation and translation on the geometric shape of the 3DMM to obtain the spatial coordinates of N key points of the 3D face with expression and head posture.

[0043] S9-2), using the best focal length, the spatial coordinates of N key points of the 3D face with expression and head posture, and the projection point coordinates, a mapping matrix from 2D to 3D space is calculated.

[0044] The key points in step S03) are the key points corresponding to the last 51 indexes of the 403 indexes in the 3DMM key point file lands_info.txt.

[0045] Furthermore, in step S06), the training frame is an image set consisting of an image frame taken every 8 frames from the image frame set of the upper half of the human body, and the interval value of the candidate focal length is , the step size is 50, the dimension of the shape coefficient is 100, the dimension of the expression coefficient is 79, and the dimension of the Euler angle and translation coefficient is 3.

[0046] The present invention also discloses a device for generating a stable head posture of a digital human, comprising a processor and a memory storing program instructions, wherein the processor is configured to execute the above-mentioned method for generating a stable head posture of a digital human when running the program instructions.

[0047] The present invention also discloses a storage medium storing program instructions, which, when running, execute the method for generating a stable head posture of a digital human as described above.

[0048] Beneficial effects of the present invention: A four-stage coarse-to-fine 3DMM reconstruction method is used to achieve stable digital human head synchronization. Dense supervision signals are obtained through dense facial and head key point detection, and key points that have a greater impact on head posture are focused on, and interference points are removed to support high-precision calculation of digital human 3DMM and head joint posture; the signal jitter existing in the long time series of face and head key points in each frame of the video is smoothed by a smoothing method, which is more in line with the naturalness and continuity of real head movement; the corresponding coordinates of 2D space key points in 3D space are obtained through depth estimation, and 3D supervision is performed using key points marked with coordinate values ​​in both 2D and 3D space to overcome the weak supervision caused by using only projection key points and tracking key points for supervision in 2D space. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 The following is a flow chart of the method described in the embodiment. DETAILED DESCRIPTION

[0050] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0051] Example 1

[0052] This embodiment discloses a method for generating a stable head posture of a digital human. Figure 1 As shown, the following steps are included:

[0053] S01) Collect 3 to 5 minutes of original training video to obtain the original training video , the original training video It should maintain 25FPS, 2K resolution, and high-quality image quality, and the audio should be pure human voice without background noise.

[0054] Video shooting requirements include the following:

[0055] 1. Maintain a relatively stable and natural head and body posture in the first 30 seconds of the video, and keep your mouth shut and do not speak;

[0056] 2. Maintain normal and natural speaking state in the last 3.5 minutes of the video, keep the head moving smoothly and slowly or stay still for a short time, and do not move your hands above your chest and the speed should not be too fast;

[0057] 3. There is no occlusion of human body parts in the entire time domain video;

[0058] 4. Girls should tie their hair tightly and take off any extra accessories;

[0059] 5. The human voice should be pure and free of any environmental noise.

[0060] S02), the original training video Perform preprocessing to obtain audio files , Video files of the upper part of the human body and upper body image frames . Use FFmpeg tool from Intercept , The resolution is 400×400 Pixel to 512×512 Pixel (440×440 Pixel in this embodiment). The picture should include all parts of the human body above the chest, with the head located in the upper middle part of the picture and the width of the shoulders maintained at about 400 Pixel. The index value i ranges from 0 to The total number of frames minus 1, in this embodiment, the value range of i is .

[0061] S03), obtaining an open source 3D face model BFM2009, and obtaining 51 3D key points 3DPoint51 on the 3D face model that have a perspective projection relationship with 51 key points of the 2D upright face.

[0062] In this embodiment, 51 3D key points 3DPoint51 are key points corresponding to the last 51 indexes of 403 indexes in the 3DMM key point file lands_info.txt. 3DPoint51 is a key point of the upright 3D face model and has no index value.

[0063] S04), detect the image frame of the upper part of the human body The sparse 68 facial key points on the image are smoothed and the coordinate values ​​of the last 51 key points are taken as the 2D space supervision coordinate markers. .

[0064] In this embodiment, OpenFace is used to Perform 68 keypoint detection and smooth keypoints. The index value of The index value remains consistent, that is, each frame of the image corresponds to a set of 51 key point coordinates.

[0065] S05) Video file of the upper part of the human body Perform optical flow tracking to obtain facial motion optical flow, select 478 key points with significant optical flow changes, and track the motion trajectories of these key points in the flow sequence as dense 2D space supervision coordinate markers .

[0066] In this embodiment, Co-Tracker is used to For optical flow estimation, a Laplacian filter is used to select 478 key points where the optical flow changes significantly. The index value of The index value remains consistent, that is, each frame of the image corresponds to a set of 478 key point coordinates.

[0067] S06) Get the best focal length The acquisition process is as follows: The training data for rough 3DMM reconstruction includes: training frame , each training frame Corresponding 2D space supervision coordinate marking , where the value range of j is , set the candidate focal length The interval is and step size is 50, setting the optimization parameters include: shape coefficient of 3DMM , 3DMM expression coefficient , Euler angles of head rotation in 3D space , the translation vector of the head rotation in 3D space , set the output value to use Euler angles and translation vectors Rotate and translate the 3D space key point 3DPoint51, and perspective project it into 2D space to obtain the coordinates of the projection point , set the loss function , loss function The mathematical expression is:

[0068] ;

[0069] For each candidate focal length Set the iteration step size to 2000 and perform iterative training, using the loss function Perform BP update gradient with optimizer, iterate for the first 1000 steps, and fix the shape coefficient and expression coefficient , optimize the Euler angles and translation vectors , after 1000 iterations, jointly optimize the shape coefficients , expression coefficient , Euler angle and translation vectors , comparing each candidate focal length The loss function after 2000 training steps , take the candidate focal length corresponding to the minimum loss as the optimal focal length The best focal length obtained in this embodiment .

[0070] In this step, all index values ​​j remain consistent, and j is the value from The index of the image set consisting of an image frame taken every 8 frames in the image set. Candidate focal length The interval value is , with a step size of 50. The dimension is 100, Dimension is 79, optimized Euler angle and translation vectors The dimension is 3.

[0071] S07) Obtain detailed 3DMM shape coefficient , expression coefficient , Euler angles of head rotation in 3D space , translation vector .

[0072] The acquisition process is: Set up training data for detailed 3DMM reconstruction: training frame , each training frame Corresponding 2D space supervision coordinate marking , setting optimization parameters include: detailed 3DMM shape coefficient , detailed 3DMM expression coefficient , Euler angles of head rotation in detailed 3D space , translation vector of head rotation in detailed 3D space , set the output value to use the Euler angles of the head rotation in detailed 3D space and the translation vector of the head rotation in detailed 3D space Rotate and translate the 3D space key point 3DPoint51, and perspective project it into 2D space to obtain the coordinates of the projection point , set the loss function , loss function The mathematical expression is:

[0073] ;

[0074] Set the iteration step size to 2000 and perform iterative training, fixing the focal length to the optimal focal length obtained in step S06) , using the loss function Perform BP update gradient with optimizer, iterate the first 1000 steps, and fix the shape coefficient of detailed 3DMM and expression coefficient , optimize the Euler angles of head rotation in detailed 3D space and the translation vector of the head rotation in detailed 3D space , after 1000 iterations, jointly optimize the shape coefficients of the detailed 3DMM , detailed 3DMM expression coefficient , Euler angles of head rotation in detailed 3D space and translation vectors , and finally obtain the shape coefficient of the detailed 3DMM , detailed 3DMM expression coefficient , Euler angles of head rotation in detailed 3D space and the translation vector of the head rotation in detailed 3D space .

[0075] S08) Obtain dense 2D space supervision coordinate marking The corresponding rough 3D key points on the 3D upright face model , set training data: training frame , each training frame Corresponding dense 2D space supervision coordinate marking , set the optimization parameters to rough 3D key points , set the output value to use the Euler angles of the head rotation in detailed 3D space and the translation vector of the head rotation in detailed 3D space For the key points of the rough 3D space Perform rotation and translation, and perspective project into 2D space to obtain the coordinates of the projection point , set the 2D space loss function , 2D space loss function The mathematical expression is:

[0076] , set the iteration step length to 300 and perform iterative training, fixing the focal length to the optimal focal length obtained in step S06) , fix the shape coefficient of the detailed 3DMM obtained in step S07) and expression coefficient , Euler angles of head rotation in detailed 3D space and translation vectors ,use Perform BP update gradient with optimizer to optimize rough 3D key points .

[0077] S09) Obtain 2D space supervision coordinate mark Corresponding fine 3D key points on the 3D upright face model , Euler angles of head rotation in 3D space , the translation vector of the head rotation in 3D space , set training data: training frame , each training frame Corresponding dense 2D space supervision coordinate marking , set the first output value: use Euler angles and translation vectors Key points in 3D space Perform rotation and translation, and perspective project into 2D space to obtain the coordinates of the projection point , set the 2D space loss function , 2D space loss function The mathematical expression is:

[0078] ,Set the second output value: Use , and Calculate the geometry of the 3DMM ,use , , and Calculate the mapping matrix from 2D to 3D space , using the mapping matrix Will Map upward to the 3D face model space to obtain the 3D mapping key point coordinates ,use and Key points in 3D space Perform rotation and translation to obtain 3D supervision key points , set the 3D space loss function , The mathematical expression is:

[0079] , set the iteration step size to 8300 and perform iterative training, using the loss function for the first 300 and optimizer, fixed focal length , , and , optimize 3D key points , the loss function is used for the last 8000 , fixed focal length , , , bundled joint optimization of 3D key points , and , get fine 3D key points , Euler angles of head rotation in 3D space , the translation vector of the head rotation in 3D space .

[0080] In this embodiment, in the setting output values ​​of steps S06), S07), S08), and S09), the specific steps of obtaining the projection of 3D to 2D key points are the same, and S06) is used as an example for explanation, and the detailed steps include:

[0081] S6-1. Call the forward_geo_sub method of 3DMM and input , and , the output is the geometry of 51 key points of a 3D face with expression ;

[0082] S6-2, Yes Change and convert to the rotation matrix in the XYZ direction in 3D space ;

[0083] S6-3. Use and right Perform spatial rotation and translation to obtain the spatial coordinates of 51 key points of the 3D face with expression and head posture ;

[0084] S6-4, Use focal length and as well as 1 / 2 resolution value, perform perspective projection calculation, and obtain the final .

[0085] In step S09), in setting the second output value, use , , , and Calculate the mapping matrix from 2D to 3D space The detailed steps include:

[0086] S9-1. Use and right Perform spatial rotation and translation to obtain the spatial coordinates of 478 key points of the 3D face with expressions and head postures .

[0087] S9-2, Use focal length , ,and Calculated .

[0088] Example 2

[0089] This embodiment discloses a device for generating a stable head posture of a digital human, including a processor and a memory storing program instructions. The processor is configured to execute the method for generating a stable head posture of a digital human as described in Example 1 when running the program instructions.

[0090] Example 3

[0091] This embodiment discloses a storage medium storing program instructions. When the program instructions are run, the method for generating a stable head posture of a digital human as described in Embodiment 1 is executed.

[0092] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0093] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes, or a transient storage medium.

[0094] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0095] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. The technicians may clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0096] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically separately, or two or more units may be integrated in one unit.

[0097] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A method for generating a stable head posture of a digital human, characterized by: The method includes: S01), collect original training videos; S02), preprocessing the original training video to obtain an audio file, a video file of the upper half of the human body, and an image frame of the upper half of the human body; S03), obtaining a 3D face model, and obtaining 3D spatial key points on the 3D face model that have a perspective projection relationship with the 2D upright face key points; S04), detecting K sparse facial key points on the image frame of the upper half of the human body, and smoothing the K sparse facial key points, taking the coordinate values ​​of the last M key points as 2D space supervision coordinate marks, where M is equal to the number of 3D space key points obtained in step S03), and K is greater than M; S05), performing optical flow tracking on the video file of the upper part of the human body to obtain the facial motion optical flow, selecting N key points with significant optical flow changes, and tracking the motion trajectories of the N key points in the flow sequence as dense 2D space supervision coordinate markers; S06), obtain the best focal length, set the training frame, and the 2D space supervision coordinate mark corresponding to each training frame As training data; set the interval and step size of candidate focal lengths; set the optimization parameters to the shape coefficient and expression coefficient of the rough 3DMM and the Euler angle of head rotation and translation vectors ; Set the output value to use and Rotate and translate the key points in 3D space, and project the coordinates of the projected points into 2D space ; Set the loss function ; S07) Obtain the shape coefficient and expression coefficient of the detailed 3DMM, the Euler angle and translation vector of the head rotation in 3D space, set the training frame, and the 2D space supervision coordinate marker corresponding to each training frame As training data; set the optimization parameters to the shape coefficient and expression coefficient of the detailed 3DMM and the Euler angle of head rotation and translation vectors ; Set the output value to use and Rotate and translate the key points in 3D space and perspective project them into 2D space to obtain the coordinates of the projected points ; Set the loss function ; in is the optimal focal length obtained in step S06); S08), obtain the coarse 3D space key points corresponding to the dense 2D space supervision coordinate mark on the 3D upright face model, set the training frame, and the dense 2D space supervision coordinate mark corresponding to each training frame As training data; set the optimization parameters to the rough 3D space key points; set the output value to use Euler angles and translation vectors The rough 3D space key points to be obtained are rotated and translated and perspective projected into 2D space to obtain the coordinates of the projection points. ; Set 2D space loss function in is the optimal focal length obtained in step S06); S09), obtain the fine 3D space key points corresponding to the dense 2D space supervision coordinate mark on the 3D upright face model, the Euler angle of the head rotation in the 3D space, and the translation vector of the head rotation in the 3D space, set the training frame, and the dense 2D space supervision coordinate mark corresponding to each training frame As training data; Set the first output value to use Euler angles and translation vectors , rotate and translate the key points in 3D space, and perspective project them into 2D space to obtain the coordinates of the projection points , set the 2D space loss function , in Indicates the best focal length; Set the second output value to use the shape coefficient, expression coefficient and fine 3D space key points of the detailed 3DMM to calculate the geometric shape of the 3DMM; use the geometric shape, optimal focal length, fine 3D space key points and projection point coordinates of the 3DMM to calculate the mapping matrix from 2D to 3D space ; Use the mapping matrix to map the 2D space supervision coordinate markers upward to the 3D face model space, and obtain the 3D mapping key point coordinates , using Euler angles and translation vectors , rotate and translate the 3D space key points to obtain the 3D supervision key points , set the 3D space loss function , Set 8300 steps of iterative training, and the total loss function for the first 300 steps of training is , the total loss function after 8000 training steps is .

2. The method for generating a stable head posture of a digital human according to claim 1, characterized in that: In step S02), the FFmpeg tool is used to capture a video file of the upper half of the human body from the original training video. The resolution of the video file of the upper half of the human body is 400×400 pixels to 512×512 pixels. The picture includes all parts of the human body above the chest, and the head is located in the upper middle part of the picture.

3. The method for generating a stable head posture of a digital human according to claim 1, characterized in that: In step S04), OpenFace is used to detect key points of the upper half of the human body image frame and smooth the key points. The index value of the 2D spatial supervision coordinate marker is consistent with the index value of the upper half of the human body image frame, that is, each frame of the upper half of the human body image corresponds to a set of key point coordinates.

4. The method for generating a stable head posture of a digital human according to claim 1, characterized in that: In step S05), Co-Tracker is used to estimate the optical flow of the upper part of the human body video file, and a Laplace filter is used to select the parts with significant optical flow changes. The index value of the dense 2D space supervision coordinate marker is consistent with the index value of the image frame of the upper half of the human body, that is, each frame of the image corresponds to a set of The coordinates of key points.

5. The method for generating a stable head posture of a digital human according to claim 1, characterized in that: In the setting output values ​​of steps S06), S07), S08), and S09), the method of obtaining the projection of 3D to 2D key points is consistent, and includes: A. Call the forward_geo_sub method of 3DMM, with the input being the shape coefficient, expression coefficient and 3D space key points, and the output being the geometric shape of the key points of the 3D face with expression; B. Change the Euler angle and convert it into a rotation matrix in the XYZ direction in 3D space; C. Use the rotation matrix and translation coefficients to perform spatial rotation and translation on the geometric shape to obtain M spatial coordinates of the key points of the 3D face with expression and head posture; D. Use the best focal length, the M spatial coordinates of the key points of the 3D face with expression and head posture, and the 1 / 2 resolution value of the video file of the upper half of the human body to perform perspective projection calculation to obtain the final projection point coordinates.

6. The method for generating a stable head posture of a digital human according to claim 1, characterized in that: In setting the second output value in step S09), the detailed steps of calculating the mapping matrix from 2D to 3D space using the geometric shape, optimal focal length, Euler angles, translation coefficients and projection point coordinates of the 3DMM are: S9-1), using Euler angles and translation coefficients to perform spatial rotation and translation on the geometric shape of the 3DMM to obtain the spatial coordinates of N key points of the 3D face with expression and head posture; S9-2), using the best focal length, the spatial coordinates of N key points of the 3D face with expression and head posture, and the projection point coordinates, a mapping matrix from 2D to 3D space is calculated.

7. The method for generating a stable head posture of a digital human according to claim 1, characterized in that: The key points in step S03) are the key points corresponding to the last 51 indexes of the 403 indexes in the 3DMM key point file lands_info.txt.

8. The method for generating a stable head posture of a digital human according to claim 1, characterized in that: In step S06), the training frame is an image set consisting of an image frame taken every 8 frames from the image frame set of the upper half of the human body, and the interval value of the candidate focal length is , the step size is 50, the dimension of the shape coefficient is 100, the dimension of the expression coefficient is 79, and the dimension of the Euler angle and translation coefficient is 3.

9. A device for generating a stable head posture of a digital human, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for generating a stable head posture of a digital human as claimed in any one of claims 1 to 8 when running the program instructions.

10. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the method for generating a stable head posture of a digital human as claimed in any one of claims 1 to 8 is executed.