Method for generating animal face style images, method for training models, and device

The method and apparatus for generating animal face style images using pre-trained models address the limitations of current video interactive applications by providing diverse and personalized image transformations, enhancing user engagement and image editing functions.

JP7596533B2Active Publication Date: 2024-12-09BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2023528414
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-11-13
Filing Date
2021-11-12
Publication Date
2024-12-09
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

Current video interactive applications lack the ability to provide diverse and personalized image style transformations, leading to a poor user experience and limited engagement.

Method used

A method and apparatus for generating animal face style images using a pre-trained animal face style image generation model, which converts human faces into animal faces, and a training method for the model using Generative Adversarial Networks and Style-based Generative Adversarial Networks to enhance image editing functions and user engagement.

Benefits of technology

Enriches image editing capabilities and enhances user experience by dynamically generating realistic animal face style images tailored to individual users, improving the fun and functionality of video interactive applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007596533000001
    Figure 0007596533000001
  • Figure 0007596533000002
    Figure 0007596533000002
  • Figure 0007596533000003
    Figure 0007596533000003
Patent Text Reader

Abstract

A method for generating an animal face style image, a model training method, a device, and an apparatus for training the model, the method including: acquiring an original human face image (S101); and using a pre-trained animal face style image generation model to obtain an animal face style image corresponding to the original human face image (S102). The animal face style image is an image obtained by converting a human face in the original human face image into an animal face. The animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image. The first animal face style sample image is generated based on the first human face sample image by the pre-trained animal face generation model. The animal face generation model is trained based on a second human face sample image and the first animal face sample image. The method can enhance the image editing functions of a terminal, improve the fun of video interactive applications, and provide users with special effects.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to a Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on November 13, 2020, bearing application number 202011269334.0 and entitled "Method for generating animal face style images, model training method, device and apparatus," the entire contents of which are incorporated herein by reference.

[0002] The present disclosure relates to the technical field of image processing, and in particular to a method for generating animal face style images, a model training method, an apparatus and a device. [Background technology]

[0003] With the development of image processing technology, the functions of video interactive applications have gradually become richer, and image transformation has become a new and interesting way to play. Image style transformation refers to transforming one or more images from one style to another. However, the types of style transformation supported by current video interactive applications are still limited and lacking in interest, which leads to poor user experience and may not meet the user's needs for personalized image style transformation. Summary of the Invention [Means for solving the problem]

[0004] In order to solve the above technical problems, or at least partially solve the above technical problems, embodiments of the present disclosure provide a method for generating animal face style images, a method, an apparatus and a device for training a model.

[0005] In a first aspect, an embodiment of the present disclosure comprises: obtaining an original human face image; utilizing a pre-trained animal face style image generation model to obtain an animal face style image corresponding to the original human face image; Including, The animal face style image is an image obtained by converting a human face in the original human face image into an animal face, the animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image, the first animal face style sample image is generated based on the first human face sample image by a pre-trained animal face generation model, and the animal face generation model is trained based on a second human face sample image and the first animal face sample image. A method for generating an animal face style image is provided.

[0006] In a second aspect, an embodiment of the present disclosure comprises: training an image generation model based on the second human face sample image and the first animal face sample image to obtain an animal face generation model; obtaining a first animal face style sample image corresponding to a first human face sample image by the animal face generation model, the first animal face style sample image being an image obtained by converting a human face in the first human face sample image into an animal face; training a styled image generation model based on the first human face sample image and the first animal face styled sample image to obtain an animal face styled image generation model; Including, The animal face style image generation model is used to obtain an animal face style image corresponding to an original human face image, and the animal face style image is an image obtained by converting a human face in the original human face image into an animal face. A method for training an animal face style image generation model is further provided.

[0007] In a third aspect, an embodiment of the present disclosure comprises: an original human face image acquisition module for acquiring an original human face image; a styled image generation module for obtaining an animal face styled image corresponding to the original human face image by utilizing a pre-trained animal face styled image generation model; Including, The animal face style image is an image obtained by converting a human face in the original human face image into an animal face, the animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image, the first animal face style sample image is generated based on the first human face sample image by a pre-trained animal face generation model, and the animal face generation model is trained based on a second human face sample image and the first animal face sample image. An apparatus for generating an animal face style image is further provided.

[0008] In a fourth aspect, an embodiment of the present disclosure comprises: an animal face generation model training module for training an image generation model based on the second human face sample image and the first animal face sample image to obtain an animal face generation model; a style sample image generation module for obtaining a first animal face style sample image corresponding to a first human face sample image by the animal face generation model, the first animal face style sample image being an image obtained by converting a human face in the first human face sample image into an animal face; a styled image generation model training module for training a styled image generation model based on the first human face sample image and the first animal face styled sample image to obtain an animal face styled image generation model; Including, The animal face style image generation model is used to obtain an animal face style image corresponding to an original human face image, and the animal face style image is an image obtained by converting a human face in the original human face image into an animal face. An apparatus for training an animal face style image generation model is further provided.

[0009] In a fifth aspect, an embodiment of the present disclosure further provides an electronic device including a memory and a processor, the memory storing a computer program, the computer program, when executed by the processor, causing the processor to perform either a method for generating an animal face style image or a method for training an animal face style image generation model according to an embodiment of the present disclosure.

[0010] In a sixth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, causing the processor to perform any one of a method for generating an animal face style image or a method for training an animal face style image generation model according to an embodiment of the present disclosure.

[0011] Compared with the conventional technology, the technical solutions according to the embodiments of the present disclosure have at least the following advantages:

[0012] In the embodiment of the present disclosure, the server can deliver a pre-trained animal face style image generation model to a terminal and call it up to generate an animal face style image corresponding to an original human face image, so that the image editing function of the terminal can be enriched. Taking a video interactive application as an example, calling up this animal face style image generation model to obtain an animal face style image corresponding to an original human face image not only enriches the image editing function of the application, but also improves the fun of this video interactive application, provides users with new special effect play, and improves the user's usage experience. In addition, by using this animal face style image generation model, for each original face image of different users, an animal face style image suitable for the user's original face image can be dynamically generated, which can enhance the intelligence of generating animal face style images and display better image effects, such as obtaining more realistic animal face style images. [Brief description of the drawings]

