Makeup concentration obtaining method and device of makeup migration model, equipment and medium
By using an adaptive optimization method to optimize the makeup concentration weight value in the makeup migration model, the problem that traditional models cannot obtain the optimal makeup concentration in a personalized manner is solved, and the best makeup effect is achieved.
Patent Information
- Application Number
- CN202411716748.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-18
AI Technical Summary
The traditional makeup migration model cannot effectively obtain the optimal makeup migration concentration for different users in a personalized manner, resulting in the inability to achieve the best makeup effect.
By obtaining the initial makeup concentration weight value, performing weight processing, and then performing makeup migration on the original image, combining the appearance score to adaptively find optimization, and optimizing the makeup concentration weight value to determine the optimal makeup concentration value.
It has achieved personal recommendation of the best makeup migration concentration based on each person's facial features and makeup style to achieve the best makeup effect.
Smart Images

Figure CN119648658A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and medium for acquiring makeup concentration of a makeup migration model of a virtual character model. Background Art
[0002] With the rise of artificial intelligence technology, more and more financial service platforms / systems can now support functions such as shopping, social networking, interactive games, resource transfer and short video publishing. Among them, these financial service platforms / systems can also have functions such as applying for loans, credit cards or purchasing insurance and financial products. They can also be insurance systems, banking systems, transaction systems and order systems. In financial service platforms / systems, for example, user image reprocessing, including makeup migration, is often involved.
[0003] Makeup transfer refers to the technology of directly transferring the makeup on the target image to the original image. Due to the differences in facial features and makeup styles of different people, the existing makeup transfer models have different effects when combined with facial features and makeup styles. Traditional technical solutions lack the ability to obtain the optimal makeup transfer concentration for different users and cannot achieve the best makeup effect. Summary of the invention
[0004] The present application provides a makeup concentration acquisition method, device, computer equipment and storage medium of a makeup migration model to solve the technical problem that the best makeup effect cannot be achieved in traditional solutions.
[0005] A method for obtaining makeup concentration of a makeup transfer model, comprising: Get the initialized makeup concentration weight value; According to the makeup concentration weight value, the makeup matrix of the makeup reference image and the makeup matrix of the original image are weighted to obtain a new makeup matrix; Using the new makeup matrix, performing makeup migration on the original image to obtain a target feature map; Inputting the target feature map and the original image into a makeup generation network to obtain a beauty score of the target image; Taking the makeup concentration weight value as a variable and the appearance score of the target image as an adaptive value, optimizing the makeup concentration weight value to obtain a target makeup concentration weight value; The makeup density value of the original image is determined according to the target makeup density weight value.
[0006] Furthermore, optimizing the makeup concentration weight value to obtain a target makeup concentration weight value includes: a. Initializing multiple makeup concentration weight values in the first iteration process; b. determining the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process according to the multiple makeup concentration weight values in the first iteration process, and recording the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process; c. Using the Levy flight method, updating multiple makeup concentration weight values in the first iteration process to obtain multiple makeup concentration weight values in the second iteration process; d. Using the makeup concentration weight values corresponding to the highest optimal appearance score among the multiple makeup concentration weight values in the first iteration process to replace the makeup concentration weight values in the second iteration process, to obtain a new set of multiple makeup concentration weight values; e. determining whether a candidate makeup concentration weight value in the set of multiple new makeup concentration weight values is less than a preset probability value, wherein the candidate makeup concentration weight value represents each makeup concentration weight value in the set of multiple new makeup concentration weight values; f. If the candidate makeup concentration weight value is less than the preset probability value, randomly replace it with the value of the candidate makeup concentration weight value until all the makeup concentration weight values less than the preset probability value in the new set of multiple makeup concentration weight values are replaced, thereby obtaining another new set of multiple makeup concentration weight values; g. Using the other set of multiple new makeup concentration weight values as the iteration initial value, and re-participating in the iterative calculation of step bf until the number of iterations is greater than the preset number of iterations; h. The optimal makeup concentration weight value among the multiple makeup concentration weight values obtained in the last set of iterative processes is used as the target makeup concentration weight value.
[0007] Furthermore, the method of using the Levy flight method to update the multiple makeup concentration weight values in the first iteration process to obtain the multiple makeup concentration weight values in the second iteration process includes: The following formula is used to update the multiple makeup concentration weight values in the first iteration process: in, represents the makeup concentration weight value of the ith iteration, represents the step size coefficient, s represents the step size, represents the dot multiplication operation, represents the preset probability value, is a random number drawn from a uniform distribution, and are two solutions randomly selected by random permutation; Use the following method to obtain multiple makeup concentration weight values in the second iteration process: in, >0, represents the step size coefficient, are the initial step size and parameters.
[0008] Furthermore, the using the new makeup matrix to perform makeup migration on the original image to obtain a target feature map includes: Use the following method to perform makeup migration on the original image to obtain a target feature map: in, represents the target feature map, and I represents The identity matrix of the same size and dimensions, Indicates the makeup concentration weight value, represents the conversion function, represents the characteristics of the target image, represents the makeup reference image, Represents the target feature map.
[0009] Furthermore, after optimizing the makeup concentration weight value to obtain a target makeup concentration weight value, the method further includes: The target makeup concentration weight value is used as the initial makeup concentration weight value of the user corresponding to the original image, and is updated to the makeup transfer model.
[0010] A makeup concentration acquisition device for a makeup migration model, comprising: An acquisition module is used to obtain the makeup concentration weight value after initialization; A weighting module, used for performing weighted processing on the makeup matrix of the makeup reference image and the makeup matrix of the original image according to the makeup concentration weight value to obtain a new makeup matrix; A transfer module, used to perform makeup migration on the original image using the new makeup matrix to obtain a target feature map; An input module, used to input the target feature map and the original image into a makeup transfer network to obtain a beauty score of the target image; An optimization module is used to optimize the makeup concentration weight value by taking the makeup concentration weight value as a variable and the appearance score of the target image as an adaptive value, so as to obtain a target makeup concentration weight value; The determination module is used to determine the makeup concentration value of the original image according to the target makeup concentration weight value.
[0011] Furthermore, the optimization module is used to: a. Initializing multiple makeup concentration weight values in the first iteration process; b. determining the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process according to the multiple makeup concentration weight values in the first iteration process, and recording the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process; c. Using the Levy flight method, updating multiple makeup concentration weight values in the first iteration process to obtain multiple makeup concentration weight values in the second iteration process; d. Using the makeup concentration weight value with the highest optimal appearance score among the multiple makeup concentration weight values in the first iteration process, to replace the makeup concentration weight value in the second iteration process, to obtain a new set of multiple makeup concentration weight values; e. determining whether a candidate makeup concentration weight value in the set of multiple new makeup concentration weight values is less than a preset probability value, wherein the candidate makeup concentration weight value represents each makeup concentration weight value in the multiple new makeup concentration weight values; f. If the candidate makeup concentration weight value is less than the preset probability value, randomly replace it with a value of the candidate makeup concentration weight value until all the makeup concentration weight values less than the preset probability value in the new set of multiple makeup concentration weight values are replaced, thereby obtaining another new set of multiple makeup concentration weight values; g. Using the other set of multiple new makeup concentration weight values as the iteration initial value, and re-participating in the iterative calculation of step bf until the number of iterations is greater than the preset number of iterations; h. The optimal makeup concentration weight value among the multiple makeup concentration weight values obtained in the last set of iterative processes is used as the target makeup concentration weight value.
[0012] Furthermore, the method of using the Levy flight method to update the multiple makeup concentration weight values in the first iteration process to obtain the multiple makeup concentration weight values in the second iteration process includes: The following formula is used to update the multiple makeup concentration weight values in the first iteration process: in, represents the makeup concentration weight value of the ith iteration, represents the step size coefficient, s represents the step size, represents the dot multiplication operation, represents the preset probability value, is a random number drawn from a uniform distribution, and are two solutions randomly selected by random permutation; Use the following method to obtain multiple makeup concentration weight values in the second iteration process: in, >0, represents the step size coefficient, are the initial step size and parameters.
[0013] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the control method of the virtual character model.
[0014] In the above scheme, the initial makeup concentration weight value is first obtained, and the makeup concentration weight value is used to generate the target image and obtain its appearance score. Then, the makeup concentration weight value is used as a variable, and the appearance score of the target image is used as an adaptive value to optimize the makeup concentration weight value. The target makeup concentration weight value with the optimal weight value under the original image can be obtained, and then the makeup concentration value of the makeup reference image is determined according to the target makeup concentration weight value to generate a new target image. This is equivalent to providing an adaptive makeup concentration adjustment network, which can be applied to the makeup transfer model to find the optimal makeup concentration. In this way, it is possible to achieve personalized recommendations for the optimal makeup transfer concentration for different users based on the different facial features of each person and the diversity of makeup styles, so as to achieve the best makeup effect. This is very necessary for current market applications and research. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 This is a schematic diagram of an application environment of a makeup concentration acquisition method in an embodiment of the present application; Figure 2 This is a flow chart of a method for obtaining makeup concentration in one embodiment of the present application; Figure 3 yes Figure 2 A schematic diagram of a process of step S50; Figure 4 is a structural schematic diagram of a makeup concentration acquisition device in one embodiment of the present application; Figure 5It is a structural diagram of a computer device in one embodiment of the present application. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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. Based on 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.
[0018] The control method of the virtual character model provided in the embodiment of the present application can be applied to Figure 1 In the application environment, the terminal device or server can obtain the makeup concentration weight value; according to the makeup concentration weight value, the makeup matrix of the makeup reference image and the makeup matrix of the original image are weighted to obtain a new makeup matrix; using the new makeup matrix, the original image is migrated to obtain the beauty score of the target feature map; the target feature map and the original image are input into the makeup migration network to obtain the target image; with the makeup concentration weight value as a variable and the beauty score of the target image as an adaptive value, the makeup concentration weight value is optimized to obtain the target makeup concentration weight value; according to the target makeup concentration weight value, the makeup concentration value of the makeup reference image is determined. In the present application, since the target feature map and the original image at the corresponding makeup concentration are input into the makeup migration network to obtain the beauty score of the target image, and the makeup concentration weight value is used as a variable, the beauty score is used for adaptive optimization, and the optimal target makeup concentration weight value can be obtained, and the migration concentration of the optimal makeup can be obtained according to the individualization of different users to achieve the best makeup effect. The server may be implemented as an independent server or a server cluster composed of multiple servers. The terminal device may be a user terminal such as a mobile phone or a tablet computer.
[0019] In one embodiment, if Figure 2 As shown, a method for obtaining makeup concentration of a makeup migration model is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the process, including the following steps: S10: Obtaining an initialized makeup concentration weight value.
[0020] S20: performing weighted processing on the makeup matrix of the makeup reference image and the makeup matrix of the original image according to the makeup concentration weight value to obtain a new makeup matrix.
[0021] Today, when beauty software is indispensable, automatic makeup and makeup beautification have penetrated into every photo taking, live broadcasting, and even shopping software. With the development of artificial intelligence technology, makeup transfer technology is one of the very important technologies. In reality, you only need a user's own facial photo (source image, original image), select a makeup type that the user wants to transfer (makeup reference image, reference image), and you can automatically generate the makeup type of the makeup reference image that the user wants to draw, and get the target image (result image). In actual applications, since it is unknown which makeup type is suitable for the user, the user needs to try it in the mirror after applying the required makeup type one by one. Therefore, the makeup transfer technology used to simulate the makeup effect allows the user to know how each makeup type feels when applied to the user without real makeup, so that the user can find the makeup that suits him. However, in the traditional makeup transfer model, each person's facial features are different, and the makeup style is diverse. The effect of combining different people's facial features with makeup styles is different. Although the step of manual makeup is eliminated, if the makeup effects are generated one by one based on the makeup transfer model and selected from them, the efficiency is still low.
[0022] In an embodiment of the present application, a method for obtaining makeup concentration of a makeup migration model is provided. The makeup concentration refers to an attribute parameter of a makeup feature that reflects a makeup type. The makeup feature includes makeup attributes and color features. For example, makeup attributes may include whether there is eye shadow, whether lip gloss is applied, and whether there is sunburn, etc. The color feature reflects the color feature of the corresponding makeup attribute. The differences in the above makeup attributes and color features are all reflected as numerical differences. Different numerical values represent different makeup types. Different numerical values reflect different makeup concentrations.
[0023] In the steps S10-S20, the makeup concentration weight value is first initialized, and then the makeup matrix of the makeup reference image and the makeup matrix of the original image are weighted according to the makeup concentration weight value to obtain a new makeup matrix. It should be noted that the makeup matrix of the makeup reference image reflects the makeup type of the makeup reference image, while the makeup matrix of the original image reflects the makeup type of the original image. This step uses the initialized makeup concentration weight value to weight the makeup matrix of the makeup reference image and the makeup matrix of the original image to obtain a new makeup matrix, that is, during the weighted processing of the makeup matrix of the makeup reference image and the makeup matrix of the original image, the weight of the makeup concentration is determined by the makeup concentration weight value.
[0024] S30: Using the new makeup matrix, perform makeup migration on the original image to obtain a target feature map.
[0025] S40: Input the target feature map and the original image into a makeup generation network to obtain a beauty score of the target image.
[0026] In steps S30-S40, after weighting the makeup matrix of the makeup reference image and the makeup matrix of the original image according to the makeup concentration weight value to obtain a new makeup matrix, the new makeup matrix is used to perform makeup migration on the original image to obtain a target feature map. In other words, the original image first uses the makeup type that has been changed by weight to perform makeup migration on the makeup of the original image to obtain a target feature map, and the target feature map and the original image are input into the makeup generation network to obtain the target image, and the corresponding appearance score of the target image is obtained. Among them, the appearance score can be a way for the makeup generation network to automatically score according to the scoring rules, or it can be a way for the user to manually score, and there is no specific limitation.
[0027] At this point, the beauty score of the target image corresponding to the makeup concentration weight can be obtained.
[0028] S50: Taking the makeup concentration weight value as a variable and the appearance score of the target image as an adaptive value, optimizing the makeup concentration weight value to obtain a target makeup concentration weight value.
[0029] After obtaining the appearance score of the target image under one of the makeup concentration weight values, the makeup concentration weight value is used as a variable, and the appearance score of the target image is used as an adaptive value. The makeup concentration weight value is optimized to obtain a target makeup concentration weight value, that is, the makeup concentration weight value corresponding to the target image with the highest appearance score is found, and recorded as the target makeup concentration weight value.
[0030] S60: Determine a makeup density value of the original image according to the target makeup density weight value.
[0031] After the target makeup concentration weight value is obtained through optimization, the makeup concentration value of the original image is determined according to the target makeup concentration weight value, which can be used in the subsequent makeup migration corresponding to the original image.
[0032] For example, nowadays, more and more financial service platforms / systems can support functions such as shopping, social networking, interactive games, resource transfer and short video publishing. Among them, these financial service platforms / systems can also have functions such as applying for loans, credit cards or purchasing insurance and financial products. When users of the financial service platform promote video products, they can use the method provided by this application to transfer makeup, eliminating the process of artificial makeup and obtaining the best makeup effect, thereby improving the effect of video marketing.
[0033] It can be seen that in this embodiment, a method for obtaining makeup concentration of a makeup transfer model is provided. First, an initial makeup concentration weight value is obtained, and the makeup concentration weight value is used to generate a target image and obtain its appearance score. Then, the makeup concentration weight value is used as a variable, and the appearance score of the target image is used as an adaptive value to optimize the makeup concentration weight value. The target makeup concentration weight value with the best weight value under the original image can be obtained, and then the makeup concentration value of the makeup reference image is determined according to the target makeup concentration weight value to generate a new target image. This is equivalent to providing an adaptive adjustment network for makeup concentration, which can be applied to the makeup transfer model for finding the optimal makeup concentration. In this way, it is possible to achieve personalized recommendations for the optimal makeup transfer concentration for different users based on the different facial features of each person and the diversity of makeup styles, so as to achieve the best makeup effect. This is very necessary for current market applications and research.
[0034] It should be noted that, in step S50, the purpose of the adaptive optimization is to optimize the weight value using an adaptive method according to the characteristics of the makeup type of the makeup reference image (which can be understood as the makeup style) to obtain a suitable makeup concentration weight value, thereby obtaining the optimal makeup attribute for the original image. To improve the optimization efficiency, the present application embodiment provides an optimization method: In one embodiment, if Figure 2 As shown, in step S50, that is, optimizing the makeup concentration weight value to obtain the target makeup concentration weight value, the following steps are included: a. Initialize multiple makeup concentration weight values in the first iteration process.
[0035] b. Determine the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iterative process according to the multiple makeup concentration weight values in the first iterative process, and record the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iterative process.
[0036] In this embodiment, based on the improved cuckoo algorithm, the optimal target makeup concentration weight value is obtained by using multiple iterations of optimization. First, for the convenience of description, the previous iteration process is called the first iteration process, and the next iteration process is called the second iteration process. In step ab, the multiple makeup concentration weight values in the first iteration process are initialized. For example, the number of initialized makeup concentration weight values is n, the search space is d, and the multiple makeup concentration weight values are recorded as ,in, Respectively represent the 1st to nth makeup concentration weight values, represents the first makeup concentration weight value under iteration 0, T represents the number of iterations, and the first iteration process is recorded as 0.
[0037] Then, according to the multiple makeup concentration weight values in the first iteration process , determine the optimal makeup concentration value in the first iteration process , bϵ[1,2,...,n] and the corresponding optimal appearance score , and record the optimal makeup concentration value in the first iteration process , bϵ[1,2,...,n] and the corresponding optimal appearance score .
[0038] c. Using the Levy flight method, the multiple makeup concentration weight values in the first iteration process are updated to obtain the multiple makeup concentration weight values in the second iteration process.
[0039] The optimal makeup concentration value during recording the first iteration , bϵ[1,2,...,n] and the corresponding optimal appearance score Afterwards, keep the best bird's nest location of the previous generation , and use the Levy flight method to update multiple makeup concentration weight values in the first iteration process , and obtain multiple makeup concentration weight values in the second iteration process, recorded as .
[0040] It is understandable that in order to improve the optimization efficiency, the Levy flight method is used for optimization in this embodiment. It is worth noting that the Levy flight method has a good global search capability, which can effectively avoid the optimization process from falling into a local optimal solution, and can obtain an accurate optimal makeup concentration value, which is relatively simple to implement and faster.
[0041] Specifically, the following formula is used to update the multiple makeup concentration weight values in the first iteration process: (3) in, represents the makeup concentration weight value of the ith iteration, represents the step size coefficient, s represents the step size, represents the dot multiplication operation, Represents the preset probability value, that is, the probability of discovering the optimal makeup concentration of the current iteration. is a random number drawn from a uniform distribution, and are two solutions chosen randomly by random permutation.
[0042] Then use the following method to obtain multiple makeup concentration weight values in the second iteration process: (4) (5) in, >0, represents the step size coefficient, are the initial step size and parameters.
[0043] It can be seen that in this embodiment, a balanced combination of local random walk and global exploratory random walk is adopted to improve the optimization efficiency.
[0044] d. Use the makeup concentration weight values with higher optimal appearance scores among the multiple makeup concentration weight values in the first iteration process to replace the makeup concentration weight values in the second iteration process, so as to obtain a new set of multiple makeup concentration weight values.
[0045] In step d, multiple makeup concentration weight values are obtained in the second iteration process. After that, the multiple makeup concentration weight values generated by the previous generation, that is, Compare and replace the lower makeup concentration weight value with the higher optimal appearance score, so as to obtain a set of better bird's nest positions, that is, to obtain a new set of multiple makeup concentration weight values .
[0046] e. Determine whether a candidate makeup concentration weight value in the set of multiple new makeup concentration weight values is less than a preset probability value, wherein the candidate makeup concentration weight value represents each makeup concentration weight value in the multiple new makeup concentration weight values.
[0047] f. If the candidate makeup concentration weight value is less than the preset probability value, the candidate makeup concentration weight value is randomly replaced by a value of the same size until all the makeup concentration weight values less than the preset probability value in the new set of multiple makeup concentration weight values are replaced to obtain another new set of multiple makeup concentration weight values.
[0048] In step ef, after the makeup concentration weight value is updated, a new set of multiple makeup concentration weight values is used. Each makeup concentration weight value in is used as a candidate makeup concentration weight value, and the candidate makeup concentration weight value is compared with the preset probability ( Generally set to 0.25) for comparison, if the candidate makeup concentration weight value > , then use formula (3) to The makeup concentration weight value of is randomly changed again. Medium to preset probability Smaller makeup concentration weight value, and randomly change the preset probability A larger makeup concentration weight value, at this time, another set of multiple makeup concentration weight values will be obtained, recorded as .
[0049] g. Using the other set of multiple new makeup concentration weight values as the iteration initial value, and re-participating in the iterative calculation of step bf until the number of iterations is greater than the preset number of iterations.
[0050] h. The optimal makeup concentration weight value among the multiple makeup concentration weight values obtained in the last set of iterative processes is used as the target makeup concentration weight value.
[0051] Get another set of multiple makeup concentration weight values, recorded as Then, the other set of multiple makeup concentration weight values As the initial value of the iteration, re-participate in the iterative calculation of step bf until the number of iterations T is greater than the preset number of iterations. Finally, the optimal makeup concentration weight value among the multiple makeup concentration weight values obtained in the last set of iterations is output as the global optimal appearance score. , and output the global optimal makeup concentration weight value , the global optimal makeup concentration weight value As the target makeup concentration weight value.
[0052] It can be seen that in this embodiment, the makeup concentration weight value is optimized based on the cuckoo optimization method. Due to the small number of parameters, the convergence speed is insensitive to parameter changes, it is not easy to fall into the local optimum, it is easy to couple with other algorithms, it has good versatility, strong robustness, and the step size parameter is configurable. The alternating use of large step size and small step size can make the global search capability stronger, and the optimal makeup concentration weight can be quickly found. For different facial images, the best makeup effect picture can be synthesized accordingly, which can ensure high-fidelity color transfer and high-resolution face generation, and obtain the highest appearance score.
[0053] In one embodiment, in step S30, that is, using the new makeup matrix to perform makeup migration on the original image to obtain a target feature map, includes: performing makeup migration on the original image to obtain a target feature map in the following manner: in, represents the target feature map, and I represents The identity matrix of the same size and dimensions, represents the makeup concentration weight, represents the conversion function, represents the characteristics of the target image, represents the makeup reference image, Represents the target feature map.
[0054] In this embodiment, in order to adaptively adjust the makeup concentration and realize interpolation makeup transfer, the embodiment of the present application uses the makeup concentration weight value , to weight the makeup matrix of the makeup reference image y and the target image x, a new makeup matrix can be obtained, and then the conversion function , the characteristics of the target image It is linearly transferred to reconstruct the makeup features of the interpolated target image, thereby achieving makeup migration with controllable makeup concentration.
[0055] In one embodiment, after optimizing the makeup concentration weight value to obtain a target makeup concentration weight value, the method further includes: using the target makeup concentration weight value as the initial makeup concentration weight value of the user corresponding to the original image, and updating the makeup migration model.
[0056] In this embodiment, the target makeup concentration weight value is used as the initial makeup concentration weight value of the user corresponding to the original image, and is updated to the makeup migration model. In this way, when the user uses the makeup migration model to migrate makeup next time, the target makeup concentration weight value obtained in the previous makeup migration process is used as the initial makeup concentration weight value of this makeup migration. Since the target makeup concentration weight value is determined by the user's facial features, the weight optimization process of this makeup migration can be further accelerated, thereby improving the efficiency of makeup migration.
[0057] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0058] In one embodiment, a makeup concentration acquisition device of a makeup migration model is provided, and the makeup concentration acquisition device of the makeup migration model corresponds one-to-one to the makeup concentration acquisition method of the makeup migration model in the above embodiment. Figure 4 As shown, the makeup concentration acquisition device of the makeup migration model includes a packaging module 101, a storage module 102, a reading module 103, a parsing module 104 and a setting module 105. The detailed description of each functional module is as follows: An acquisition module 101 is used to acquire an initialized makeup concentration weight value; A weighting module 102 is used to perform weighted processing on the makeup matrix of the makeup reference image and the makeup matrix of the original image according to the makeup concentration weight value to obtain a new makeup matrix; A transfer module 103 is used to perform makeup migration on the original image using the new makeup matrix to obtain a target feature map; An input module 104 is used to input the target feature map and the original image into a makeup transfer network to obtain a beauty score of the target image; An optimization module 105 is used to optimize the makeup concentration weight value by taking the makeup concentration weight value as a variable and the beauty score of the target image as an adaptive value to obtain a target makeup concentration weight value; The determination module 106 is used to determine the makeup concentration value of the original image according to the target makeup concentration weight value.
[0059] In one embodiment, the optimization module 105 is used to: a. Initializing multiple makeup concentration weight values in the first iteration process; b. determining the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process according to the multiple makeup concentration weight values in the first iteration process, and recording the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process; c. Using the Levy flight method, updating multiple makeup concentration weight values in the first iteration process to obtain multiple makeup concentration weight values in the second iteration process; d. Using the makeup concentration weight value with the highest optimal appearance score among the multiple makeup concentration weight values in the first iteration process, to replace the makeup concentration weight value in the second iteration process, to obtain a new set of multiple makeup concentration weight values; e. determining whether a candidate makeup concentration weight value in the set of multiple new makeup concentration weight values is less than a preset probability value, wherein the candidate makeup concentration weight value represents each makeup concentration weight value in the multiple new makeup concentration weight values; f. If the candidate makeup concentration weight value is less than the preset probability value, randomly replace it with a value of the candidate makeup concentration weight value until all the makeup concentration weight values less than the preset probability value in the new set of multiple makeup concentration weight values are replaced, thereby obtaining another new set of multiple makeup concentration weight values; g. Using the other set of multiple new makeup concentration weight values as the iteration initial value, and re-participating in the iterative calculation of step bf until the number of iterations is greater than the preset number of iterations; h. The optimal makeup concentration weight value among the multiple makeup concentration weight values obtained in the last set of iterative processes is used as the target makeup concentration weight value.
[0060] In one embodiment, the optimization module 105 is used to: The following formula is used to update the multiple makeup concentration weight values in the first iteration process: in, represents the makeup concentration weight value of the ith iteration, represents the step size coefficient, s represents the step size, represents the dot multiplication operation, represents the preset probability value, is a random number drawn from a uniform distribution, and are two solutions randomly selected by random permutation; Use the following method to obtain multiple makeup concentration weight values in the second iteration process: in, >0, represents the step size coefficient, are the initial step size and parameters.
[0061] For the specific definition of the makeup concentration acquisition device of the makeup migration model, please refer to the relevant definition of the makeup concentration acquisition method of the makeup migration model mentioned above, which will not be repeated here. Each module in the makeup concentration acquisition device of the makeup migration model can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0062] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. When the computer program is executed by the processor, a makeup concentration acquisition method of a makeup migration model is implemented.
[0063] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Get the initialized makeup concentration weight value; According to the makeup concentration weight value, the makeup matrix of the makeup reference image and the makeup matrix of the original image are weighted to obtain a new makeup matrix; Using the new makeup matrix, performing makeup migration on the original image to obtain a target feature map; Inputting the target feature map and the original image into a makeup generation network to obtain a beauty score of the target image; Taking the makeup concentration weight value as a variable and the appearance score of the target image as an adaptive value, optimizing the makeup concentration weight value to obtain a target makeup concentration weight value; The makeup density value of the original image is determined according to the target makeup density weight value.
[0064] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Get the initialized makeup concentration weight value; According to the makeup concentration weight value, the makeup matrix of the makeup reference image and the makeup matrix of the original image are weighted to obtain a new makeup matrix; Using the new makeup matrix, performing makeup migration on the original image to obtain a target feature map; Inputting the target feature map and the original image into a makeup generation network to obtain a beauty score of the target image; Taking the makeup concentration weight value as a variable and the appearance score of the target image as an adaptive value, optimizing the makeup concentration weight value to obtain a target makeup concentration weight value; The makeup density value of the original image is determined according to the target makeup density weight value.
[0065] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0066] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0067] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for obtaining makeup concentration of a makeup migration model, characterized in that: include: Get the initialized makeup concentration weight value; According to the makeup concentration weight value, the makeup matrix of the makeup reference image and the makeup matrix of the original image are weighted to obtain a new makeup matrix; Using the new makeup matrix, performing makeup migration on the original image to obtain a target feature map; Inputting the target feature map and the original image into a makeup generation network to obtain a beauty score of the target image; Taking the makeup concentration weight value as a variable and the appearance score of the target image as an adaptive value, optimizing the makeup concentration weight value to obtain a target makeup concentration weight value; The makeup density value of the original image is determined according to the target makeup density weight value.
2. The makeup concentration acquisition method according to claim 1, characterized in that: The optimizing the makeup concentration weight value to obtain a target makeup concentration weight value includes: a. Initializing multiple makeup concentration weight values in the first iteration process; b. determining the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process according to the multiple makeup concentration weight values in the first iteration process, and recording the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process; c. Using the Levy flight method, updating multiple makeup concentration weight values in the first iteration process to obtain multiple makeup concentration weight values in the second iteration process; d. Using the makeup concentration weight values corresponding to the highest optimal appearance score among the multiple makeup concentration weight values in the first iteration process to replace the makeup concentration weight values in the second iteration process, to obtain a new set of multiple makeup concentration weight values; e. determining whether a candidate makeup concentration weight value in the set of multiple new makeup concentration weight values is less than a preset probability value, wherein the candidate makeup concentration weight value represents each makeup concentration weight value in the set of multiple new makeup concentration weight values; f. If the candidate makeup concentration weight value is less than the preset probability value, randomly replace it with the value of the candidate makeup concentration weight value until all the makeup concentration weight values less than the preset probability value in the new set of multiple makeup concentration weight values are replaced, thereby obtaining another new set of multiple makeup concentration weight values; g. Using the other set of multiple new makeup concentration weight values as the iteration initial value, and re-participating in the iterative calculation of step bf until the number of iterations is greater than the preset number of iterations; h. The optimal makeup concentration weight value among the multiple makeup concentration weight values obtained in the last set of iterative processes is used as the target makeup concentration weight value.
3. The makeup concentration acquisition method according to claim 2, characterized in that: The method of updating the multiple makeup concentration weight values in the first iteration process by using the Levy flight method to obtain the multiple makeup concentration weight values in the second iteration process includes: The following formula is used to update the multiple makeup concentration weight values in the first iteration process: in, represents the makeup concentration weight value of the ith iteration, represents the step size coefficient, s represents the step size, represents the dot multiplication operation, represents the preset probability value, is a random number drawn from a uniform distribution, and are two solutions randomly selected by random permutation; Use the following method to obtain multiple makeup concentration weight values in the second iteration process: in, >0, represents the step size coefficient, are the initial step size and parameters.
4. The makeup concentration acquisition method according to claim 1, characterized in that: The step of using the new makeup matrix to perform makeup migration on the original image to obtain a target feature map includes: Use the following method to perform makeup migration on the original image to obtain a target feature map: in, represents the target feature map, and I represents The identity matrix of the same size and dimensions, Indicates the makeup concentration weight value, represents the conversion function, represents the characteristics of the target image, represents the makeup reference image, Represents the target feature map.
5. The makeup concentration acquisition method according to claim 1, characterized in that: After optimizing the makeup concentration weight value to obtain a target makeup concentration weight value, the method further includes: The target makeup concentration weight value is used as the initial makeup concentration weight value of the user corresponding to the original image, and is updated to the makeup transfer model.
6. A makeup concentration acquisition device for a makeup migration model, characterized in that: include: An acquisition module is used to obtain the makeup concentration weight value after initialization; A weighting module, used for performing weighted processing on the makeup matrix of the makeup reference image and the makeup matrix of the original image according to the makeup concentration weight value to obtain a new makeup matrix; A transfer module, used to perform makeup migration on the original image using the new makeup matrix to obtain a target feature map; An input module, used to input the target feature map and the original image into a makeup transfer network to obtain a beauty score of the target image; An optimization module is used to optimize the makeup concentration weight value by taking the makeup concentration weight value as a variable and the appearance score of the target image as an adaptive value, so as to obtain a target makeup concentration weight value; The determination module is used to determine the makeup concentration value of the original image according to the target makeup concentration weight value.
7. The makeup concentration acquisition device according to claim 6, characterized in that: The optimization module is used for: a. Initializing multiple makeup concentration weight values in the first iteration process; b. determining the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process according to the multiple makeup concentration weight values in the first iteration process, and recording the optimal makeup concentration weight value and the corresponding optimal appearance score in the first iteration process; c. Using the Levy flight method, updating multiple makeup concentration weight values in the first iteration process to obtain multiple makeup concentration weight values in the second iteration process; d. Using the makeup concentration weight value with the highest optimal appearance score among the multiple makeup concentration weight values in the first iteration process, to replace the makeup concentration weight value in the second iteration process, to obtain a new set of multiple makeup concentration weight values; e. determining whether a candidate makeup concentration weight value in the set of multiple new makeup concentration weight values is less than a preset probability value, wherein the candidate makeup concentration weight value represents each makeup concentration weight value in the multiple new makeup concentration weight values; f. If the candidate makeup concentration weight value is less than the preset probability value, randomly replace it with a value of the candidate makeup concentration weight value until all the makeup concentration weight values less than the preset probability value in the new set of multiple makeup concentration weight values are replaced, thereby obtaining another new set of multiple makeup concentration weight values; g. Using the other set of multiple new makeup concentration weight values as the iteration initial value, and re-participating in the iterative calculation of step bf until the number of iterations is greater than the preset number of iterations; h. The optimal makeup concentration weight value among the multiple makeup concentration weight values obtained in the last set of iterative processes is used as the target makeup concentration weight value.
8. The makeup concentration acquisition device according to claim 7, characterized in that: The optimization module is used for: The following formula is used to update the multiple makeup concentration weight values in the first iteration process: in, represents the makeup concentration weight value of the ith iteration, represents the step size coefficient, s represents the step size, represents the dot multiplication operation, represents the preset probability value, is a random number drawn from a uniform distribution, and are two solutions randomly selected by random permutation; Use the following method to obtain multiple makeup concentration weight values in the second iteration process: in, >0, represents the step size coefficient, are the initial step size and parameters.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the makeup concentration acquisition method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the makeup concentration acquisition method according to any one of claims 1 to 5 are implemented.