Method and device for processing beauty parameter, electronic equipment and storage medium
By grouping user image sets and calculating beautification parameters, the system automatically adjusts these parameters, solving the problem of users needing to manually adjust them and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2026-03-20
AI Technical Summary
Users need to adjust the beautification parameters for each image during the beautification process, resulting in a poor user experience.
By acquiring a set of target images, grouping them into sub-sets, grouping the images based on facial features, and calculating the target beautification parameters for each user, the user's facial area can be automatically adjusted.
It enables automatic adjustment of beauty parameters based on user characteristics, improving the user experience and avoiding the hassle of manual adjustment.
Smart Images

Figure CN115601803B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and particularly relates to a beauty parameter processing method and device, electronic equipment and a storage medium. BACKGROUND
[0002] With the development of intelligent mobile terminals, the technology of taking a selfie by using an intelligent mobile terminal is becoming more and more mature. After taking a selfie by using an intelligent mobile terminal, a user can beautify the image obtained by using a beauty technology. The beauty processing of the image by the beauty technology can include multiple modes, such as whitening, skin smoothing, freckle removal, eye enlargement, face slimming, body slimming, etc. Each beauty mode in the beauty processing is set with a fixed parameter value, and the image can be processed according to the fixed parameter value in the beauty mode.
[0003] However, face beautification is a customized process, and there is a lack of beauty parameters suitable for all people. Therefore, the user needs to adjust each picture when beautifying, which leads to a poor user experience. SUMMARY
[0004] The present application provides a beauty parameter processing method and device, electronic equipment and a storage medium to solve the problem that the user needs to adjust the beauty parameter of each picture in the related art, which leads to a poor user experience.
[0005] In a first aspect, the present application provides a beauty parameter processing method, including: obtaining a target image set, wherein each image in the target image set contains face information of a user; grouping all images in the target image set to obtain at least one sub-image set, wherein each image in each sub-image set has a face feature corresponding to a same user, and each sub-image set corresponds to a user; taking each sub-image set in the at least one sub-image set as a target sub-image set, and the target sub-image set corresponds to a target user; obtaining a target beauty parameter of each target user by performing operation on a current beauty parameter corresponding to each image in the target sub-image set, and collecting images for the target user according to the target beauty parameter, wherein the target beauty parameter is used to adjust a face region of the target user in the collected images.
[0006] In a second aspect, the application provides a processing device for beauty parameter, comprising: a first obtaining module, configured to obtain a target image set, wherein each image in the target image set is an image containing face information of a user; a grouping module, configured to group all images in the target image set to obtain at least one sub-image set, wherein each image in each sub-image set has a same user corresponding face feature, and each sub-image set corresponds to a user; and an operation module, configured to take each sub-image set in the at least one sub-image set as a target sub-image set, and the target sub-image set corresponds to a target user, and obtain a target beauty parameter of each target user by operating a current beauty parameter corresponding to each image in the target sub-image set, wherein the target beauty parameter is used to adjust a face region of the target user in a collected image.
[0007] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus.
[0008] The memory is configured to store a computer program.
[0009] The processor is configured to execute the program stored in the memory, and implement the steps of the processing method for beauty parameter according to any one of the first aspect.
[0010] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the steps of the processing method for beauty parameter according to any one of the first aspect.
[0011] The technical solution of the application can be applied to the field of deep learning based on computer vision. The above technical solution provided by the embodiments of the application has the following advantages compared with the prior art.
[0012] The method provided by the embodiment of the present application firstly acquires a target image set containing face information of a user, then groups each image in the target image set to obtain at least one sub-image set, each image in each sub-image set has a face feature corresponding to the same user, each sub-image set corresponds to one user, finally, each sub-image set in the at least one sub-image set is taken as a target sub-image set, and the target sub-image set corresponds to a target user, and a target beautifying parameter used for adjusting a face image of the target user is obtained by performing operation on a current beautifying parameter corresponding to each image in the target sub-image set. The method groups the image set containing faces according to face features to obtain a sub-image set corresponding to each user, then performs operation on a parameter corresponding to each image in the target sub-image set to obtain a target beautifying parameter of each target user, and the target beautifying parameter is obtained according to all beautifying parameters of the target user, so the target beautifying parameter is a beautifying parameter suitable for the target user, and therefore, when the target user uses the beautifying technology subsequently, the intelligent terminal only needs to automatically adjust according to the target beautifying parameter, avoiding manual adjustment of the user on each image, thereby improving the user experience, and further solving the problem that the user experience is poor because the user needs to adjust the beautifying parameter of each image in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0013] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced hereinafter. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
[0015] Figure 1 A flowchart of a beautifying parameter processing method provided by the embodiment of the present application;
[0016] Figure 2 A flowchart of a beautifying parameter processing method provided by the embodiment of the present application;
[0017] Figure 3 A structural diagram of a beautifying parameter processing device provided by the embodiment of the present application;
[0018] Figure 4 A structural diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0020] According to an aspect of the embodiments of the present application, a processing method of beautifying parameters is provided. Optionally, in the embodiments, the processing method of beautifying parameters can be applied to a hardware environment composed of a terminal and a server. The server is connected with the terminal through a network, and can be used to provide services for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server, and is used to provide data storage services for the server.
[0021] The network can include but is not limited to at least one of the following: a wired network, a wireless network. The wired network can include but is not limited to at least one of the following: a wide area network, a metropolitan area network, a local area network. The wireless network can include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal can include but is not limited to a PC, a mobile phone, a tablet computer, etc.
[0022] The processing method of beautifying parameters in the embodiments of the present application can be executed by the server, or can be executed by the terminal, or can be executed by the server and the terminal jointly. The terminal executing the processing method of beautifying parameters in the embodiments of the present application can also be executed by a client installed thereon.
[0023] Taking the server as an example for executing the processing method of beautifying parameters in the embodiments, Figure 1 A flowchart of a processing method of beautifying parameters provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the method includes the following steps: Figure 1
[0024] Step S201, obtaining a target image set, wherein each image in the target image set contains face information of a user;
[0025] In the embodiments, the target image set can be a photo album of a smart mobile terminal of the user, or can be a draft box of a certain beautifying software in the smart mobile terminal.
[0026] Step S202, grouping all images in the target image set to obtain at least one sub-image set, wherein each image in each sub-image set has a same face feature of a user, and each sub-image set corresponds to a user.
[0027] In the embodiment, all images in the target image set are grouped according to the face features in each image, and each group of sub-image sets corresponds to a user. If there are two face features in an image, that is, two users in an image, the image exists in the group image set corresponding to the two users.
[0028] The face feature extraction process of each image includes face detection, face key point detection, face alignment, and face feature extraction. The specific extraction process will be described in detail below.
[0029] In step S203, each sub-image set in the at least one group of sub-image sets is taken as a target sub-image set, and the target sub-image set corresponds to a target user. The target beauty parameter of each target user is obtained by operating the current beauty parameter corresponding to each image in the target sub-image set. The target beauty parameter is used to adjust the face region of the target user in the collected image.
[0030] In the embodiment, each sub-image set in the at least one group of sub-image sets is taken as a target sub-image set. Because each image may come from different beauty software, and the value range of the beauty parameter of each beauty software may be different, the current beauty parameter of each image in the target sub-image set needs to be operated to obtain the target beauty parameter.
[0031] The current beauty parameter can be one or more, and can also include multiple sub-beauty parameters, such as the parameters of skin smoothing, face slimming, eye adjustment, etc.
[0032] In one embodiment, grouping all images in the target image set to obtain at least one group of sub-image sets includes: performing face detection on each image in the target image set by using a first neural network to determine at least one face region in each image; extracting a face feature vector corresponding to each face region; and classifying all face feature vectors corresponding to the images by using a clustering algorithm to obtain at least one group of sub-image sets.
[0033] In the embodiment, the first neural network is used to position the face in each image to lock the face region where the face is located, and then the face feature vector of the face region is extracted. In this way, non-face regions are not extracted for feature extraction when the face feature vector is extracted, thereby improving the accuracy of the face feature vector and the accuracy of face grouping, and further making the target beauty parameter more accurate.
[0034] The first neural network can be a Faster RCNN (faster region-based convolutional neural network), but is not limited to the Faster RCNN, and can also be other neural networks, such as a convolutional neural network with a cascade structure. A person skilled in the art can select a suitable neural network according to actual conditions.
[0035] To obtain more accurate grouping results and thus more accurate beautification parameters, in an embodiment, the step of classifying the face feature vectors corresponding to all the images by using the clustering algorithm to obtain at least one sub-image set includes the following steps: determining a plurality of distances between the face feature vector corresponding to each face region and the feature data in the pre-stored database; sorting the plurality of distances in ascending order of distance, and selecting the feature data corresponding to the smallest predetermined number of distances from the plurality of distances as target feature data; constructing an undirected graph model by using the target feature data; initializing each target feature data in the undirected graph model as an independent type; traversing each target feature data in the undirected graph model in a random order to obtain a plurality of average encoding lengths, and attributing each target feature data in the undirected graph model to the type with the largest average encoding length drop, to obtain the types of the undirected graph model, wherein the average encoding length is the length between any two target feature data; determining the type of the face feature vector of each face region according to the types of the undirected graph model, and grouping all the images according to the type of the face feature vector of each face region to obtain at least one sub-image set.
[0036] In this embodiment, a predetermined number of target feature data are first obtained by using the k-nearest neighbor algorithm, the target feature data are used to represent the corresponding face feature vectors, an undirected graph model is constructed by using the target feature data, then the data in the undirected graph model are traversed by using the Infomap clustering algorithm, to determine the type of each data in the undirected graph model, and then the type of the face feature vector is determined according to the type of each data, to realize classification of the face feature vectors. The k-nearest neighbor algorithm and the Infomap clustering algorithm do not need to specify the number of categories, and thus can more quickly and accurately realize grouping of the target image set.
[0037] The pre-stored database can be a pre-stored face database, and the plurality of distances can be obtained by calculating the Euclidean distance between the face feature vector and the feature data. The predetermined number has a relatively large impact on classification, and thus selecting a too large or too small value will cause errors. Therefore, in actual applications, the value of the predetermined number is generally a relatively small value, for example, a cross-validation method (i.e., a part of samples are used as a training set and a part are used as a test set) is used to select an optimal value.
[0038] In an embodiment, the extracting the face feature vector corresponding to each face region comprises: inputting each face region into a second neural network to output a plurality of face key points corresponding to each face region, wherein the plurality of face key points at least comprise key points corresponding to facial feature information of each user; determining a face posture corresponding to each face region according to a positional relationship between the plurality of face key points of each face region; in a case where the face posture corresponding to the face region is different from a preset face posture, adjusting the face posture corresponding to each region to the preset face posture by performing a similarity transformation on the face posture corresponding to the face region and the preset face posture, inputting the face region after adjustment into a third neural network to obtain the face feature vector of the face region; and in a case where the face posture corresponding to the face region is the same as the preset face posture, inputting the face region into the third neural network to obtain the face feature vector of the face region.
[0039] In the embodiment, the second neural network is used to obtain the plurality of face key points, which can be eyebrows, eyes, nose, mouth and outline of the face, and then the face posture is determined according to the positional relationship between the plurality of face key points, such as turning head and lowering head. In a case where the face posture is not the preset face posture, if the face image is directly input into the third neural network, an inaccurate face feature vector can be obtained, thereby resulting in an incorrect classification result. Therefore, the similarity transformation is used to adjust the face posture to the preset face posture, and the feature extraction is performed on the image, so that a more accurate face feature vector can be obtained, thereby obtaining a more accurate classification result.
[0040] The second neural network can be a deep alignment network (DAN), and the third neural network can be facenet. Similarly, in actual applications, the second neural network and the third neural network can also be other neural networks, which can be selected by a person skilled in the art according to actual conditions.
[0041] In an embodiment, the obtaining the target beautifying parameter of the target user by performing operation on the current beautifying parameter corresponding to each image in the target sub-image set comprises: performing normalization operation on a value range corresponding to the current beautifying parameter of each image in the target sub-image set to obtain a normalized target range; determining a normalized value corresponding to the current beautifying parameter according to the target range; performing average operation on the normalized values corresponding to the current beautifying parameter of all images in the target sub-image set to obtain an average value corresponding to the current beautifying parameter; and taking the average value as the target beautifying parameter of the target user.
[0042] In the above, it is mentioned that the value ranges of the beautifying parameters are different due to different sources of the beautifying parameters. In order to obtain more accurate beautifying parameters, in the embodiment, a normalization method is used to normalize the value range of the current beautifying parameter, then the normalized value corresponding to the current beautifying parameter is determined, and then all the normalized beautifying parameter values are averaged to obtain the target parameter value.
[0043] In an embodiment, before each sub-image set in the at least one set of sub-image sets is taken as a target sub-image set, and the target sub-image set corresponds to a target user, and the target beautifying parameter of each target user is obtained by performing operation on the current beautifying parameter corresponding to each image in the target sub-image set, the method further comprises: obtaining the current beautifying parameter of each image; determining the value range corresponding to the current beautifying parameter of each image according to the source of each image; generating a database of each face image by using the current beautifying parameter corresponding to each image and the value range corresponding to the current beautifying parameter; and searching the current beautifying parameter of each image in each set of sub-image sets and the value range corresponding to the current beautifying parameter from the database.
[0044] In the embodiment, a database of structured data is generated by using the current beautifying parameter and the value range corresponding to the beautifying parameter, and then the database is saved in the target image set. The data format in the database can be dictionary type, for example, five organs-eyes-size adjustment: current beautifying parameter-value range (from-50 to +50), five organs-eyes-eye whitening: current beautifying parameter-value range (from-50 to +50), skin-skin color: current beautifying parameter-value range (from-50 to +50), and skin-mole removal: current beautifying parameter-value range (from-50 to +50). In this way, the corresponding beautifying parameter and value range of each image can be quickly searched from the database, so that the target beautifying parameter can be obtained more quickly.
[0045] In an embodiment, after each sub-image set in the at least one set of sub-image sets is taken as a target sub-image set, and the target sub-image set corresponds to a target user, and the target beautifying parameter of each target user is obtained by performing operation on the current beautifying parameter corresponding to each image in the target sub-image set, the method further comprises: in response to an operation of collecting an image, and in a case where it is detected that there is a face in a first image collected by a user, extracting a target face feature vector corresponding to the face in the first image, and determining a first user corresponding to the face in the first image according to the target face feature vector; and performing beautifying operation on the face in the target image according to the target beautifying parameter corresponding to the first user.
[0046] In the embodiment, after obtaining the target beautifying parameter, when the user performs the image capturing operation on the smart mobile terminal and there is a face in the captured image, the corresponding first user can be searched according to the face feature vector corresponding to the face, and the face is automatically adjusted according to the target beautifying parameter corresponding to the first user, so as to avoid manual adjustment of the face in the captured image by the user, thereby further improving the experience of the user.
[0047] The extraction of the target face feature vector can adopt the same method as the extraction of the face feature vector of each image, which will not be described here.
[0048] The technical solutions of the present application will be further described in detail below with reference to the specific embodiments:
[0049] Figure 2 The flowchart of the beautifying parameter processing method provided by the embodiment of the present application is shown in FIG. 1, which includes the following steps: Figure 2
[0050] Step one, input the picture library which needs to contain one or more face pictures. There are two cases for the face pictures: case one, no beautifying processing is performed, so the face picture does not need to be calculated in step four; case two, the beautifying processing is performed in the software, and the process of the beautifying parameter is reserved in the picture library in a structured form and corresponds to the original picture. The face beautifying parameter values include the face slimming amplitude, the skin polishing amplitude, the whitening amplitude, the eye enlarging amplitude, the lip dimension, the nose amplitude, etc.
[0051] Step two, detect all faces of each picture in the picture library, and extract the feature of each face using the face feature flow (the extracted face feature vector can be a 512-dimensional vector). The flow includes face detection, face key point detection, face alignment, and face feature extraction.
[0052] Step three, use the k-nearest neighbor and Infomap clustering algorithm to perform face clustering on all face features, and cluster multiple groups of faces, i.e., several different users.
[0053] Step four, traverse each picture in the multiple groups of faces in sequence, merge the structured beautifying parameters in the same group of faces, and obtain the target beautifying parameter of each group of faces by normalizing and equalizing the current beautifying parameter. The parameter considers the multiple beautifying information of a user and can summarize the most suitable beautifying effect of the user.
[0054] Step five, save the feature of each group of clustered faces and the final beautifying parameter value in the software as the beautifying template of the user.
[0055] Step six, the face beautifying preset is completed through the above steps.
[0056] Figure 3 A structure diagram of a beauty parameter processing device is provided for an embodiment of the present application. As shown in the figure, the device comprises: Figure 3
[0057] A first acquisition module 10 is configured to acquire a target image set, wherein each image in the target image set contains face information of a user.
[0058] A grouping module 20 is configured to group all images in the target image set to obtain at least one sub-image set, wherein each image in each sub-image set has a face feature of a same user, and each sub-image set corresponds to a user.
[0059] An operation module 30 is configured to take each sub-image set in the at least one sub-image set as a target sub-image set, and the target sub-image set corresponds to a target user, and to obtain a target beauty parameter of each target user by performing operation on a current beauty parameter corresponding to each image in the target sub-image set, wherein the target beauty parameter is used to adjust a face region of the target user in a collected image.
[0060] In an embodiment, the grouping module 20 comprises a detection submodule, an extraction submodule and a classification submodule, wherein the detection submodule is configured to perform face detection on each image in the target image set by using a first neural network to determine at least one face region in each image; the extraction submodule is configured to extract a face feature vector corresponding to each face region; and the classification submodule is configured to classify face feature vectors corresponding to all images by using a clustering algorithm to obtain at least one sub-image set.
[0061] In an embodiment, the classification submodule includes a first determination unit, a selection unit, a construction unit, an initialization unit, a second determination unit, and a third determination unit. The first determination unit is configured to determine a plurality of distances between a face feature vector corresponding to each face region and feature data in a pre-stored database. The selection unit is configured to sort the plurality of distances in ascending order of distance and select feature data corresponding to a predetermined number of smallest distances from the plurality of distances as target feature data. The construction unit is configured to construct an undirected graph model using the target feature data. The initialization unit is configured to initialize each target feature data in the undirected graph model as an independent type. The second determination unit is configured to traverse each target feature data in the undirected graph model in a random order to obtain a plurality of average encoding lengths and attribute each target feature data in the undirected graph model to a type with the largest decrease in average encoding length to obtain types of the undirected graph model. The average encoding length is a length between any two target feature data. The third determination unit is configured to determine a type of the face feature vector of each face region according to the types of the undirected graph model, group all images according to the type of the face feature vector of each face region, and obtain at least one sub-image set.
[0062] In an embodiment, the extraction submodule includes a first input unit, a fourth determination unit, a second input unit, and a third input unit. The first input unit is configured to input each face region into a second neural network to output a plurality of face key points corresponding to each face region, wherein the plurality of face key points include at least key points corresponding to facial feature information of each user. The fourth determination unit is configured to determine a face pose of each face region according to a positional relationship between the plurality of face key points of each face region. The second input unit is configured to, in a case where the face pose of the face region is different from a preset face pose, adjust the face pose of each region to the preset face pose by performing a similarity transformation on the face pose of the face region and the preset face pose, input the adjusted face region into a third neural network, and obtain a face feature vector of the face region. The third input unit is configured to, in a case where the face pose of the face region is the same as the preset face pose, input the face region into the third neural network to obtain the face feature vector of the face region.
[0063] In an embodiment, the operation module 30 comprises a first determining submodule, a second determining submodule, a third determining submodule and a fourth determining submodule. The first determining submodule is configured to normalize the value range corresponding to the current beauty parameter of each image in the target sub-image set to obtain a normalized target range. The second determining submodule is configured to determine the normalized value corresponding to the current beauty parameter according to the target range. The third determining submodule is configured to average the normalized values corresponding to the current beauty parameter of all images in the target sub-image set to obtain an average value corresponding to the current beauty parameter. The fourth determining submodule is configured to take the average value as the target beauty parameter of the target user.
[0064] In an embodiment, the device further comprises a second obtaining module, a determining module, a generating module and a searching module. The second obtaining module is configured to obtain the current beauty parameter of each image before taking each sub-image set in the at least one sub-image set as a target sub-image set, and the target sub-image set corresponds to a target user, and obtaining the target beauty parameter of each target user by operating the current beauty parameter corresponding to each image in the target sub-image set. The determining module is configured to determine the value range corresponding to the current beauty parameter of each image according to the source of each image. The generating module is configured to generate a database of each face image by using the current beauty parameter corresponding to each image and the value range corresponding to the current beauty parameter. The searching module is configured to search for the current beauty parameter of each image in each sub-image set and the value range corresponding to the current beauty parameter from the database.
[0065] In an embodiment, the device further comprises an extracting module and an adjusting module. The extracting module is configured to extract the target face feature vector corresponding to the face in the first image collected by the user and determine the first user corresponding to the face in the first image according to the target face feature vector in response to the operation of collecting images and in the case that it is detected that the first image collected by the user contains a face. The adjusting module is configured to perform a beauty operation on the face in the target image according to the target beauty parameter corresponding to the first user.
[0066] As Figure 4As shown, the embodiment of the present application provides an electronic device, comprising a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112 and the memory 113 complete mutual communication through the communication bus 114,
[0067] The memory 113 is used for storing a computer program.
[0068] In an embodiment of the present application, the processor 111 is used for executing the program stored in the memory 113, and realizes the control method of the processing of the beautifying parameter provided by any one of the preceding method embodiments.
[0069] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the processing method of the beautifying parameter provided by any one of the preceding method embodiments.
[0070] It should be noted that, in this document, relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the stated elements.
[0071] The above merely describes the specific embodiments of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing beautification parameters, characterized in that, include: Obtain a target image set, wherein each image in the target image set contains the user's facial information; Grouping all images in the target image set to obtain at least one sub-image set includes: performing face detection on each image in the target image set using a first neural network to determine at least one face region in each image; extracting face feature vectors corresponding to each face region; determining multiple distances between the face feature vectors corresponding to each face region and feature data in a pre-stored database; sorting the multiple distances in ascending order and selecting the feature data corresponding to the smallest predetermined number of distances from the multiple distances as target feature data; constructing an undirected graph model using the target feature data; and initializing each target feature data in the undirected graph model as an independent... Type; Traverse each target feature data in the undirected graph model in a random order to obtain multiple average encoding lengths, and assign each target feature data in the undirected graph model to the type with the largest decrease in average encoding length to obtain the type of the undirected graph model, wherein the average encoding length is the length between any two target feature data; determine the type of facial feature vector for each face region according to the type of the undirected graph model, and group all images according to the type of facial feature vector for each face region to obtain at least one set of sub-images, wherein each image in each set of sub-images has facial features corresponding to the same user, and each set of sub-images corresponds to one user; Each of the at least one set of sub-images is taken as a target sub-image set, and the target sub-image set corresponds to a target user. The target beautification parameters for each target user are obtained by calculating the current beautification parameters corresponding to each image in the target sub-image set. The target beautification parameters are used to adjust the facial area of the target user in the acquired image.
2. The method according to claim 1, characterized in that, The extraction of facial feature vectors corresponding to each facial region includes: Each face region is input into the second neural network to output multiple facial key points corresponding to each face region, wherein the multiple facial key points include at least the key points corresponding to the facial features of each user; The facial pose corresponding to each facial region is determined based on the positional relationship between multiple facial key points in each facial region. When the facial pose corresponding to the face region is different from the preset facial pose, the facial pose corresponding to the face region is adjusted to the preset facial pose by performing a similarity transformation on the facial pose corresponding to the face region and the preset facial pose. The adjusted facial region is then input into the third neural network to obtain the facial feature vector of the face region. If the facial pose corresponding to the facial region is the same as the preset facial pose, the facial region is input into the third neural network to obtain the facial feature vector of the facial region.
3. The method according to claim 1, characterized in that, The step of calculating the target beautification parameters for the target user by processing the current beautification parameters corresponding to each image in the target sub-image set includes: Normalize the value range of the current beautification parameter for each image in the target sub-image set to obtain the normalized target range; The normalized value corresponding to the current beautification parameter is determined based on the target range; The normalized values corresponding to the current beautification parameters of all images in the target sub-image set are averaged to obtain the average value corresponding to the current beautification parameters. The average value is used as the target beautification parameter for the target user.
4. The method according to claim 1, characterized in that, Before taking each of the at least one set of sub-image sets as a target sub-image set, and the target sub-image set corresponding to a target user, and calculating the target beautification parameters for the target user by performing calculations on the current beautification parameters corresponding to each image in the target sub-image set, the method further includes: Get the current beautification parameters for each image; Based on the source of each image, determine the value range of the current beautification parameters for each image; A database of each face image is generated using the current beautification parameters corresponding to each image and the value range of the current beautification parameters. The database is used to retrieve the current beautification parameters and the corresponding value range for each image in each sub-image set.
5. The method according to claim 1, characterized in that, After taking each of the at least one set of sub-image sets as a target sub-image set, and the target sub-image set corresponding to a target user, and obtaining the target beautification parameters for the target user by calculating the current beautification parameters corresponding to each image in the target sub-image set, the method further includes: In response to the image acquisition operation, and when a face is detected in the first image acquired by the user, the target face feature vector corresponding to the face in the first image is extracted, and the first user corresponding to the face in the first image is determined based on the target face feature vector. Based on the target beautification parameters corresponding to the first user, beautification operation is performed on the face in the target image.
6. A device for processing beautification parameters, characterized in that, include: The first acquisition module is used to acquire a target image set, wherein each image in the target image set contains the user's facial information; The grouping module is used to group all images in the target image set to obtain at least one sub-image set: A first neural network is used to perform face detection on each image in the target image set to determine at least one face region in each image; face feature vectors corresponding to each face region are extracted; multiple distances are determined between the face feature vectors corresponding to each face region and feature data in a pre-stored database; the multiple distances are sorted in ascending order, and the feature data corresponding to the smallest predetermined number of distances is selected as target feature data; an undirected graph model is constructed using the target feature data; and each target feature data in the undirected graph model is initialized as a unique... The undirected graph model is categorized into several types. Each target feature data in the undirected graph model is traversed in a random order to obtain multiple average encoding lengths. Each target feature data in the undirected graph model is then assigned to the type with the largest decrease in average encoding length, thus determining the type of the undirected graph model. The average encoding length is the length between any two target feature data. Based on the type of the undirected graph model, the type of facial feature vector for each face region is determined. All images are then grouped according to the type of facial feature vector for each face region to obtain at least one set of sub-images. Each image in each sub-image set has facial features corresponding to the same user, and each sub-image set corresponds to one user. The calculation module is used to take each of the at least one set of sub-image sets as a target sub-image set, and the target sub-image set corresponds to a target user. By calculating the current beautification parameters corresponding to each image in the target sub-image set, the target beautification parameters of each target user are obtained. The target beautification parameters are used to adjust the facial area of the target user in the acquired image.
7. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in a memory, implements the steps of the method for processing beautification parameters as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for processing beauty parameters as described in any one of claims 1-5.
Citation Information
Patent Citations
Image processing method and device, computer readable storage medium and electronic equipment
CN107742274A
Face state detection method based on multi-task neural network
CN114663943A
Customized Diagnosis Service Relay System and skin fitting diagnosis method using the same
KR102177070B1