WO2022016996A1 - 图像处理方法、装置、电子设备及计算机可读存储介质 - Google Patents

图像处理方法、装置、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2022016996A1
WO2022016996A1 PCT/CN2021/096713 CN2021096713W WO2022016996A1 WO 2022016996 A1 WO2022016996 A1 WO 2022016996A1 CN 2021096713 W CN2021096713 W CN 2021096713W WO 2022016996 A1 WO2022016996 A1 WO 2022016996A1
Authority
WO
WIPO (PCT)
Prior art keywords
face image
face
person
synthetic
character
Prior art date
Application number
PCT/CN2021/096713
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 WO2022016996A1 publication Critical patent/WO2022016996A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/174Facial expression recognition

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to an image processing method, apparatus, electronic device, and computer-readable storage medium.
  • Image generation is an information processing capability that has become increasingly popular in recent years. Image generation involves many aspects, among which, face image generation is a very important research field. Its main purpose is to generate a face image of sufficient quality for commercial use or experimental use, or to generate a face image that meets the constraints according to the user's constraints.
  • the embodiments of the present application provide an image processing method, an apparatus, an electronic device, and a computer-readable storage medium, which can improve the quality of a generated face image.
  • an embodiment of the present application provides an image processing method, including:
  • the set of face images comprising a face image of a first character, a face image of a specified gesture of a second character, and a face image of a specified expression of a third character;
  • first face feature set includes the facial features of the first person and the posture of the second person characteristics and the facial expression characteristics of the third person;
  • an image processing apparatus including:
  • an acquisition module configured to acquire a face image collection, the face image collection comprising the face image of the first character, the face image of the specified posture of the second character and the face image of the specified expression of the third character;
  • a processing module configured to perform feature extraction on each face image in the face image set to obtain a first face feature set, where the first face feature set includes the facial features of the first person, the The posture feature of the second character and the facial expression feature of the third character;
  • the processing module is further configured to perform face synthesis according to the first face feature set to obtain a synthetic face image of the first character, and the synthetic face image of the first character has the first character
  • the facial features of the second character, the posture features of the second character, and the facial expression features of the third character are further configured to perform face synthesis according to the first face feature set to obtain a synthetic face image of the first character, and the synthetic face image of the first character has the first character
  • the facial features of the second character, the posture features of the second character, and the facial expression features of the third character are further configured to perform face synthesis according to the first face feature set to obtain a synthetic face image of the first character, and the synthetic face image of the first character has the first character
  • the facial features of the second character, the posture features of the second character, and the facial expression features of the third character are further configured to perform face synthesis according to the first face feature set to obtain a synthetic face image of the first character, and the synthetic face image of the first character has the first character
  • an embodiment of the present application provides an electronic device, including a processor and a memory, where the processor and the memory are connected to each other, wherein the memory is used to store a computer program, and the computer program includes program instructions , the processor is configured to invoke the program instructions to perform the following method:
  • the set of face images comprising a face image of a first character, a face image of a specified gesture of a second character, and a face image of a specified expression of a third character;
  • first face feature set includes the facial features of the first person and the posture of the second person characteristics and the facial expression characteristics of the third person;
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following method:
  • the set of face images comprising a face image of a first character, a face image of a specified gesture of a second character, and a face image of a specified expression of a third character;
  • first face feature set includes the facial features of the first person and the posture of the second person characteristics and the facial expression characteristics of the third person;
  • the embodiments of the present application are aimed at the problems of low image quality caused by insufficient facial editing, insufficient expression of facial expressions, or relatively single image content, etc. generated by generating face images.
  • Multi-angle face expression images can improve the quality of the generated face images.
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of another image processing method provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the technical solutions of the present application may relate to the technical field of artificial intelligence, and can be applied to scenarios such as image processing, such as scenarios that can be specifically used to generate face images, so as to improve the quality of the generated face images, thereby promoting the construction of smart cities .
  • the data involved in this application such as various images and/or features, may be stored in a database, or may be stored in a blockchain, which is not limited in this application.
  • the embodiments of the present application provide An image processing scheme, which can be applied in application scenarios such as beauty, motion picture synthesis, video production, virtual character fabrication (such as virtual game character fabrication), etc. Through this image processing scheme, face transformation can be achieved. , face editing and other effects.
  • the image processing solution described in the embodiments of the present application is specifically: acquiring a face image set, where the face image set includes a face image of a first person, a face image of a specified pose of a second person, and a specified expression of a third person face image; perform feature extraction on each face image in the face image set to obtain a first face feature set, and the first face feature set includes the facial features of the first character, the facial features of the second character.
  • the gesture feature and the facial expression feature of the third character perform face synthesis according to the first face feature set to obtain a synthetic face image of the first character, and the synthetic face image of the first character has the Facial features, gesture features of the second character, and facial expression features of the third character.
  • the above process can generate faces with different expressions from multiple angles, and can meet certain image quality requirements while editing face attributes with certain accuracy.
  • the user can upload the frontal photo of character A, the side of character B, such as the photo turned 60° to the right and the facial expression photo of character B to the electronic device, and then use the above-mentioned image processing scheme, Then a photo with an expression on the side of person A can be synthesized, and the expression here is the expression corresponding to the expression photo of person B.
  • Person A can be the user himself or someone else.
  • the user can upload the frontal photo of person A to the electronic device, and select the profile photo of person B and the facial expression photo of person B from multiple photos provided by the electronic device for face synthesis, and then The user can submit the composition instruction to the electronic device by clicking the composition button. After detecting the composition instruction, the electronic device can obtain the frontal photo of the person A, the side photo of the person B, and the expression photo of the person B, and then use the above-mentioned image processing. If the solution is adopted, a photo with an expression on the side of person A can be synthesized, and the expression here is the expression corresponding to the expression photo of person B.
  • the electronic device may provide a user with a face synthesis interface, so that the user can set a face image set based on the face synthesis interface, such as setting a frontal photo of character A, a profile photo of character B, and the expression of character B Photo.
  • the face synthesis interface may include a synthesis button, the user may submit a synthesis instruction to the electronic device by clicking the synthesis button, and the electronic device may acquire the face image set after detecting the synthesis instruction.
  • the synthesizing instruction may carry a set of face images, such as a frontal photo of person A, a profile photo of person B, and an expression photo of person B.
  • the synthetic face image of the first person in order to avoid the situation of using the synthetic face image to pretend to be a real face for crime, can be written into the blockchain, so as to achieve the goal of correcting the synthetic face image.
  • the electronic device may write the synthetic face image of the first person and the identification of the user requesting to synthesize the synthetic face image or the device information of the user terminal corresponding to the user into the blockchain.
  • the identifier of the user for example, may be the user's account number or the user's mobile phone number, etc., which may be used to uniquely identify the user.
  • the device information of the user terminal may be, for example, information used to uniquely identify the user terminal, such as the physical address, device number, and internet protocol address of the user terminal.
  • the electronic device referred to in the embodiment of the present application may be a user terminal corresponding to the user, or may not be.
  • the electronic device may write the corrected synthetic face image of the first person into the blockchain.
  • a digest calculation may also be performed on the synthesized face image of the first person to obtain digest information, and then write the digest information into the blockchain.
  • This embodiment of the present application does not limit the algorithm used for calculating the summary information of the synthesized face image of the first person.
  • the synthetic face image of a person and the device information of the user terminal mentioned above perform digest calculation to obtain second digest information, and then write the second digest information into the blockchain.
  • the electronic device may perform a summary calculation on the corrected synthetic face image of the first person to obtain third summary information, and then 3.
  • the summary information is written into the blockchain.
  • the user's identity or the device information of the user terminal can also be introduced here to perform summary calculation with the synthetic face image of the first person to obtain the corresponding summary information to be written into the block chain.
  • the embodiments of the present application will not be described in detail here.
  • FIG. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application.
  • the method can be applied to an electronic device, and the electronic device can be a terminal or a server.
  • the terminal referred to may be an intelligent terminal such as a notebook computer and a desktop computer, and the server referred to includes but is not limited to a single server or a server cluster.
  • the method may include the following steps:
  • the first character, the second character, and the third character may be the same or different from each other.
  • the specified posture may also be called a fixed posture, for example, the specified posture may be a specified left-right rotation angle, a specified up-down rotation angle, or a specified rotation angle in a plane.
  • the gesture described in this embodiment of the present application may refer to the gesture of the face.
  • the designated expression may also be called a fixed expression, for example, the designated expression may be angry, happy or sad.
  • the human face image described in this embodiment of the present application may refer to an image including a face of a person, that is, it may refer to an image including a human face.
  • the electronic device may perform step S101 when detecting the synthesis instruction.
  • the process of obtaining the face image set may be the face image set carried in the request for the electronic device to obtain the face image set.
  • the process of acquiring the face image set may be that the electronic device reads the face image set from a specified directory.
  • the facial features may also be referred to as facial features.
  • the gesture feature referred to may refer to the gesture feature of the face.
  • the electronic device may invoke a feature extraction algorithm to perform feature extraction on each face image in the face image set to obtain a first face feature set. This process can effectively perform feature extraction and ensure the accuracy of the extracted features.
  • the electronic device can specifically call a feature extraction algorithm to perform feature extraction on the face image of the first person, obtain the facial features of the first person, and perform feature extraction on the face image of the specified posture of the second person, The pose feature of the second person is obtained, and the feature extraction is performed on the face image of the specified expression of the third person to obtain the facial expression feature of the third person.
  • the feature extraction algorithm adopted by the electronic device may also be different.
  • the electronic device may specifically use a facial feature extraction algorithm to extract features from the face image of the first person, use a posture feature extraction algorithm to extract features from a face image of a specified posture of the second person, and use an expression feature extraction algorithm to extract features from the face image of the second person. Feature extraction is performed on the face image of the specified expression of the third person.
  • the electronic device may perform feature fusion according to the first face feature set, thereby obtaining a synthetic face image of the first person. After obtaining the synthetic face image of the first person, the electronic device may output the synthetic face image of the first person.
  • the face corresponding to the synthetic face image of the first person obtained by this process is the face of the first person
  • the posture corresponding to the synthetic face image of the first person is the designated posture mentioned above
  • the synthetic face of the first person The expression corresponding to the image is the designated expression mentioned above.
  • the electronic device may perform face synthesis according to preset fusion parameters and the first face feature set to obtain a synthesized face image of the first person.
  • the fusion parameters can be set according to experience.
  • the electronic device may further perform up-sampling according to the first face feature set to obtain a synthetic face image of the first person.
  • the upsampling may include any of the following: bilinear interpolation, nearest neighbor interpolation, and transposed convolution.
  • the electronic device can obtain a face image set, which includes the face image of the first character, the face image of the specified posture of the second character, and the specified face image of the third character.
  • facial images of expressions the electronic device can perform feature extraction on each face image in the face image set to obtain a first face feature set, and perform face synthesis according to the first face feature set to obtain the first face feature set
  • the synthetic face image of the character, the synthetic face image of the first character has the facial feature of the first character, the posture feature of the second character and the facial expression feature of the third character, and the above-mentioned process can generate a realistic multi-face image.
  • the angle of face expression image can improve the quality of the generated face image.
  • FIG. 2 is a schematic flowchart of another image processing method according to an embodiment of the present application.
  • the method can be applied to an electronic device, and the electronic device can be a terminal or a server.
  • the terminal referred to may be an intelligent terminal such as a notebook computer and a desktop computer, and the server referred to includes but is not limited to a single server or a server cluster.
  • the embodiment of the present application can improve the stability of the synthesized face image through the image correction process of steps S204-S206, so that the quality of the output synthesized face image is higher.
  • the method may include the following steps:
  • S201 Acquire a face image set, where the face image set includes a face image of a first person, a face image of a second person with a specified posture, and a face image of a third person with a specified expression.
  • steps S201 to S203 reference may be made to steps S101 to S103 in the embodiment of FIG. 1 , which is not repeated in this embodiment of the present application.
  • the electronic device may correct the synthetic face image of the first person. Specifically, the electronic device can perform image detection on the synthetic face image of the first person, obtain an image detection result, and correct the synthetic face image of the first person according to the image detection result, so as to obtain the corrected first person's face image.
  • the synthetic face image of the person is output, and the corrected synthetic face image of the first person is output.
  • the electronic device performs image detection on the synthetic face image of the first person to obtain an image detection result, and corrects the synthetic face image of the first person according to the image detection result to obtain the corrected first person's face image.
  • the process of synthesizing a face image of a person may be as follows: the electronic device performs face detection on the synthetic face image of the first person, and obtains the coordinates of each key point in the multiple key points in the synthetic face image of the first person As the image detection result; the electronic device calculates the transformation matrix used to transform the coordinates of each key point to the coordinates of the preset key point corresponding to the key point; the electronic device obtains correction according to the synthetic face image of the first person and the transformation matrix The synthetic face image of the first person after.
  • the key points here may refer to face key points.
  • the preset key point may refer to any image in the face image set or a key point of a specified image. Since the key point is one of the very important attributes of the human face, it is used to correct the key points of the generated face by detecting its key points on the face of a certain person, a certain head turning posture or a certain expression. , which can make the output synthetic face image more stable in most cases, reduce the possibility of distortion of the synthetic face image, and make the synthetic face image look more normal through correction.
  • the electronic device performs feature extraction on each face image in the face image set, and the process of obtaining the first face feature set may also be for the electronic device to utilize the trained convolution
  • the neural network model performs feature extraction on each face image in the face image set to obtain a first face feature set.
  • the electronic device uses the trained convolutional neural network model to perform feature extraction on each face image in the face image set, and the process of obtaining the first face feature set may be the electronic device using the trained
  • the convolution layer included in the convolutional neural network model performs feature extraction on each face image in the face image set to obtain a first face feature set.
  • the electronic device performs face synthesis according to the first face feature set, and the process of obtaining the synthesized face image of the first person can also be performed by the electronic device according to the first person.
  • the face feature set is up-sampled to obtain a synthetic face image of the first person.
  • the upsampling may include any of the following: bilinear interpolation, nearest neighbor interpolation, and transposed convolution.
  • the electronic device may specifically upsample the first face feature set through the trained convolutional neural network model to obtain a synthetic face image of the first person. Upsampling is achieved through the trained convolutional neural network model, which will make the upsampling more efficient.
  • the electronic device can specifically perform a bilinear interpolation operation according to the first face feature set through the trained convolutional neural network model to obtain a synthetic person of the first character face image.
  • the quality of the image obtained by the bilinear interpolation method is high, and there is no discontinuous pixel value.
  • the electronic device may specifically construct a feature map according to the first face feature set, and then use the trained convolutional neural network model to perform bilinear interpolation according to the feature map operation to obtain a synthetic face image of the first person.
  • the processing process of the bilinear interpolation method can refer to the following formula:
  • y i,j x i-,j- (1- ⁇ i)(1- ⁇ j)+x j+,j- ⁇ i(1- ⁇ j)+x i-,j+ (1- ⁇ i) ⁇ j+x i+,j+ ⁇ i ⁇ j formula 1.1;
  • y represents the synthetic face image.
  • x represents the feature map.
  • i - means round i down
  • i + means round up i. j - Indicates that j is rounded down.
  • j + means round up j.
  • y may be used as the synthetic face image of the first person.
  • the trained convolutional neural network model after obtaining y, input y into the first convolutional layer in the trained convolutional neural network model to perform a convolution operation to obtain a final synthetic face image as the synthetic face of the first character face image.
  • input y to the first convolution layer to perform a convolution operation to obtain a first synthetic face image, and then perform a bilinear operation according to the first synthetic face image to obtain the final synthetic face image.
  • the face image is used as a composite face image of the first person.
  • the bilinear interpolation referred to in the embodiments of this application is essentially to find four pixels around the target position (i, j) in x, and use the pixel values of these four pixels to calculate y at the target position. The pixel value of the pixel.
  • the electronic device can specifically perform the nearest neighbor interpolation operation according to the first face feature set through the trained convolutional neural network model to obtain a synthetic face image of the first person .
  • the electronic device may specifically construct a feature map according to the first face feature set, and then use the trained convolutional neural network model to perform a nearest neighbor interpolation operation according to the feature map, Obtain the synthetic face image of the first person.
  • the processing process of using the nearest neighbor interpolation method can refer to the following formula:
  • y represents the synthetic face image.
  • x represents the feature map.
  • i represents the abscissa of the pixel at the target position, and j represents the ordinate of the pixel at the target position.
  • u represents the abscissa of the pixel in x, and v represents the ordinate of the pixel in x.
  • y may be used as the synthetic face image of the first person.
  • the second convolutional layer here may be the same as or different from the aforementioned first convolutional layer.
  • input y to the second convolution layer to perform a convolution operation to obtain a second synthetic face image, and then perform a nearest neighbor interpolation operation according to the second synthetic face image to obtain the final synthetic face image.
  • the face image is used as a composite face image of the first person.
  • the nearest neighbor interpolation referred to in the embodiments of this application is essentially to find the pixel value of the pixel closest to the target position (i, j) in the source image as the pixel value of the pixel at the target position in the synthesized face image. .
  • the electronic device when the upsampling includes transposed convolution, can specifically perform transposed convolution according to the first face feature set through the transposed convolution layer included in the trained convolutional neural network model, to obtain A composite face image of the first person.
  • the electronic device may specifically use the first face feature set to construct a feature map, and use the transposed convolution layer included in the trained convolutional neural network model to perform transposed convolution on the feature map, A synthetic face image of the first person is obtained.
  • the process of using the transposed convolution method can refer to the following formula:
  • y represents the synthetic face image.
  • x represents the feature map.
  • k represents the convolution kernel of the transposed convolution layer.
  • c represents the column of the convolution kernel, r represents the row of the convolution kernel, and r' represents the row of the area where the sliding window of the convolution kernel slides.
  • row means column and col means row.
  • I represents the preset column range, and J represents the preset row range.
  • y may be used as the synthetic face image of the first person.
  • the transposed convolution operation may also be performed multiple times, so as to obtain the final synthetic face image as the synthetic face image of the first person.
  • an electronic device can have a transposed convolutional layer followed by another transposed convolutional layer, and the latter transposed convolutional layer can then perform a transposed convolutional layer based on the output of the previous transposed convolutional layer. operation, so as to obtain the final synthetic face image as the synthetic face image of the first person.
  • the aforementioned trained convolutional neural network model can be obtained in the following manner:
  • the electronic device obtains a face image data set, the face image data set includes at least one group of images, and each group of images in the at least one group of images includes the original face image, at least one gesture in each gesture The corresponding at least one face image and the at least one face image corresponding to each expression in the at least one expression.
  • a group of images in the at least one group of images may include a face image of character C, a face image corresponding to each of the 54 expressions, and a person corresponding to each of the 4 gestures face image.
  • the electronic device uses the face image data set to train an initial convolutional neural network model to obtain a trained convolutional neural network model.
  • the electronic device uses the face image data set to train the initial convolutional neural network model, and the process of obtaining the trained convolutional neural network model may be as follows:
  • the electronic device performs feature extraction on the target group images in the at least one group of images to obtain a second face feature set.
  • the target group of images may be any group of images in the at least one group of images, or any group of images randomly selected from the at least one group of images.
  • the electronic device may perform feature extraction on the target group images in the at least one group of images by using an initial convolutional neural network model.
  • the electronic device may specifically perform feature extraction on the target group images in the at least one group of images through the convolution layer included in the initial convolutional neural network model.
  • the electronic device uses the initial convolutional neural network model to upsample the second face feature set to obtain at least one first synthetic face image.
  • the electronic device may use the initial convolutional neural network model to perform a bilinear interpolation operation according to the second face feature set to obtain at least one first synthetic face image, or the electronic device may use the initial The convolutional neural network performs nearest neighbor interpolation according to the second face feature set to obtain at least one first synthetic face image, or the electronic device can use the transposed convolutional layer included in the initial convolutional neural network model to obtain at least one first synthetic face image.
  • the second face feature set is transposed and convoluted to obtain at least one first synthetic face image.
  • the electronic device performs restoration processing on each first synthetic face image in the at least one first synthetic face image through the initial convolutional neural network model, and obtains a second corresponding to each first synthetic face image.
  • a face image is synthesized, the second synthesized face image is matched with the original face image included in the face image of the target group, and a converged convolutional neural network model is obtained as the trained convolutional neural network model.
  • matching can be similar, similar or the same meaning.
  • the electronic device may repeatedly perform the restoration processing of each first synthetic face image in the at least one first synthetic face image by using the initial convolutional neural network model in 1-3, to obtain In the process of synthesizing the second face image corresponding to each first synthetic face image, until the model converges, a converged convolutional neural network model is obtained as the trained convolutional neural network model.
  • the electronic device performs restoration processing on each first synthetic face image in the at least one first synthetic face image by using the initial convolutional neural network model to obtain each first synthetic face
  • the process of the second synthetic face image corresponding to the image may be that the electronic device performs feature extraction on each of the first synthetic face image and the original face image to obtain a third face feature set, and then passes through the initial convolutional neural network.
  • the model upsamples the third face feature set to obtain a second synthetic face image corresponding to each of the first synthetic face images.
  • the electronic device can obtain the corrected synthetic face image of the first character by correcting the synthetic face image of the first character, and this process makes the output synthetic face image more Stable and true.
  • FIG. 3 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
  • the apparatus can be applied to the aforementioned electronic equipment.
  • the device may include:
  • the acquiring module 301 is configured to acquire a face image set, where the face image set includes a face image of a first person, a face image of a specified posture of a second person, and a face image of a specified expression of a third person.
  • the processing module 302 is configured to perform feature extraction on each face image in the face image set to obtain a first face feature set, where the first face feature set includes the facial features of the first person, all The posture feature of the second character and the facial expression feature of the third character.
  • the processing module 302 is further configured to perform face synthesis according to the first face feature set to obtain a synthetic face image of the first character, where the synthetic face image of the first character has the Facial features, gesture features of the second character, and facial expression features of the third character.
  • the processing module 302 performs face synthesis according to the first face feature set to obtain a synthesized face image of the first character, specifically using a trained convolutional neural network model Upsampling the first face feature set to obtain a synthetic face image of the first person, where the upsampling includes any one of the following: bilinear interpolation, nearest neighbor interpolation, and transposed convolution.
  • the upsampling includes transposed convolution
  • the processing module 302 uses the trained convolutional neural network model to upsample the first face feature set to obtain the The synthetic face image of the first person, specifically using the transposed convolution layer included in the trained convolutional neural network model to perform a transposed convolution on the first face feature set to obtain the first person synthetic face images.
  • the processing module 302 uses the transposed convolution layer included in the trained convolutional neural network model to perform transposed convolution on the first face feature set to obtain the first facial feature set.
  • a synthetic face image of a person specifically using the first face feature set to construct a feature map; using the transposed convolution layer included in the trained convolutional neural network model to transpose the feature map product to obtain the synthetic face image of the first person.
  • the image processing apparatus further includes an output module 303 .
  • the processing module 302 is further configured to perform image detection on the synthetic face image of the first person after obtaining the synthetic face image of the first person to obtain an image detection result ; Perform face correction on the synthetic face image of the first person according to the image detection result to obtain the corrected synthetic face image of the first person.
  • the output module 303 is configured to output the corrected synthetic face image of the first person.
  • the processing module 302 is further configured to acquire a face image dataset, where the face image dataset includes at least one group of images, and each group of images in the at least one group of images
  • the image includes an original face image, at least one face image corresponding to each gesture in at least one gesture, and at least one face image corresponding to each expression in at least one expression; using the face image data set to The initial convolutional neural network model is trained to obtain the trained convolutional neural network model.
  • the processing module 302 uses the face image data set to train an initial convolutional neural network model to obtain a trained convolutional neural network model, specifically for the at least one group of Perform feature extraction on the target group image in the image to obtain a second face feature set; use the initial convolutional neural network model to upsample the second face feature set to obtain at least one first synthetic face image; performing restoration processing on each of the first synthetic face images in the at least one first synthetic face image through the initial convolutional neural network model, to obtain a corresponding image of each first synthetic face image A second synthetic face image, where the second synthetic face image matches the original face image included in the target group face images, and a converged convolutional neural network model is obtained as the trained convolutional neural network model.
  • the image processing apparatus can obtain a face image set, which includes the face image of the first character, the face image of the second character in a specified posture, and the face image of the third character.
  • a face image with a specified expression the image processing device can perform feature extraction on each face image in the face image set to obtain a first face feature set, and perform face synthesis according to the first face feature set to obtain the
  • the synthetic face image of the first character, the synthetic face image of the first character has the facial feature of the first character, the posture feature of the second character and the facial expression feature of the third character, and the above process can be used to generate realistic
  • the multi-angle face expression images can improve the quality of the generated face images.
  • FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device includes a processor and memory.
  • the electronic device may further include an input device and/or an output device.
  • the electronic device described in this embodiment may include: one or more processors 1000 , one or more input devices 2000 , one or more output devices 3000 and a memory 4000 .
  • the processor 1000, the input device 2000, the output device 3000, and the memory 4000 may be connected through a bus.
  • the input device 2000 and the output device 3000 are optional devices in the electronic device, that is, the electronic device may only include the processor 1000 and the memory 4000 .
  • the input device 2000 and the output device 3000 may be standard wired or wireless communication interfaces.
  • the input device 2000 may be a touch screen or a touch display screen
  • the output device 3000 may be a display screen or a touch display screen, which is not limited in this embodiment of the present application.
  • the processor 1000 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC) , Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 4000 can be a high-speed RAM memory, or a non-volatile memory, such as a disk memory.
  • the memory 4000 is used to store a set of program codes, and the input device 2000 , the output device 3000 and the processor 1000 can call the program codes stored in the memory 4000 . specifically:
  • the processor 1000 is configured to acquire a face image set, the face image set including a face image of a first character, a face image of a specified posture of a second character, and a face image of a specified expression of a third character; Feature extraction is performed on each face image in the face image set to obtain a first face feature set, where the first face feature set includes the facial features of the first character and the posture features of the second character and the facial expression feature of the third character; perform face synthesis according to the first face feature set to obtain a synthetic face image of the first character, and the synthetic face image of the first character has the first character
  • the facial features of a character, the gesture features of the second character, and the facial expression features of the third character are configured to acquire a face image set, the face image set including a face image of a first character, a face image of a specified posture of a second character, and a face image of a specified expression of a third character; Feature extraction is performed on each face image in the face image set to obtain a first face feature
  • the processor 1000 performs face synthesis according to the first face feature set, and obtains a synthesized face image of the first character.
  • the trained convolutional neural network model is used to synthesize the first face.
  • the face feature set is upsampled to obtain a synthetic face image of the first person, and the upsampling includes any one of the following: bilinear interpolation, nearest neighbor interpolation, and transposed convolution.
  • the upsampling includes transposed convolution
  • the processor 1000 uses the trained convolutional neural network model to upsample the first face feature set to obtain the first character's Synthesizing a face image, specifically using the transposed convolution layer included in the trained convolutional neural network model to perform a transposed convolution on the first face feature set to obtain a synthetic face of the first character image.
  • the processor 1000 uses the transposed convolution layer included in the trained convolutional neural network model to perform transposed convolution on the first face feature set to obtain a composite of the first character A face image, specifically using the first face feature set to construct a feature map; using the transposed convolution layer included in the trained convolutional neural network model to perform a transposed convolution on the feature map to obtain the The synthetic face image of the first person is described.
  • the processor 1000 is further configured to perform image detection on the synthetic face image of the first character after obtaining the synthetic face image of the first character to obtain an image detection result; according to the The image detection result performs face correction on the synthetic face image of the first person to obtain the corrected synthetic face image of the first person; outputting the corrected synthetic face image of the first person through the output device 3000 face image.
  • the processor 1000 is further configured to acquire a face image data set, where the face image data set includes at least one group of images, and each group of images in the at least one group of images includes an original person a face image, at least one face image corresponding to each gesture in at least one gesture, and at least one face image corresponding to each expression in at least one expression; using the face image data set to perform the initial convolution
  • the neural network model is trained to obtain a trained convolutional neural network model.
  • the processor 1000 uses the face image data set to train an initial convolutional neural network model, and obtains a trained convolutional neural network model, specifically for the at least one group of images.
  • the initial convolutional neural network model performs restoration processing on each first synthetic face image in the at least one first synthetic face image to obtain a second synthetic face corresponding to each of the first synthetic face images.
  • a face image, the second synthetic face image matches the original face image included in the target group face image, and a converged convolutional neural network model is obtained as the trained convolutional neural network model.
  • the processor 1000 , the input device 2000 , and the output device 3000 described in the embodiments of the present application may perform the implementations described in the embodiments of FIG. 1 and FIG. 2 , and may also perform the implementations described in the embodiments of the present application. The implementation manner will not be repeated here.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the methods in the foregoing embodiments can be implemented, or the computer program is executed by the processor When executed, the functions of each module of the apparatus in the above embodiment are realized.
  • a computer program when executed by a processor can implement the following methods:
  • the set of face images comprising a face image of a first character, a face image of a specified gesture of a second character, and a face image of a specified expression of a third character;
  • first face feature set includes the facial features of the first person and the posture of the second person characteristics and the facial expression characteristics of the third person;
  • the storage medium involved in the present application such as a computer-readable storage medium, may be non-volatile or volatile.
  • Each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of sampling hardware or in the form of sampling software function modules.
  • the computer-readable storage medium can be volatile or non-volatile.
  • the computer storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), and the like.
  • the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; Use the created data, etc.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Biophysics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本申请实施例提供了一种图像处理方法、装置、电子设备及计算机可读存储介质,该方法包括:获取人脸图像集合,人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像和第三人物的指定表情的人脸图像;对人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,第一人脸特征集合包括第一人物的脸部特征、第二人物的姿态特征和第三人物的表情特征;根据第一人脸特征集合进行人脸合成,得到第一人物的合成人脸图像,第一人物的合成人脸图像具有第一人物的脸部特征、第二人物的姿态特征和第三人物的表情特征。采用本申请,能够提升生成的人脸图像的质量。此外,本申请还涉及区块链技术,第一人物的合成人脸图像可写入区块链中。