[0013] The drawings herein, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the disclosure.

[0014] In order to more clearly describe the technical solutions in the embodiments of the present disclosure or the prior art, the following briefly describes the drawings that need to be used to describe the embodiments or the prior art. Obviously, a person skilled in the art can also obtain other drawings based on these drawings without paying labor worth the inventive step.

[0015] [Figure 1] 1 is a flowchart of a method for generating an animal face style image according to an embodiment of the present disclosure; [Diagram 2] 1 is a flowchart of a method for generating an animal face style image according to another embodiment of the present disclosure; [Diagram 3] 1 is a flowchart of a method for training an animal face style image generation model according to an embodiment of the present disclosure; [Figure 4] 1 is a structural schematic diagram of an animal face style image generating apparatus according to an embodiment of the present disclosure; [Diagram 5] 1 is a structural schematic diagram of an animal face style image generation model training device according to an embodiment of the present disclosure; [Figure 6] 1 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0016] In order to make the above objectives, features and advantages of the present disclosure more clearly comprehensible, the technical solutions of the present disclosure are further described below. It should be noted that, unless contradictory, the features in the examples and embodiments of the present disclosure can be combined with each other.

[0017] In order to facilitate a thorough understanding of the present disclosure, numerous specific details are set forth in the following description, but the present disclosure may be embodied in other forms different from those described herein. Apparently, the embodiments in the present specification are merely some embodiments of the present disclosure, but not all embodiments.

[0018] 1 is a flowchart of a method for generating an animal face style image according to an embodiment of the present disclosure. The method for generating an animal face style image is performed by an apparatus for generating an animal face style image, which can be realized by software and / or hardware and integrated into any electronic device with computing capabilities, such as a terminal such as a smartphone, a tablet, or a laptop.

[0019] The animal face style image generating device may be realized in the form of an independent application program or a mini program integrated on a public platform, or may be realized as a functional module integrated on an application program or mini program having a style image generating function. The application program having the style image generating function may include, but is not limited to, a video interactive application. The mini program may include, but is not limited to, a video interactive mini program.

[0020] The method for generating an animal face style image according to an embodiment of the present disclosure can be applied to a scene in which an animal face style image is obtained. In an embodiment of the present disclosure, the animal face style image or the animal face style sample image is an image obtained by converting a human face into an animal face, for example, converting a human face into an animal face such as a cat face or a dog face to obtain an animal face style image. In addition, after converting a human face into an animal face, the facial expression of the human face can be matched with the facial expression of the animal face, and the five senses state of the human face can also be matched with the five senses state of the animal face, for example, when a smile appears on a human face, a smile also appears on the corresponding animal face, and when the eyes on a human face are open, the eyes on the corresponding animal face are also open, etc.

[0021] As shown in FIG. 1, a method for generating an animal face style image according to an embodiment of the present disclosure may include the following steps.

[0022] S101: Obtain an original human face image.

[0023] For example, when a user needs to generate an animal face style image, the user can obtain an image stored in the terminal, or can take an image or video in real time by an image capture device of the terminal. The animal face style image generation device obtains an original human face image to be processed according to an image selection operation, an image capture operation, or an image upload operation of the user on the terminal.

[0024] For example, take the example of a user calling an image capture device (such as a camera) of a terminal in a video interactive application to capture an image in real time, and then the video interactive application jumps to an image collection interface, and then the image collection interface can display the capture presentation information. The capture presentation information can be at least one of information for presenting the user to place the face of the human face image in the image collection interface at a preset position (such as the center position of the screen) on the terminal screen, adjust the distance from the face to the terminal screen (by adjusting this distance, a face area of ​​an appropriate size can be obtained in the image collection interface so that the face area is not too large or too small), and adjust the rotation angle of the face (different rotation angles correspond to different face orientations such as front and profile). The user captures an image according to the capture presentation information, and thus the video interactive application can easily obtain an original human face image that meets the input requirements of the animal face style image generation model. Note that the input requirements of the animal face style image generation model may mean restrictive conditions for the input image, such as the position of the face in the input image, the size of the input image, and the like.

[0025] In addition, the video interactive application can also pre-store a shooting template according to the input requirements of the animal face style image generation model. The shooting template pre-defines information such as the position of the user's face in the image, the size of the face area, the face direction, and the image size. The video interactive application can use the shooting template to obtain the required original human face image according to the user's shooting operation.

[0026] Of course, if there is a difference between the image captured by the user and the image conditions among the input requirements of the animal face style image generation model (such as the position of the human face in the image, image size, etc.), the original human face image conforming to the model input can be obtained by performing operational processing such as cropping, zooming, and rotation on the image captured by the user.

[0027] S102: Obtain an animal face style image corresponding to the original human face image by utilizing a pre-trained animal face style image generation model.

[0028] The animal face style image is an image obtained by converting a human face in an original human face image into an animal face, and the animal face style image generation model has a function of converting a human face into an animal face. The animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image, and the first animal face style sample image is generated based on the first human face sample image by a pre-trained animal face generation model, that is, the animal face generation model has a function of generating a corresponding animal face style image for any human face image, and when the human face in the first human face sample image is converted into an animal face, the corresponding first animal face style sample image is obtained. The animal face generation model is trained based on a second human face sample image and a first animal face sample image, and the first animal face sample image is an animal face image showing realistic animal face features, and the second human face sample image and the first human face sample image may be the same face image or different face images, and are not particularly limited in the embodiments of the present disclosure.

[0029] In addition, the multiple first animal face sample images used for training the animal face generation model correspond to the same animal type, for example, the multiple first animal face sample images used for training the animal face generation model all correspond to animal face images of cats or dogs. In further subdivision, the multiple first animal face sample images used for training the animal face generation model may correspond to animal face images belonging to the same breed of the same animal type, for example, the multiple first animal face sample images used for training the animal face generation model may all correspond to animal face images of Dragon Lee cat breed or Persian cat breed. In other words, in the embodiment of the present disclosure, multiple animal face generation models can be trained for different animal types or different animal breeds of the same animal type, so that each animal face generation model has the function of generating an animal face image of a specific type or specific breed. The first animal face sample images may be obtained by collecting animal images taken of animals on the Internet.

