WO2023185398A1 - 一种脸部处理方法、装置、计算机设备及存储介质 - Google Patents

一种脸部处理方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2023185398A1
WO2023185398A1 PCT/CN2023/080028 CN2023080028W WO2023185398A1 WO 2023185398 A1 WO2023185398 A1 WO 2023185398A1 CN 2023080028 W CN2023080028 W CN 2023080028W WO 2023185398 A1 WO2023185398 A1 WO 2023185398A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
information
image
model
image data
Prior art date
Application number
PCT/CN2023/080028
Other languages
English (en)
French (fr)
Inventor
蒋昊
温翔
唐迪
王峰
温琦
徐国智
周佳庆
Original Assignee
北京字跳网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023185398A1 publication Critical patent/WO2023185398A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Definitions

  • the present disclosure relates to the field of computer technology, and specifically, to a facial processing method, device, computer equipment and storage medium.
  • Embodiments of the present disclosure provide at least a facial processing method, device, computer equipment, and storage medium.
  • embodiments of the present disclosure provide a facial processing method, including:
  • the three-dimensional face reconstruction coefficients include the three-dimensional face reconstruction coefficients used when performing three-dimensional face reconstruction on the face-driven image data.
  • the target face-pinching parameter information of the face-driven image data is determined; the target face-pinching parameter information is used for rendering Get the virtual character in the virtual scene.
  • the target face-pinching parameter information is obtained using a pre-trained face processing model
  • the face processing model includes a face pinching parameter prediction model and a parameter integration model
  • the face-pinching parameter prediction model is used to generate initial face-pinching parameter information based on the face driving image data;
  • the parameter integration model is used to generate initial face-pinching parameter information based on the initial face-pinching parameter information, the three-dimensional face reconstruction coefficient and the
  • the facial gesture information generates the integrated target face-pinching parameter information.
  • the face pinching parameter prediction model is trained through the following steps:
  • the weight parameter information in the face-pinching parameter prediction model to be trained is adjusted to obtain a trained face-pinching parameter prediction model.
  • the extracting the first image feature of the face driven image data sample includes:
  • the method further includes:
  • the second generated face image is input into the pre-trained face recognition model to obtain the second image features of the second generated face image.
  • the extraction of the first face key point information corresponding to the target part in the face driven image data sample includes:
  • the method further includes:
  • the mesh information Includes position information of each feature point in the three-dimensional face reconstruction model corresponding to the second generated face image;
  • the second face key point information corresponding to the second generated face image is determined.
  • the step of training the face-pinching parameter prediction model further includes:
  • the step of adjusting the weight parameter information in the face-pinching parameter prediction model to be trained based on the first loss information and the second loss information to obtain a trained face-pinching parameter prediction model includes:
  • the weight parameter information in the face-pinching parameter prediction model to be trained is adjusted to obtain a trained face-pinching parameter prediction model.
  • obtaining the first face area image of the face driven image data sample includes:
  • the method further includes:
  • the third generated face image is input into the pre-trained face segmentation model to obtain a second facial region image of the third generated face image.
  • the pre-trained generator includes a pre-trained pixel-to-pixel model; the pixel-to-pixel model is trained through the following steps:
  • each parameter sample includes face pinching parameter information, reconstruction coefficient information of the three-dimensional face reconstruction model, and facial posture information;
  • the model parameter information of the pixel-to-pixel model is adjusted to obtain a trained pixel-to-pixel model.
  • the parameter integration model is trained through the following steps:
  • the model parameter information of the parameter integration model is adjusted to obtain a trained parameter integration model.
  • embodiments of the present disclosure also provide a facial processing device, including:
  • the first acquisition module is used to obtain the three-dimensional face reconstruction coefficients of the three-dimensional face reconstruction model corresponding to the face-driven image data, and the face posture information; the three-dimensional face reconstruction coefficients include performing on the face-driven image data The weight coefficient of the target basis vector of each reference 3D face used in 3D face reconstruction;
  • a first determination module configured to determine initial face pinching parameter information based on the face driven image data
  • a second determination module configured to determine the target face-pinching parameter information of the face-driven image data based on the initial face-pinching parameter information, the three-dimensional face reconstruction coefficient, and the face posture information; the target The face pinching parameter information is used to render the virtual character in the virtual scene.
  • embodiments of the present disclosure also provide a computer device, including: a processor, a memory and a bus, so The memory stores machine-readable instructions executable by the processor.
  • the processor and the memory communicate through a bus.
  • the machine-readable instructions are executed when the processor executes the instructions.
  • embodiments of the present disclosure also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program executes the above-mentioned first aspect, or any of the first aspects. steps in a possible implementation.
  • the face processing method provided by the embodiment of the present disclosure first determines the initial face pinching parameter information based on the face driving image data, and then determines the face driving parameter information based on the initial face pinching parameter information, the three-dimensional face reconstruction coefficient, and the face posture information.
  • Target face pinching parameter information of image data by adding three-dimensional face reconstruction coefficients to generate target face-pinching parameter information, it can not only expand the degree of freedom of face-pinching to a certain extent, but also avoid unreasonable pinching to a certain extent when pinching the face based only on the initial parameter information. Face problems; and by adding face pose information, the generated virtual character can have the face pose of the face-driven image data, thereby improving the similarity between the generated virtual character and the face-driven image data.
  • At least two types of loss information are used in the embodiments of the present disclosure, namely, the first loss information between the first image feature of the face driven image data sample and the second image feature of the first generated face image, and the face
  • the second loss information between the first face key point information of the driving image data sample and the second face key point information of the second generated face image is used to train the face pinching parameter prediction model, which can make the trained face pinching
  • the face-pinching parameter information predicted by the face parameter prediction model is more accurate and reliable; and the face key point information can be the face key point information of the target part (such as eyes, mouth), which can render based on the predicted face-pinching parameter information.
  • the target parts of the virtual character are more similar to the target parts in the face-driven image data samples.
  • the generator used in the process of training the face-pinching parameter prediction model in the embodiment of the present disclosure can be trained based on the face-pinching parameter information, the reconstruction coefficient information of the three-dimensional face reconstruction model, and the facial posture information.
  • the generator can more accurately generate face images when faced with facial postures at any angle, thereby improving the accuracy of training the face-pinching parameter prediction model.
  • Figure 1 shows a flow chart of a facial processing method provided by an embodiment of the present disclosure
  • Figure 2 shows a training flow chart of the face-pinching parameter prediction model provided by an embodiment of the present disclosure
  • Figure 3 shows a training flow chart of the generator provided by an embodiment of the present disclosure
  • Figure 4 shows a training flow chart of the parameter integration model provided by an embodiment of the present disclosure
  • Figure 5 shows a flow chart of another face processing method provided by an embodiment of the present disclosure
  • Figure 6 shows a schematic diagram of a facial processing device provided by an embodiment of the present disclosure
  • FIG. 7 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure.
  • the face-driven image data is usually input into a pre-trained face recognition network or face segmentation network to obtain the face-pinching parameters, and then by adjusting the face-pinching parameters, rendering Get the game character.
  • a pre-trained face recognition network or face segmentation network to obtain the face-pinching parameters
  • rendering Get the game character rendering Get the game character.
  • the present disclosure provides a face processing method that first determines the initial face pinching parameter information based on the face driving image data, and then, based on the initial face pinching parameter information, the three-dimensional face reconstruction coefficient, and the face posture information, Determine the target face-pinching parameter information of the face-driven image data.
  • the generated virtual character can have the face pose of the face-driven image data, thereby improving the similarity between the generated virtual character and the face-driven image data.
  • face-driven image data or face-driven image data samples involved in the embodiments of the present disclosure are all used after authorization by the controller.
  • the execution subject of the face processing method provided by the embodiment of the disclosure is generally a computer device with certain computing capabilities.
  • the following describes the face processing method provided by the embodiment of the present disclosure, taking the execution subject as the server as an example.
  • the method includes S101 to S103, where:
  • S101 Obtain the three-dimensional face reconstruction coefficients and face posture information of the three-dimensional face reconstruction model corresponding to the face-driven image data; the three-dimensional face reconstruction coefficients include when performing three-dimensional face reconstruction on the face-driven image data The weight coefficient of the target basis vector of each reference three-dimensional face used.
  • the face-driven image data may refer to an image containing the face of the controller.
  • the image containing the face of the controller can be obtained by collecting images of real people, for example, by taking pictures or Collect images containing the face of the controller through video recording and other methods. It should be noted here that the process of obtaining face-driven image data can be performed by the controller himself after triggering the image acquisition operation, or by the controller's authorization.
  • the three-dimensional face reconstruction model corresponding to the face-driven image data can be obtained by using a general three-dimensional face model, such as a general three-dimensional deformable face model (3D Morphable Models, 3DMM).
  • 3DMM three-dimensional feature points can be used to represent a face, and the position information of these three-dimensional feature points can constitute the mesh information corresponding to the face model.
  • each three-dimensional feature point can be weighted by the basis vectors (1, 0, 0), (0, 1, 0) and (0, 0, 1) in the three directions of the three-dimensional space.
  • the weights of the vectors in the three directions are x, y, z respectively.
  • the mesh information of the face-driven image data can be obtained from the mesh information of a standard three-dimensional face (i.e., the average face) and the target basis vectors of multiple reference three-dimensional faces.
  • the target basis vectors may include basis vectors under identity features and basis vectors under expression features.
  • the mesh information of the three-dimensional face reconstruction model corresponding to the face-driven image data where S represents the mesh information of the face-driven image data, represents the mesh information of a standard three-dimensional face, s id represents the basis vector under the identity feature, ⁇ i represents the weight coefficient of the basis vector under the identity feature, m represents the number of standard three-dimensional faces, and s exp represents the basis vector under the expression feature. , ⁇ j represents the weight coefficient of the basis vector under the expression feature, and n represents the number of expressions in each standard three-dimensional face.
  • the mesh information of a standard three-dimensional face (i.e., the average face) and the target basis vectors of multiple reference three-dimensional faces can be obtained based on the facial scan data of other real faces.
  • the face can be obtained by using the mesh information of a standard three-dimensional face (i.e., the mean face), the basis vectors under the identity features of multiple reference three-dimensional faces, and the basis vectors under the expression features to perform a weighted sum, the face can be obtained
  • a three-dimensional face reconstruction model whose features are similar to the facial features in the face-driven image data.
  • the weight coefficient ⁇ i of the basis vector under the identity feature and the weight coefficient ⁇ j of the basis vector under the expression feature are the three-dimensional face reconstruction model. 3D face reconstruction coefficients of the model.
  • the model topology relationship between the standard 3D face and the reference 3D face is the model topology relationship under the open source model, which is different from the face model topology relationship used in the virtual scene.
  • the point cloud registration wrapping method can be used to combine the mesh information of the standard three-dimensional face with the model topological relationship under the open source model.
  • the basis vector s id of the reference three-dimensional face under the identity feature and the basis vector s exp of the reference three-dimensional face under the expression feature respectively correspond to the mesh information converted to a standard three-dimensional face with the topological relationship of the face model in the virtual scene. Reference is made to the basis vector s' id of the three-dimensional face under the identity feature, and the basis vector s' exp of the three-dimensional face under the expression feature.
  • the face gesture information may refer to the face gesture information in the face driven image data.
  • the initial three-dimensional face reconstruction model obtained above can be rotated.
  • the rotation angle of the three-dimensional face reconstruction model is the face pose. information.
  • the mesh information corresponding to the three-dimensional face reconstruction model with the topological relationship of the face model in the virtual scene can be expressed by the following formula:
  • r is the face posture information, which can be expressed as (r x , r y , r z ), r x , r y , r z are the rotation components in three directions respectively.
  • S102 Determine initial face-pinching parameter information based on the face-driven image data.
  • the target face-pinching parameter information is The virtual character in the virtual scene is obtained by rendering.
  • face driven image data, three-dimensional face reconstruction coefficients, and face posture information can be input into a pre-trained face processing model to obtain target face pinching parameter information.
  • the face processing model includes a face pinching parameter prediction model and a parameter integration model.
  • the face-pinching parameter prediction model is used to generate initial face-pinching parameter information based on face-driven image data;
  • the parameter integration model is used to generate integrated target face-pinching parameters based on initial face-pinching parameter information, three-dimensional face reconstruction coefficients, and face posture information. information.
  • the integrated target face-pinching parameter information contains the three-dimensional face reconstruction coefficient, that is, the integrated target face-pinching parameter information can be used to represent the three-dimensional face reconstruction coefficient. In this way, there is no need to directly convert the three-dimensional face reconstruction coefficient into Input into the game engine to avoid more time-consuming rendering process.
  • the face-driven image data, three-dimensional face reconstruction coefficients, and face pose information are input into the pre-trained face processing model.
  • the face-pinching parameter prediction model included in the face processing model can first be used to predict the face based on the face.
  • the image data is driven to generate initial face-pinching parameter information, and then the parameter integration model included in the face processing model generates integrated target face-pinching parameter information based on the initial face-pinching parameter information, three-dimensional face reconstruction coefficients, and face posture information. .
  • the training process of the face-pinching parameter prediction model in the face processing model is introduced below. Refer to the training flow chart of the face-pinching parameter prediction model shown in Figure 2.
  • the face-pinching parameter prediction model is trained through the following steps:
  • S201 Extract the first image feature of the face-driven image data sample, the first face key point information corresponding to the target part in the face-driven image data sample, and the person of the three-dimensional face reconstruction model corresponding to the face-driven image data sample. Face sample reconstruction coefficients and facial pose information.
  • the first image feature may refer to the feature of the face in the face-driven image data sample.
  • the first image feature may be obtained through face recognition.
  • the first image feature may be obtained using a pre-trained face recognition model, that is, the face-driven image data sample is input into the pre-trained face recognition model to obtain the face-driven image data sample.
  • the target parts in the face-driven image data sample can be preset face parts, such as eyes, mouth, nose, etc.
  • the first face key point information corresponding to the target part can represent the shape characteristics of the target part.
  • the first facial key point information corresponding to the target part may be obtained through facial key point detection.
  • the first face key point information corresponding to the target part in the face driven image data sample can be obtained by using a pre-trained face key point detection model, that is, the face driven image data sample is input to a pre-trained face key point detection model.
  • the first face key point information corresponding to the target part in the face driven image data sample can be obtained.
  • the face key point detection model can be trained in advance according to actual needs.
  • the facial key point detection model is trained based on the facial key point information of the eye area, so that the trained facial key point detection model can more accurately detect the facial key point information of the eye area.
  • the face sample reconstruction coefficient and facial pose information of the three-dimensional face reconstruction model corresponding to the face-driven image data sample can be obtained according to the aforementioned process of reconstructing the three-dimensional face model, which will not be described again here.
  • S202 Input the first image feature into the face-pinching parameter prediction model to be trained, and obtain the first predicted face-pinching parameter information corresponding to the face-driven image data sample; and input the first face key point information into the face-pinching parameter prediction model to be trained.
  • the second predicted face-pinching parameter information corresponding to the face-driven image data sample is obtained.
  • S203 Input the first predicted face-pinching parameter information, face sample reconstruction coefficient and facial posture information into the pre-trained generator to obtain the first generated face image; and, input the second predicted face-pinching parameter information, face gesture information into the pre-trained generator.
  • the face sample reconstruction coefficient and facial pose information are input into the pre-trained generator to obtain a second generated face image.
  • a pre-trained generator can generate a face image based on face pinching parameter information, face sample reconstruction coefficients, and facial posture information.
  • the generator can be trained At this time, you can first determine the skeletal parameter information corresponding to the face pinching parameter information, and then obtain the final position of each feature point in the mesh information through skinning processing. Next, use the differentiable rendering engine to obtain the rendering result, and then use the differentiable rendering The rendering results obtained by the engine are processed into the rendering results of the 3D engine.
  • the training process of the generator will be detailed below.
  • S204 Determine the first loss information based on the second image feature and the first image feature of the second generated face image; and, based on the second face key point information and the first face key point of the second generated face image information to determine the second loss information.
  • the second image feature may refer to the feature of the face in the second generated face image.
  • the second image feature can also be obtained using a pre-trained face recognition model, that is, the second generated face image is input into the pre-trained face recognition model to obtain the second generated face image. the second image feature.
  • the first loss information between the second image feature and the first image feature may be calculated based on a cosine loss function.
  • the first image feature can be recorded as The second image feature is Then the first loss information is
  • the second face key point information may be the key point information of the target part in the second generated face image.
  • the target part in the second generated face image is the same face part as the target part in the face driving image data sample.
  • the second predicted face-pinching parameter information, face sample reconstruction coefficient and facial posture information can be skinned first to obtain the grid mesh information corresponding to the second generated face image; and then based on the mesh information and preset camera parameter information to determine the second face key point information corresponding to the second generated face image.
  • the main step is to perform skinning calculation on the second predicted face pinching parameter information to obtain the bone parameter information corresponding to the second predicted face pinching parameter information.
  • the mesh information corresponding to the second generated face image is obtained based on the skeletal parameter information, face sample reconstruction coefficient and facial posture information.
  • the target feature points corresponding to the target part can be marked in the mesh information corresponding to the second generated face image.
  • the grid mesh information can be projected to obtain the position information of the target feature points on the second generated face image, that is, the third generated face image corresponding to the second generated face image.
  • Key point information of two faces In one implementation, the first face key point information can be recorded as The key point information of the second face is Then the second loss information is
  • the weight parameter information in the face pinching parameter prediction model the values of w 1 and w 2 are obtained.
  • the optimal solution is obtained to obtain the trained face-pinching parameter prediction model.
  • the reconstruction coefficients and facial pose information are input into the pre-trained generator to obtain a third generated face image; next, based on the pixel information of the second face area image of the third generated face image and the first face area
  • the pixel information of the image determines the third loss information.
  • the first face region image can be obtained through image segmentation.
  • the face-driven image data sample can be input into a pre-trained face segmentation model to obtain the first face-driven image data sample. Face area image.
  • the process of using the pre-trained generator to generate the third generated face image can refer to the foregoing process, which will not be described again here.
  • the second face region image of the third generated face image may be obtained by inputting the third generated face image into a pre-trained face segmentation model. Then, the third loss information can be determined based on the pixel value information of each pixel point in the second face area image and the pixel value information of each pixel point in the first face area image.
  • the weight parameter information in the face-pinching parameter prediction model to be trained can be adjusted based on the first loss information, the second loss information, and the third loss information to obtain a trained face-pinching parameter prediction model.
  • the first loss information, the second loss information and the third loss information can be weighted and summed to obtain the total loss information, and then the weight parameter information in the face-pinching parameter prediction model to be trained is adjusted based on the total loss information.
  • the training process of the generator used in the training process of the face-pinching parameter prediction model is described in detail below.
  • the generator may include a pixel-to-pixel (Pixel-to-Pixel) model.
  • the process of training the generator is mainly the process of training the pixel-to-pixel model.
  • the generator is trained through the following steps:
  • each parameter sample includes face pinching parameter information, reconstruction coefficient information of the three-dimensional face reconstruction model, and facial posture information.
  • parameter samples can be obtained by uniform sampling.
  • the sampling range corresponding to the face-pinching parameter information, the reconstruction coefficient information of the three-dimensional face reconstruction model, and the facial posture information can be set respectively.
  • the sampling range corresponding to the reconstruction coefficient information of the three-dimensional face reconstruction model can be -3 to 3
  • the sampling range of facial posture information in the first direction (left and right direction) can be -15 degrees to 15 degrees, that is, the left and right swing range of the human face is 15 degrees
  • the sampling range on the up and down swing (up and down swing) can be -40 degrees to 40 degrees, that is, the up and down swing range of the human face is 40 degrees
  • the sampling range corresponding to the face pinching parameter information is 0 to 1.
  • S302 Input the face-pinching parameter information in each parameter sample into the game engine to obtain a fourth generated face image.
  • S303 Perform skinning processing on each parameter sample respectively to obtain the mesh information after skinning processing.
  • the main task is to perform skinning calculation on the face-pinching parameter information in the parameter sample to obtain the corresponding bone parameter information, and then obtain the fourth generation based on the bone parameter information, the reconstruction coefficient information of the three-dimensional face reconstruction model, and the facial posture information.
  • S304 Perform differentiable rendering on the mesh information after each skinning process to obtain the fifth generated face image.
  • the fifth generated face image is an image similar in face shape to the fourth generated face image, but has pixel differences.
  • S305 Input the fifth generated face image into the pixel-to-pixel model to be trained to obtain the sixth generated face image.
  • the perceptual loss information can be the loss information between pixels, that is, the loss information between the pixel information of the fourth generated face image and the pixel information of the sixth generated face image. For each parameter sample, the perceptual loss information corresponding to the parameter sample can be obtained.
  • the trained pixel-to-pixel model can process face images that require pixel processing and obtain face images whose pixel information is more similar to that of face-driven image data. That is, the image obtained by differentiable rendering can be processed into The effect is consistent with the image rendered by the game engine.
  • the generator obtained through the above training can be used in the training process of the face-pinching parameter prediction model.
  • three-dimensional face reconstruction can be performed on multiple face-driven image data samples, so that mesh information samples of multiple three-dimensional face reconstruction models can be obtained.
  • S402 Input multiple mesh information samples into the parameter integration model to be trained to obtain integrated face-pinching parameter information.
  • S403 Determine the reconstructed mesh information of the three-dimensional face reconstruction model based on the integrated face-pinching parameter information and the standard mesh information of the standard three-dimensional face model.
  • the integrated face-pinching parameter information can be skinned to obtain the corresponding bone parameter information, and then the bone parameter information and the standard mesh information of the standard three-dimensional face model can be used to obtain the reconstructed mesh information of the three-dimensional face reconstruction model.
  • the mesh loss information can be determined.
  • the mesh loss information of the mesh information sample is determined respectively.
  • the mesh information sample can be recorded as S
  • the reconstructed mesh information corresponding to the mesh information sample can be recorded as S′
  • S405 Based on the mesh loss information, adjust the model parameter information of the parameter integration model to obtain the trained parameter integration model.
  • the obtained face driven image data is input into the pre-trained face key point detection model to obtain the first key point information of the eye part and the mouth part. .
  • three-dimensional face reconstruction is performed based on the face-driven image data and the first key point information to obtain the three-dimensional face reconstruction coefficients and face posture information of the three-dimensional face reconstruction model.
  • the three-dimensional face reconstruction coefficient and face posture information constitute the mesh information of the three-dimensional face reconstruction model corresponding to the face-driven image data.
  • the aligned generated face image is input into the pre-trained face recognition model to obtain the first image feature of the generated face image.
  • the first image feature is input into the trained face-pinching parameter prediction model, and the first face-pinching parameter information corresponding to the generated face image is obtained based on the first image feature, the three-dimensional face reconstruction coefficient and the face posture information.
  • the first face-pinching parameter information and the second face-pinching parameter information are fused to obtain the initial face-pinching parameter information, and then the initial face-pinching parameter information, three-dimensional face reconstruction coefficient and face posture information are input into the parameter integration after training. model to obtain the integrated target face-pinching parameter information.
  • the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible The internal logic is determined.
  • embodiments of the present disclosure also provide a facial processing device corresponding to the facial processing method. Since the principle of solving the problem of the device in the embodiment of the disclosure is similar to the above-mentioned facial processing method of the embodiment of the disclosure, therefore For the implementation of the device, please refer to the implementation of the method, and repeated details will not be repeated.
  • the device includes: a first acquisition module 601, a first determination module 602, and a second determination module 603; wherein,
  • the first acquisition module 601 is used to obtain the three-dimensional face reconstruction coefficients and face posture information of the three-dimensional face reconstruction model corresponding to the face-driven image data; the three-dimensional face reconstruction coefficients include the face-driven image data The weight coefficient of the target basis vector of each reference 3D face used when performing 3D face reconstruction;
  • the first determination module 602 is used to determine initial face pinching parameter information based on the face driving image data
  • the second determination module 603 is configured to determine the target face-pinching parameter information of the face-driven image data based on the initial face-pinching parameter information, the three-dimensional face reconstruction coefficient, and the face posture information;
  • the target face pinching parameter information is used to render the virtual character in the virtual scene.
  • the target face-pinching parameter information is obtained using a pre-trained face processing model
  • the face processing model includes a face pinching parameter prediction model and a parameter integration model
  • the face-pinching parameter prediction model is used to generate initial face-pinching parameter information based on the face driving image data;
  • the parameter integration model is used to generate initial face-pinching parameter information based on the initial face-pinching parameter information, the three-dimensional face reconstruction coefficient and the
  • the facial gesture information generates the integrated target face-pinching parameter information.
  • the device further includes:
  • An extraction module for extracting the first image feature of the face-driven image data sample, the first face key point information corresponding to the target part in the face-driven image data sample, and the corresponding first face key point information of the face-driven image data sample. Face sample reconstruction coefficients and facial pose information of the three-dimensional face reconstruction model;
  • a first input module configured to input the first image feature into the face-pinching parameter prediction model to be trained, and obtain the first predicted face-pinching parameter information corresponding to the face-driven image data sample; and, convert the The first face key point information is input into the face-pinching parameter prediction model to be trained, and the second predicted face-pinching parameter information corresponding to the face-driven image data sample is obtained;
  • the second input module is used to input the first predicted face-pinching parameter information, the face sample reconstruction coefficient and the facial posture information into a pre-trained generator to obtain a first generated face image; and , input the second predicted face-pinching parameter information, the face sample reconstruction coefficient and the facial posture information into the pre-trained generator to obtain a second generated face image;
  • a third determination module configured to determine first loss information based on the second image feature of the second generated face image and the first image feature; and, based on the second person's second generated face image The face key point information and the first face key point information are used to determine the second loss information;
  • a first adjustment module configured to adjust the weight parameter information in the face-pinching parameter prediction model to be trained based on the first loss information and the second loss information, to obtain a trained face-pinching parameter prediction model.
  • the extraction module is specifically used for:
  • the device Before the third determination module determines the first loss information based on the second image feature of the second generated face image and the first image feature, the device further includes:
  • the third input module is used to input the second generated face image into the pre-trained face recognition model to obtain the second image features of the second generated face image.
  • the extraction module is specifically used for:
  • the device Before the third determination module determines the second loss information based on the second face key point information of the second generated face image and the first face key point information, the device further includes:
  • a first processing module configured to perform skinning processing on the second predicted face-pinching parameter information, the face sample reconstruction coefficient and the facial posture information, to obtain a grid corresponding to the second generated face image.
  • mesh information includes the position information of each feature point in the three-dimensional face reconstruction model corresponding to the second generated face image;
  • a fourth determination module configured to determine the second face key point information corresponding to the second generated face image based on the mesh information and preset camera parameter information.
  • the device further includes:
  • a second acquisition module configured to acquire the first face area image of the face driven image data sample
  • a fourth input module configured to input the first facial region image into the face-pinching parameter prediction model to be trained, and obtain the third predicted face-pinching parameter information corresponding to the face driving image data sample;
  • the fifth input module is used to input the third predicted face-pinching parameter information, the face sample reconstruction coefficient and the facial posture information into the pre-trained generator to obtain a third generated face image. ;
  • a fifth determination module configured to determine third loss information based on the pixel information of the second face area image of the third generated face image and the pixel information of the first face area image;
  • the first adjustment module is specifically used for:
  • the weight parameter information in the face-pinching parameter prediction model to be trained is adjusted to obtain a trained face-pinching parameter prediction model.
  • the second acquisition module is specifically used for:
  • the device Before the fifth determination module determines the third loss information based on the pixel information of the second face area image of the third generated face image and the pixel information of the first face area image, the device further includes:
  • a sixth input module is used to input the third generated face image into the pre-trained face segmentation model to obtain a second facial region image of the third generated face image.
  • the pre-trained generator includes a pre-trained pixel-to-pixel model; the device further includes:
  • the third acquisition module is used to acquire multiple parameter samples; each parameter sample includes face pinching parameter information, reconstruction coefficient information of the three-dimensional face reconstruction model, and facial posture information;
  • the seventh input module is used to input the face-pinching parameter information in each of the parameter samples into the game engine to obtain a fourth generated face image
  • the second processing module is used to perform skinning processing on each of the parameter samples respectively, and obtain the mesh information after skinning processing;
  • a rendering module used to perform differentiable rendering on each of the skinned mesh information to obtain a fifth generated face image
  • An eighth input module is used to input the fifth generated face image into the pixel-to-pixel model to be trained to obtain a sixth generated face image
  • a sixth determination module configured to determine perceptual loss information for each of the parameter samples based on the pixel information of the fourth generated face image and the pixel information of the sixth generated face image obtained from the parameter sample;
  • the second adjustment module is used to adjust the model parameter information of the pixel-to-pixel model based on the perceptual loss information to obtain a trained pixel-to-pixel model.
  • the device further includes:
  • the fourth acquisition module is used to acquire mesh information samples of multiple three-dimensional face reconstruction models
  • the ninth input module is used to input the plurality of mesh information samples into the parameter integration model to be trained, and obtain the integrated face pinching parameter information;
  • a seventh determination module configured to determine the reconstructed mesh information of the three-dimensional face reconstruction model based on the integrated face-pinching parameter information and the standard mesh information of the standard three-dimensional face model;
  • the eighth determination module is used to determine mesh loss information for each of the mesh information samples based on the reconstructed mesh information corresponding to the mesh information sample and the mesh information sample;
  • the third adjustment module is used to adjust the model parameter information of the parameter integration model based on the mesh loss information to obtain a trained parameter integration model.
  • a schematic structural diagram of a computer device 700 provided for an embodiment of the present disclosure includes a processor 701 , a memory 702 , and a bus 703 .
  • the memory 702 is used to store execution instructions, including the memory 7021 and the external memory 7022; the memory 7021 here is also called the internal memory, and is used to temporarily store the operation data in the processor 701, as well as the data exchanged with the external memory 7022 such as the hard disk,
  • the processor 701 exchanges data with the external memory 7022 through the memory 7021.
  • the processor 701 and the memory 702 communicate through the bus 703, so that the processor 701 executes the following instructions:
  • the three-dimensional face reconstruction coefficients include the three-dimensional face reconstruction coefficients used when performing three-dimensional face reconstruction on the face-driven image data.
  • the target face-pinching parameter information of the face-driven image data is determined; the target face-pinching parameter information is used for rendering Get the virtual character in the virtual scene.
  • Embodiments of the present disclosure also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • Embodiments of the present disclosure also provide a computer program product.
  • the computer product carries program code.
  • the instructions included in the program code can be used to execute the steps of the facial processing method described in the above method embodiments. For details, please refer to the above method. The embodiments will not be described again here.
  • the above-mentioned computer program product can be specifically implemented by hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium.
  • the computer program product is embodied as a software product, such as a Software Development Kit (SDK), etc. wait.
  • SDK Software Development Kit
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division.
  • multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor.
  • the technical solution of the present disclosure is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本公开提供了一种脸部处理方法、装置、计算机设备及存储介质,其中,该方法包括:获取人脸驱动图像数据对应的三维人脸重建模型的三维人脸重建系数和人脸姿态信息;基于人脸驱动图像数据,确定初始捏脸参数信息;基于初始捏脸参数信息、三维人脸重建系数以及人脸姿态信息,确定人脸驱动图像数据的目标捏脸参数信息。本公开实施例通过增加三维人脸重建系数生成目标捏脸参数信息,既可以在一定程度上扩大捏脸自由度,又可以在一定程度上避免仅根据初始参数信息捏脸时出现捏出不合理人脸的问题;通过增加人脸姿态信息,生成的虚拟角色能够具有人脸驱动图像数据的人脸姿态,从而可以提高虚拟角色与人脸驱动图像数据的相似度。

