Makeup transfer model training method, device and makeup transfer method and device

By decomposing and combining information on reference makeup pictures, pseudo makeup results are generated, which solves the problem of noise interference in GAN makeup transfer technology, improves the accuracy and authenticity of makeup results, and ensures the retention of skin color and lighting.

CN116484932BActive Publication Date: 2024-09-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210044584.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-14
Publication Date
2024-09-06
Estimated Expiration
2042-01-14

AI Technical Summary

Technical Problem

The existing GAN-based makeup transfer technology is prone to introduce noise interference during the training process, resulting in low accuracy and authenticity of makeup results. In particular, noise interference from skin color and lighting information is difficult to avoid, affecting the training effect of the model.

Method used

By decomposing the reference makeup image, extracting color information and separating the makeup color information, and combining it with the lighting information and color information of the image to be applied, a pseudo makeup result is generated, noise interference is reduced, and the pseudo makeup result is used to migrate the makeup The model undergoes supervised training to ensure that the makeup results generated by the model retain the original skin color and lighting.

Benefits of technology

It improves the accuracy and authenticity of the makeup application results generated by the makeup transfer model, reduces noise interference, and ensures the retention of skin color and lighting in pictures to be applied.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116484932B
    Figure CN116484932B
Patent Text Reader

Abstract

The present application provides a method and device for training a makeup transfer model, and a makeup transfer method and device, which can be applied to various scenarios such as SNS, artificial intelligence, and image processing. The training method includes: obtaining a first reference makeup picture and a first target picture to be made up; performing a decomposition operation on the first reference makeup picture to obtain the first color information of the first reference makeup picture; performing a decomposition operation on the first target picture to obtain the second illumination information and the second color information of the first target picture; determining the makeup color information corresponding to the first reference makeup picture according to the first color information, and determining the second original skin color information corresponding to the first target picture according to the second color information; determining the pseudo makeup result of the first target picture according to the second illumination information, the second original skin color information, and the makeup color information; using the pseudo makeup result as the first supervisory information to train the makeup transfer model, thereby reducing additional noise interference during the training process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and more specifically, to a makeup transfer model training method and device, and a makeup transfer method and device. Background Art

[0002] With the development of artificial intelligence and computer vision technology, and with the gradual popularization of beauty and makeup software, makeup transfer technology has received widespread attention, such as makeup transfer technology based on generative adversarial networks (GAN, Generative Adversarial Networks).

[0003] The makeup transfer technology based on GAN is to input a reference makeup picture and a target makeup-free picture to be applied into the network model, and then the network model applies makeup to the target makeup-free picture through the reference makeup picture. In order to better train the network model, it is usually necessary to rely on some artificially generated pseudo makeup results to train the network model. However, the current artificially generated pseudo makeup results often introduce noise interference, such as additional skin color and lighting noise interference, resulting in low accuracy and authenticity of the makeup results obtained by the network model. Summary of the invention

[0004] The present application provides a makeup transfer model training method and device, and a makeup transfer method and device, which can reduce additional noise interference during the training process, thereby improving the accuracy and authenticity of the makeup results obtained by the trained network model.

[0005] In a first aspect, a method for training a makeup transfer model is provided, the training method comprising:

[0006] Obtaining a first reference makeup image and a first target image to be made up;

[0007] performing a decomposition operation on the first reference makeup picture to obtain first color information of the first reference makeup picture;

[0008] performing a decomposition operation on the first target image to obtain second illumination information and second color information of the first target image;

[0009] Determining makeup color information corresponding to the first reference makeup image according to the first color information, and determining second original skin color information corresponding to the first target image according to the second color information;

[0010] determining a pseudo makeup result of the first target image according to the second illumination information, the second original skin color information, and the makeup color information;

[0011] The makeup transfer model is trained by using the pseudo makeup result as the first supervisory information.

[0012] In a second aspect, a makeup migration method is provided, comprising: obtaining a second reference makeup image and a second target image to be applied with makeup;

[0013] Performing makeup extraction on the second reference makeup image according to the trained makeup transfer model to obtain makeup features, wherein the trained makeup transfer model is obtained by training according to the training method described in the first aspect above;

[0014] A makeup result picture is determined according to the makeup features and the second target picture, and the makeup result picture is the second target picture having the makeup features.

[0015] In a third aspect, a training device for a makeup transfer model is provided, comprising:

[0016] An acquisition module, used to acquire a first reference makeup image and a first target image to be applied with makeup;

[0017] a decomposition module, configured to perform a decomposition operation on the first reference makeup image to obtain first color information of the first reference makeup image; and perform a decomposition operation on the first target image to obtain second illumination information and second color information of the first target image;

[0018] a first determining module, configured to determine makeup color information corresponding to the first reference makeup image according to the first color information, and to determine second original skin color information corresponding to the first target image according to the second color information;

[0019] a second determination module, configured to determine a pseudo makeup result of the first target image according to the second illumination information, the second original skin color information, and the makeup color information;

[0020] A training module is used to train the makeup transfer model by using the pseudo makeup result as the first supervisory information.

[0021] In a fourth aspect, a makeup migration device is provided, comprising:

[0022] An acquisition module, used to acquire a second reference makeup image and a second target image to be applied with makeup;

[0023] an extraction module, configured to extract makeup from the second reference makeup image according to a trained makeup transfer model to obtain makeup features, wherein the trained makeup transfer model is obtained by training according to the training method described in the first aspect;

[0024] A determination module is used to determine a makeup result picture according to the makeup features and the second target picture, wherein the makeup result picture is the second target picture having the makeup features.

[0025] On the other hand, a computer-readable storage medium is provided, comprising instructions, which, when executed on a computer device, enable the computer device to execute the method as described in the first aspect or the second aspect.

[0026] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores a computer program, and the processor calls the computer program stored in the memory to execute the steps in the training method of the makeup transfer model described in the first aspect or the makeup transfer method described in the second aspect.

[0027] On the other hand, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps in the training method of the makeup transfer model described in the first aspect or the makeup transfer method described in the second aspect.

[0028] An embodiment of the present application provides a method for training a makeup transfer model, by decomposing a reference makeup picture to obtain corresponding color information, then decomposing makeup color information based on the color information, and then only combining the makeup color information with the lighting information and color information of the picture to be made up to obtain a pseudo-makeup result, so that the obtained pseudo-makeup result only transfers the makeup of the reference makeup picture, reduces the noise interference of the lighting and original skin color in the reference makeup picture, and retains the original skin color and lighting in the picture to be made up, and then uses the pseudo-makeup result to supervise the makeup transfer model for training, so that the trained makeup transfer model can generate a makeup result that retains the original skin color and lighting in the picture to be made up, thereby improving the accuracy and authenticity of the makeup result. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a structural diagram of the speech synthesis system provided in an embodiment of the present application.

