Expression transformation method and apparatus, electronic device, and computer readable medium
View Patent ↗An expression transformation method and apparatus, an electronic device, and a computer readable medium. The method comprises: acquiring a target face image ( 201 ); and inputting the target face image into a pre-trained expression transformation model to obtain an expression transformation image ( 202 ). The expression transformation model performs expression transformation on the target face image to achieve different expression transformation effects. A set of face images which are locally processed and have preset expressions displayed are used for training, so that the effect of the additional special effect can be achieved for the expression transformation image on the basis of transformation.
1 . An expression transformation method, comprising:
obtaining a target face image;
inputting the target face image into an expression transformation model,
wherein the expression transformation model is pre-trained using an original face image set and an image set subjected to local processing and displaying preset expressions, and
wherein the image set subjected to local processing and displaying preset expressions for training the expression transformation model is obtained by performing local processing on particular regions of face images that present the preset expressions, and wherein the local processing performed on the particular regions of face images comprises image super-resolution processing and local whitening super-resolution processing; and
generating an expression transformation image by the expression transformation model performing expression transformation on the target face image, wherein the expression transformation image comprises a particular expression with an added effect, and wherein the added effect comprises beaming, whitened teeth, or colored hair.
2 . The method according to claim 1 , wherein after inputting the target face image into the pre-trained expression transformation model to obtain the expression transformation image, the method further comprises:
performing a masking processing on a target region of the expression transformation image to obtain an expression transformation image after the masking processing.
3 . The method according to claim 1 , wherein the expression transformation model comprises at least one of an expression transformation network or an expression transformation grid.
4 . The method according to claim 3 , further comprising:
obtaining the expression transformation image in response to inputting the target face image into the expression transformation network, wherein the expression transformation network is obtained through training by using the original face image set and the image set subjected to local processing and displaying the preset expressions.
5 . The method according to claim 4 , wherein the expression transformation network is obtained through training through the following steps:
obtaining the original face image set; and
inputting the original face image set and the image set subjected to local processing and displaying preset expressions into a preset first generative adversarial network for training to generate the expression transformation network.
6 . The method according to claim 1 , wherein the face images that present the preset expressions are obtained through:
inputting original face images in the original face image set into a pre-trained second generative adversarial network to obtain the face images that present the preset expressions.
7 . The method according to claim 3 , further comprising:
obtaining the expression transformation image corresponding to the target face image in response to inputting the target face image into the expression transformation grid, wherein the expression transformation grid is obtained through the original face image set and an original face image set subjected to local processing and displaying preset expressions.
8 . The method according to claim 3 , wherein the expression transformation grid is obtained through the following steps:
obtaining the original face image set;
performing local processing on each original face image that presents the preset expressions to obtain the image set subjected to local processing and displaying the preset expressions; and
storing, in preset grids, the original face image set and the face image set subjected to local processing and displaying the preset expressions to generate the expression transformation grid, wherein the expression transformation grid can represent a one-to-one corresponding relation between original face images and the expression transformation images corresponding thereto.
9 . An electronic device, comprising:
one or more processors; and
a storage apparatus, storing one or more programs, wherein
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement operations comprising:
obtaining a target face image;
inputting the target face image into an expression transformation model,
wherein the expression transformation model is pre-trained using an original face image set and an image set subjected to local processing and displaying preset expressions, and
wherein the image set subjected to local processing and displaying preset expressions for training the expression transformation model is obtained by performing local processing on particular regions of face images that present the preset expressions, and wherein the local processing performed on the particular regions of face images comprises image super-resolution processing and local whitening super-resolution processing; and
generating an expression transformation image by the expression transformation model performing expression transformation on the target face image, wherein the expression transformation image comprises a particular expression with an added effect, and wherein the added effect comprises beaming, whitened teeth, or colored hair.
10 . A non-transitory computer readable medium, storing a computer program, wherein the program, when executed by a processor, implements operations comprising:
obtaining a target face image;
inputting the target face image into an expression transformation model,
wherein the expression transformation model is pre-trained using an original face image set and an image set subjected to local processing and displaying preset expressions, and
wherein the image set subjected to local processing and displaying preset expressions for training the expression transformation model is obtained by performing local processing on particular regions of face images that present the preset expressions, and wherein the local processing performed on the particular regions of face images comprises image super-resolution processing and local whitening super-resolution processing; and
generating an expression transformation image by the expression transformation model performing expression transformation on the target face image, wherein the expression transformation image comprises a particular expression with an added effect, and wherein the added effect comprises beaming, whitened teeth, or colored hair.
11 . The electronic device according to claim 9 , wherein after inputting the target face image into the pre-trained expression transformation model to obtain the expression transformation image, the operations further comprise:
performing a masking processing on a target region of the expression transformation image to obtain an expression transformation image after the masking processing.
12 . The electronic device according to claim 9 , wherein the expression transformation model comprises at least one of an expression transformation network or an expression transformation grid.
13 . The electronic device according to claim 12 , the operations further comprising:
obtaining the expression transformation image in response to inputting the target face image into the expression transformation network, wherein the expression transformation network is obtained through training by using the original face image set and the image set subjected to local processing and displaying the preset expressions.
14 . The electronic device according to claim 13 , wherein the expression transformation network is obtained through training through operations of:
obtaining the original face image set; and
inputting the original face image set and the image set subjected to local processing and displaying preset expressions into a preset first generative adversarial network for training to generate the expression transformation network.
15 . The electronic device according to claim 9 , wherein the face images that present the preset expressions are obtained through:
inputting original face images in the original face image set into a pre-trained second generative adversarial network to obtain the face images that present the preset expressions.
16 . The electronic device according to claim 12 , the operations further comprising:
obtaining the expression transformation image corresponding to the target face image in response to inputting the target face image into the expression transformation grid, wherein the expression transformation grid is obtained through the original face image set and the face image set subjected to local processing and displaying preset expressions.
17 . The electronic device according to claim 12 , wherein the expression transformation grid is obtained through operations of:
obtaining the original face image set;
performing local processing on each original face image that presents the preset expressions to obtain the image set subjected to local processing and displaying the preset expressions; and
storing, in preset grids, the original face image set and the face image set subjected to local processing and displaying the preset expressions to generate the expression transformation grid, wherein the expression transformation grid can represent a one-to-one corresponding relation between original face images and the expression transformation images corresponding thereto.