[0030] Regarding the specific training procedure of the above model, the embodiment of the present disclosure is not specifically limited, and a person skilled in the art can implement it with any available training method according to the function of the model. Illustratively, the above model training procedure can include: First, obtain an animal face generation model by training an image generation model based on the second human face sample image and the first animal face sample image. Available image generation models may include, but are not limited to, a Generative Adversarial Network (GAN) model, a StyleganStyle-Based Generative Adversarial Network for Generator Architecture model, and the like. Next, obtain a first animal face style sample image corresponding to the first human face sample image by the animal face generation model. The first animal face style sample image is an image obtained by converting the human face in the first human face sample image into an animal face. Finally, obtain an animal face style image generation model by training a style image generation model based on the first human face sample image and the first animal face style sample image. Among them, available style image generation models may include, for example, Conditional Generative Adversarial Networks (CGAN) models, Cycle Consistent Adversarial Networks (Cycle-GAN) models, etc.

[0031] By using the animal face generation model to obtain a first animal face style sample image corresponding to the first human face sample image, and then using the first human face sample image and the first animal face style sample image as paired training samples for training to obtain an animal face style image generation model, the training effect of the animal face style image generation model can be ensured, and further, the animal face style image corresponding to the generated original human face image has a good display effect, for example, obtaining a more realistic animal face style image.

[0032] In addition to the above technical proposals, optionally, the first human face sample image is obtained by adjusting the position of a human face relative to the first original human face sample image based on a first correspondence relationship between human face key points in the first original human face sample image and animal face key points in the first original animal face sample image. The second human face sample image is obtained by adjusting the position of the human face relative to the second original human face sample image based on a second correspondence between the human face key points in the second original human face sample image and the animal face key points in the first original animal face sample image. The first animal face sample image is obtained by adjusting the position of the animal face with respect to the first original animal face sample image based on the first correspondence relationship or the second correspondence relationship.

[0033] That is, considering the difference between the animal face and the human face, before obtaining the first animal face style sample image corresponding to the first human face sample image by the animal face generation model, it is necessary to determine a first correspondence between the human face key points in the first original human face sample image and the animal face key points in the first original animal face sample image, and the first human face sample image is obtained by adjusting the position of the human face with respect to the first original human face sample image based on this first correspondence, thereby obtaining a first human face sample image that satisfies the input requirements (position of the human face in the image, image size, etc.) of the animal face generation model or the animal face style image generation model. Similarly, the first animal face sample image can also be obtained by adjusting the position of the animal face with respect to the first original animal face sample image based on this first correspondence, and the first animal face sample image similarly satisfies the input requirements of the model.

[0034] Exemplarily, after the first correspondence is determined, an affine transformation matrix is ​​constructed for adjusting the position of the human face in the first original human face sample image according to the key points of the human face involved in the first correspondence, and the position of the human face is adjusted for the first original human face sample image according to the affine transformation matrix, so as to obtain a first human face sample image; an affine transformation matrix is ​​constructed for adjusting the position of the animal face in the first original animal face sample image according to the key points of the animal face involved in the first correspondence, and the position of the animal face is adjusted for the first original animal face sample image according to the affine transformation matrix, so as to obtain a first animal face sample image. For the specific construction of the affine transformation matrix, reference can be made to the principle of affine transformation. In addition, the affine transformation matrix may be related to the parameters such as zoom parameters, cropping ratios, etc. of the first original human face sample image or the first original animal face sample image, that is, in the process of adjusting the position of the human face or the animal face, the related image processing operations may include cropping, zooming, rotation, etc., but can be specifically determined according to the needs of image processing.

[0035] The first human face sample image and the first animal face sample image finally obtained by performing image adjustment based on the same key point correspondence have the same image size, and the human face area in the first human face sample image and the animal face area in the first animal face sample image correspond to the same image position, for example, the human face area is located in the central area of ​​the first human face sample image, and the animal face area is also located in the central area of ​​the first animal face sample image, etc. Also, the difference between the area of ​​the human face area and the area of ​​the animal face area is smaller than an area threshold (a value that can be flexibly set), that is, the area of ​​the human face area matches the area of ​​the animal face area. This ensures that the animal face generation model generates a first animal face style sample image with good display effect; furthermore, since the animal face style image generation model can be obtained by training based on high-quality training samples, good model training effect can be ensured, and a situation where the animal face area and the human face area in the animal face style image generated by the animal face style image generation model do not match, which affects the display effect of the animal face style image, for example, the animal face area being too large or too small compared with the human face area, can be avoided.

[0036] Similarly, prior to training to obtain an animal face generation model, a second correspondence relationship between the human face key points in the second original human face sample image and the animal face key points in the first original animal face sample image can be determined first, and then the human face position adjustment can be performed on the second original human face sample image based on the second correspondence relationship. Related image processing operations can include cropping, zooming, rotation, etc., so that a second human face sample image that meets the input image conditions of the image generation model can be obtained. Of course, according to the order of demand for the first animal face sample image, the position adjustment of the animal face can be performed on the first original animal face sample image in advance based on this second correspondence relationship, so that a first animal face sample image that meets the input requirements of the image generation model can be obtained.

[0037] Exemplarily, after the above second correspondence is determined, an affine transformation matrix for adjusting the position of the human face in the second original human face sample image can be constructed based on the key points of the human face involved in the second correspondence, and an affine transformation matrix for adjusting the position of the animal face in the first original animal face sample image can also be constructed based on the key points of the animal face related to the second correspondence. The finally obtained second human face sample image and the first animal face sample image have the same image size, and the human face area in the second human face sample image and the animal face area in the first animal face sample image correspond to the same image position, for example, the human face area is located in the central area of ​​the second human face sample image, and the animal face area is also located in the central area of ​​the first animal face sample image, etc. In addition, the difference between the area of ​​the human face area and the area of ​​the animal face area is smaller than an area threshold (a numerical value can be flexibly set), that is, the area of ​​the human face area is consistent with the area of ​​the animal face area. This can ensure a good model training effect based on high-quality training samples.