[0030] Figure 2 It is a flowchart of the training method of the makeup transfer model provided in the embodiment of the present application.

[0031] Figure 3 It is a schematic diagram of an application scenario of the training method of the makeup transfer model provided in an embodiment of the present application.

[0032] Figure 4 It is a flow chart of the makeup migration method provided in the embodiment of the present application.

[0033] Figure 5 It is a schematic block diagram of a training device for a makeup transfer model provided in an embodiment of the present application.

[0034] Figure 6 2 is another flowchart of the method for training a makeup transfer model provided in an embodiment of the present application.

[0035] Figure 7 It is a schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. For the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0037] The embodiments of the present application provide a method and device for training a makeup transfer model and a method and device for makeup transfer. Specifically, the method and method for training a makeup transfer model in the embodiments of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server. The embodiments of the present application can be applied to various scenarios such as social network services, artificial intelligence, computer vision technology, image processing, etc.

[0038] First, some nouns or terms that appear in the description of the embodiments of the present application are explained as follows:

[0039] Social Networking Services (SNS) is a platform that establishes social networks or social connections between people. For example, shared interests, activities, backgrounds or real-life connections. A social networking service includes a representation of each user's social connections (usually a profile) and various additional services. Most social networking services are web-based online community services and provide users with means to interact on the Internet, such as email and instant messaging. Sometimes considered a social networking service, but in a broader sense, social networking services usually refer to individual-centric services and are centered on online community service groups. Social networking sites allow users to share their ideas, pictures, articles, activities, and events in their networks.

[0040] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0041] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0042] Computer Vision Technology (CV) Computer vision is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphic processing so that computer processing becomes an image that is more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0043] Cloud technology: refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.

[0044] Blockchain system: It can be a distributed system formed by connecting clients and multiple nodes (any form of computing devices connected to the network, such as servers and user terminals) through network communication. The nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP). In a distributed system, any machine such as a server or terminal can join and become a node. The node includes the hardware layer, the middle layer, the operating system layer and the application layer.

[0045] Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0046] Generative Adversarial Networks (GAN) is a deep learning model and one of the most promising methods for unsupervised learning on complex distributions in recent years. The model produces fairly good output through the mutual game learning of (at least) two modules in the framework: the generative model and the discriminative model. In the original GAN ​​theory, it is not required that both G and D are neural networks, but only that they can fit the corresponding generation and discrimination functions. However, in practice, deep neural networks are generally used as G and D. An excellent GAN application requires a good training method, otherwise the output may be unsatisfactory due to the freedom of the neural network model.

[0047] Supervised learning is a training method / learning method in machine learning. It refers to the process of adjusting the parameters of the classifier using a set of samples of known categories to achieve the required performance, also known as supervised training or teacher learning.

[0048] Poisson Blending, also known as Seamlessclone, is used to blend two images "seamlessly". The basic principle is to optimize an equation, try to keep the relevant brightness at the basic boundary, and retain the gradient of the cut image, so that the two images look "seamlessly" stitched together.

[0049] Mean square error (MSE) is the most commonly used regression loss function. The mean square error is the sum of the squares of the distances between the target variable and the predicted value.

[0050] Loss function, in machine learning, refers to the objective to be minimized in model training.

[0051] The RGB color model is a color standard in the industry. It obtains a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue. This standard covers almost all colors that can be perceived by human vision and is one of the most widely used color systems.

[0052] The L*a*b* model was established based on an international standard for measuring color established by CIE in 1931. It was improved and named in 1976. The L*a*b* color model makes up for the shortcomings of the RGB and CMYK color models. It is a device-independent color model and also a color model based on physiological characteristics. L*a*b* consists of a brightness channel and two color channels. In the L*a*b* color space, each color is represented by three numbers: L*, a*, and b*.

[0053] At present, the makeup transfer technology based on GAN usually inputs a picture with reference makeup and a picture without makeup that needs to be applied into the makeup transfer model. After being processed by the makeup transfer model, the reference makeup can be transferred to the picture without makeup that needs to be applied. At present, the training method of the makeup transfer model usually requires the use of artificial rules to generate pseudo makeup results, and then the pseudo makeup results are used to supervise the makeup transfer model.

[0054] At present, there are three main methods for using artificial rules to generate pseudo-makeup results:

[0055] The first one, the color histogram matching method, transforms the color histogram of the no-makeup picture so that the color histogram of the no-makeup picture matches the color histogram of the reference plastic surgery picture.

[0056] The second type, TPS (Thin plate spline) transformation, uses TPS to distort and interpolate the face of the reference makeup picture based on the information of the key points of the face, so that the transformed reference makeup face and the face of the picture that needs makeup are aligned.

[0057] The third method is the Poisson fusion method. Based on face alignment, the face with reference makeup is fused to the face without makeup using the Poisson fusion method.

[0058] In order to better generate realistic and accurate results, existing methods will choose to segment different corresponding areas of the face through segmentation technology, and then extract the information of the corresponding areas respectively, and then input them into the network to provide additional information. However, current training methods, such as histogram matching and TPS transformation, will also bring the skin color and lighting information in the reference image with makeup into the generated pseudo makeup results while transferring makeup. The skin color and lighting of these reference images are noise to the network, causing the makeup transfer network trained with the pseudo makeup results to regard the skin color and makeup of the reference image as makeup, resulting in the makeup results generated by the makeup transfer network changing the original skin color and lighting of the face in the non-makeup image, resulting in unrealistic makeup results.

[0059] Therefore, the embodiments of the present application provide a makeup transfer model training method and device, and a makeup transfer method and device, which involve artificial intelligence computer vision technology and machine learning technology, etc., which can reduce noise interference in the training process, so that the trained makeup transfer model can generate makeup results that retain the original skin color and lighting in the makeup picture to be applied, thereby improving the accuracy and authenticity of the makeup results.

[0060] Among them, the embodiments of the present application can be implemented in combination with cloud technology or blockchain network technology.

[0061] For example, in the makeup migration method disclosed in the embodiments of the present application, these data can be stored on the blockchain.