Description

一种脸部处理方法、装置、计算机设备及存储介质
本申请要求于2022年03月30日提交中国专利局、申请号为202210325620.7、申请名称为“一种脸部处理方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机技术领域,具体而言,涉及一种脸部处理方法、装置、计算机设备及存储介质。
背景技术
随着网络游戏的快速发展,越来越多的游戏中设置了捏脸功能,通过捏脸功能帮助控制人员定制个性化的游戏角色。
在基于脸部数据创建相应的游戏角色时候,如何使得通过捏脸功能创建的游戏角色与控制人员的人脸更像,是值得研究的问题。
发明内容
本公开实施例至少提供一种脸部处理方法、装置、计算机设备及存储介质。
第一方面,本公开实施例提供了一种脸部处理方法,包括:
获取人脸驱动图像数据对应的三维人脸重建模型的三维人脸重建系数、以及人脸姿态信息;所述三维人脸重建系数包括对所述人脸驱动图像数据进行三维人脸重建时使用的各个参考三维人脸的目标基向量的权重系数;
基于所述人脸驱动图像数据,确定初始捏脸参数信息;
基于所述初始捏脸参数信息、所述三维人脸重建系数、以及所述人脸姿态信息,确定所述人脸驱动图像数据的目标捏脸参数信息;所述目标捏脸参数信息用于渲染得到虚拟场景中的虚拟角色。
一种可选的实施方式中,所述目标捏脸参数信息是利用预先训练的脸部处理模型得到的;
所述脸部处理模型包括捏脸参数预测模型和参数整合模型;
所述捏脸参数预测模型用于基于所述人脸驱动图像数据生成初始捏脸参数信息;所述参数整合模型用于基于所述初始捏脸参数信息、所述三维人脸重建系数以及所述人脸姿态信息生成整合后的所述目标捏脸参数信息。
一种可选的实施方式中,所述捏脸参数预测模型通过以下步骤训练得到:
提取人脸驱动图像数据样本的第一图像特征、所述人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息、以及所述人脸驱动图像数据样本对应的三维人脸重建模型的人脸样本重建系数和脸部姿态信息;
将所述第一图像特征输入至待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第一预测捏脸参数信息;以及,将所述第一人脸关键点信息输入至所述待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第二预测捏脸参数信息;
将所述第一预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至预先训练的生成器中,得到第一生成人脸图像;以及,将所述第二预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至所述预先训练的生成器中,得到第二生成人 脸图像;
基于所述第二生成人脸图像的第二图像特征以及所述第一图像特征,确定第一损失信息;以及,基于所述第二生成人脸图像的第二人脸关键点信息以及所述第一人脸关键点信息,确定第二损失信息;
基于所述第一损失信息和所述第二损失信息,调整所述待训练的捏脸参数预测模型中的权重参数信息,得到训练好的捏脸参数预测模型。
一种可选的实施方式中,所述提取人脸驱动图像数据样本的第一图像特征,包括:
将所述人脸驱动图像数据样本输入至预先训练的人脸识别模型中,得到所述人脸驱动图像数据样本的第一图像特征;
基于所述第二生成人脸图像的第二图像特征以及所述第一图像特征,确定第一损失信息之前,所述方法还包括:
将所述第二生成人脸图像输入至所述预先训练的人脸识别模型中,得到所述第二生成人脸图像的第二图像特征。
一种可选的实施方式中,所述提取所述人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息,包括:
将所述人脸驱动图像数据样本输入至预先训练的人脸关键点检测模型中,得到所述人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息;
基于所述第二生成人脸图像的第二人脸关键点信息以及所述第一人脸关键点信息,确定第二损失信息之前,所述方法还包括:
对所述第二预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息进行蒙皮处理,得到所述第二生成人脸图像对应的网格mesh信息;所述mesh信息包括所述第二生成人脸图像对应的三维人脸重建模型中各个特征点的位置信息;
基于所述mesh信息和预设相机参数信息,确定所述第二生成人脸图像对应的所述第二人脸关键点信息。
一种可选的实施方式中,对所述捏脸参数预测模型进行训练的步骤还包括:
获取所述人脸驱动图像数据样本的第一脸部区域图像;
将所述第一脸部区域图像输入至所述待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第三预测捏脸参数信息;
将所述第三预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至所述预先训练的生成器中,得到第三生成人脸图像;
基于所述第三生成人脸图像的第二脸部区域图像的像素信息和所述第一脸部区域图像的像素信息,确定第三损失信息;
所述基于所述第一损失信息和所述第二损失信息,调整所述待训练的捏脸参数预测模型中的权重参数信息,得到训练好的捏脸参数预测模型,包括:
基于所述第一损失信息、所述第二损失信息和所述第三损失信息,调整所述待训练的捏脸参数预测模型中的权重参数信息,得到训练好的捏脸参数预测模型。
一种可选的实施方式中,所述获取所述人脸驱动图像数据样本的第一脸部区域图像,包括:
将所述人脸驱动图像数据样本输入至预先训练的人脸分割模型中,得到所述人脸驱动图像数据样本的第一脸部区域图像;
基于所述第三生成人脸图像的第二脸部区域图像的像素信息和所述第一脸部区域图像的像素信息,确定第三损失信息之前,所述方法还包括:
将所述第三生成人脸图像输入至所述预先训练的人脸分割模型中,得到所述第三生成人脸图像的第二脸部区域图像。
一种可选的实施方式中,所述预先训练的生成器包括预先训练的像素到像素模型;所述像素到像素模型通过以下步骤训练得到:
获取多个参数样本;各个所述参数样本中包括捏脸参数信息、三维人脸重建模型的重建系数信息和脸部姿态信息;
分别将各个所述参数样本中的捏脸参数信息输入至游戏引擎中,得到第四生成人脸图像;
分别对各个所述参数样本进行蒙皮处理,得到蒙皮处理后的mesh信息;
对各个所述蒙皮处理后的mesh信息进行可微渲染,得到第五生成人脸图像;
将所述第五生成人脸图像输入至待训练的像素到像素模型中,得到第六生成人脸图像;
针对各个所述参数样本,基于该参数样本得到的所述第四生成人脸图像的像素信息和所述第六生成人脸图像的像素信息,确定感知损失信息;
基于所述感知损失信息,对所述像素到像素模型的模型参数信息进行调整,得到训练好的像素到像素模型。
一种可选的实施方式中,所述参数整合模型通过以下步骤训练得到:
获取多个三维人脸重建模型的mesh信息样本;
分别将所述多个mesh信息样本输入至待训练的参数整合模型中,得到整合后的捏脸参数信息;
基于所述整合后的捏脸参数信息和标准三维人脸模型的标准mesh信息,确定所述三维人脸重建模型的重建mesh信息;
针对各个所述mesh信息样本,基于该mesh信息样本对应的重建mesh信息和该mesh信息样本,确定mesh损失信息;
基于所述mesh损失信息,调整所述参数整合模型的模型参数信息,得到训练好的参数整合模型。
第二方面,本公开实施例还提供一种脸部处理装置,包括:
第一获取模块,用于获取人脸驱动图像数据对应的三维人脸重建模型的三维人脸重建系数、以及人脸姿态信息;所述三维人脸重建系数包括对所述人脸驱动图像数据进行三维人脸重建时使用的各个参考三维人脸的目标基向量的权重系数;
第一确定模块,用于基于所述人脸驱动图像数据,确定初始捏脸参数信息;
第二确定模块,用于基于所述初始捏脸参数信息、所述三维人脸重建系数、以及所述人脸姿态信息,确定所述人脸驱动图像数据的目标捏脸参数信息;所述目标捏脸参数信息用于渲染得到虚拟场景中的虚拟角色。
第三方面,本公开实施例还提供一种计算机设备,包括:处理器、存储器和总线,所 述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。
第四方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。
本公开实施例提供的脸部处理方法,首先基于人脸驱动图像数据,确定初始捏脸参数信息,然后根据初始捏脸参数信息、三维人脸重建系数、以及人脸姿态信息,确定人脸驱动图像数据的目标捏脸参数信息。上述过程中,通过增加三维人脸重建系数生成目标捏脸参数信息,既可以在一定程度上扩大捏脸自由度,又可以在一定程度上避免仅根据初始参数信息捏脸时出现捏出不合理人脸的问题;并且通过增加人脸姿态信息,可以使得生成的虚拟角色能够具有人脸驱动图像数据的人脸姿态,从而可以提高生成的虚拟角色与人脸驱动图像数据的相似度。
进一步地,本公开实施例中使用至少两种损失信息,即人脸驱动图像数据样本的第一图像特征和第一生成人脸图像的第二图像特征之间的第一损失信息,以及人脸驱动图像数据样本的第一人脸关键点信息和第二生成人脸图像的第二人脸关键点信息之间的第二损失信息,对捏脸参数预测模型进行训练,可以使得训练完成的捏脸参数预测模型预测出的捏脸参数信息更加准确可靠;并且人脸关键点信息可以是目标部位(例如眼睛、嘴)的人脸关键点信息,可以使得基于预测出来的捏脸参数信息渲染得到的虚拟角色的目标部位与人脸驱动图像数据样本中的目标部位更相似。
进一步地,本公开实施例在训练捏脸参数预测模型过程中使用的生成器可以基于捏脸参数信息、三维人脸重建模型的重建系数信息和脸部姿态信息训练得到,通过将脸部姿态信息作为输入,可以使得生成器可以在面对任意角度的面部姿态的时候,都能够较为准确地生成人脸图像,进而可以提高训练捏脸参数预测模型的准确性。
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
附图说明
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。
图1示出了本公开实施例所提供的一种脸部处理方法的流程图;
图2示出了本公开实施例所提供的捏脸参数预测模型的训练流程图;
图3示出了本公开实施例所提供的生成器的训练流程图;
图4示出了本公开实施例所提供的参数整合模型的训练流程图;
图5示出了本公开实施例所提供的另一种脸部处理方法的流程图;
图6示出了本公开实施例所提供的一种脸部处理装置的示意图;
图7示出了本公开实施例所提供的一种计算机设备的示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
在相关通过捏脸功能创建游戏角色的方案中,通常是将脸驱动图像数据输入至预先训练好的人脸识别网络或人脸分割网络中,得到捏脸参数,然后通过调整捏脸参数,渲染得到游戏角色。但是上述方案中,基于捏脸参数渲染出来的游戏角色与脸驱动图像数据仍然存在明显的差异。
基于此,本公开提供了一种脸部处理方法,首先基于人脸驱动图像数据,确定初始捏脸参数信息,然后,根据初始捏脸参数信息、三维人脸重建系数、以及人脸姿态信息,确定人脸驱动图像数据的目标捏脸参数信息。上述过程中,通过增加三维人脸重建系数生成目标捏脸参数信息,既可以在一定程度上扩大捏脸自由度,又可以在一定程度上避免仅根据初始参数信息捏脸时出现捏出不合理人脸的问题;并且通过增加人脸姿态信息,可以使得生成的虚拟角色能够具有人脸驱动图像数据的人脸姿态,从而可以提高生成的虚拟角色与人脸驱动图像数据的相似度。
针对以上方案所存在的缺陷以及所提出的解决方案,均是发明人在经过实践并仔细研究后得出的结果,因此,上述问题的发现过程以及下文中本公开针对上述问题所提出的解决方案,都应该是发明人在本公开过程中对本公开做出的贡献。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
首先需要说明的是,本公开实施例中所涉及到的人脸驱动图像数据或者人脸驱动图像数据样本,都是经控制人员授权之后使用的。
为便于对本实施例进行理解,首先对本公开实施例所公开的一种脸部处理方法进行详细介绍,本公开实施例所提供的脸部处理方法的执行主体一般为具有一定计算能力的计算机设备。
下面以执行主体为服务器为例对本公开实施例提供的脸部处理方法加以说明。
参见图1所示,为本公开实施例提供的一种脸部处理方法的流程图,所述方法包括S101~S103,其中:
S101:获取人脸驱动图像数据对应的三维人脸重建模型的三维人脸重建系数、以及人脸姿态信息;所述三维人脸重建系数包括对所述人脸驱动图像数据进行三维人脸重建时使用的各个参考三维人脸的目标基向量的权重系数。
在本公开实施例中,人脸驱动图像数据可以指包含控制人员脸部的图像。这里,可以通过对真人进行图像采集的方式,得到包含控制人员脸部的图像,例如可以通过拍照或者 录像等方式采集包含控制人员脸部的图像。这里需要说明的是,获取人脸驱动图像数据的过程可以是控制人员自己触发图像采集操作后执行的,或者是经过控制人员授权后执行的。
人脸驱动图像数据对应的三维人脸重建模型可以是利用通用的三维人脸模型得到的,例如通用的三维可变形人脸模型(3D Morphable Models,3DMM)。在3DMM中,可以利用三维特征点来表示一张人脸,这些三维特征点的位置信息可以构成对应人脸模型的网格mesh信息。其中,每个三维特征点可以由三维空间的三个方向上的基向量(1,0,0)、(0,1,0)和(0,0,1)加权得到,对于三维特征点(x,y,z)而言,三个方向上的向量的权重分别为x,y,z。
在具体实施中,人脸驱动图像数据的mesh信息可以由一张标准三维人脸(即均值人脸)的mesh信息和多张参考三维人脸的目标基向量得到。其中,目标基向量可以包括身份特征下的基向量和表情特征下的基向量。具体地,可以按照公式得到人脸驱动图像数据对应的三维人脸重建模型的mesh信息,其中,S表示人脸驱动图像数据的mesh信息,表示标准三维人脸的mesh信息,sid表示身份特征下的基向量,αi表示身份特征下的基向量的权重系数,m表示标准三维人脸的数量,sexp表示表情特征下的基向量,βj表示表情特征下的基向量的权重系数,n表示每张标准三维人脸的表情数量。这里,标准三维人脸(即均值人脸)的mesh信息和多张参考三维人脸的目标基向量可以是根据其他真实人脸的脸部扫描数据得到的。
也就是,通过利用一张标准三维人脸(即均值人脸)的mesh信息、多张参考三维人脸的身份特征下的基向量和表情特征下的基向量进行加权求和,可以得到脸部特征与人脸驱动图像数据中的脸部特征相似的三维人脸重建模型,其中,身份特征下的基向量的权重系数αi和表情特征下的基向量的权重系数βj即三维人脸重建模型的三维人脸重建系数。
在具体实施中,标准三维人脸和参考三维人脸具有的模型拓扑关系是开源模型下的模型拓扑关系,与虚拟场景中使用的人脸模型拓扑关系是不同的。在一种方式中,可以利用点云配准wrapping的方式,将具有开源模型下的模型拓扑关系的标准三维人脸的mesh信息参考三维人脸在身份特征下的基向量sid、参考三维人脸在表情特征下的基向量sexp分别对应转换到具有虚拟场景下的人脸模型拓扑关系的标准三维人脸的mesh信息参考三维人脸在身份特征下的基向量s′id、参考三维人脸在表情特征下的基向量s'exp
利用具有虚拟场景下的人脸模型拓扑关系的标准三维人脸的mesh信息参考三维人脸在身份特征下的基向量s'id、参考三维人脸在表情特征下的基向量s'exp,可以得到人脸驱动图像数据对应的、具有虚拟场景下的人脸模型拓扑关系的初始三维人脸重建模型。
在本公开实施例中,人脸姿态信息可以指人脸驱动图像数据中的人脸姿态信息。这里可以对上述得到的初始三维人脸重建模型进行旋转,在得到的三维人脸重建模型与人脸驱动图像数据中的人脸姿态一致的时候,三维人脸重建模型的旋转角度即人脸姿态信息。
最终,通过给定一张人脸驱动图像数据,得到的具有虚拟场景下的人脸模型拓扑关系的三维人脸重建模型对应的mesh信息,可以由以下公式表示: 其中,r即人脸姿态信息,可以表示为(rx,ry,rz),rx,ry,rz分别为三个方向上的旋转分量。
S102:基于所述人脸驱动图像数据,确定初始捏脸参数信息。
S103:基于所述初始捏脸参数信息、所述三维人脸重建系数、以及所述人脸姿态信息,确定所述人脸驱动图像数据的目标捏脸参数信息;所述目标捏脸参数信息用于渲染得到虚拟场景中的虚拟角色。
在具体实施中,可以将人脸驱动图像数据、三维人脸重建系数、以及人脸姿态信息输入至预先训练的脸部处理模型中,得到目标捏脸参数信息。其中,脸部处理模型包括捏脸参数预测模型和参数整合模型。捏脸参数预测模型用于基于人脸驱动图像数据生成初始捏脸参数信息;参数整合模型用于基于初始捏脸参数信息、三维人脸重建系数以及人脸姿态信息生成整合后的目标捏脸参数信息。这里,整合后的目标捏脸参数信息中是包含三维人脸重建系数的,也就是可以用整合后的目标捏脸参数信息表示三维人脸重建系数,这样,可以不用直接将三维人脸重建系数输入中游戏引擎中,避免造成渲染过程中较多的耗时。
也就是,将人脸驱动图像数据、三维人脸重建系数、以及人脸姿态信息输入至预先训练的脸部处理模型中,可以先由脸部处理模型中包含的捏脸参数预测模型基于人脸驱动图像数据生成初始捏脸参数信息,然后再由脸部处理模型中包含的参数整合模型基于初始捏脸参数信息、三维人脸重建系数、以及人脸姿态信息生成整合后的目标捏脸参数信息。
下面对脸部处理模型中的捏脸参数预测模型的训练过程进行介绍。参见图2所示的捏脸参数预测模型的训练流程图,捏脸参数预测模型通过以下步骤训练得到:
S201:提取人脸驱动图像数据样本的第一图像特征、人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息、以及人脸驱动图像数据样本对应的三维人脸重建模型的人脸样本重建系数和脸部姿态信息。
这里,第一图像特征可以指人脸驱动图像数据样本中人脸的特征。第一图像特征可以是通过人脸识别得到的。在一种实施方式中,第一图像特征可以是利用预先训练的人脸识别模型得到的,即将人脸驱动图像数据样本输入至预先训练的人脸识别模型中,得到人脸驱动图像数据样本的第一图像特征。
人脸驱动图像数据样本中的目标部位可以是预设人脸部位,例如眼睛、嘴巴、鼻子等。目标部位对应的第一人脸关键点信息可以表征目标部位的形状特征。目标部位对应的第一人脸关键点信息可以是通过人脸关键点检测得到的。在一种实施方式中,人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息可以是利用预先训练的人脸关键点检测模型得到的,即将人脸驱动图像数据样本输入至预先训练的人脸关键点检测模型中,可以得到人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息。这里,可以根据实际需求预先对人脸关键点检测模型进行训练,比如,想要使得基于目标捏脸参数信息渲染的虚拟角色的眼睛与人脸驱动图像数据样本中的眼睛更相似,这里就可以基于眼睛部位的人脸关键点信息对人脸关键点检测模型进行训练,使得训练完成的人脸关键点检测模型能够更加准确地检测出眼睛部位的人脸关键点信息。
人脸驱动图像数据样本对应的三维人脸重建模型的人脸样本重建系数和脸部姿态信息 可以根据前述重建三维人脸模型的过程,得到人脸样本重建系数和脸部姿态信息,这里不再赘述。
S202:将第一图像特征输入至待训练的捏脸参数预测模型中,得到人脸驱动图像数据样本对应的第一预测捏脸参数信息;以及,将第一人脸关键点信息输入至待训练的捏脸参数预测模型中,得到人脸驱动图像数据样本对应的第二预测捏脸参数信息。
S203:将第一预测捏脸参数信息、人脸样本重建系数和脸部姿态信息输入至预先训练的生成器中,得到第一生成人脸图像;以及,将第二预测捏脸参数信息、人脸样本重建系数和脸部姿态信息输入至预先训练的生成器中,得到第二生成人脸图像。
在本公开实施例中,预先训练的生成器能够基于捏脸参数信息、人脸样本重建系数和脸部姿态信息得到生成人脸图像。为了避免由于引入脸部姿态信息导致生成器需要适应较大的图片变化的问题以及基于脸部姿态信息生成的图片内容变化较大的问题,因此在具体实施中,可以在对生成器进行训练的时候,可以先将捏脸参数信息对应的骨骼参数信息确定出来,然后通过蒙皮处理得到mesh信息中各个特征点的最终位置,接下来利用可微渲染引擎得到渲染结果,然后再将可微渲染引擎得到的渲染结果处理为3D引擎的渲染结果。生成器的训练过程将在下文进行详述。
S204:基于第二生成人脸图像的第二图像特征以及第一图像特征,确定第一损失信息;以及,基于第二生成人脸图像的第二人脸关键点信息以及第一人脸关键点信息,确定第二损失信息。
在本公开实施例中,第二图像特征可以指第二生成人脸图像中人脸的特征。在一种实施方式中,第二图像特征也可以是利用预先训练的人脸识别模型得到的,即将第二生成人脸图像输入至预先训练的人脸识别模型中,得到第二生成人脸图像的第二图像特征。
在一种方式中,可以基于余弦损失函数计算第二图像特征与第一图像特征之间的第一损失信息。这里,可以记第一图像特征为第二图像特征为则第一损失信息为
第二人脸关键点信息可以为第二生成人脸图像中目标部位的关键点信息。第二生成人脸图像中的目标部位是与人脸驱动图像数据样本中的目标部位相同的人脸部位。
在一种实施方式中,可以先对第二预测捏脸参数信息、人脸样本重建系数和脸部姿态信息进行蒙皮处理,得到第二生成人脸图像对应的网格mesh信息;然后基于mesh信息和预设相机参数信息,确定第二生成人脸图像对应的第二人脸关键点信息。
这里,主要是对第二预测捏脸参数信息进行蒙皮计算,得到第二预测捏脸参数信息对应的骨骼参数信息。然后根据骨骼参数信息、人脸样本重建系数和脸部姿态信息得到第二生成人脸图像对应的网格mesh信息。之后,可以在第二生成人脸图像对应的网格mesh信息中标注出目标部位对应的目标特征点。然后,根据标注的目标特征点和预设相机参数信息,可以对网格mesh信息进行投影,得到目标特征点在第二生成人脸图像上的位置信息,即第二生成人脸图像对应的第二人脸关键点信息。在一种实施方式中,可以记第一人脸关键点信息为第二人脸关键点信息为则第二损失信息为
S205:基于第一损失信息和第二损失信息,调整待训练的捏脸参数预测模型中的权重参数信息,得到训练好的捏脸参数预测模型。
这里可以对第一损失信息和第二损失信息进行加权求和,得到L=w1L1+w2L2,通过调整捏脸参数预测模型中的权重参数信息,得到w1和w2的最优解,从而得到训练好的捏脸参数预测模型。
为了提高捏脸参数预测模型的预测准确度,在一种实施方式中,在对捏脸参数预测模型的训练过程中还可以:获取人脸驱动图像数据样本的第一脸部区域图像;然后将第一脸部区域图像输入至待训练的捏脸参数预测模型中,得到人脸驱动图像数据样本对应的第三预测捏脸参数信息;接下来,将第三预测捏脸参数信息、人脸样本重建系数和脸部姿态信息输入至预先训练的生成器中,得到第三生成人脸图像;接下来,基于第三生成人脸图像的第二脸部区域图像的像素信息和第一脸部区域图像的像素信息,确定第三损失信息。
在上述过程中,第一脸部区域图像可以是通过图像分割得到,具体地,可以将人脸驱动图像数据样本输入至预先训练的人脸分割模型中,得到人脸驱动图像数据样本的第一脸部区域图像。
利用预先训练的生成器生成第三生成人脸图像的过程可以参照前述过程,这里不再赘述。
第三生成人脸图像的第二脸部区域图像可以是将第三生成人脸图像输入至预先训练的人脸分割模型中得到的。然后,通过第二脸部区域图像中各个像素点的像素值信息以及第一脸部区域图像中各个像素点的像素值信息,可以确定第三损失信息。
在得到第三损失信息之后,可以基于第一损失信息、第二损失信息和第三损失信息,调整待训练的捏脸参数预测模型中的权重参数信息,得到训练好的捏脸参数预测模型。这里,可以对第一损失信息、第二损失信息和第三损失信息进行加权求和,得到总的损失信息,然后根据总的损失信息调整待训练的捏脸参数预测模型中的权重参数信息。
承接前文,下面对捏脸参数预测模型训练过程中使用到的生成器的训练过程进行详述。参见图3所示的生成器的训练流程图,在具体实施中,生成器中可以包括像素到像素(Pixel-to-Pixel)模型,训练生成器的过程主要就是训练像素到像素模型的过程,这里,生成器通过以下步骤训练得到:
S301:获取多个参数样本;各个参数样本中包括捏脸参数信息、三维人脸重建模型的重建系数信息和脸部姿态信息。
这里,参数样本可以是通过均匀采样得到的。这里,可以分别设定捏脸参数信息、三维人脸重建模型的重建系数信息和脸部姿态信息对应的采样范围,例如三维人脸重建模型的重建系数信息对应的采样范围可以为-3到3,脸部姿态信息在第一方向(左右方向)上的采样范围可以为-15度到15度,即人脸的左右摆动幅度为15度,脸部姿态信息在第二方向(上下方向,即上下摆动)上的采样范围可以为-40度到40度,即人脸的上下摆动幅度为40度,捏脸参数信息对应的采样范围为0到1。
S302:分别将各个参数样本中的捏脸参数信息输入至游戏引擎中,得到第四生成人脸图像。
S303:分别对各个参数样本进行蒙皮处理,得到蒙皮处理后的mesh信息。
这里,主要是对参数样本中的捏脸参数信息进行蒙皮计算,得到对应的骨骼参数信息,从而根据骨骼参数信息、三维人脸重建模型的重建系数信息和脸部姿态信息,得到第四生成人脸图像对应的三维人脸模型的mesh信息。
S304:对各个蒙皮处理后的mesh信息进行可微渲染,得到第五生成人脸图像。
这里,可以预先设置好脸部贴图、相机参数以及光照参数等信息,通过可微渲染,得到第五生成人脸图像。第五生成人脸图像是与第四生成人脸图像的人脸形状相似的图像,但是存在像素差异。
S305:将第五生成人脸图像输入至待训练的像素到像素模型中,得到第六生成人脸图像。
S306:针对各个参数样本,基于该参数样本得到的第四生成人脸图像的像素信息和第六生成人脸图像的像素信息,确定感知损失信息。
这里,感知损失信息Perceptual Loss,可以为像素之间的损失信息,即第四生成人脸图像的像素信息和第六生成人脸图像的像素信息之间的损失信息。针对每个参数样本,可以得到该参数样本对应的感知损失信息。
S307:基于感知损失信息,对像素到像素模型的模型参数信息进行调整,得到训练好的像素到像素模型。
训练好的像素到像素模型能够对需要进行像素处理的人脸图像进行处理,得到像素信息与人脸驱动图像数据的像素信息更相似的人脸图像,即可以将可微渲染得到的图像处理成与游戏引擎渲染得到的图像一致的效果。
通过上述训练得到的生成器即可应用在捏脸参数预测模型的训练过程中。
下面对脸部处理模型中的参数整合模型的训练过程进行介绍。参见图4所示的参数整合模型的训练流程图,参数整合模型通过以下步骤训练得到:
S401:获取多个三维人脸重建模型的mesh信息样本。
在本公开实施例中,可以对多张人脸驱动图像数据样本进行三维人脸重建,从而可以得到多个三维人脸重建模型的mesh信息样本。
S402:分别将多个mesh信息样本输入至待训练的参数整合模型中,得到整合后的捏脸参数信息。
S403:基于整合后的捏脸参数信息和标准三维人脸模型的标准mesh信息,确定三维人脸重建模型的重建mesh信息。
这里,可以对整合后的捏脸参数信息进行蒙皮处理,得到对应的骨骼参数信息,然后利用骨骼参数信息和标准三维人脸模型的标准mesh信息,得到三维人脸重建模型的重建mesh信息。
S404:针对各个mesh信息样本,基于该mesh信息样本对应的重建mesh信息和该mesh信息样本,确定mesh损失信息。
通过mesh信息样本和对应的重建mesh信息,可以确定mesh损失信息。针对每个mesh信息样本,分别确定该mesh信息样本的mesh损失信息。这里,可以记mesh信息样本为S,记mesh信息样本对应的重建mesh信息为S′,则mesh损失信息可以为Lm=||S′-S||。
S405:基于mesh损失信息,调整参数整合模型的模型参数信息,得到训练好的参数整合模型。
参见图5示出的另一种脸部处理方法的流程图,将得到的人脸驱动图像数据输入到预先训练的人脸关键点检测模型中,得到眼睛部位和嘴巴部位的第一关键点信息。然后根据人脸驱动图像数据和第一关键点信息进行三维人脸重建得到三维人脸重建模型的三维人脸重建系数以及人脸姿态信息。三维人脸重建系数以及人脸姿态信息构成人脸驱动图像数据对应的三维人脸重建模型的mesh信息。
将三维人脸重建系数以及人脸姿态信息输入至训练完成的生成器中,得到生成人脸图像。然后,根据第一关键点信息在mesh信息中标注出眼睛部位和嘴巴部位的各个关键点的位置信息。然后,根据预先设置好脸部贴图、相机参数以及光照参数等信息,将mesh信息投影在生成人脸图像上,得到各个关键点在生成人脸图像上的位置信息,即生成人脸图像的第二关键点信息。然后,根据第一关键点信息和第二关键点信息,将人脸驱动图像数据与生成人脸图像进行对齐。
接下来,将对齐后的生成人脸图像输入至预先训练的人脸识别模型中,得到生成人脸图像的第一图像特征。将第一图像特征输入至训练完成的捏脸参数预测模型中,根据第一图像特征、三维人脸重建系数以及人脸姿态信息,得到生成人脸图像对应的第一捏脸参数信息。
将生成人脸图像输入至预先训练的人脸关键点检测模型中,得到眼睛部位和嘴巴部位的第二关键点信息,根据第二关键点信息、三维人脸重建系数以及人脸姿态信息,得到第二捏脸参数信息。
然后对第一捏脸参数信息和第二捏脸参数信息进行融合,得到初始捏脸参数信息,然后将初始捏脸参数信息、三维人脸重建系数以及人脸姿态信息输入至训练完成的参数整合模型,得到整合后的目标捏脸参数信息。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
基于同一发明构思,本公开实施例中还提供了与脸部处理方法对应的脸部处理装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述脸部处理方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。
参照图6所示,为本公开实施例提供的一种脸部处理装置的架构示意图,所述装置包括:第一获取模块601、第一确定模块602、第二确定模块603;其中,
第一获取模块601,用于获取人脸驱动图像数据对应的三维人脸重建模型的三维人脸重建系数、以及人脸姿态信息;所述三维人脸重建系数包括对所述人脸驱动图像数据进行三维人脸重建时使用的各个参考三维人脸的目标基向量的权重系数;
第一确定模块602,用于基于所述人脸驱动图像数据,确定初始捏脸参数信息;
第二确定模块603,用于基于所述初始捏脸参数信息、所述三维人脸重建系数、以及所述人脸姿态信息,确定所述人脸驱动图像数据的目标捏脸参数信息;所述目标捏脸参数信息用于渲染得到虚拟场景中的虚拟角色。
一种可选的实施方式中,所述目标捏脸参数信息是利用预先训练的脸部处理模型得到的;
所述脸部处理模型包括捏脸参数预测模型和参数整合模型;
所述捏脸参数预测模型用于基于所述人脸驱动图像数据生成初始捏脸参数信息;所述参数整合模型用于基于所述初始捏脸参数信息、所述三维人脸重建系数以及所述人脸姿态信息生成整合后的所述目标捏脸参数信息。
一种可选的实施方式中,所述装置还包括:
提取模块,用于提取人脸驱动图像数据样本的第一图像特征、所述人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息、以及所述人脸驱动图像数据样本对应的三维人脸重建模型的人脸样本重建系数和脸部姿态信息;
第一输入模块,用于将所述第一图像特征输入至待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第一预测捏脸参数信息;以及,将所述第一人脸关键点信息输入至所述待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第二预测捏脸参数信息;
第二输入模块,用于将所述第一预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至预先训练的生成器中,得到第一生成人脸图像;以及,将所述第二预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至所述预先训练的生成器中,得到第二生成人脸图像;
第三确定模块,用于基于所述第二生成人脸图像的第二图像特征以及所述第一图像特征,确定第一损失信息;以及,基于所述第二生成人脸图像的第二人脸关键点信息以及所述第一人脸关键点信息,确定第二损失信息;
第一调整模块,用于基于所述第一损失信息和所述第二损失信息,调整所述待训练的捏脸参数预测模型中的权重参数信息,得到训练好的捏脸参数预测模型。
一种可选的实施方式中,提取模块,具体用于:
将所述人脸驱动图像数据样本输入至预先训练的人脸识别模型中,得到所述人脸驱动图像数据样本的第一图像特征;
在所述第三确定模块基于所述第二生成人脸图像的第二图像特征以及所述第一图像特征,确定第一损失信息之前,所述装置还包括:
第三输入模块,用于将所述第二生成人脸图像输入至所述预先训练的人脸识别模型中,得到所述第二生成人脸图像的第二图像特征。
一种可选的实施方式中,提取模块,具体用于:
将所述人脸驱动图像数据样本输入至预先训练的人脸关键点检测模型中,得到所述人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息;
在所述第三确定模块基于所述第二生成人脸图像的第二人脸关键点信息以及所述第一人脸关键点信息,确定第二损失信息之前,所述装置还包括:
第一处理模块,用于对所述第二预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息进行蒙皮处理,得到所述第二生成人脸图像对应的网格mesh信息;所述mesh信息包括所述第二生成人脸图像对应的三维人脸重建模型中各个特征点的位置信息;
第四确定模块,用于基于所述mesh信息和预设相机参数信息,确定所述第二生成人脸图像对应的所述第二人脸关键点信息。
一种可选的实施方式中,所述装置还包括:
第二获取模块,用于获取所述人脸驱动图像数据样本的第一脸部区域图像;
第四输入模块,用于将所述第一脸部区域图像输入至所述待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第三预测捏脸参数信息;
第五输入模块,用于将所述第三预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至所述预先训练的生成器中,得到第三生成人脸图像;
第五确定模块,用于基于所述第三生成人脸图像的第二脸部区域图像的像素信息和所述第一脸部区域图像的像素信息,确定第三损失信息;
第一调整模块,具体用于:
基于所述第一损失信息、所述第二损失信息和所述第三损失信息,调整所述待训练的捏脸参数预测模型中的权重参数信息,得到训练好的捏脸参数预测模型。
一种可选的实施方式中,第二获取模块,具体用于:
将所述人脸驱动图像数据样本输入至预先训练的人脸分割模型中,得到所述人脸驱动图像数据样本的第一脸部区域图像;
在第五确定模块基于所述第三生成人脸图像的第二脸部区域图像的像素信息和所述第一脸部区域图像的像素信息,确定第三损失信息之前,所述装置还包括:
第六输入模块,用于将所述第三生成人脸图像输入至所述预先训练的人脸分割模型中,得到所述第三生成人脸图像的第二脸部区域图像。
一种可选的实施方式中,所述预先训练的生成器包括预先训练的像素到像素模型;所述装置还包括:
第三获取模块,用于获取多个参数样本;各个所述参数样本中包括捏脸参数信息、三维人脸重建模型的重建系数信息和脸部姿态信息;
第七输入模块,用于分别将各个所述参数样本中的捏脸参数信息输入至游戏引擎中,得到第四生成人脸图像;
第二处理模块,用于分别对各个所述参数样本进行蒙皮处理,得到蒙皮处理后的mesh信息;
渲染模块,用于对各个所述蒙皮处理后的mesh信息进行可微渲染,得到第五生成人脸图像;
第八输入模块,用于将所述第五生成人脸图像输入至待训练的像素到像素模型中,得到第六生成人脸图像;
第六确定模块,用于针对各个所述参数样本,基于该参数样本得到的所述第四生成人脸图像的像素信息和所述第六生成人脸图像的像素信息,确定感知损失信息;
第二调整模块,用于基于所述感知损失信息,对所述像素到像素模型的模型参数信息进行调整,得到训练好的像素到像素模型。
一种可选的实施方式中,所述装置还包括:
第四获取模块,用于获取多个三维人脸重建模型的mesh信息样本;
第九输入模块,用于分别将所述多个mesh信息样本输入至待训练的参数整合模型中,得到整合后的捏脸参数信息;
第七确定模块,用于基于所述整合后的捏脸参数信息和标准三维人脸模型的标准mesh信息,确定所述三维人脸重建模型的重建mesh信息;
第八确定模块,用于针对各个所述mesh信息样本,基于该mesh信息样本对应的重建mesh信息和该mesh信息样本,确定mesh损失信息;
第三调整模块,用于基于所述mesh损失信息,调整所述参数整合模型的模型参数信息,得到训练好的参数整合模型。
关于装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。
基于同一技术构思,本公开实施例还提供了一种计算机设备。参照图7所示,为本公开实施例提供的计算机设备700的结构示意图,包括处理器701、存储器702、和总线703。其中,存储器702用于存储执行指令,包括内存7021和外部存储器7022;这里的内存7021也称内存储器,用于暂时存放处理器701中的运算数据,以及与硬盘等外部存储器7022交换的数据,处理器701通过内存7021与外部存储器7022进行数据交换,当计算机设备700运行时,处理器701与存储器702之间通过总线703通信,使得处理器701在执行以下指令:
获取人脸驱动图像数据对应的三维人脸重建模型的三维人脸重建系数、以及人脸姿态信息;所述三维人脸重建系数包括对所述人脸驱动图像数据进行三维人脸重建时使用的各个参考三维人脸的目标基向量的权重系数;
基于所述人脸驱动图像数据,确定初始捏脸参数信息;
基于所述初始捏脸参数信息、所述三维人脸重建系数、以及所述人脸姿态信息,确定所述人脸驱动图像数据的目标捏脸参数信息;所述目标捏脸参数信息用于渲染得到虚拟场景中的虚拟角色。
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的脸部处理方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。
本公开实施例还提供一种计算机程序产品,该计算机产品承载有程序代码,所述程序代码包括的指令可用于执行上述方法实施例中所述的脸部处理方法的步骤,具体可参见上述方法实施例,在此不再赘述。
其中,上述计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实 际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以所述权利要求的保护范围为准。