[0038] Optionally, the animal face style image generation model is trained based on a first human face sample image and a second animal face style sample image, and the second animal face style sample image is obtained by replacing a background region in the first animal face style sample image with a background region in the first human face sample image. By replacing the background, in the process of obtaining the animal face style image generation model by training, the influence of the background region in the animal face style sample image on the model training effect can be minimized, so as to ensure good model training effect, and further ensure that the generated animal face style image has good display effect.

[0039] Further, the second animal face style sample image is obtained by fusing the first animal face style sample image and the first human face sample image based on the second animal face mask image. The second animal face mask image is obtained based on the first animal face style sample image by a pre-trained animal face segmentation model, and the second animal face mask image is used to determine the animal face region in the first animal face style sample image as the animal face region in the second animal face style sample image. The animal face segmentation model is obtained by training based on the second animal face sample image and the position labeling result of the animal face region in the second animal face sample image. In ensuring that the animal face segmentation model has the function of generating a mask image corresponding to the animal face region in the image, a person skilled in the art can realize it by any available training method, and is not specifically limited in the embodiments of the present disclosure.

[0040] In the embodiment of the present disclosure, the server can deliver the pre-trained animal face style image generation model to the terminal and call it to generate an animal face style image corresponding to the original human face image, so that the image editing function of the terminal can be enriched. Taking a video interactive application as an example, calling the animal face style image generation model to obtain an animal face style image corresponding to the original human face image not only enriches the image editing function of the application, but also improves the fun of the application, provides users with newer special effect play, and improves the user's usage experience. In addition, by using the animal face style image generation model, for each original face image of different users, an animal face style image suitable for the user's original face image can be dynamically generated, which can enhance the intelligence of generating the animal face style image and display better image effects.

[0041] FIG. 2 is a flowchart of a method for generating an animal face style image according to another embodiment of the present disclosure, which can be further optimized and extended based on the above technical solutions and combined with the above optional embodiments.

[0042] As shown in FIG. 2, a method for generating an animal face style image according to an embodiment of the present disclosure may include the following steps.

[0043] S201: According to a type of animal-based special effect selected by a user, a correspondence relationship between an animal face key point and a human face key point corresponding to the type of animal-based special effect is determined.

[0044] Exemplarily, when a user launches an application program or a mini-program with a style image generation function on a terminal, the application program or the mini-program may display an interface for selecting a type of animal feature to the user, and the type of animal feature may be distinguished by different animal types, such as cat face special effects or dog face special effects, and may also be distinguished by different animal breeds, such as dragon li cat face special effects or Persian cat face special effects. Based on the type of animal special effects selected by the user, the terminal determines which type of animal the user currently wants to generate an animal face style image corresponding to, and further determines a correspondence relationship between the key points of the animal face and the key points of the human face. This correspondence relationship may be pre-stored in the terminal for the terminal to call according to the type of animal special effects. Of course, the terminal may determine an animal face corresponding to the type of animal special effects selected by the user, and after recognizing the key points of the human face in the user image, associate the key points of the animal face with the key points of the human face. The user image may be an image acquired by the terminal according to the user's image selection operation, image shooting operation, or image upload operation on the terminal.

[0045] S202: Based on the determined correspondence, adjust the position of the human face relative to the user image to obtain an original human face image.

[0046] According to the correspondence between the determined animal face key points and human face key points, an original human face image is obtained by performing human face position adjustment on the user image. The original human face image meets the input requirements of the animal face style image generation model. After the animal face style image generation model is trained, the input requirements (such as the position of the face in the image, the size of the image, etc.) corresponding to the model are also determined at the same time. Therefore, the terminal recognizes the human face key points in the user image using the key point recognition technology, and then performs human face position adjustment on the user image based on the determined correspondence, for example, the terminal uses the human face key points belonging to this correspondence in the user image to build an affine transformation matrix for adjusting the position of the human face in the user image, and the affine transformation matrix can be used to adjust the position of the human face in the user image, so that an original human face image that meets the input requirements of the animal face style image generation model is obtained. The related image processing operations include cropping, zooming, rotation, etc.

[0047] S203: Obtain an original human face image.

[0048] S204: Obtain an animal face style image corresponding to the original human face image by utilizing the pre-trained animal face style image generation model.

[0049] S205: Fusing an animal face region in the animal face style image with a background region in the user image to obtain a target animal face style image corresponding to the user image.

[0050] The background region in the user image is the remaining image region after removing the face region from the user image. For example, an image processing technique can be used to extract the animal face region from the animal face style image and the background region from the user image, and then blend (or mix) the two according to the position of the background region and the position of the human face region in the user image. That is, in the target animal face style image finally displayed to the user, except that the user's face features are changed to animal face features, the background region of the user image remains in the background of the image, so that the change of the background region in the user image is avoided in the process of generating the animal face style image.

[0051] Optionally, fusing the animal face region in the animal face style image with the background region in the user image to obtain a target animal face style image corresponding to the user image includes:

[0052] According to the animal face style image, an intermediate result image having the same image size as the user image is obtained. The position of the animal face region in the intermediate result image is the same as the position of the human face region in the user image. For example, according to the correspondence relationship between the key points of the animal face in the animal face style image and the key points of the human face in the user image, the animal face style image can be mapped to the image coordinates corresponding to the user image to obtain the intermediate result image.

[0053] A first animal face mask image corresponding to a type of animal-based special effect is determined.

[0054] Based on the first animal face mask image, the user image and the intermediate result image are fused to obtain a target animal face style image corresponding to the user image, and the first animal face mask image is used to determine an animal face region in the intermediate result image as an animal face region in the target animal face style image.

[0055] By using the first animal face mask image to realize the fusion of the user image and the intermediate result image, in addition to ensuring the acquisition of the target animal face style image, it also contributes to improving the efficiency of the image fusion process.

[0056] Furthermore, the step of fusing the user image and the intermediate result image based on the first animal face mask image to obtain a target animal face style image corresponding to the user image includes: The method may include a step of performing a smoothing process, such as a Gaussian blur process, on edges of the animal face in the first animal face mask image, and a step of fusing the user image and the intermediate result image based on the smoothed animal face mask image to obtain a target animal face style image corresponding to the user image.