[0062] For example, the second reference makeup picture, the second target picture to be applied, the makeup features corresponding to the second reference makeup picture, and the makeup result picture can all be stored on the blockchain. In order to facilitate the storage and query of the second reference makeup picture, the second target picture to be applied, the makeup features corresponding to the second reference makeup picture, and the makeup result picture, optionally, the makeup migration method also includes: sending the second reference makeup picture, the second target picture to be applied, the makeup features corresponding to the second reference makeup picture, and the makeup result picture to the blockchain network, so that the nodes of the blockchain network fill the second reference makeup picture, the second target picture to be applied, the makeup features corresponding to the second reference makeup picture, and the makeup result picture into a new block, and when a consensus is reached on the new block, the new block is appended to the end of the blockchain. The embodiment of the present application can store the second reference makeup picture, the second target picture to be applied, the makeup features corresponding to the second reference makeup picture, and the makeup result picture on the chain to realize record backup. When makeup migration is required, the corresponding second reference makeup picture, the second target picture to be applied, the makeup features corresponding to the second reference makeup picture, and the makeup result picture can be directly and quickly obtained from the blockchain without having to perform a series of processing through the makeup migration system before obtaining the migration result, thereby improving the efficiency of data processing and data acquisition.

[0063] Please refer to Figure 1 , Figure 1A schematic diagram of the structure of the makeup migration system provided in the embodiment of the present application. The makeup migration system includes a terminal 100 and a server 200, etc.; the terminal 100 and the server 200 are connected via a network, for example, via a wired or wireless network connection, etc. The terminal 100 can be a smart phone, a tablet computer, a laptop computer, a smart TV, a smart speaker, a wearable smart device, a smart car terminal, etc. The terminal 100 can also include a client, which can be an application client, a browser client, or an instant messaging client, etc. The server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0064] Among them, the terminal 100 can be used to display a graphical user interface. Among them, the terminal is used to interact with the user through the graphical user interface, for example, by downloading and installing the corresponding client through the terminal and running it, for example, by calling the corresponding applet and running it, for example, by logging into the website to present the corresponding graphical user interface, etc. In an embodiment of the present application, the terminal 100 can be a terminal device for the user to upload the second reference makeup picture and the second target picture to be applied. Among them, when performing makeup migration, the second reference makeup picture and the second target picture to be applied are uploaded through the terminal device used by the user, and the second reference makeup picture and the second target picture to be applied are sent to the server 200 for makeup migration. The server 200 will send the makeup result picture to the terminal 100.

[0065] Among them, in an embodiment of the present application, when training the makeup transfer model, the server 200 can be specifically used to: obtain a first reference makeup picture and a first target picture to be applied with makeup; perform decomposition operations on the first reference makeup picture and the first target picture to be applied with makeup, respectively, to obtain first color information of the first reference makeup picture and second illumination color and second color information of the first target picture to be applied with makeup; determine makeup color information corresponding to the first reference makeup picture according to the first color information, and determine second original skin color information corresponding to the first target picture to be applied with makeup according to the second color information; determine a pseudo-makeup result of the first target picture to be applied with makeup according to the second illumination information, the second original skin color information and the makeup color information; and use the pseudo-makeup result as supervision information to train the makeup transfer model.

[0066] Specifically, after completing the training of the makeup transfer model, the server 200 may store the makeup transfer model locally, or send it to the terminal 100. Exemplarily, if the makeup transfer model is stored locally, when performing makeup transfer, the terminal 100 needs to send the second reference makeup picture and the second target picture to be applied to the server 200. The server 200 may be specifically used to: obtain the second reference makeup picture and the second target picture to be applied; perform makeup extraction on the second reference makeup picture to obtain makeup features; determine a makeup result picture according to the makeup features and the second target picture to be applied, the makeup result picture being the second target picture to be applied with the makeup features; and send the makeup result picture to the terminal 100.

[0067] Exemplarily, if the makeup migration model is stored in terminal 100, when performing makeup migration, terminal 100 can be specifically used to: obtain a second reference makeup picture and a second target picture to be applied; perform makeup extraction on the second reference makeup picture to obtain makeup features; determine a makeup result picture based on the makeup features and the second target picture to be applied, the makeup result picture being the second target picture to be applied having the makeup features; and display the makeup result picture.

[0068] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.

[0069] See also Figure 2 , Figure 2 A flow chart of a method for training a makeup transfer model described in an embodiment of the present application is shown. The method for training a makeup transfer model is applied to a computer device, which may be a server. The method mainly includes steps 101 to 106, which are described as follows:

[0070] Step 101, obtaining a first reference makeup picture and a first target picture to be made-up.

[0071] It is easy to understand that in the process of model training, it is usually necessary to obtain a large number of training sample pairs, namely, a first reference makeup picture and a first target picture to be applied with makeup. For the sake of ease of explanation, the embodiment of the present application takes a first reference makeup picture and a first target picture to be applied with makeup as an example.

[0072] Specifically, the first reference makeup image may be an image with reference makeup, and the first target image to be made up may be an image of a face without makeup to be made up. In subsequent steps, the reference makeup in the first reference makeup image may be transferred to the face without makeup in the first target image through the training method provided by the present application to obtain a pseudo makeup result, and the pseudo makeup result may be used to perform supervised training on the makeup transfer model.

[0073] Step 102: performing a decomposition operation on the first reference makeup image to obtain first color information of the first reference makeup image.

[0074] It is easy to understand that in order to avoid introducing the lighting information of the first reference makeup picture as noise, the first reference makeup picture can be first decomposed, and the decomposition operation is used to decompose the first reference makeup picture to obtain the lighting information and color information of the first reference makeup picture. In this way, when the pseudo makeup result is subsequently generated, the lighting information of the first reference makeup picture is avoided from being introduced. Among them, the above step 102 also includes: performing a decomposition operation on the first reference makeup picture to obtain the first lighting information of the first reference makeup picture.

[0075] Step 103: performing a decomposition operation on the first target image to obtain second illumination information and second color information of the first target image.

[0076] Specifically, the first target image is decomposed to obtain second illumination information and second color information of the first target image, so that in subsequent steps, the second illumination information and second color information can be combined with the makeup color information of the first reference makeup image to obtain a pseudo makeup result.

[0077] Specifically, the illumination information and color information of the first reference makeup image can be decomposed through the L*a*b* color space. In the L*a*b* color space, the image can be represented by three dimensions: L*, a*, and b*, where the L* dimension represents the illumination intensity, and the a* and b* dimensions represent the color. Through the L*a*b* color space, we can decompose the illumination information and color information of the first reference makeup image, that is, only the L* dimension is used to represent the illumination, and the remaining two dimensions are used to represent the color.