Claims (13)

  1. 一种脸部处理方法,其特征在于,包括:
    获取人脸驱动图像数据、所述人脸驱动图像数据对应的三维人脸重建模型的三维人脸重建系数、以及人脸姿态信息;所述三维人脸重建系数包括对所述人脸驱动图像数据进行三维人脸重建时使用的各个参考三维人脸的目标基向量的权重系数;
    基于所述人脸驱动图像数据,确定初始捏脸参数信息;
    基于所述初始捏脸参数信息、所述三维人脸重建系数、以及所述人脸姿态信息,确定所述人脸驱动图像数据的目标捏脸参数信息;所述目标捏脸参数信息用于渲染得到虚拟场景中的虚拟角色。
  2. 根据权利要求1所述的方法,其特征在于,所述目标捏脸参数信息是利用预先训练的脸部处理模型得到的;
    所述脸部处理模型包括捏脸参数预测模型和参数整合模型;
    所述捏脸参数预测模型用于基于所述人脸驱动图像数据生成初始捏脸参数信息;所述参数整合模型用于基于所述初始捏脸参数信息、所述三维人脸重建系数以及所述人脸姿态信息生成整合后的所述目标捏脸参数信息。
  3. 根据权利要求2所述的方法,其特征在于,所述捏脸参数预测模型通过以下步骤训练得到:
    提取人脸驱动图像数据样本的第一图像特征、所述人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息、以及所述人脸驱动图像数据样本对应的三维人脸重建模型的人脸样本重建系数和脸部姿态信息;
    将所述第一图像特征输入至待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第一预测捏脸参数信息;以及,将所述第一人脸关键点信息输入至所述待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第二预测捏脸参数信息;
    将所述第一预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至预先训练的生成器中,得到第一生成人脸图像;以及,将所述第二预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至所述预先训练的生成器中,得到第二生成人脸图像;
    基于所述第二生成人脸图像的第二图像特征以及所述第一图像特征,确定第一损失信息;以及,基于所述第二生成人脸图像的第二人脸关键点信息以及所述第一人脸关键点信息,确定第二损失信息;
    基于所述第一损失信息和所述第二损失信息,调整所述待训练的捏脸参数预测模型中的权重参数信息,得到完成训练的捏脸参数预测模型。
  4. 根据权利要求3所述的方法,其特征在于,所述提取人脸驱动图像数据样本的第一图像特征,包括:
    将所述人脸驱动图像数据样本输入至预先训练的人脸识别模型中,得到所述人脸驱动图像数据样本的第一图像特征;
    基于所述第二生成人脸图像的第二图像特征以及所述第一图像特征,确定第一损失信息之前,所述方法还包括:
    将所述第二生成人脸图像输入至所述预先训练的人脸识别模型中,得到所述第二生成人脸图像的第二图像特征。
  5. 根据权利要求3所述的方法,其特征在于,所述提取所述人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息,包括:
    将所述人脸驱动图像数据样本输入至预先训练的人脸关键点检测模型中,得到所述人脸驱动图像数据样本中目标部位对应的第一人脸关键点信息;
    所述基于所述第二生成人脸图像的第二人脸关键点信息以及所述第一人脸关键点信息,确定第二损失信息之前,所述方法还包括:
    对所述第二预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息进行蒙皮处理,得到所述第二生成人脸图像对应的网格mesh信息;所述mesh信息包括所述第二生成人脸图像对应的三维人脸重建模型中各个特征点的位置信息;
    基于所述mesh信息和预设相机参数信息,确定所述第二生成人脸图像对应的所述第二人脸关键点信息。
  6. 根据权利要求3所述的方法,其特征在于,对所述捏脸参数预测模型进行训练的步骤还包括:
    获取所述人脸驱动图像数据样本的第一脸部区域图像;
    将所述第一脸部区域图像输入至所述待训练的捏脸参数预测模型中,得到所述人脸驱动图像数据样本对应的第三预测捏脸参数信息;
    将所述第三预测捏脸参数信息、所述人脸样本重建系数和所述脸部姿态信息输入至所述预先训练的生成器中,得到第三生成人脸图像;
    基于所述第三生成人脸图像的第二脸部区域图像的像素信息和所述第一脸部区域图像的像素信息,确定第三损失信息;
    所述基于所述第一损失信息和所述第二损失信息,调整所述待训练的捏脸参数预测模型中的权重参数信息,得到完成训练的捏脸参数预测模型,包括:
    基于所述第一损失信息、所述第二损失信息和所述第三损失信息,调整所述待训练的捏脸参数预测模型中的权重参数信息,得到完成训练的捏脸参数预测模型。
  7. 根据权利要求6所述的方法,其特征在于,所述获取所述人脸驱动图像数据样本的第一脸部区域图像,包括:
    将所述人脸驱动图像数据样本输入至预先训练的人脸分割模型中,得到所述人脸驱动图像数据样本的第一脸部区域图像;
    所述基于所述第三生成人脸图像的第二脸部区域图像的像素信息和所述第一脸部区域图像的像素信息,确定第三损失信息之前,所述方法还包括:
    将所述第三生成人脸图像输入至所述预先训练的人脸分割模型中,得到所述第三生成人脸图像的第二脸部区域图像。
  8. 根据权利要求3至7任一项所述的方法,其特征在于,所述预先训练的生成器包括预先训练的像素到像素模型;所述像素到像素模型通过以下步骤训练得到:
    获取多个参数样本;各个所述参数样本中包括捏脸参数信息、三维人脸重建模型的重建系数信息和脸部姿态信息;
    分别将各个所述参数样本中的捏脸参数信息输入至游戏引擎中,得到第四生成人脸图像;
    分别对各个所述参数样本进行蒙皮处理,得到蒙皮处理后的mesh信息;
    对各个所述蒙皮处理后的mesh信息进行可微渲染,得到第五生成人脸图像;
    将所述第五生成人脸图像输入至待训练的像素到像素模型中,得到第六生成人脸图像;
    针对各个所述参数样本,基于该参数样本得到的所述第四生成人脸图像的像素信息和所述第六生成人脸图像的像素信息,确定感知损失信息;
    基于所述感知损失信息,对所述像素到像素模型的模型参数信息进行调整,得到完成训练的像素到像素模型。
  9. 根据权利要求2所述的方法,其特征在于,所述参数整合模型通过以下步骤训练得到:
    获取多个三维人脸重建模型的mesh信息样本;
    分别将所述多个mesh信息样本输入至待训练的参数整合模型中,得到整合后的捏脸参数信息;
    基于所述整合后的捏脸参数信息和标准三维人脸模型的标准mesh信息,确定所述三维人脸重建模型的重建mesh信息;
    针对各个所述mesh信息样本,基于该mesh信息样本对应的重建mesh信息和该mesh信息样本,确定mesh损失信息;
    基于所述mesh损失信息,调整所述参数整合模型的模型参数信息,得到完成训练的参数整合模型。
  10. 一种脸部处理装置,其特征在于,包括:
    第一获取模块,用于获取人脸驱动图像数据、所述人脸驱动图像数据对应的三维人脸重建模型的三维人脸重建系数、以及人脸姿态信息;所述三维人脸重建系数包括对所述人脸驱动图像数据进行三维人脸重建时使用的各个参考三维人脸的目标基向量的权重系数;
    第一确定模块,用于基于所述人脸驱动图像数据,确定初始捏脸参数信息;
    第二确定模块,用于基于所述初始捏脸参数信息、所述三维人脸重建系数、以及所述人脸姿态信息,确定所述人脸驱动图像数据的目标捏脸参数信息;所述目标捏脸参数信息用于渲染得到虚拟场景中的虚拟角色。
  11. 一种计算机设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至9任一项所述的脸部处理方法的步骤。
  12. 一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至9任一项所述的脸部处理方法的步骤。
  13. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序或指令,所述计算机程序或所述指令被处理器执行时实现如权利要求1至9任一项所述脸部处理方法的步骤。