[0057] By performing a smoothing process on the edge portion of the animal face in the first animal face mask image and then fusing the images, a smooth transition can be achieved between the background area in the user image and the animal face area in the intermediate result image, so as to optimize the image fusion effect and ensure the final display effect of the target animal face style image.

[0058] In addition, after a target animal face style image corresponding to a user image is obtained, or an animal face style image corresponding to an original human face image is obtained, a special effect identifier selected by a user can be determined according to a special effect selection operation by a user on an image editing interface, and a special effect corresponding to the special effect identifier selected by a user can be added to the target animal face style image or the animal face style image to further improve the fun of image editing. The special effects selectable by a user include any kind of props and stickers, but are not specifically limited in the embodiment of the present disclosure.

[0059] In the embodiment of the present disclosure, after a user image is obtained, first, an original human face image is obtained by performing human face position adjustment on the user image according to the correspondence between the animal face key points corresponding to the type of animal face special effect selected by the user and the human face key points. Then, an animal face style image generation model is used to obtain an animal face style image corresponding to the original human face image. Finally, the animal face area in the animal face style image and the background area in the user image are merged to obtain a target animal face style image displayed to the user. In order to animalize the user's facial features while leaving the original background in the user image, the image editing function in the terminal is enriched. Taking a video interactive application as an example, by calling the animal face style image generation model to obtain an animal face style image, not only can the image editing function of the application be enriched, but also the fun of the application can be improved, and a new special effect play can be provided to the user, improving the user's usage experience.

[0060] 3 is a flowchart of a method for training an animal face style image generation model according to an embodiment of the present disclosure, which is applied to a method for training an animal face style image generation model with the function of converting a human face into an animal face. The method for training an animal face style image generation model is performed by a training device for an animal face style image generation model, which can be realized by software and / or hardware and integrated on a server.

[0061] The training method for the animal face style image generation model according to the embodiment of the present disclosure is performed in cooperation with the animal face style image generation method according to the embodiment of the present disclosure. For contents not described in detail in the following embodiments, the description in the above-mentioned embodiment can be referred to.

[0062] As shown in FIG. 3, a method for training an animal face style image generation model according to an embodiment of the present disclosure may include the following steps.

[0063] S301: Train an image generation model based on the second human face sample image and the first animal face sample image to obtain an animal face generation model.

[0064] S302: Obtain a first animal face style sample image corresponding to the first human face sample image by an animal face generation model. The first animal face style sample image is an image obtained by converting the human face in the first human face sample image into an animal face.

[0065] S303: Train a styled image generation model based on the first human face sample image and the first animal face styled sample image to obtain an animal face styled image generation model. The animal face style image generation model is used to obtain an animal face style image corresponding to an original human face image, where the animal face style image is an image obtained by converting a human face in the original human face image into an animal face.

[0066] Optionally, before the step of training an image generation model based on the second human face sample image and the first animal face sample image to obtain an animal face generation model, the model training method according to the embodiment of the present disclosure includes: The method further includes the steps of determining a second correspondence between human face key points in the second original human face sample image and animal face key points in the first original animal face sample image; obtaining a second human face sample image by aligning the human face with respect to the second original human face sample image based on the second correspondence; and obtaining a first animal face sample image by aligning the animal face with respect to the first original animal face sample image based on the second correspondence.

[0067] Prior to the step of obtaining a first animal face style sample image corresponding to the first human face sample image by the animal face generation model, the model training method according to an embodiment of the present disclosure further includes the steps of determining a first correspondence between human face key points in the first original human face sample image and animal face key points in the first original animal face sample image, and obtaining the first human face sample image by aligning the animal face with respect to the first original human face sample image based on the first correspondence.

[0068] Optionally, after the step of obtaining a first animal face style image corresponding to the first human face sample image by the animal face generation model, the model training method according to an embodiment of the present disclosure further includes a step of obtaining a second animal face style sample image by replacing a background region in the first animal face style sample image with a background region in the first human face sample image.

[0069] Correspondingly, the step of training a styled image generation model based on the first human face sample image and the first animal face sample image to obtain an animal face styled image generation model includes the step of training a styled image generation model based on the first human face sample image and the second animal face sample image to obtain an animal face styled image generation model.

[0070] Optionally, the step of obtaining a second animal face style sample image by replacing background regions in the first animal face style sample image with background regions in the first human face sample image includes the steps of obtaining an animal face mask image corresponding to the first animal face style sample image based on the pre-trained animal face segmentation model, and fusing the first animal face style sample image and the first human face sample image based on the animal face mask image to obtain a second animal face style sample image, the animal face mask image being used to determine the animal face regions in the first animal face style sample image as animal face regions in the second animal face style sample image.

[0071] Optionally, the model training method according to an embodiment of the present disclosure further includes a step of obtaining a second animal face sample image and a position labeling result of the animal face region in the second animal face sample image, and a step of training based on the second animal face sample image and the position labeling result of the animal face region to obtain an animal face segmentation model.

[0072] In the embodiment of the present disclosure, the server can deliver the pre-trained animal face style image generation model to the terminal and call it to generate an animal face style image corresponding to the original human face image, so that the image editing function of the terminal can be enriched. Taking a video interactive application as an example, calling the animal face style image generation model to obtain an animal face style image not only enriches the image editing function of the application, but also improves the fun of the application and provides users with new special effect play, improving the user's usage experience.

[0073] 4 is a structural schematic diagram of an animal face style image generating device according to an embodiment of the present disclosure, which is applied to convert a user's face into an animal face. The animal face style image generating device can be realized by software and / or hardware and integrated into any electronic device with computing capabilities, such as a terminal such as a smartphone, a tablet, or a laptop.

[0074] As shown in FIG. 4, the animal face style image generating apparatus 400 according to the embodiment of the present disclosure includes: an original human face image acquisition module 401 for acquiring an original human face image; a styled image generation module 402 for obtaining an animal face styled image corresponding to the original human face image by utilizing a pre-trained animal face styled image generation model; Including, The animal face style image is an image obtained by converting a human face in an original human face image into an animal face, and the animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image.