[0078] Similarly, the illumination information and color information of the first target image can be decomposed through the L*a*b* color space, that is, only the L* dimension is used to represent the illumination, and the remaining two dimensions are used to represent the color.

[0079] Considering that L*a*b* is a less commonly used color space compared to RGB color space, the step of "decomposing the first reference makeup image" may include: converting the first reference makeup image from RGB color space to L*a*b* color space to decompose the illumination information and color information of the first reference makeup image. The step of "decomposing the first target image" may include: converting the first target image from RGB color space to L*a*b* color space to decompose the illumination information and color information of the first target image.

[0080] In some embodiments, the first reference makeup image and the first target image to be made up are both in L*a*b* color space.

[0081] It is easy to understand that in order to avoid introducing the original skin color of the face in the first reference makeup picture as noise, it is also necessary to separate the original skin color of the face in the first reference makeup picture from the makeup color. Therefore, the embodiment of the present application assumes that the color information of any reference makeup picture is obtained by adding the original skin color and the makeup color. That is, any picture It can be expressed as: in, represents the illumination dimension, represents the original skin color of the face, Indicates makeup color. Represents a join of dimensions.

[0082] Therefore, the first reference makeup image I R It is expressed as: That is the first reference makeup picture I R It is obtained by adding the illumination dimension and the color dimension, where The first reference makeup picture I R The first illumination information, is the first color information of the first reference makeup image, which is obtained by adding the makeup color and the original skin color. Represents a join of dimensions.

[0083] Therefore, the first target image I to be made up can be S It is expressed as: That is, the first target image I S It is obtained by adding the illumination dimension and the color dimension, where The first target image to be put on makeup S The second illumination information, The first target image to be put on makeup S The second color information, It is easy to understand that since the first target image I to be made up can be considered S No makeup, therefore, the second color information That is, the original skin color.

[0084] Step 104, determining makeup color information corresponding to the first reference makeup picture according to the first color information, and determining second original skin color information corresponding to the first target picture to be applied with makeup according to the second color information.

[0085] From the above, it can be seen that the first color information can be considered to be the sum of the makeup color and the original skin color. The step of "determining the makeup color information corresponding to the first reference makeup picture according to the first color information" can specifically include: calculating the first original skin color information corresponding to the first reference makeup picture according to the first color information; subtracting the first color information from the first original skin color information to obtain the makeup color information.

[0086] It is easy to understand that since the makeup part is only a small part of the face, the original skin color of the face can be estimated by averaging the colors of all pixels on the face.

[0087] Therefore, the first reference makeup image I can be obtained R The first raw skin color information Where Avg represents the average operation, (I b +I m ) is the first color information.

[0088] Specifically, it can be seen from the above that the first reference makeup image I R First color information It is obtained by adding the original skin color and makeup color of the face, so the makeup color information can be obtained

[0089] Similarly, the original skin color of the face can be estimated by averaging the colors of all pixels on the face. That is, the first target image I S The first raw skin color information Among them, Avg represents the average operation, is the first color information.

[0090] Step 105 , determining a pseudo makeup result of the first target image to be made-up based on the second illumination information, the second original skin color information, and the makeup color information.

[0091] Specifically, in order to avoid the pseudo-makeup result being affected by the noise of the original skin color and lighting information in the first reference makeup picture, after decomposing the lighting information, original skin color information and makeup color information of the first reference makeup picture, the makeup color information can be combined with the second lighting information and the second original skin color information of the first target picture to be applied to obtain a pseudo-makeup result.

[0092] Specifically, step 105 may include: combining the second illumination information, the second original skin color information, and the makeup color information according to a first preset formula to obtain a pseudo-makeup result of the first target image.

[0093] Among them, the second preset formula is: in, For fake makeup results, is the second illumination information of the first target image to be made up, is the original skin color information of the first target image to be made up, It is the makeup color information of the first reference makeup image.

[0094] Step 106: Use the pseudo makeup result as the first supervisory information to train the makeup transfer model.

[0095] Specifically, the pseudo makeup result obtained by the training method provided in the present application does not introduce the first lighting information and the first original skin color information of the first reference makeup picture. The makeup transfer model trained using the pseudo makeup result will not extract the skin color and lighting of the reference makeup picture as makeup features, thereby retaining the lighting and skin color of the target makeup picture, thereby improving the authenticity of the makeup results generated by the makeup transfer model.

[0096] Specifically, in order to ensure the accuracy of makeup features extracted by the makeup transfer system, a pseudo makeup removal result of the first reference makeup image can also be generated, and the pseudo makeup removal result is used as the second supervisory information to train the makeup transfer model.

[0097] In this embodiment, the training method also includes: when performing a decomposition operation on the first reference makeup image, first lighting information is also obtained; based on the first original skin color information and the first lighting information, a pseudo makeup removal result of the first reference makeup image is determined; and the pseudo makeup removal result is used as the second supervision information to train the makeup migration model.

[0098] It is easy to understand that by using the first reference makeup image I R Makeup color information Separate, only keep the first original skin color information and first light information You can get the first reference makeup picture I R Pseudo-makeup removal results.

[0099] Specifically, determining a pseudo makeup removal result of a first reference makeup picture according to the first original skin color information and the first illumination information includes: combining the first original skin color information and the first illumination information according to a second preset formula to obtain a pseudo makeup removal result of the first reference makeup picture.

[0100] Specifically, the second preset formula is: in, For fake makeup removal results, is the first illumination information, is the first original skin color information, Represents a join of dimensions.

[0101] Specifically, the makeup transfer model includes a makeup extraction network and a makeup transfer network, wherein the makeup extraction network is used to extract makeup features in a reference makeup picture, and the makeup transfer network is used to fuse the makeup features extracted by the makeup transfer network with the target makeup picture. The training method also includes: based on a first reference makeup picture, obtaining a makeup removal result and a first makeup feature of the first reference makeup picture through the makeup extraction network; supervising the makeup extraction network according to a loss value between the makeup removal result of the first reference makeup picture and a pseudo makeup removal result of the first target picture; inputting the makeup removal result and the first makeup feature into the makeup transfer network to obtain a re-makeup result; and training the makeup transfer network according to the loss value between the re-makeup result and the first reference makeup picture.