PCT/CN2023/080028 2022-03-30 2023-03-07 一种脸部处理方法、装置、计算机设备及存储介质 WO2023185398A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210325620.7A CN114677476A (zh) 2022-03-30 2022-03-30 一种脸部处理方法、装置、计算机设备及存储介质
CN202210325620.7 2022-03-30

Publications (1)

Publication Number Publication Date
WO2023185398A1 true WO2023185398A1 (zh) 2023-10-05

Family

ID=82076853

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/080028 WO2023185398A1 (zh) 2022-03-30 2023-03-07 一种脸部处理方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN114677476A (zh)
WO (1) WO2023185398A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114677476A (zh) * 2022-03-30 2022-06-28 北京字跳网络技术有限公司 一种脸部处理方法、装置、计算机设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008873A (zh) * 2019-04-25 2019-07-12 北京华捷艾米科技有限公司 面部表情捕捉方法、系统及设备
CN110717977A (zh) * 2019-10-23 2020-01-21 网易(杭州)网络有限公司 游戏角色脸部处理的方法、装置、计算机设备及存储介质
CN111632374A (zh) * 2020-06-01 2020-09-08 网易(杭州)网络有限公司 游戏中虚拟角色的脸部处理方法、装置及可读存储介质
US20210043000A1 (en) * 2019-05-15 2021-02-11 Zhejiang Sensetime Technology Development Co., Ltd. Method, apparatus and device for processing deformation of virtual object, and storage medium
CN114219896A (zh) * 2021-12-17 2022-03-22 芜湖叠纸网络科技有限公司 一种虚拟角色生成系统及方法
CN114677476A (zh) * 2022-03-30 2022-06-28 北京字跳网络技术有限公司 一种脸部处理方法、装置、计算机设备及存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020037676A1 (zh) * 2018-08-24 2020-02-27 太平洋未来科技(深圳)有限公司 三维人脸图像生成方法、装置及电子设备
KR20210104107A (ko) * 2019-03-18 2021-08-24 베이징 센스타임 테크놀로지 디벨롭먼트 컴퍼니 리미티드 주시 영역 검출 방법, 장치 및 전자 디바이스

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008873A (zh) * 2019-04-25 2019-07-12 北京华捷艾米科技有限公司 面部表情捕捉方法、系统及设备
US20210043000A1 (en) * 2019-05-15 2021-02-11 Zhejiang Sensetime Technology Development Co., Ltd. Method, apparatus and device for processing deformation of virtual object, and storage medium
CN110717977A (zh) * 2019-10-23 2020-01-21 网易(杭州)网络有限公司 游戏角色脸部处理的方法、装置、计算机设备及存储介质
CN111632374A (zh) * 2020-06-01 2020-09-08 网易(杭州)网络有限公司 游戏中虚拟角色的脸部处理方法、装置及可读存储介质
CN114219896A (zh) * 2021-12-17 2022-03-22 芜湖叠纸网络科技有限公司 一种虚拟角色生成系统及方法
CN114677476A (zh) * 2022-03-30 2022-06-28 北京字跳网络技术有限公司 一种脸部处理方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN114677476A (zh) 2022-06-28