Description

图像处理方法、装置、电子设备及计算机可读存储介质
本申请要求于2020年7月22日提交中国专利局、申请号为202010710400.7,发明名称为“图像处理方法、装置、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种图像处理方法、装置、电子设备及计算机可读存储介质。
背景技术
图像生成是近年来逐渐流行的一项信息处理能力。图像生成涉及许多方面,其中,人脸图像生成是十分重要的研究领域。它的主要目的是生成质量上足以商业使用或者实验使用的人脸图像,或者是依照使用者的限制生成满足限制条件的人脸图像。
目前,针对人脸图像生成,大型投入的相关技术主要是在传媒、推广等领域,如制作虚拟人物。但是,发明人意识到,对于人脸的编辑难以做到精细化,操控的粒度不足。一方面是由于技术的不成熟,另一方面是由于相关技术需要海量数据的支撑,难以满足。同时,对于完成度较高的相关技术,也会存在诸多缺陷,例如人物身份属于无中生有、表情的表现力不够等属性不达标的问题;又或者是人脸图像的清晰度过低、图像内容单一等质量有损的问题。因此,如何提升生成的人脸图像的质量成为亟待解决的问题。
发明内容
本申请实施例提供给了一种图像处理方法、装置、电子设备及计算机可读存储介质,可以提升生成的人脸图像的质量。
第一方面,本申请实施例提供了一种图像处理方法,包括:
获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
第二方面,本申请实施例提供了一种图像处理装置,包括:
获取模块,用于获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
处理模块,用于对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
所述处理模块,还用于根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
第三方面,本申请实施例提供了一种电子设备,包括处理器和存储器,所述处理器和所述存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行以下方法:
获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一 人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现以下方法:
获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
本申请实施例相较于现有技术针对生成人脸图像产生的人脸编辑不够精细、人脸表情的表现力不够或图像内容较为单一等导致图像质量低下的问题,采用本申请可以生成逼真的多角度的人脸表情图像,能够提升生成的人脸图像的质量。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种图像处理方法的流程示意图;
图2是本申请实施例提供的另一种图像处理方法的流程示意图;
图3是本申请实施例提供的一种图像处理装置的结构示意图;
图4是本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
本申请的技术方案可涉及人工智能技术领域,如可应用于图像处理等场景中,如可具体用于生成人脸图像的场景,以提升生成的人脸图像的质量,从而推动智慧城市的建设。可选的,本申请涉及的数据如各种图像和/或特征等可存储于数据库中,或者可以存储于区块链中,本申请不做限定。
由于人脸姿态、表情的变化具有多样性和复杂性,再加上现有技术的人脸图像生成技术上的缺陷,如人脸生成模型特有的不稳定性和可能导致的细节缺失,使得多角度的人脸表情图像生成十分困难,并且生成的人脸图像的质量也不高,为了实现多角度的人脸表情图像的生成,并保证其生成的人脸图像的质量,本申请实施例提供了一种图像处理方案,该图像处理方案可以应用在美颜,动图合成,视频制作,虚拟人物捏造(如虚拟游戏人物捏造)等等应用场景下,通过该图像处理方案可以达到人脸变换、人脸编辑等效果。
本申请实施例所述的图像处理方案具体为:获取人脸图像集合,该人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;对该人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,该第一人脸特征集合包括该第一人物的脸部特征、该第二人物的姿态特征以及该第三人物的表情特征;根据该第一人脸特征集合进行人脸合成,得到该第一人物的合成人脸图像,该第一人物的 合成人脸图像具有该第一人物的脸部特征、该第二人物的姿态特征以及该第三人物的表情特征。采用上述过程能够生成多角度的不同表情人脸,并且在编辑人脸属性具有一定准确度的同时满足一定的图像质量要求,
在一个应用场景中,用户可以将人物A的正面照片、人物B的侧面,如右侧转60°的照片以及人物B的表情照片上传到电子设备中,然后采用上述提及的图像处理方案,便可以合成人物A的侧面带表情的照片,此处的表情为人物B的表情照片对应的表情。人物A可以是用户自己也可以是其他人。
在一个应用场景中,用户可以将人物A的正面照片上传到电子设备中,并从电子设备提供的多张照片中选取人物B的侧面照片以及人物B的表情照片以用于人脸合成,然后用户可以通过点击合成按钮提交合成指令至电子设备,电子设备在检测到合成指令后,可以获取该人物A的正面照片、人物B侧面照片以及人物B的表情照片,然后采用上述提及的图像处理方案,便可以合成人物A的侧面带表情的照片,此处的表情为人物B的表情照片对应的表情。
在一个应用场景中,电子设备可以为用户提供人脸合成界面,使得用户能够基于该人脸合成界面设置人脸图像集合,如设置人物A的正面照片,人物B的侧面照片以及人物B的表情照片。该人脸合成界面可以包括合成按钮,用户可以通过点击该合成按钮提交合成指令至电子设备,电子设备可以在检测到合成指令后,获取该人脸图像集合。在一个实施例中,该合成指令可以携带人脸图像集合,如人物A的正面照片,人物B的侧面照片以及人物B的表情照片。
在一个实施例中,为了避免出现利用合成人脸图像冒充真实人脸来用于犯罪的情况,因此可以将第一人物的合成人脸图像写入区块链中,以达到对合成人脸图像溯源的目的。或,电子设备可以将第一人物的合成人脸图像以及请求合成该合成人脸图像的用户的标识或该用户对应的用户终端的设备信息写入区块链中。其中,用户的标识,例如可以为用户的账号或用户的手机号等可以用于唯一标识该用户的信息。用户终端的设备信息,例如可以为用户终端的物理地址、设备编号、网际协议地址等用于唯一标识该用户终端的信息。在一个实施例中,本申请实施例所指的电子设备可以为该用户对应的用户终端,也可以不为。在一个实施例中,电子设备在对第一人物的合成人脸图像进行矫正的情况下,可以将矫正后的第一人物的合成人脸图像写入区块链中。
在一个实施例中,考虑到合成人脸图像的私密性,也可以对第一人物的合成人脸图像进行摘要计算,得到摘要信息,然后将摘要信息写入区块链中。本申请实施例对于计算第一人物的合成人脸图像的摘要信息所采用的算法不做限制。相应地,还可以对第一人物的合成人脸图像以及上述提及的用户的标识进行摘要计算,得到第一摘要信息,然后将第一摘要信息写入区块链中,或还可以对第一人物的合成人脸图像以及上述提及的用户终端的设备信息进行摘要计算,得到第二摘要信息,然后将第二摘要信息写入区块链中。在一个实施例中,电子设备在对第一人物的合成人脸图像进行矫正的情况下,可以对矫正后的第一人物的合成人脸图像进行摘要计算,得到第三摘要信息,然后将第三摘要信息写入区块链中,同理,也可以在此引入用户的标识或用户终端的设备信息一并与第一人物的合成人脸图像进行摘要计算得到相应的摘要信息以写入区块链中,本申请实施例在此不做赘述。
请参阅图1,为本申请实施例提供的一种图像处理方法的流程示意图。该方法可以应用在电子设备中,该电子设备可以为终端或服务器。所指的终端,如可以为笔记本电脑、台式电脑等智能终端,所指的服务器包括但不限于单个的服务器或服务器集群。具体地,该方法可以包括以下步骤:
S101、获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像。
其中,第一人物、第二人物、第三人物相互之间可以相同或不同。指定姿态也可以称为固定姿态,例如,该指定姿态可以为指定的左右转角、指定的上下转角或指定的平面内的转角。本申请实施例所述的姿态可以是指脸部的姿态。相应地,指定表情也可以称为固定表情,例如,该指定表情可以为生气、开心或悲伤。本申请实施例所述的人脸图像可以是指包括人物的脸部的图像,也就是说可以是指包括人脸的图像。
在一个实施例中,电子设备可以在检测到合成指令时,执行步骤S101。
在一个实施例中,在检测到合成指令时,所述的获取人脸图像集合的过程可以为电子设备获取人脸图像集合请求携带的人脸图像集合。或,在检测到合成指令时,所述的获取人脸图像集合的过程可以为电子设备从指定目录中读取该人脸图像集合。
S102、对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
其中,所述的脸部特征也可以称为面部特征。所指的姿态特征可以是指脸部的姿态特征。
在一个实施例中,电子设备可以调用特征提取算法对人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合。采用该过程能够有效进行特征提取,保障提取的特征的准确性。
在一个实施例中,电子设备具体可以调用特征提取算法对第一人物的人脸图像进行特征提取,得到第一人物的脸部特征,对第二人物的指定姿态的人脸图像进行特征提取,得到第二人物的姿态特征、对第三人物的指定表情的人脸图像进行特征提取,得到第三人物的表情特征。
在一个实施例中,根据提取的特征的不同,电子设备所采用的特征提取算法也可以不同。例如,电子设备具体可以采用脸部特征提取算法对第一人物的人脸图像进行特征提取,采用姿态特征提取算法对第二人物的指定姿态的人脸图像进行特征提取,采用表情特征提取算法对第三人物的指定表情的人脸图像进行特征提取。
S103、根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
本申请实施例中,电子设备可以根据第一人脸特征集合进行特征融合,从而得到第一人物的合成人脸图像。在得到第一人物的合成人脸图像后,电子设备可以输出该第一人物的合成人脸图像。采用该过程得到的第一人物的合成人脸图像对应的脸为第一人物的脸,第一人物的合成人脸图像对应的姿态为前述提及的指定姿态,并且第一人物的合成人脸图像对应的表情为前述提及的指定表情。
在一个实施例中,为了有效地进行特征融合,电子设备具体可以根据预设的融合参数以及该第一人脸特征集合进行人脸合成,得到该第一人物的合成人脸图像。其中,所述的融合参数可以根据经验设置。
在一个实施例中,为了有效地进行特征融合,电子设备还可以根据该第一人脸特征集合进行上采样,得到第一人物的合成人脸图像。其中,上采样可以包括以下任一项:双线性插值、最近邻插值、转置卷积。
可见,图1所示的实施例中,电子设备可以获取人脸图像集合,该人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;电子设备可以对该人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,并根据该第一人脸特征集合进行人脸合成,得到该第一人物的合成人脸图像,该第一人物的合成人脸图像具有该第一人物的脸部特征、该第二人物的姿态特征以及该第三人物的表 情特征,采用上述过程可以生成逼真的多角度的人脸表情图像,能够提升生成的人脸图像的质量。
请参阅图2,为本申请实施例提供的另一种图像处理方法的流程示意图。该方法可以应用在电子设备中,该电子设备可以为终端或服务器。所指的终端,如可以为笔记本电脑、台式电脑等智能终端,所指的服务器包括但不限于单个的服务器或服务器集群。相较于图1实施例,本申请实施例可以通过步骤S204-S206的图像矫正过程提升合成人脸图像的稳定性,使得输出的合成人脸图像的质量更高。具体地,该方法可以包括以下步骤:
S201、获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像。
S202、对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
S203、根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
其中,步骤S201-步骤S203可参见图1实施例中的步骤S101-步骤S103,本申请实施例在此不做赘述。
S204、对所述第一人物的合成人脸图像进行图像检测,得到图像检测结果。
S205、根据所述图像检测结果对所述第一人物的合成人脸图像进行人脸矫正,得到矫正后的所述第一人物的合成人脸图像。
S206、输出矫正后的所述第一人物的合成人脸图像。
在步骤S204-步骤S206中,为了使得输出的合成人脸图像更加真实稳定,电子设备可以对第一人物的合成人脸图像进行矫正。具体地,电子设备可以对第一人物的合成人脸图像进行图像检测,得到图像检测结果,并根据图像检测结果对该第一人物的合成人脸图像进行矫正,从而得到矫正后的该第一人物的合成人脸图像,并输出该矫正后的该第一人物的合成人脸图像。
在一个实施例中,电子设备对第一人物的合成人脸图像进行图像检测,得到图像检测结果,并根据图像检测结果对该第一人物的合成人脸图像进行矫正,得到矫正后的该第一人物的合成人脸图像的过程可以如下:电子设备对第一人物的合成人脸图像进行人脸检测,得到第一人物的合成人脸图像中的多个关键点中每个关键点的坐标作为图像检测结果;电子设备计算每个关键点的坐标变换到该关键点对应的预设关键点的坐标使用的变换矩阵;电子设备根据该第一人物的合成人脸图像以及该变换矩阵得到矫正后的第一人物的合成人脸图像。此处的关键点可以是指人脸关键点。其中,预设关键点可以是指人脸图像集合中任一图像或指定图像的关键点。由于关键点是人脸非常重要的属性之一,所以通过对某个人、某种头部转姿或某种表情的人脸检测其关键点,以用于对生成的人脸的关键点进行矫正,可以使得输出的合成人脸图像在大部分情况下更稳定,降低合成人脸图像畸变的可能性,通过矫正可以使得合成人脸图像看起来更加正常。
在一个实施例中,为了有效地进行特征提取,电子设备对该人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合的过程还可以为电子设备利用训练后的卷积神经网络模型对该人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合。
在一个实施例中,电子设备利用训练后的卷积神经网络模型对该人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合的过程具体可以为电子设备利用训练后的卷积神经网络模型包括的卷积层对该人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合。
在一个实施例中,为了有效地进行特征融合,电子设备根据该第一人脸特征集合进行人脸合成,得到该第一人物的合成人脸图像的过程还可以为电子设备根据该第一人脸特征集合进行上采样,得到第一人物的合成人脸图像。其中,上采样可以包括以下任一项:双线性插值、最近邻插值、转置卷积。
在一个实施例中,电子设备具体可以通过训练后的卷积神经网络模型对该第一人脸特征集合进行上采样,得到第一人物的合成人脸图像。通过训练后的卷积神经网络模型实现上采样,将使得上采样的效率更高。
在一个实施例中,当上采样包括双线性插值时,电子设备具体可以通过训练后的卷积神经网络模型根据第一人脸特征集合执行双线性插值操作,得到第一人物的合成人脸图像。采用双线性插值的方法得到的图像的质量较高,不会出现像素值不连续的情况。
在一个实施例中,当上采样包括双线性插值时,电子设备具体可以根据第一人脸特征集合构建特征图,然后利用训练后的卷积神经网络模型根据该特征图执行双线性插值操作,得到第一人物的合成人脸图像。其中,采用双线性插值的方法的处理过程可以参见如下公式:
y i,j=x i-,j-(1-Δi)(1-Δj)+x j+,j-Δi(1-Δj)+x i-,j+(1-Δi)Δj+x i+,j+ΔiΔj公式1.1;
其中,y表示合成人脸图像。x表示特征图。Δi=i-i -。Δj=j-j -。i表示目标位置的像素的横坐标,j表示目标位置的像素的纵坐标。i -表示对i向下取整,i +表示对i向上取整。j -表示对j向下取整。j +表示对j向上取整。
在一个实施例中,可以将y作为第一人物的合成人脸图像。
在一个实施例中,还可以在得到y之后,将y输入到训练后的卷积神经网络模型中的第一卷积层执行卷积操作,得到最终的合成人脸图像作为第一人物的合成人脸图像。或,还可以在得到y之后,将y输入到第一卷积层执行卷积操作,得到第一合成人脸图像,然后根据第一合成人脸图像执行双线性操作,得到最终的合成人脸图像作为第一人物的合成人脸图像。上述过程配合双线性插值操作与卷积操作,能够使得最终的合成人脸图像拥有更高的分辨率。
需要说明的是,本申请实施例所指的双线性插值本质上就是找到x中目标位置(i,j)周围的四个像素,利用这四个像素的像素值计算出y在该目标位置的像素的像素值。
在一个实施例中,当上采样包括最近邻插值时,电子设备具体可以通过训练后的卷积神经网络模型根据第一人脸特征集合执行最近邻插值操作,得到第一人物的合成人脸图像。
在一个实施例中,当上采样包括最近邻插值时,电子设备具体可以根据第一人脸特征集合构建特征图,然后利用训练后的卷积神经网络模型根据该特征图执行最近邻插值操作,得到第一人物的合成人脸图像。其中,采用最近邻插值的方法的处理过程可以参见如下公式:
Figure PCTCN2021096713-appb-000001
其中,y表示合成人脸图像。x表示特征图。i表示目标位置的像素的横坐标,j表示目标位置的像素的纵坐标。u表示x中的像素的横坐标,v表示x中的像素的纵坐标。
在一个实施例中,可以将y作为第一人物的合成人脸图像。
在一个实施例中,可以在得到y之后,将y输入到训练后的卷积神经网络模型的第二 卷积层执行卷积操作,得到最终的合成人脸图像。此处的第二卷积层可以与前述第一卷积层相同或不同。或,还可以在得到y之后,将y输入到第二卷积层执行卷积操作,得到第二合成人脸图像,然后根据第二合成人脸图像执行最近邻插值操作,得到最终的合成人脸图像作为第一人物的合成人脸图像。
需要说明的是,本申请实施例所指的最近邻插值本质上就是找到源图像中距离目标位置(i,j)最近的像素的像素值作为合成人脸图像中该目标位置的像素的像素值。
在一个实施例中,当上采样包括转置卷积时,电子设备具体可以通过训练后的卷积神经网络模型包括的转置卷积层根据第一人脸特征集合进行转置卷积,得到第一人物的合成人脸图像。
在一个实施例中,电子设备具体可以利用该第一人脸特征集合构建特征图,并利用该训练后的卷积神经网络模型包括的转置卷积层对该特征图进行转置卷积,得到该第一人物的合成人脸图像。其中,采用转置卷积的方法的处理过程可以参见如下公式:
Figure PCTCN2021096713-appb-000002
其中,y表示合成人脸图像。x表示特征图。k表示转置卷积层的卷积核。c表示卷积核的列,r表示卷积核的行,r'表示卷积核的滑动窗口滑动的区域的行。row表示列,col表示行。I表示预设的列范围,J表示预设的行范围。
在一个实施例中,可以将y作为第一人物的合成人脸图像。
在一个实施例中,还可以多次执行转置卷积的操作,从而得到最终的合成人脸图像作为第一人物的合成人脸图像。例如,电子设备可以在一个转置卷积层后再接另一个转置卷积层,然后,后一个转置卷积层便可以根据上一个转置卷积层的输出执行转置卷积的操作,从而得到最终的合成人脸图像作为第一人物的合成人脸图像。
在一个实施例中,前述提及的训练后的卷积神经网络模型可以通过如下方式得到:
1、电子设备获取人脸图像数据集,该人脸图像数据集包括至少一组图像,该至少一组图像中的每组图像包括原人脸图像、至少一种姿态中每种姿态对应的至少一张人脸图像以及至少一种表情中每种表情对应的至少一张人脸图像。例如,该至少一组图像中的一组图像可以包括人物C的人脸图像、54种表情中每种表情对应的一张人脸图像、4种姿态中每种姿态对应的一张人脸图像。
2、电子设备利用该人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型。
具体地,电子设备利用该人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型的过程可以如下:
①电子设备对该至少一组图像中的目标组图像进行特征提取,得到第二人脸特征集合。其中,目标组图像可以为该至少一组图像中的任一组图像,或为从该至少一组图像中随机选取的任一组图像。在一个实施例中,电子设备可以通过初始的卷积神经网络模型对该至少一组图像中的目标组图像进行特征提取。在一个实施例中,电子设备具体可以通过初始的卷积神经网络模型包括的卷积层对该至少一组图像中的目标组图像进行特征提取。
②电子设备利用初始的卷积神经网络模型对该第二人脸特征集合进行上采样,得到至少一张第一合成人脸图像。在一个实施例中,电子设备可以利用初始的卷积神经网络模型根据该第二人脸特征集合执行双线性插值的操作,得到至少一张第一合成人脸图像,或电子设备可以利用初始的卷积神经网络根据该第二人脸特征集合执行最近邻插值,得到至少一张第一合成人脸图像,或电子设备可以利用初始的卷积神经网络模型包括的转置卷积层根据该第二人脸特征集合进行转置卷积,得到至少一张第一合成人脸图像。
③电子设备通过该初始的卷积神经网络模型对该至少一张第一合成人脸图像中每张第一合成人脸图像进行还原处理,得到该每张第一合成人脸图像对应的第二合成人脸图像,该第二合成人脸图像与该目标组人脸图像包括的原人脸图像相匹配,得到收敛的卷积神经网络模型作为训练后的卷积神经网络模型。其中,相匹配可以是相近、相似或相同的含义。本申请实施例中,电子设备可以重复执行①-③中的通过该初始的卷积神经网络模型对该至少一张第一合成人脸图像中每张第一合成人脸图像进行还原处理,得到该每张第一合成人脸图像对应的第二合成人脸图像的过程,直到模型收敛,得到收敛的卷积神经网络模型作为训练后的卷积神经网络模型。
在一个实施例中,电子设备通过该初始的卷积神经网络模型对该至少一张第一合成人脸图像中每张第一合成人脸图像进行还原处理,得到该每张第一合成人脸图像对应的第二合成人脸图像的过程可以是电子设备对该每张第一合成人脸图像以及原人脸图像进行特征提取,得到第三人脸特征集合,然后通过初始的卷积神经网络模型对该第三人脸特征集合进行上采样,得到该每张第一合成人脸图像对应的第二合成人脸图像。
可见,图2所示的实施例中,电子设备可以通过对第一人物的合成人脸图像进行矫正,得到矫正后的第一人物的合成人脸图像,该过程使得输出的合成人脸图像更加稳定真实。
请参阅图3,为本申请实施例提供的一种图像处理装置的结构示意图。该装置可以应用于前述提及的电子设备。具体地,该装置可以包括:
获取模块301,用于获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像。
处理模块302,用于对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
处理模块302,还用于根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
在一种可选的实施方式中,处理模块302根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,具体为利用训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,所述上采样包括以下任一项:双线性插值、最近邻插值、转置卷积。
在一种可选的实施方式中,所述上采样包括转置卷积,处理模块302利用所述训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,具体为利用所述训练后的卷积神经网络模型包括的转置卷积层对所述第一人脸特征集合进行转置卷积,得到所述第一人物的合成人脸图像。
在一种可选的实施方式在,处理模块302利用所述训练后的卷积神经网络模型包括的转置卷积层对所述第一人脸特征集合进行转置卷积,得到所述第一人物的合成人脸图像,具体为利用所述第一人脸特征集合构建特征图;利用所述训练后的卷积神经网络模型包括的转置卷积层对所述特征图进行转置卷积,得到所述第一人物的合成人脸图像。
在一种可选的实施方式中,所述图像处理装置还包括输出模块303。
在一种可选的实施方式中,处理模块302,还用于在得到所述第一人物的合成人脸图像之后,对所述第一人物的合成人脸图像进行图像检测,得到图像检测结果;根据所述图像检测结果对所述第一人物的合成人脸图像进行人脸矫正,得到矫正后的所述第一人物的合成人脸图像。
在一种可选的实施方式中,输出模块303,用于输出矫正后的所述第一人物的合成人脸图像。
在一种可选的实施方式中,处理模块302,还用于获取人脸图像数据集,所述人脸图像数据集包括至少一组图像,所述至少一组图像中的每组图像包括原人脸图像、至少一种姿态中每种姿态对应的至少一张人脸图像以及至少一种表情中每种表情对应的至少一张人脸图像;利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型。
在一种可选的实施方式中,处理模块302利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型,具体为对所述至少一组图像中的目标组图像进行特征提取,得到第二人脸特征集合;利用初始的卷积神经网络模型对所述第二人脸特征集合进行上采样,得到至少一张第一合成人脸图像;通过所述初始的卷积神经网络模型对所述至少一张第一合成人脸图像中每张第一合成人脸图像进行还原处理,得到所述每张第一合成人脸图像对应的第二合成人脸图像,所述第二合成人脸图像与所述目标组人脸图像包括的原人脸图像相匹配,得到收敛的卷积神经网络模型作为训练后的卷积神经网络模型。
可见,图3所示的实施例中,图像处理装置可以获取人脸图像集合,该人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;图像处理装置可以对该人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,并根据该第一人脸特征集合进行人脸合成,得到该第一人物的合成人脸图像,该第一人物的合成人脸图像具有该第一人物的脸部特征、该第二人物的姿态特征以及该第三人物的表情特征,采用上述过程可以生成逼真的多角度的人脸表情图像,能够提升生成的人脸图像的质量。
请参阅图4,为本申请实施例提供的一种电子设备的结构示意图。该电子设备包括处理器和存储器。可选的,该电子设备还可包括输入设备和/或输出设备。例如,如图4所示,本实施例中所描述的电子设备可以包括:一个或多个处理器1000,一个或多个输入设备2000,一个或多个输出设备3000和存储器4000。处理器1000、输入设备2000、输出设备3000和存储器4000可以通过总线连接。其中,输入设备2000和输出设备3000为该电子设备中可选的设备,即该电子设备可以仅包括处理器1000和存储器4000。在一个实施例中,输入设备2000、输出设备3000可以是标准的有线或无线通信接口。在一个实施例中,输入设备2000可以为触摸屏或触摸显示屏,输出设备3000可以为显示屏或触摸显示屏,本申请实施例不做限制。
处理器1000可以是中央处理模块(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器4000可以是高速RAM存储器,也可为非不稳定的存储器(non-volatile memory),例如磁盘存储器。存储器4000用于存储一组程序代码,输入设备2000、输出设备3000和处理器1000可以调用存储器4000中存储的程序代码。具体地:
处理器1000,用于获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
在一个实施例中,处理器1000根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,具体为利用训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,所述上采样包括以下任一项:双线性插值、最近邻插值、转置卷积。
在一个实施例中,所述上采样包括转置卷积,处理器1000利用所述训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,具体为利用所述训练后的卷积神经网络模型包括的转置卷积层对所述第一人脸特征集合进行转置卷积,得到所述第一人物的合成人脸图像。
在一个实施例中,处理器1000利用所述训练后的卷积神经网络模型包括的转置卷积层对所述第一人脸特征集合进行转置卷积,得到所述第一人物的合成人脸图像,具体为利用所述第一人脸特征集合构建特征图;利用所述训练后的卷积神经网络模型包括的转置卷积层对所述特征图进行转置卷积,得到所述第一人物的合成人脸图像。
在一个实施例中,处理器1000,还用于在得到所述第一人物的合成人脸图像之后,对所述第一人物的合成人脸图像进行图像检测,得到图像检测结果;根据所述图像检测结果对所述第一人物的合成人脸图像进行人脸矫正,得到矫正后的所述第一人物的合成人脸图像;通过输出设备3000输出矫正后的所述第一人物的合成人脸图像。
在一个实施例中,处理器1000,还用于获取人脸图像数据集,所述人脸图像数据集包括至少一组图像,所述至少一组图像中的每组图像包括原人脸图像、至少一种姿态中每种姿态对应的至少一张人脸图像以及至少一种表情中每种表情对应的至少一张人脸图像;利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型。
在一个实施例中,处理器1000利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型,具体为对所述至少一组图像中的目标组图像进行特征提取,得到第二人脸特征集合;利用初始的卷积神经网络模型对所述第二人脸特征集合进行上采样,得到至少一张第一合成人脸图像;通过所述初始的卷积神经网络模型对所述至少一张第一合成人脸图像中每张第一合成人脸图像进行还原处理,得到所述每张第一合成人脸图像对应的第二合成人脸图像,所述第二合成人脸图像与所述目标组人脸图像包括的原人脸图像相匹配,得到收敛的卷积神经网络模型作为训练后的卷积神经网络模型。
具体实现中,本申请实施例中所描述的处理器1000、输入设备2000、输出设备3000可执行图1实施例、图2实施例所描述的实现方式,也可执行本申请实施例所描述的实现方式,在此不再赘述。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时可实现上述实施例中方法的步骤,或者,计算机程序被处理器执行时实现上述实施例中装置的各模块的功能。例如,计算机程序被处理器执行时可以实现以下方法:
获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
可选的,该计算机程序被处理器执行时还可实现上述实施例中方法的其他步骤,这里 不再赘述。进一步可选的,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。
在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以是两个或两个以上模块集成在一个模块中。上述集成的模块既可以采样硬件的形式实现,也可以采样软件功能模块的形式实现。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的计算机可读存储介质可为易失性的或非易失性的。例如,该计算机存储介质可以为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。所述的计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
其中,本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
以上所揭露的仅为本申请一种较佳实施例而已,当然不能以此来限定本申请之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本申请权利要求所作的等同变化,仍属于本申请所涵盖的范围。

Claims (20)

  1. 一种图像处理方法,包括:
    获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
    对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
    根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
  2. 根据权利要求1所述的方法,其中,所述根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,包括:
    利用训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,所述上采样包括以下任一项:双线性插值、最近邻插值、转置卷积。
  3. 根据权利要求2所述的方法,其中,所述上采样包括转置卷积,所述利用所述训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,包括:
    利用所述训练后的卷积神经网络模型包括的转置卷积层对所述第一人脸特征集合进行转置卷积,得到所述第一人物的合成人脸图像。
  4. 根据权利要求3所述的方法,其中,所述利用所述训练后的卷积神经网络模型包括的转置卷积层对所述第一人脸特征集合进行转置卷积,得到所述第一人物的合成人脸图像,包括:
    利用所述第一人脸特征集合构建特征图;
    利用所述训练后的卷积神经网络模型包括的转置卷积层对所述特征图进行转置卷积,得到所述第一人物的合成人脸图像。
  5. 根据权利要求1-4任一项所述的方法,其中,所述得到所述第一人物的合成人脸图像之后,所述方法还包括:
    对所述第一人物的合成人脸图像进行图像检测,得到图像检测结果;
    根据所述图像检测结果对所述第一人物的合成人脸图像进行人脸矫正,得到矫正后的所述第一人物的合成人脸图像;
    输出矫正后的所述第一人物的合成人脸图像。
  6. 根据权利要求2-4任一项所述的方法,其中,所述方法还包括:
    获取人脸图像数据集,所述人脸图像数据集包括至少一组图像,所述至少一组图像中的每组图像包括原人脸图像、至少一种姿态中每种姿态对应的至少一张人脸图像以及至少一种表情中每种表情对应的至少一张人脸图像;
    利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型。
  7. 根据权利要求6所述的方法,其中,所述利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型,包括:
    对所述至少一组图像中的目标组图像进行特征提取,得到第二人脸特征集合;
    利用初始的卷积神经网络模型对所述第二人脸特征集合进行上采样,得到至少一张第一合成人脸图像;
    通过所述初始的卷积神经网络模型对所述至少一张第一合成人脸图像中每张第一合成人脸图像进行还原处理,得到所述每张第一合成人脸图像对应的第二合成人脸图像,所述 第二合成人脸图像与所述目标组人脸图像包括的原人脸图像相匹配,得到收敛的卷积神经网络模型作为训练后的卷积神经网络模型。
  8. 一种图像处理装置,包括:
    获取模块,用于获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
    处理模块,用于对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
    所述处理模块,还用于根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
  9. 一种电子设备,包括处理器和存储器,所述处理器和所述存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行以下方法:
    获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
    对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
    根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
  10. 根据权利要求9所述的电子设备,其中,执行所述根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,包括:
    利用训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,所述上采样包括以下任一项:双线性插值、最近邻插值、转置卷积。
  11. 根据权利要求10所述的电子设备,其中,所述上采样包括转置卷积,执行所述利用所述训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,包括:
    利用所述训练后的卷积神经网络模型包括的转置卷积层对所述第一人脸特征集合进行转置卷积,得到所述第一人物的合成人脸图像。
  12. 根据权利要求9-11任一项所述的电子设备,其中,所述得到所述第一人物的合成人脸图像之后,所述处理器还用于执行:
    对所述第一人物的合成人脸图像进行图像检测,得到图像检测结果;
    根据所述图像检测结果对所述第一人物的合成人脸图像进行人脸矫正,得到矫正后的所述第一人物的合成人脸图像;
    输出矫正后的所述第一人物的合成人脸图像。
  13. 根据权利要求10-11任一项所述的电子设备,其中,所述处理器还用于执行:
    获取人脸图像数据集,所述人脸图像数据集包括至少一组图像,所述至少一组图像中的每组图像包括原人脸图像、至少一种姿态中每种姿态对应的至少一张人脸图像以及至少一种表情中每种表情对应的至少一张人脸图像;
    利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型。
  14. 根据权利要求13所述的电子设备,其中,执行所述利用所述人脸图像数据集对初 始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型,包括:
    对所述至少一组图像中的目标组图像进行特征提取,得到第二人脸特征集合;
    利用初始的卷积神经网络模型对所述第二人脸特征集合进行上采样,得到至少一张第一合成人脸图像;
    通过所述初始的卷积神经网络模型对所述至少一张第一合成人脸图像中每张第一合成人脸图像进行还原处理,得到所述每张第一合成人脸图像对应的第二合成人脸图像,所述第二合成人脸图像与所述目标组人脸图像包括的原人脸图像相匹配,得到收敛的卷积神经网络模型作为训练后的卷积神经网络模型。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现以下方法:
    获取人脸图像集合,所述人脸图像集合包括第一人物的人脸图像、第二人物的指定姿态的人脸图像以及第三人物的指定表情的人脸图像;
    对所述人脸图像集合中各人脸图像进行特征提取,得到第一人脸特征集合,所述第一人脸特征集合包括所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征;
    根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,所述第一人物的合成人脸图像具有所述第一人物的脸部特征、所述第二人物的姿态特征以及所述第三人物的表情特征。
  16. 根据权利要求15所述的计算机可读存储介质,其中,执行所述根据所述第一人脸特征集合进行人脸合成,得到所述第一人物的合成人脸图像,包括:
    利用训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,所述上采样包括以下任一项:双线性插值、最近邻插值、转置卷积。
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述上采样包括转置卷积,执行所述利用所述训练后的卷积神经网络模型对所述第一人脸特征集合进行上采样,得到所述第一人物的合成人脸图像,包括:
    利用所述训练后的卷积神经网络模型包括的转置卷积层对所述第一人脸特征集合进行转置卷积,得到所述第一人物的合成人脸图像。
  18. 根据权利要求15-17任一项所述的计算机可读存储介质,其中,所述得到所述第一人物的合成人脸图像之后,所述计算机程序被处理器执行时还用于实现:
    对所述第一人物的合成人脸图像进行图像检测,得到图像检测结果;
    根据所述图像检测结果对所述第一人物的合成人脸图像进行人脸矫正,得到矫正后的所述第一人物的合成人脸图像;
    输出矫正后的所述第一人物的合成人脸图像。
  19. 根据权利要求16-17任一项所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还用于实现:
    获取人脸图像数据集,所述人脸图像数据集包括至少一组图像,所述至少一组图像中的每组图像包括原人脸图像、至少一种姿态中每种姿态对应的至少一张人脸图像以及至少一种表情中每种表情对应的至少一张人脸图像;
    利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型。
  20. 根据权利要求19所述的计算机可读存储介质,其中,执行所述利用所述人脸图像数据集对初始的卷积神经网络模型进行训练,得到训练后的卷积神经网络模型,包括:
    对所述至少一组图像中的目标组图像进行特征提取,得到第二人脸特征集合;
    利用初始的卷积神经网络模型对所述第二人脸特征集合进行上采样,得到至少一张第 一合成人脸图像;
    通过所述初始的卷积神经网络模型对所述至少一张第一合成人脸图像中每张第一合成人脸图像进行还原处理,得到所述每张第一合成人脸图像对应的第二合成人脸图像,所述第二合成人脸图像与所述目标组人脸图像包括的原人脸图像相匹配,得到收敛的卷积神经网络模型作为训练后的卷积神经网络模型。
PCT/CN2021/096713 2020-07-22 2021-05-28 图像处理方法、装置、电子设备及计算机可读存储介质 WO2022016996A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010710400.7A CN111833413B (zh) 2020-07-22 2020-07-22 图像处理方法、装置、电子设备及计算机可读存储介质
CN202010710400.7 2020-07-22

Publications (1)

Publication Number Publication Date
WO2022016996A1 true WO2022016996A1 (zh) 2022-01-27

Family

ID=72924678

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/096713 WO2022016996A1 (zh) 2020-07-22 2021-05-28 图像处理方法、装置、电子设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN111833413B (zh)
WO (1) WO2022016996A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115588108A (zh) * 2022-11-02 2023-01-10 上海人工智能创新中心 一种生成序列影像的方法、电子设备及介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111833413B (zh) * 2020-07-22 2022-08-26 平安科技(深圳)有限公司 图像处理方法、装置、电子设备及计算机可读存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254336A (zh) * 2011-07-14 2011-11-23 清华大学 人脸视频合成方法及装置
US20190012578A1 (en) * 2017-07-07 2019-01-10 Carnegie Mellon University 3D Spatial Transformer Network
CN110097606A (zh) * 2018-01-29 2019-08-06 微软技术许可有限责任公司 面部合成
CN111383307A (zh) * 2018-12-29 2020-07-07 上海智臻智能网络科技股份有限公司 基于人像的视频生成方法及设备、存储介质
WO2020150689A1 (en) * 2019-01-18 2020-07-23 Snap Inc. Systems and methods for realistic head turns and face animation synthesis on mobile device
CN111539903A (zh) * 2020-04-16 2020-08-14 北京百度网讯科技有限公司 训练人脸图像合成模型的方法和装置
CN111583399A (zh) * 2020-06-28 2020-08-25 腾讯科技(深圳)有限公司 图像处理方法、装置、设备、介质和电子设备
CN111833413A (zh) * 2020-07-22 2020-10-27 平安科技(深圳)有限公司 图像处理方法、装置、电子设备及计算机可读存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020067362A1 (en) * 1998-11-06 2002-06-06 Agostino Nocera Luciano Pasquale Method and system generating an avatar animation transform using a neutral face image
CN106845330A (zh) * 2016-11-17 2017-06-13 北京品恩科技股份有限公司 一种基于深度卷积神经网络的二维人脸识别模型的训练方法
CN107680158A (zh) * 2017-11-01 2018-02-09 长沙学院 一种基于卷积神经网络模型的三维人脸重建方法
CN109344724B (zh) * 2018-09-05 2020-09-25 深圳伯奇科技有限公司 一种证件照自动背景替换方法、系统及服务器

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254336A (zh) * 2011-07-14 2011-11-23 清华大学 人脸视频合成方法及装置
US20190012578A1 (en) * 2017-07-07 2019-01-10 Carnegie Mellon University 3D Spatial Transformer Network
CN110097606A (zh) * 2018-01-29 2019-08-06 微软技术许可有限责任公司 面部合成
CN111383307A (zh) * 2018-12-29 2020-07-07 上海智臻智能网络科技股份有限公司 基于人像的视频生成方法及设备、存储介质
WO2020150689A1 (en) * 2019-01-18 2020-07-23 Snap Inc. Systems and methods for realistic head turns and face animation synthesis on mobile device
CN111539903A (zh) * 2020-04-16 2020-08-14 北京百度网讯科技有限公司 训练人脸图像合成模型的方法和装置
CN111583399A (zh) * 2020-06-28 2020-08-25 腾讯科技(深圳)有限公司 图像处理方法、装置、设备、介质和电子设备
CN111833413A (zh) * 2020-07-22 2020-10-27 平安科技(深圳)有限公司 图像处理方法、装置、电子设备及计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115588108A (zh) * 2022-11-02 2023-01-10 上海人工智能创新中心 一种生成序列影像的方法、电子设备及介质
CN115588108B (zh) * 2022-11-02 2024-05-14 上海人工智能创新中心 一种生成序列影像的方法、电子设备及介质

Also Published As

Publication number Publication date
CN111833413B (zh) 2022-08-26
CN111833413A (zh) 2020-10-27

Similar Documents

Publication Publication Date Title
US11373275B2 (en) Method for generating high-resolution picture, computer device, and storage medium
WO2020199906A1 (zh) 人脸关键点检测方法、装置、设备及存储介质
WO2020192568A1 (zh) 人脸图像生成方法、装置、设备及存储介质
US10789453B2 (en) Face reenactment
US9811894B2 (en) Image processing method and apparatus
WO2018176958A1 (zh) 一种随图像中关键点移动的自适应贴图方法和系统
WO2022012085A1 (zh) 人脸图像处理方法、装置、存储介质及电子设备
WO2017035966A1 (zh) 用于人脸图像处理的方法和装置
JP2023545565A (ja) 画像検出方法、モデルトレーニング方法、画像検出装置、トレーニング装置、機器及びプログラム
WO2022016996A1 (zh) 图像处理方法、装置、电子设备及计算机可读存储介质
CN111047509B (zh) 一种图像特效处理方法、装置及终端
WO2023035531A1 (zh) 文本图像超分辨率重建方法及其相关设备
TW201115252A (en) Document camera with image-associated data searching and displaying function and method applied thereto
US20200380639A1 (en) Enhanced Image Processing Techniques for Deep Neural Networks
WO2022022043A1 (zh) 人脸图像生成方法、装置、服务器及存储介质
US10489839B2 (en) Information presentation method and information presentation apparatus
CN112288665A (zh) 图像融合的方法、装置、存储介质及电子设备
JP2019117577A (ja) プログラム、学習処理方法、学習モデル、データ構造、学習装置、および物体認識装置
CN113673519B (zh) 基于文字检测模型的文字识别方法及其相关设备
WO2022100680A1 (zh) 混血人脸图像生成方法、模型训练方法、装置和设备
WO2022105569A1 (zh) 页面方向识别方法、装置、设备及计算机可读存储介质
WO2020062191A1 (zh) 图像处理方法、装置及设备
WO2024098685A1 (zh) 虚拟人物面部驱动方法、装置、终端设备和可读存储介质
WO2021051605A1 (zh) 基于表情驱动的虚拟视频合成方法、装置及存储介质
CN115984447B (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: 21846221

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21846221

Country of ref document: EP

Kind code of ref document: A1