[0102] Specifically, the makeup extraction network can be iteratively trained with minimizing the loss value between the makeup removal result of the first reference makeup image and the pseudo makeup removal result of the first target image as the training goal, until the loss value between the makeup removal result of the first reference makeup image and the pseudo makeup removal result of the first target image converges, or until the number of iterative training reaches a threshold, so as to optimize the parameters of the makeup extraction network.

[0103] It is easy to understand that, ideally, the reference makeup picture is input into the makeup extraction network, and then the obtained makeup removal result and makeup features are input into the makeup transfer network, and the obtained re-makeup result should be consistent with the reference makeup picture. Therefore, during the training process, the loss value between the re-makeup result and the first reference makeup picture can be calculated, and the makeup transfer model can be trained with minimizing the loss value as the training goal to optimize the model parameters of the makeup transfer model and improve the accuracy of the makeup features fused by the makeup transfer network. Among them, the loss value can be the MSE loss value. The MSE loss value can measure the average difference between the re-makeup result and the first reference makeup picture, so that the difference between the re-makeup result and the first reference makeup picture can be minimized during the training process.

[0104] In this embodiment, the training method also includes: based on the first target image to be made-up and the makeup features, obtaining the makeup result of the first target image to be made-up through a makeup transfer network; supervising the makeup transfer network according to the loss value between the makeup result of the first target image and the pseudo makeup result of the first target image; inputting the makeup result into the makeup extraction network to obtain a re-makeup removal result; and training the makeup transfer model according to the loss value between the re-makeup removal result and the first target image to be made-up.

[0105] Specifically, the loss value between the makeup result of the first target image and the pseudo-makeup result of the first target image can be used as a training target to iteratively train the makeup extraction network until the loss value between the makeup result of the first target image and the pseudo-makeup result of the first target image converges, or until the number of iterative training reaches a threshold, so as to optimize the parameters of the makeup transfer network.

[0106] It is easy to understand that, ideally, the target makeup picture and makeup features are input into the makeup transfer network, and then the obtained makeup result is input into the makeup extraction network, and the obtained re-makeup removal result should be consistent with the target makeup picture. Therefore, during the training process, the loss value between the re-makeup removal result and the first target picture to be made up can be calculated, and the loss value can be minimized as the training target to train the makeup transfer model to optimize the model parameters of the makeup transfer model, thereby improving the accuracy of the makeup extraction network in extracting makeup features. Among them, the loss value can be the MSE loss value. The MSE loss value can measure the average difference between the re-makeup removal result and the first target picture to be made up, so that the difference between the re-makeup removal result and the first target picture to be made up can be minimized as much as possible during the training process.

[0107] In this embodiment, the makeup result is input into the makeup extraction network to obtain a second makeup feature, and the training method further includes: training the makeup transfer model according to the loss value between the first makeup feature and the second makeup feature.

[0108] Specifically, the loss value between the first makeup feature and the second makeup feature may be a cycle consistency loss value. In this way, the consistency of makeup features extracted by the makeup extraction network for the same makeup on different faces can be ensured.

[0109] To better illustrate the training method of the makeup transfer model provided in the embodiment of the present application, please refer to Figure 3 , the following is an overall description of the training method:

[0110] like Figure 3 As shown, the makeup transfer model includes a makeup extraction network and a makeup transfer network. First, a first reference makeup image and a first target image to be applied with makeup are obtained, and a pseudo makeup removal result is generated by the training method provided in the embodiment of the present application. And the fake makeup results Then, the pseudo-makeup removal results were used And the fake makeup results The makeup extraction network obtains the makeup removal result based on the first reference makeup picture and the makeup transfer network obtains the makeup application result based on the first target picture to be applied and the makeup features. At the same time, the makeup removal result obtained by the makeup extraction network based on the first reference makeup picture is input into the makeup transfer network. The makeup transfer network obtains the makeup removal result based on the makeup features F m The makeup transfer network is based on the target makeup image and makeup features F m The makeup result is input into the makeup extraction network, and the makeup extraction network obtains the makeup removal result and makeup feature F based on the makeup result. mr A MES loss function is used to supervise the reference makeup image and the re-makeup result, a MES loss function is used to supervise the target makeup image and the re-makeup removal result, and a MES loss function is used to supervise the makeup feature F m And makeup features F mr A cycle-consistent loss function is used for supervision. The makeup transfer model trained in this way can generate makeup results that retain the lighting and skin color in the target makeup image, improve the authenticity and accuracy of the makeup results, and ensure the accuracy of the makeup extraction network in extracting makeup features, as well as the accuracy of the makeup transfer network in fusion of makeup.

[0111] All of the above technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described in detail here.

[0112] The embodiment of the present application obtains a first reference makeup image and a first target image to be made up, then decomposes the first reference makeup image to obtain first color information of the first reference makeup image, and decomposes the first target image to obtain second illumination information and second color information of the first target image, then determines the makeup color information corresponding to the first reference makeup image according to the first color information, and determines the second original skin color information corresponding to the first target image to be made up according to the second color information, then determines a pseudo makeup result of the first target image to be made up according to the second illumination information, the second original skin color information and the makeup color information, and uses the pseudo makeup result as supervision information to train a makeup transfer model, so that the obtained pseudo makeup result only transfers the makeup of the reference makeup image, reduces the noise interference of the illumination and the original skin color in the reference makeup image, and retains the original skin color and illumination in the target makeup image, so that the trained makeup transfer model can generate a makeup result that retains the original skin color and illumination in the target makeup image, thereby improving the accuracy and authenticity of the makeup result.

[0113] See also Figure 4 , Figure 4The flowchart of the makeup transfer method described in the embodiment of the present application is shown. The training method of the makeup transfer model is applied to the makeup transfer model trained by the training method provided in the above embodiment. The makeup transfer model can be deployed on a computer device, which can be a server or a terminal. The method mainly includes steps 201 to 203, which are described as follows:

[0114] Step 201, obtaining a second reference makeup picture and a second target picture to be made-up.

[0115] The second reference makeup picture may be a picture with reference makeup, and the second target picture to be made up may be a face picture without makeup. Specifically, the user may upload the second reference makeup picture and the second target picture to be made up through the client.

[0116] Step 202: Perform makeup extraction on the second reference makeup image according to the trained makeup transfer model to obtain makeup features. The trained makeup transfer model is trained according to the training method provided in the above embodiment.

[0117] Specifically, the makeup transfer model may include a makeup extraction network for extracting makeup features of the second reference makeup image.

[0118] In this embodiment, step 202 may specifically include: performing feature extraction on the second reference makeup image to obtain a first feature; performing feature extraction on a preset area of ​​the second reference makeup image to obtain a second feature; and subtracting the first feature from the second feature to obtain a makeup feature.