Similar Documents

Publication Publication Date Title
US20210232924A1 (en) Method for training smpl parameter prediction model, computer device, and storage medium
CN110717977B (zh) 游戏角色脸部处理的方法、装置、计算机设备及存储介质
WO2020103700A1 (zh) 一种基于微表情的图像识别方法、装置以及相关设备
KR102103939B1 (ko) 머리 회전을 갖는 아바타 얼굴 표정 애니메이션
WO2021184933A1 (zh) 一种人体三维模型重建方法
EP3992919B1 (en) Three-dimensional facial model generation method and apparatus, device, and medium
WO2016161553A1 (en) Avatar generation and animations
WO2021004257A1 (zh) 视线检测和视频处理的方法、装置、设备和存储介质
WO2022143645A1 (zh) 三维人脸重建的方法、装置、设备和存储介质
CN116109798B (zh) 图像数据处理方法、装置、设备及介质
CN113628327B (zh) 一种头部三维重建方法及设备
US11475608B2 (en) Face image generation with pose and expression control
WO2021063271A1 (zh) 人体模型重建方法、重建系统及存储介质
US11514638B2 (en) 3D asset generation from 2D images
WO2023185395A1 (zh) 一种面部表情捕捉方法、装置、计算机设备及存储介质
WO2023185398A1 (zh) 一种脸部处理方法、装置、计算机设备及存储介质
WO2024103890A1 (zh) 模型构建方法、重建方法、装置、电子设备及非易失性可读存储介质
WO2023066120A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2023160350A1 (zh) 一种脸部处理方法、装置、计算机设备及存储介质
CN111950430A (zh) 基于颜色纹理的多尺度妆容风格差异度量及迁移方法、系统
WO2023030381A1 (zh) 三维人头重建方法、装置、设备及介质
CN114202615A (zh) 人脸表情的重建方法、装置、设备和存储介质
WO2022179603A1 (zh) 一种增强现实方法及其相关设备
CN117132711A (zh) 一种数字人像定制方法、装置、设备及存储介质
CN115631285B (zh) 基于统一驱动的人脸渲染方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23777776

Country of ref document: EP

Kind code of ref document: A1