[0075] Optionally, the first animal face style sample image is generated based on the first human face sample image by a pre-trained animal face generation model, and the animal face generation model is trained based on the second human face sample image and the first animal face sample image.

[0076] Optionally, the apparatus 400 according to the embodiment of the present disclosure may further include: a correspondence determining module for determining a correspondence between an animal face key point and a human face key point corresponding to the type of the animal special effect selected by a user; a human face position adjustment module for obtaining an original human face image by performing human face position adjustment on a user image based on a correspondence relationship between an animal face key point corresponding to the type of the animal-based special effect and a human face key point, the original human face image satisfying an input requirement of an animal face style image generation model; Includes.

[0077] Optionally, the image fusion module fuses the animal face regions in the animal face style image with background regions in the user image to obtain a target animal face style image corresponding to the user image.

[0078] Optionally, the image fusion module: an intermediate result image specifying unit for obtaining an intermediate result image having the same image size as the user image according to the animal face style image, where the position of the animal face region in the intermediate result image is the same as the position of the human face region in the user image; A first animal face mask image determining unit for determining a first animal face mask image corresponding to a type of an animal-based special effect; an image fusion unit for fusing a user image and an intermediate result image based on a first animal face mask image to obtain a target animal face style image corresponding to the user image, the first animal face mask image being used to determine an animal face region in the intermediate result image as an animal face region in the target animal face style image; Includes.

[0079] Optionally, the first human face sample image is obtained by aligning the human face with respect to the first original human face sample image based on a first correspondence between human face keypoints in the first original human face sample image and animal face keypoints in the first original animal face sample image. The second human face sample image is obtained by adjusting the position of the human face relative to the second original human face sample image based on a second correspondence between the human face key points in the second original human face sample image and the animal face key points in the first original animal face sample image. The first animal face sample image is obtained by adjusting the position of the animal face with respect to the first original animal face sample image based on the first correspondence relationship or the second correspondence relationship.

[0080] Optionally, the animal face style image generation module is trained based on a first human face sample image and a second animal face style sample image, and the second animal face style sample image is obtained by replacing a background region in the first animal face style sample image with a background region in the first human face sample image.

[0081] Optionally, the second animal face style sample image is obtained by fusing the first animal face style sample image and the first human face sample image based on the second animal face mask image. A second animal face mask image is obtained based on the first animal face style sample image by the pre-trained animal face segmentation model, and the second animal face mask image is used to determine an animal face region in the first animal face style sample image as an animal face region in the second animal face style sample image.

[0082] The animal face style image generating device according to the embodiment of the present disclosure can execute any animal face style image generating method according to the embodiment of the present disclosure, and has corresponding function modules and beneficial effects. For contents not described in detail in the device embodiment of the present disclosure, reference can be made to the description in any method embodiment of the present disclosure.

[0083] 5 is a structural schematic diagram of an apparatus for training an animal face style image generation model according to an embodiment of the present disclosure, which is applied to a method for training an animal face style image generation model with the function of converting a human face into an animal face. The apparatus for training an animal face style image generation model can be realized by software and / or hardware and integrated on a server.

[0084] As shown in FIG. 5, the training apparatus 500 for an animal face style image generation model according to an embodiment of the present disclosure includes: an animal face generation model training module 501 for training an image generation model based on the second human face sample image and the first animal face sample image to obtain an animal face generation model; A style sample image generation module 502 for obtaining a first animal face style sample image corresponding to a first human face sample image by an animal face generation model, the first animal face style sample image being an image obtained by converting a human face in the first human face sample image into an animal face; a styled image generation model training module 503 for training a styled image generation model based on the first human face sample image and the first animal face styled sample image to obtain an animal face styled image generation model; Including, The animal face style image generation model is used to obtain an animal face style image corresponding to an original human face image, where the animal face style image is an image obtained by converting a human face in the original human face image into an animal face.

[0085] Optionally, the device 500 according to the embodiment of the present disclosure may further include: a second correspondence determination module for determining a second correspondence between the human face key points in the second original human face sample image and the animal face key points in the first original animal face sample image; a human face alignment module for performing human face alignment with respect to the second original human face sample image based on the second correspondence relationship to obtain a second human face sample image; an animal face positioning module for performing an animal face position adjustment on the first original animal face sample image based on the second correspondence relationship to obtain a first animal face sample image; a first correspondence determination module for determining a first correspondence between human face key points in the first original human face sample image and animal face key points in the first original animal face sample image; a human face alignment module for aligning the animal face with respect to the first original human face sample image according to the first correspondence relationship to obtain a first human face sample image; Includes.

[0086] Optionally, the device 500 according to the embodiment of the present disclosure may further include: The apparatus further includes a background region replacement module for obtaining a second animal face style sample image by replacing a background region in the first animal face style sample image with a background region in the first human face sample image.

[0087] Optionally, the style image generation model training module 503 specifically trains a style image generation model based on the first human face sample image and the second animal face style sample image to obtain an animal face style image generation model.

[0088] Optionally, the background region replacement module: an animal face mask image determining unit for obtaining an animal face mask image corresponding to the first animal face style sample image based on the pre-trained animal face segmentation model; an image fusion unit for fusing the first animal face style sample image and the first human face sample image based on an animal face mask image to obtain a second animal face style sample image, the animal face mask image being used to determine an animal face region in the first animal face style sample image as an animal face region in the second animal face style sample image; Includes.

[0089] Optionally, the device 500 according to the embodiment of the present disclosure may further include: a sample image and labeling result obtaining module for obtaining a second animal face sample image and a position labeling result of an animal face region in the second animal face sample image; an animal face segmentation model training module for obtaining an animal face segmentation model by training according to the second animal face sample image and the position labeling result of the animal face region; Further includes:

[0090] The training device for an animal face style image generation model according to the embodiment of the present disclosure can execute any of the training methods for an animal face style image generation model according to the embodiment of the present disclosure, and has corresponding functional modules and beneficial effects. For contents not described in detail in the device embodiment of the present disclosure, reference can be made to the description in any of the method embodiments of the present disclosure.