[0119] Specifically, the makeup extraction network may include an encoding module, a neck module and a decoding module, wherein the encoding module is used to extract a first feature of the second reference makeup image, the neck module is used to extract a second feature of the neck area, and the makeup extraction network obtains and outputs a makeup feature by subtracting the first feature from the second feature. The decoding module is used to output a makeup removal result.

[0120] Step 203, determining a makeup result picture according to the makeup features and the second target picture to be made-up, where the makeup result picture is the second target picture to be made-up having the makeup features.

[0121] Specifically, the makeup transfer model may further include a makeup transfer network, which is used to merge the makeup features input by the makeup extraction network with the second target image to be applied with makeup, so as to obtain a makeup result image.

[0122] In some embodiments, when the user uploads the second reference makeup picture and the second target picture to be applied, the user can specify to transfer the makeup of a certain area in the second reference makeup picture to the second target picture to be applied. For example, the user can specify to transfer the lip makeup in the second reference makeup picture to the second target picture to be applied. In this case, the encoding module of the makeup extraction network can only extract the makeup of the lip area and input it into the makeup transfer network.

[0123] In some embodiments, the method may further include: obtaining a third target image to be removed; and extracting makeup from the third target image according to the makeup extraction network to obtain a makeup removal result image. It is easy to understand that the makeup extraction network can extract makeup features to obtain a makeup removal result image, which is the third target image without makeup features.

[0124] Specifically, the client corresponding to the makeup transfer model, such as a beauty makeup client, can provide options for the user to operate. For example, the client interface can provide multiple buttons, such as a makeup button, a makeup removal button, etc. For example, the user can click the makeup button, and then upload the second reference makeup picture and the second target picture to be applied on the corresponding material upload interface. After that, the makeup transfer model processes the second reference makeup picture and the second target picture to be applied, and the client displays the makeup result picture. For another example, the user can click the makeup removal button, and then upload the third target picture to be removed on the corresponding material upload interface. After that, the makeup extraction network processes the third target picture, and the client displays the makeup removal result picture.

[0125] In addition, a feedback button can be provided on the interface of the client displaying the makeup result picture and the interface of the client displaying the makeup removal result picture. If the makeup result picture and the makeup removal result picture are significantly different from expectations, the user can click the feedback button and then submit feedback to the server in the corresponding feedback interface.

[0126] In addition, after the user submits feedback, the client can also display a prompt dialog box, which is used to ask the user whether he is willing for the server to use the makeup result picture and its corresponding second reference makeup picture, as well as the second target picture to be made up or the makeup removal result picture and its corresponding second target picture to be made up as training samples to train the makeup transfer model.

[0127] In this way, we can obtain timely feedback from users during use, and understand the application of the makeup transfer model in a timely manner, so as to improve the makeup transfer model in a timely manner. In addition, if the user agrees that the server will use the material as a training sample, it can also enrich the training samples for the server when training the makeup transfer model.

[0128] The embodiment of the present application obtains a makeup transfer model trained by the training method provided in the above embodiment, first obtains a second reference makeup picture and a second target picture to be applied with makeup, and then performs makeup extraction on the second reference makeup picture according to the trained makeup transfer model to obtain makeup features. The trained makeup transfer model is obtained by training according to the training method provided in the above embodiment, and then determines a makeup result picture based on the makeup features and the second target picture, and the makeup result picture is the second target picture with the makeup features, so that a real makeup result that retains the lighting and original skin color of the target makeup picture can be generated.

[0129] The above describes the method embodiment of the present application in detail. Figure 5 and Figure 6 , the device embodiments of the present application are described in detail. It should be understood that the device embodiments and the method embodiments correspond to each other, and similar descriptions can refer to the method embodiments.

[0130] Figure 5 is a schematic structural diagram of a makeup transfer model training device 10 according to an embodiment of the present application, such as Figure 5 As shown, the training device 10 of the makeup transfer model may include:

[0131] An acquisition module 11 is used to acquire a first reference makeup image and a first target image to be applied with makeup;

[0132] The decomposition module 12 is used to perform a decomposition operation on the first reference makeup image to obtain first color information of the first reference makeup image; and to perform a decomposition operation on the first target image to obtain second illumination information and second color information of the first target image;

[0133] A first determination module 13, configured to determine makeup color information corresponding to the first reference makeup image according to the first color information, and to determine second original skin color information corresponding to the first target image according to the second color information;

[0134] A second determination module 14, configured to determine a pseudo makeup result of the first target image according to the second illumination information, the second original skin color information, and the makeup color information;

[0135] The training module 15 is used to train the makeup transfer model by using the pseudo makeup result as the first supervisory information.

[0136] Optionally, the second determination module 14 may be configured to combine the second illumination information, the second original skin color information, and the makeup color information according to a first preset formula to obtain a pseudo-makeup result of the first target image.

[0137] Optionally, the first determination module 13 may be configured to: calculate first original skin color information corresponding to the first reference makeup image according to the first color information; and obtain makeup color information by subtracting the first color information from the first original skin color information.

[0138] Optionally, when the decomposition module 12 performs a decomposition operation on the first reference makeup image, the first lighting information is also obtained, and the training module 15 can also be used to: determine a pseudo-makeup removal result of the first reference makeup image based on the first original skin color information and the first lighting information; and use the pseudo-makeup removal result as the second supervision information to train the makeup migration model.

[0139] Optionally, the training module 15 may also be used to: combine the first original skin color information and the first illumination information according to a second preset formula to obtain a pseudo makeup removal result of the first reference makeup image.

[0140] Optionally, the makeup transfer model includes a makeup extraction network and a makeup transfer network, and the training module 15 can also be used to: based on a first reference makeup picture, obtain the makeup removal result and the first makeup feature of the first reference makeup picture through the makeup extraction network; supervise the makeup extraction network according to the loss value between the makeup removal result of the first reference makeup picture and the pseudo makeup removal result of the first target picture; input the makeup removal result and the first makeup feature into the makeup transfer network to obtain the re-makeup result; and train the makeup transfer network according to the loss value between the re-makeup result and the first reference makeup picture.

[0141] Optionally, the training module 15 can also be used to: obtain the makeup result of the first target image through the makeup transfer network based on the first target image and the first makeup feature; supervise the makeup transfer network according to the loss value between the makeup result of the first target image and the pseudo makeup result of the first target image; input the makeup result into the makeup extraction network to obtain the re-makeup removal result; and train the makeup transfer network according to the loss value between the re-makeup removal result and the first target image.

[0142] Optionally, the makeup result is input into the makeup extraction network to obtain a second makeup feature. The training module 15 can also be used to train the makeup migration model according to the loss value between the first makeup feature and the second makeup feature.

[0143] It should be noted that the functions of each module in the makeup transfer model training device 10 in the embodiment of the present application can correspond to the specific implementation methods in the above-mentioned method embodiments, which will not be repeated here.

[0144] Each module in the training device 10 of the makeup transfer model can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0145] The training device 10 of the makeup transfer model provided in the embodiment of the present application obtains a first reference makeup picture and a first target picture to be applied with makeup through an acquisition module 11, and then a decomposition module 12 decomposes the first reference makeup picture to obtain first color information of the first reference makeup picture, and decomposes the first target picture to obtain second illumination information and second color information of the first target picture, and then a first determination module 13 determines makeup color information corresponding to the first reference makeup picture according to the first color information, and determines second original skin color information corresponding to the first target picture according to the second color information, and then a second ... then a second determination module 13 determines makeup color information corresponding to the first reference makeup picture according to the first color information, and then a second determination module 13 determines makeup color information corresponding to the first reference makeup picture according to the first color information, and determines second original skin color information corresponding to the first target picture according to the second Module 14 determines the pseudo makeup result of the first target image according to the second lighting information, the second original skin color information and the makeup color information. Finally, the training module 15 uses the pseudo makeup result as the first supervision information to train the makeup transfer model, so that the obtained pseudo makeup result only transfers the makeup of the reference makeup image, reduces the noise interference of the lighting and the original skin color in the reference makeup image, and retains the original skin color and lighting in the target makeup image, so that the trained makeup transfer model can generate a makeup result that retains the original skin color and lighting in the target makeup image, thereby improving the accuracy and authenticity of the makeup result.

[0146] Figure 6 is a schematic structural diagram of a makeup migration device 20 according to an embodiment of the present application, such as Figure 6 As shown, the makeup migration device 20 may include:

[0147] An acquisition module 21 is used to acquire a second reference makeup picture and a second target picture to be applied with makeup;

[0148] An extraction module 22 is used to extract makeup from the second reference makeup image according to the trained makeup transfer model to obtain makeup features, wherein the trained makeup transfer model is obtained by training according to the training method provided in the above embodiment;

[0149] The determination module 23 is used to determine a makeup result picture according to the makeup feature and the second target picture, where the makeup result picture is the second target picture having the makeup feature.

[0150] Optionally, the extraction module 22 can be used to: perform feature extraction on the second reference makeup image to obtain a first feature; perform feature extraction on a preset area of ​​the second reference makeup image to obtain a second feature; and subtract the first feature from the second feature to obtain a makeup feature.

[0151] It should be noted that the functions of each module in the makeup migration device 20 in the embodiment of the present application can correspond to the specific implementation methods in the above-mentioned method embodiments, which will not be repeated here.

[0152] Each module in the training device 20 of the makeup transfer model can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0153] The training device 20 of the makeup transfer model provided in the embodiment of the present application obtains a second reference makeup picture and a second target picture to be applied with makeup through an acquisition module 21, and then an extraction module 22 performs makeup extraction on the second reference makeup picture according to the trained makeup transfer model to obtain makeup features. The trained makeup transfer model is trained according to the training method provided in the above embodiment, and then a determination module 23 determines a makeup result picture according to the makeup features and the second target picture. The makeup result picture is the second target picture with makeup features, so that a real makeup result that retains the lighting and original skin color of the target makeup picture can be generated.

[0154] In some embodiments, the present application further provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0155] Figure 7 A schematic structural diagram of a computer device provided in an embodiment of the present application, which may be Figure 1 The terminal or server shown. Figure 7 As shown, the computer device 30 may include: a communication interface 31, a memory 32, a processor 33 and a communication bus 34. The communication interface 31, the memory 32, and the processor 33 communicate with each other through the communication bus 34. The communication interface 31 is used for the computer device 30 to communicate data with external devices. The memory 32 can be used to store software programs and modules, and the processor 33 runs the software programs and modules stored in the memory 32, such as the software programs of the corresponding operations in the aforementioned method embodiments.

[0156] In some embodiments, the processor 33 may call software programs and modules stored in the memory 32 to perform the following operations:

[0157] Obtain a first reference makeup picture and a first target picture to be made up; decompose the first reference makeup picture to obtain the first color information of the first reference makeup picture; decompose the first target picture to obtain the second illumination information and the second color information of the first target picture; determine the makeup color information corresponding to the first reference makeup picture according to the first color information, and determine the second original skin color information corresponding to the first target picture according to the second color information; determine the pseudo makeup result of the first target picture according to the second illumination information, the second original skin color information and the makeup color information; use the pseudo makeup result as the first supervision information to train the makeup migration model. Or,

[0158] Obtain a second reference makeup picture and a second target picture to be applied with makeup; perform makeup extraction on the second reference makeup picture according to a trained makeup transfer model to obtain makeup features, wherein the trained makeup transfer model is trained according to the training method provided in the above embodiment; determine a makeup result picture according to the makeup features and the second target picture, wherein the makeup result picture is the second target picture having the makeup features.

[0159] The embodiment of the present application also provides a computer-readable storage medium for storing a computer program. The computer-readable storage medium can be applied to a computer device, and the computer program enables the computer device to execute the corresponding process in the video preview method in the embodiment of the present application, which will not be described here for brevity.

[0160] The embodiment of the present application also provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the corresponding process in the video preview method in the embodiment of the present application, which will not be described here for brevity.

[0161] The embodiment of the present application also provides a computer program, which includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the corresponding process in the video preview method in the embodiment of the present application, which will not be described here for the sake of brevity.

[0162] It should be understood that the processor of the embodiment of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and performed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0163] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0164] It should be understood that the above-mentioned memory is exemplary but not restrictive. For example, the memory in the embodiments of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM), etc. That is to say, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.