[0091] FIG. 6 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure, and exemplarily describes an electronic device that realizes an animal face style image generation method or an animal face style image generation model training method according to an embodiment of the present disclosure. The electronic device according to the embodiment of the present disclosure includes, but is not limited to, mobile terminals such as mobile phones, notebook personal computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as car navigation terminals), as well as fixed terminals such as digital TVs, desktop computers, and servers. The electronic device shown in FIG. 6 is merely an example, and does not limit the functions and occupancy scope of the embodiment of the present disclosure in any way.

[0092] As shown in FIG. 6, electronic device 600 includes one or more processors 601 and memory 602 .

[0093] The processor 601 may be a central processing unit (CPU) or other form of processing unit having data processing and / or instruction execution capabilities, and may control other components within the electronic device 600 to perform desired functions.

[0094] The memory 602 may include one or more computer program products including various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache). The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. The computer-readable storage medium may store one or more computer program instructions, and the processor 601 may execute the program instructions to realize the method for generating an animal face style image or the method for training an animal face style image generation model according to the embodiment of the present disclosure, and further realize other desired functions. The computer-readable storage medium may also store various contents, such as an input signal, a signal component, a noise component, etc.

[0095] The method for generating an animal face style image includes the steps of obtaining an original human face image, and obtaining an animal face style image corresponding to the original human face image by utilizing a pre-trained animal face style image generation model, where the animal face style image is an image obtained by converting a human face in the original human face image into an animal face, the animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image, the first animal face style sample image is generated based on the first human face sample image by the pre-trained animal face generation model, and the animal face generation model is trained based on a second human face sample image and the first animal face sample image.

[0096] The method for training the animal face style image generation model includes the steps of: training an image generation model based on a second human face sample image and a first animal face sample image to obtain an animal face generation model; obtaining a first animal face style sample image corresponding to the first human face sample image by the animal face generation model, the first animal face style sample image being an image obtained by converting a human face in the first human face sample image into an animal face; and training a style image generation model based on the first human face sample image and the first animal face style sample image to obtain an animal face style image generation model. The animal face style image generation model is used to obtain an animal face style image corresponding to an original human face image, the animal face style image being an image obtained by converting a human face in the original human face image into an animal face.

[0097] It should be appreciated that the electronic device 600 may also perform other alternative embodiments according to method embodiments of the present disclosure.

[0098] In one example, the electronic device 600 may further include an input device 603 and an output device 604. These components are interconnected via a bus system and / or other form of connection (not shown).

[0099] Furthermore, the input device 603 may include, for example, a keyboard and a mouse.

[0100] The output device 604 can output various information such as the obtained distance information, direction information, etc. The output device 604 can include a display, a speaker, a printer, a communication network, and a remote output device connected thereto.

[0101] Of course, for the sake of simplicity, Fig. 6 shows only some of the components related to the present disclosure in the electronic device 600, and omits components such as buses and input / output interfaces. In addition, the electronic device 600 may include any other appropriate components according to specific application conditions.

[0102] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may be a computer program product including computer program instructions that, when executed by a processor, cause the processor to perform the method for generating an animal face style image or the method for training an animal face style image generation model according to an embodiment of the present disclosure.

[0103] The computer program product may have program code written in any combination of one or more programming languages ​​for carrying out the operations of the disclosed embodiments. Programming languages ​​include object-oriented programming languages ​​such as Java, C++, and traditional procedural programming languages ​​such as "C" or similar programming languages. The program code may run entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0104] In addition, an embodiment of the present disclosure may provide a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to execute a method for generating an animal face style image or a method for training an animal face style image generation model according to an embodiment of the present disclosure.

[0105] The method for generating an animal face style image includes the steps of obtaining an original human face image, and obtaining an animal face style image corresponding to the original human face image by utilizing a pre-trained animal face style image generation model, where the animal face style image is an image obtained by converting a human face in the original human face image into an animal face, the animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image, the first animal face style sample image is generated based on the first human face sample image by the pre-trained animal face generation model, and the animal face generation model is trained based on a second human face sample image and the first animal face sample image.

[0106] The method for training the animal face style image generation model includes the steps of: training an image generation model based on a second human face sample image and a first animal face sample image to obtain an animal face generation model; obtaining a first animal face style sample image corresponding to the first human face sample image by the animal face generation model, the first animal face style sample image being an image obtained by converting a human face in the first human face sample image into an animal face; and obtaining the animal face style image generation model by training the style image generation model based on the first human face sample image and the first animal face style sample image. The animal face style image generation model is used to obtain an animal face style image corresponding to an original human face image, the animal face style image being an image obtained by converting a human face in the original human face image into an animal face.

[0107] It should be understood that the computer program instructions, when executed by a processor, may also cause the processor to perform other alternative embodiments of the method embodiments of the present disclosure.

[0108] A computer-readable storage medium can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include an electrical connection having one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0109] It should be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that any actual relationship or order exists between those entities or operations. Furthermore, the use of "comprises" or "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a set of elements not only includes those elements, but also includes other elements not expressly stated or that are inherent to such process, method, article, or apparatus. Furthermore, in the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0110] The above are only specific embodiments of the present disclosure, allowing those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. 1. A method for generating an animal face style image executed by an electronic device, comprising: obtaining an original human face image; utilizing a pre-trained animal face style image generation model to obtain an animal face style image corresponding to the original human face image; Including, the animal face style image is an image obtained by converting a human face in the original human face image into an animal face, the animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image, the first animal face style sample image is generated based on the first human face sample image by a pre-trained animal face generation model, and the animal face generation model is trained based on a second human face sample image and the first animal face sample image.

2. determining a correspondence between the animal face key points and the human face key points corresponding to the type of the animal special effect selected by a user; According to a correspondence relationship between an animal face key point corresponding to the type of the animal-based special effect and a human face key point, an original human face image is obtained by adjusting the position of the human face with respect to the user image, and the original human face image satisfies an input requirement of the animal face style image generation model; The method of claim 1 further comprising:

3. The method of claim 2 , further comprising: fusing an animal face region in the animal face style image with a background region in the user image to obtain a target animal face style image corresponding to the user image.

4. The step of fusing an animal face region in the animal face style image with a background region in the user image to obtain a target animal face style image corresponding to the user image includes: obtaining an intermediate result image based on the animal face style image, the intermediate result image having the same image size as the user image, and a position of an animal face region in the intermediate result image is the same as a position of a human face region in the user image; determining a first animal face mask image corresponding to the animal-based special effect type; 4. The method of claim 3, further comprising: fusing the user image and the intermediate result image based on the first animal face mask image to obtain a target animal face style image corresponding to the user image, wherein the first animal face mask image is used to determine an animal face region in the intermediate result image as an animal face region in the target animal face style image.

5. the first human face sample image is obtained by performing a position adjustment of a human face with respect to the first original human face sample image based on a first correspondence relationship between a human face key point in the first original human face sample image and an animal face key point in the first original animal face sample image; the second human face sample image is obtained by performing a position adjustment of a human face with respect to the second original human face sample image based on a second correspondence relationship between a human face key point in the second original human face sample image and an animal face key point in the first original animal face sample image; 2. The method of claim 1, wherein the first animal face sample image is obtained by aligning an animal face with respect to the first original animal face sample image based on the first correspondence relationship or the second correspondence relationship.

6. the animal face style image generation model is trained based on the first human face sample image and the second animal face style sample image; 2. The method of claim 1, wherein the second animal face style sample image is obtained by replacing background regions in the first animal face style sample image with background regions in the first human face sample image.

7. the second animal face style sample image is obtained by fusing the first animal face style sample image and the first human face sample image based on a second animal face mask image; the second animal face mask image is obtained based on the first animal face style sample image by a pre-trained animal face segmentation model; 7. The method of claim 6, wherein the second animal face mask image is used to determine animal face regions in the first animal face style sample image as animal face regions in the second animal face style sample image.

8. A method for training an animal face style image generation model, comprising: training an image generation model based on the second human face sample image and the first animal face sample image to obtain an animal face generation model; A step of obtaining a first animal face style sample image corresponding to a first human face sample image by the animal face generation model, the first animal face style sample image being an image obtained by converting a human face in the first human face sample image into an animal face; training a styled image generation model based on the first human face sample image and the first animal face styled sample image to obtain an animal face styled image generation model; Including, The method, characterized in that the animal face style image generation model is used to obtain an animal face style image corresponding to an original human face image, and the animal face style image is an image of a human face in the original human face image converted into an animal face.

9. determining a second correspondence between the human face key points in the second original human face sample image and the animal face key points in the first original animal face sample image; performing a position adjustment of a human face with respect to the second original human face sample image based on the second correspondence relationship to obtain the second human face sample image, and performing a position adjustment of an animal face with respect to the first original animal face sample image based on the second correspondence relationship to obtain the first animal face sample image; The method of claim 8 further comprising:

10. determining a first correspondence between human face key points in a first original human face sample image and animal face key points in the first original animal face sample image; obtaining the first original human face sample image by aligning the animal face with the first original human face sample image based on the first correspondence relationship; 10. The method of claim 9, further comprising:

11. obtaining a second animal face style sample image by replacing a background region in the first animal face style sample image with a background region in the first human face sample image; The step of training a styled image generation model based on the first human face sample image and the first animal face styled sample image to obtain an animal face styled image generation model includes:

9. The method of claim 8, further comprising: training the styled image generation model based on the first human face sample image and the second animal face styled sample image to obtain the animal face styled image generation model.

12. The step of obtaining a second animal face style sample image by replacing a background region in the first animal face style sample image with a background region in the first human face sample image includes: obtaining an animal face mask image corresponding to the first animal face style sample image based on a pre-trained animal face segmentation model; fusing the first animal face style sample image and the first human face sample image based on the animal face mask image to obtain the second animal face style sample image, the animal face mask image being used to determine an animal face region in the first animal face style sample image as an animal face region in the second animal face style sample image; The method of claim 11, comprising:

13. obtaining a second animal face sample image and a position labeling result of an animal face region in the second animal face sample image; training based on the second animal face sample image and the position labeling result of the animal face region to obtain the animal face segmentation model; 13. The method of claim 12, further comprising:

14. An apparatus for generating an animal face style image, comprising: an original human face image acquisition module for acquiring an original human face image; a styled image generation module for obtaining an animal face styled image corresponding to the original human face image by utilizing a pre-trained animal face styled image generation model; Including, The animal face style image is an image obtained by converting a human face in the original human face image into an animal face, the animal face style image generation model is trained based on a first human face sample image and a first animal face style sample image, the first animal face style sample image is generated based on the first human face sample image by a pre-trained animal face generation model, and the animal face generation model is trained based on a second human face sample image and the first animal face sample image.

15. An apparatus for training an animal face style image generation model, comprising: an animal face generation model training module for training an image generation model based on the second human face sample image and the first animal face sample image to obtain an animal face generation model; a style sample image generation module for obtaining a first animal face style sample image corresponding to a first human face sample image by the animal face generation model, the first animal face style sample image being an image obtained by converting a human face in the first human face sample image into an animal face; a styled image generation model training module for training a styled image generation model based on the first human face sample image and the first animal face styled sample image to obtain an animal face styled image generation model; Including, The animal face style image generation model is used to obtain an animal face style image corresponding to an original human face image, and the animal face style image is an image obtained by converting a human face in the original human face image into an animal face.

16. An electronic device including a memory and a processor, The memory stores a computer program, and when the computer program is executed by the processor, the computer program causes the processor to execute the animal face style image generation method according to any one of claims 1 to 7, or the animal face style image generation model training method according to any one of claims 8 to 13.

17. A computer-readable storage medium having a computer program stored thereon, A computer-readable storage medium, characterized in that, when the computer program is executed by a processor, the computer program causes the processor to perform the method for generating an animal face style image according to any one of claims 1 to 7 or the method for training an animal face style image generation model according to any one of claims 8 to 13.

Citation Information

Patent Citations

  • Facial expression image processing method and apparatus

    US20180189553A1

  • Method and system for generating animal-shaped avatar by using human face

    WO2019198850A1