[0165] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0166] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0167] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0168] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0169] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0170] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer or a server) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0171] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for training a makeup transfer model, characterized in that: The training method comprises: Obtaining a first reference makeup image and a first target image to be made up; performing a decomposition operation on the first reference makeup picture to obtain first color information of the first reference makeup picture; performing a decomposition operation on the first target image to obtain second illumination information and second color information of the first target image; Determine makeup color information corresponding to the first reference makeup image according to the first color information, and determine second original skin color information corresponding to the first target image according to the second color information; wherein, based on the fact that the first target image to be made up has no makeup color information, the second color information is determined as the second original skin color information, or the color values ​​of all pixels of the face in the second color information are averaged to obtain the second original skin color information corresponding to the first target image; determining a pseudo makeup result of the first target image according to the second illumination information, the second original skin color information, and the makeup color information; The makeup transfer model is trained by using the pseudo makeup result as the first supervisory information.

2. The method for training a makeup transfer model according to claim 1, characterized in that: The determining the pseudo makeup result of the first target image according to the second illumination information, the second original skin color information, and the makeup color information includes: The second illumination information, the second original skin color information, and the makeup color information are combined according to a first preset formula to obtain a pseudo makeup result of the first target image.

3. The method for training a makeup transfer model according to claim 2, characterized in that: The determining, according to the first color information, makeup color information corresponding to the first reference makeup picture includes: Calculating first original skin color information corresponding to the first reference makeup picture according to the first color information includes: averaging color values ​​of all pixels of the face in the first color information to obtain first original skin color information corresponding to the first reference makeup picture; The first color information is subtracted from the first original skin color information to obtain the makeup color information.

4. The method for training a makeup transfer model according to claim 3, characterized in that: The training method further comprises: When performing a decomposition operation on the first reference makeup image, first lighting information is also obtained; determining a pseudo makeup removal result of the first reference makeup image according to the first original skin color information and the first illumination information; The pseudo makeup removal result is used as the second supervisory information to train the makeup transfer model, which includes a makeup extraction network and a makeup transfer network. Specifically: Based on the first reference makeup picture, obtaining a makeup removal result and a first makeup feature of the first reference makeup picture through the makeup extraction network; supervising the makeup extraction network according to a loss value between a makeup removal result of the first reference makeup image and a pseudo makeup removal result of the first reference makeup image; Inputting the makeup removal result and the first makeup feature into the makeup transfer network to obtain a re-makeup result; The makeup transfer network is trained according to a loss value between the re-makeup result and the first reference makeup image.

5. The method for training a makeup transfer model according to claim 4, characterized in that: The determining, according to the first original skin color information and the first illumination information, a pseudo makeup removal result of the first reference makeup image includes: The first original skin color information and the first illumination information are combined according to a second preset formula to obtain a pseudo makeup removal result of the first reference makeup image.

6. The method for training a makeup transfer model according to claim 4, characterized in that: The training method further comprises: Based on the first target image and the first makeup feature, obtaining a makeup result of the first target image through the makeup transfer network; supervising the makeup transfer network according to a loss value between the makeup result of the first target image and the pseudo makeup result of the first target image; Inputting the makeup application result into the makeup extraction network to obtain a makeup removal result; The makeup extraction network is trained according to a loss value between the re-makeup removal result and the first target image.

7. The method for training a makeup transfer model according to claim 6, characterized in that: The inputting the makeup result into the makeup extraction network further obtains a second makeup feature, and the training method further includes: The makeup transfer model is trained according to the loss value between the first makeup feature and the second makeup feature.

8. A makeup migration method, characterized in that: The makeup migration method comprises: Obtaining a second reference makeup image and a second target image to be applied with makeup; Performing makeup extraction on the second reference makeup image according to the trained makeup transfer model to obtain makeup features, wherein the trained makeup transfer model is obtained by training according to the training method according to any one of claims 1 to 7; A makeup result picture is determined according to the makeup features and the second target picture, and the makeup result picture is the second target picture having the makeup features.

9. The makeup migration method according to claim 8, characterized in that: The step of extracting makeup from the second reference makeup image to obtain makeup features includes: Performing feature extraction on the second reference makeup image to obtain a first feature, where the first feature represents color information of the second reference makeup image, where the color information is obtained by adding makeup color information to original skin color information; Extracting features from a preset area of ​​the second reference makeup image to obtain a second feature, where the second feature represents original skin color information of the second reference makeup image, and the preset area is a neck area; The first feature is subtracted from the second feature to obtain a makeup feature, where the makeup feature represents makeup color information of the second reference makeup picture.

10. A training device for a makeup transfer model, characterized in that: include: An acquisition module, used to acquire a first reference makeup image and a first target image to be applied with makeup; a decomposition module, configured to perform a decomposition operation on the first reference makeup picture to obtain first color information of the first reference makeup picture; performing a decomposition operation on the first target image to obtain second illumination information and second color information of the first target image; a first determination module, configured to determine makeup color information corresponding to the first reference makeup image according to the first color information, and to determine second original skin color information corresponding to the first target image according to the second color information; wherein, based on the fact that the first target image to be made up has no makeup color information, the second color information is determined as the second original skin color information, or the color values ​​of all pixels of the face in the second color information are averaged to obtain the second original skin color information corresponding to the first target image; a second determination module, configured to determine a pseudo makeup result of the first target image according to the second illumination information, the second original skin color information, and the makeup color information; A training module is used to train the makeup transfer model by using the pseudo makeup result as the first supervisory information.

11. A makeup migration device, characterized in that: The makeup migration device comprises: An acquisition module, used to acquire a second reference makeup image and a second target image to be applied with makeup; an extraction module, configured to perform makeup extraction on the second reference makeup image according to a trained makeup transfer model to obtain makeup features, wherein the trained makeup transfer model is obtained by training according to the training method according to any one of claims 1 to 7; A determination module is used to determine a makeup result picture according to the makeup features and the second target picture, wherein the makeup result picture is the second target picture having the makeup features.

12. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on a computer device, the computer device executes the makeup transfer model training method according to any one of claims 1 to 7 or the makeup transfer method according to any one of claims 8 to 9.

13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the steps in the makeup transfer model training method described in any one of claims 1 to 7 or the makeup transfer method described in any one of claims 8 to 9 by calling the computer program stored in the memory.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the makeup transfer model training method described in any one of claims 1 to 7 or the makeup transfer method described in any one of claims 8 to 9 are implemented.

Citation Information

Patent Citations

  • A complex makeup migration method based on facial analysis and illumination migration

    CN109949216A

  • Facial makeup migration method based on deep generative network

    CN112508771A

  • Model training method and image processing method

    CN113869429A

  • Image forming device

    JP1995154592A

  • Systems and Methods for Virtual Facial Makeup Removal and Simulation, Fast Facial Detection and Landmark Tracking, Reduction in Input Video Lag and Shaking, and a Method for Recommending Makeup

    US20190014884A1