WO2023125366A1 - 图像处理方法、装置、电子设备和存储介质 - Google Patents
图像处理方法、装置、电子设备和存储介质 Download PDFInfo
- Publication number
- WO2023125366A1 WO2023125366A1 PCT/CN2022/141795 CN2022141795W WO2023125366A1 WO 2023125366 A1 WO2023125366 A1 WO 2023125366A1 CN 2022141795 W CN2022141795 W CN 2022141795W WO 2023125366 A1 WO2023125366 A1 WO 2023125366A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- model
- facial
- attribute
- target
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
- G06T13/20—Three-dimensional [3D] animation
- G06T13/40—Three-dimensional [3D] animation of characters, e.g. humans, animals or virtual beings
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
- G06V40/171—Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/172—Classification, e.g. identification
Definitions
- the present disclosure relates to the technical field of computers, for example, to an image processing method, device, electronic equipment and storage medium.
- the technology of adding special effects usually uses software to modify images to add special effects to objects in the image, such as making the object turn its head.
- this method is likely to cause distortion of the object's limbs and face, resulting in poor effects of adding special effects question.
- the present disclosure provides an image processing method, device, electronic equipment, and storage medium, so as to add facial special effects to objects, so that the generated image is most suitable for the effect of facial changes in practice, and the accuracy of adding facial special effects is improved. .
- the present disclosure provides an image processing method, the method comprising:
- the data to be processed includes Gaussian noise or an image to be converted
- an image processing device which includes:
- a data acquisition module configured to acquire data to be processed; wherein, the data to be processed includes Gaussian noise or an image to be converted;
- the target image determination module is configured to process the data to be processed based on the target facial attribute determination model to obtain a target facial image corresponding to the data to be processed; wherein at least one target feature in the target facial image is the same as corresponding to at least one preset facial feature.
- the present disclosure also provides electronic equipment, and the equipment includes:
- processors one or more processors
- a storage device configured to store one or more programs
- the one or more processors implement the above image processing method.
- the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned image processing method is realized.
- the present disclosure further provides a computer program product, including a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the above-mentioned image processing method.
- FIG. 1 is a schematic flowchart of an image processing method provided in Embodiment 1 of the present disclosure
- FIG. 2 is a schematic diagram of a target facial image matching preset facial features provided by Embodiment 1 of the present disclosure
- FIG. 3 is a schematic flowchart of an image processing method provided in Embodiment 2 of the present disclosure.
- FIG. 4 is a schematic structural diagram of a target facial attribute determination model provided in Embodiment 2 of the present disclosure.
- FIG. 5 is a schematic flowchart of an image processing method provided by Embodiment 3 of the present disclosure.
- FIG. 6 is a schematic structural diagram of a facial attribute determination model to be trained provided by Embodiment 3 of the present disclosure.
- FIG. 7 is a schematic flowchart of an image processing method provided in Embodiment 4 of the present disclosure.
- FIG. 8 is a structural block diagram of an image processing device provided in Embodiment 5 of the present disclosure.
- FIG. 9 is a schematic structural diagram of an electronic device provided by Embodiment 6 of the present disclosure.
- the term “comprise” and its variations are open-ended, ie “including but not limited to”.
- the term “based on” is “based at least in part on”.
- the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
- the disclosed technical solution can be applied to any scene that requires special effects display, for example, in a video call, special effects display can be performed; or, in a live broadcast scene, special effects display can be performed on the anchor object; it can also be applied in the video shooting process , to display special effects on the image corresponding to the subject to be photographed.
- the captured image can be processed into a special effect image, and then the processed special effect image can be displayed with special effects; it can also be applied in static
- the process of image capturing for example, after the image is captured by the built-in camera of the terminal device, the captured image is processed into a special effect image for special effect display.
- Fig. 1 is a schematic flow chart of an image processing method provided by Embodiment 1 of the present disclosure.
- the embodiment of the present disclosure is applicable to processing the facial image of the target object into a special effect image and displaying it in any image display scene supported by the Internet.
- the method can be executed by an image processing device, and the device can be implemented in the form of software and/or hardware, for example, implemented by electronic equipment, and the electronic equipment can be a mobile terminal, a personal computer (Personal Computer, PC) terminal or server etc.
- the scene of arbitrary image display is usually implemented by the cooperation of the client and the server.
- the method provided in this embodiment can be executed by the server, the client, or the cooperation of the client and the server.
- the method of the present embodiment comprises:
- the device for executing the image processing method provided by the embodiments of the present disclosure may be integrated into application software supporting image processing functions, and the software may be installed in electronic equipment, for example, the electronic equipment may be a mobile terminal or a PC terminal, etc.
- the application software may be a type of software for image/video processing, and the application software thereof will not be described here one by one, as long as the image/video processing can be realized.
- the data to be processed can be data that needs to be processed, can be Gaussian noise, or can be an image.
- the Gaussian noise may be random sampling noise, and the Gaussian noise may include at least one noise such as fluctuation noise, cosmic noise, thermal noise, and shot noise.
- the image to be converted may be an image collected based on the application software, or an image pre-stored by the application software from the storage space. In an application scenario, the image to be converted may be collected in real time or periodically. For example, in a live broadcast scene or a video shooting scene, the camera captures in real time the image corresponding to the target in the target scene, and at this time, the image captured by the camera may be used as the image to be converted.
- the image to be converted may include a target subject, and the target subject may be a user, a pet, a flower, a tree, and the like. It is also possible to process the video frame corresponding to the captured video.
- the target subject corresponding to the captured video can be set in advance.
- the image corresponding to the video frame can be used as The image is to be converted, so that the facial features of the target subject in each video frame image in the video can be subsequently processed.
- the number of target subjects in the same shooting scene can be one or more, and no matter it is one or more target subjects, the technical solution provided by the present disclosure can be used to determine the special effect display map.
- the image including the target subject can be collected in real time or at intervals as the image to be converted.
- the device can also be used to randomly collect noise to obtain Gaussian noise.
- the Gaussian noise and the image to be converted can be used as the input of the model to train the model.
- the original facial data when corresponding features need to be added to the facial image are taken as the data to be processed.
- S120 Process the data to be processed based on a target facial attribute determination model to obtain a target facial image corresponding to the data to be processed.
- the target facial attribute determination model may be pre-trained.
- the target facial attribute determination model can process the input Gaussian noise or the image to be converted to obtain an image with corresponding features added to the face in the Gaussian noise or the image to be converted.
- the facial features added by the model for the user may be pre-determined, and the facial features at this time may be used as preset facial features.
- the image output by the target facial attribute determination model can be used as the target facial image, and at this time, preset facial features are added to the target facial image.
- the preset facial features include facial features of wearing at least one kind of jewelry, facial features of different ages, facial features of different angles, facial features of different hairstyles, facial features of different hairstyles and color matching, and different facial features. At least one of the facial features of the expression.
- the accessories worn may be glasses, sunglasses, face stickers, etc., and the features corresponding to the worn accessories may be used as preset facial features.
- the facial features of different age stages can be the facial features corresponding to the subjects of different age groups. Different age groups can be based on the original collected images, and the age groups are divided by increasing or decreasing age on this basis. Different age groups It can be young age group, middle age group, old age group.
- the facial features of different angles can be the corresponding features when the main body faces different orientations. For example, the different angles can also be based on the corresponding facial angle of the main body in the original captured image, and can be deflected 20 degrees to the left on the basis of this benchmark.
- 20-degree deflection, 20-degree downward deflection, etc., and the corresponding facial features at these angles can also be used as preset facial features.
- the preset facial features may also be facial features of different hairstyles, for example, long hair, short hair, curly hair, straight hair, and the like.
- the facial features of different hairstyles and color combinations can be purple, white, black and other colors, and can be a combination of different hairstyles and different colors.
- the facial features of different expressions may include facial expression features such as smiling, angry, and angry.
- the data to be processed can be input into the pre-trained target facial attribute determination model, corresponding features can be added to the image corresponding to the data to be processed, and then the face with added features corresponding to the data to be processed can be output image, which is the target face image.
- the preset facial features may include turning the face to the right by 20° (yaw+20°), increasing the age by 20 years (age+20), wearing sunglasses (wear glasses), smiling (smlie), and turning the face to the right by 30° °(yaw+30°), at least one of the facial features corresponding to the image whose age is reduced by 20 years (age-20), then after inputting the original image (Origin) into the model, the corresponding schematic diagram can be obtained.
- the schematic diagram can be seen in Fig. 2.
- the technical solution of the embodiment of the present disclosure obtains the data to be processed, and then processes the data to be processed based on the target facial attribute determination model, and obtains the target facial image corresponding to the data to be processed after adding special effects, which solves the problem of using correction in related technologies.
- image technology generates special effect images
- the obtained special effect images have low authenticity, which causes the problem of poor user experience. It is realized to add corresponding facial features to the faces of the target objects in the data to be processed, so that the obtained special effects are realistic. Higher, as well as the effect of increasing the richness and interest of video image content, and improving the technical effect of user experience.
- FIG. 3 is a schematic flowchart of an image processing method provided in Embodiment 2 of the present disclosure.
- S120 is described, and its implementation may refer to the technical solution of this embodiment. Wherein, technical terms that are the same as or corresponding to those in the foregoing embodiments will not be repeated here.
- the method includes the following steps:
- the target facial attribute determination model includes a feature preprocessing sub-model, an attribute editing sub-model and an image generation sub-model.
- the data to be processed is processed through these three sub-models, and the target facial image corresponding to the data to be processed is obtained.
- the feature preprocessing sub-model can be used to extract the corresponding features.
- the attribute editing sub-model may refer to a model that adds preset facial features for feature extraction.
- the image generation sub-model may refer to a model that performs image generation for features output by the attribute editing sub-model.
- the feature vector to be spliced refers to the vector output by the feature preprocessing sub-model, and the feature vector extracted by the feature preprocessing sub-model can be used as the feature vector to be spliced.
- the data to be processed can be used as the input of the feature preprocessing sub-model. After the data is processed by the feature extraction of the model, the feature vector corresponding to the data to be processed can be obtained, which can be used as the feature vector to be spliced.
- a schematic structural diagram of a target face attribute determination model may be referred to in FIG. 4 , and the model may include a feature preprocessing sub-model, an attribute editing sub-model, and an image generation sub-model.
- the feature preprocessing sub-model includes a first feature extraction module and a second feature extraction module.
- the data to be processed may include Gaussian noise or an image to be converted, for the accuracy of data processing.
- Different processing methods can be adopted according to different data, and different data can be processed in a targeted manner with algorithm modules used based on different processing methods. Its processing method can refer to the following expression:
- the feature preprocessing sub-model includes a first feature extraction module and a second feature extraction module, and based on the feature preprocessing sub-model, determining the feature vector to be spliced corresponding to the data to be processed includes: if the If the data to be processed is the Gaussian noise, the feature vector to be spliced corresponding to the Gaussian noise is determined based on the first feature extraction module; if the data to be processed is the image to be converted, then based on the The second feature extraction module determines the feature vector to be spliced corresponding to the image to be converted.
- the first feature extraction module is used to extract feature vectors corresponding to Gaussian noise.
- the second feature extraction module is used to extract feature vectors corresponding to facial attributes in the image to be converted.
- two feature extraction modules may be preset in the feature preprocessing sub-model to respectively process the two kinds of data correspondingly.
- the data to be processed as Gaussian noise can be input to the first feature extraction module, and the module can process the Gaussian noise, and then the feature vector to be spliced corresponding to the Gaussian noise can be obtained;
- the data to be processed can also be The data of the converted image is input to the second feature extraction module, and the module can process the image to be converted, and then can obtain the feature vector to be stitched corresponding to the image to be converted, and correspondingly, can obtain the feature vector to be stitched corresponding to all the data to be processed.
- Gaussian noise may be processed based on the first feature extraction module, and a feature vector to be concatenated corresponding to Gaussian noise is output.
- the first feature extraction module can be a Mapping Network model.
- the image to be converted may be processed based on the second feature extraction module, and a feature vector to be spliced corresponding to the image to be converted may be output.
- the second feature extraction module can be an Encoder model, such as fixing the generator parameters of the trained stylegan model, and training the Encoder model.
- the facial image can be input, encoded by the Encoder and then passed through the stylegan generator, and can be reconstructed Take this image of the face.
- the output feature vector to be concatenated can be used as W+ for the input of the subsequent model.
- the type of data input to the model can be determined based on the data interface, and then which module to process it can be determined based on the data type. If the data to be processed is Gaussian noise, the Gaussian noise can be used as the input of the first feature extraction module, and the module can output the feature vector to be spliced corresponding to the Gaussian noise; if the data to be processed is an image to be converted, the image to be converted can be used as the first The input of the second feature extraction module, the module can output the feature vector to be spliced corresponding to the image to be converted.
- the preset feature vector refers to a vector corresponding to a preset facial feature
- the target feature vector may be a feature vector obtained by splicing the feature vector to be spliced and the preset feature vector.
- the feature vector to be spliced and the feature vector corresponding to the preset facial features can be spliced, and then the corresponding target feature vector after adding facial features to the data to be processed can be obtained , to generate the target face image with special effects based on the target feature vector.
- the sub-model can splice the feature vector to be spliced with the preset feature vector corresponding to the preset facial feature, for example, the feature vector A can be combined with The feature vector B is concatenated into A-B.
- a concatenated feature vector after splicing processing can be obtained, and the concatenated feature vector can be used as a target feature vector corresponding to the target facial image.
- the attribute editing sub-model can be a Dynamic Network model
- the Dynamic Network model can be used to splicing the feature vector to be spliced and the preset feature vector
- the output W++ is the target corresponding to the target facial image Feature vector.
- the input preset feature vector is encoded by a multilayer perceptron (MLP), and then passed through two fully connected layers (FC) and an activation function sigmoid, and multiplied by the input feature vector to be spliced. Add operation to get the target feature vector.
- MLP multilayer perceptron
- FC fully connected layers
- an activation function sigmoid an activation function sigmoid
- the feature vector to be spliced can be used as the input of the attribute editing sub-model, and the sub-model can splice the feature vector to be spliced with the preset feature vector corresponding to at least one preset facial feature, and then the target face with the preset facial feature can be obtained The target feature vector corresponding to the image, so that the target facial image with special effects can be generated based on the target feature vector.
- S240 Process the target feature vector to obtain the target facial image.
- the target feature vector corresponding to the feature vector to be spliced and the preset feature vector can be input into the pre-trained image generation sub-model, the model The target feature vector can be reconstructed, and the target facial image corresponding to the target feature vector can be output.
- the image generation sub-model may be a Generator model, for example, the Generator model may be used to process the target feature vector, and a target facial image corresponding to the target feature vector may be output.
- the parameters in the target face attribute determination model are tuned.
- a trained model attribute classifier can be added, and the attribute classifier can be a model for extracting and classifying image attribute features.
- the attribute classifier can be used to extract the feature data in the target facial image, determine the facial features in the target facial image, and verify whether the picture output by the model has preset facial features, and then, if the picture output by the model does not add preset facial features By setting facial features, the parameters in the model can be corrected to improve the accuracy of the model.
- the model parameters in the facial attribute determination model are corrected; wherein, the at least one target attribute matches the attribute identifier of the at least one preset facial feature.
- the attribute identification can refer to the identification corresponding to the preset facial features, that is to say, the preset facial features can be represented by the corresponding identification, for example, the age feature is represented by A1 , the angle feature is represented by A2 , and the wearing glasses feature is represented by A2.
- a 3 indicates that A 1 , A 2 , A 3 and other identifiers can be used as attribute identifiers of corresponding features, and target attributes can also be identifier information corresponding to preset facial features.
- the output target facial image in order to optimize the parameters in the target facial attribute determination model, can be compared with the corresponding theoretical facial image with special effects added, then correspondingly, the output target facial image can also be The attribute feature corresponding to the image is compared with the added special effect feature, so as to correct the model parameters in the classification model to be trained based on whether the attribute feature corresponding to the target facial image contains the added special effect feature.
- the target facial image can be input to a pre-trained attribute classifier, and then the classifier can perform feature extraction processing on the target facial image, and output the feature attribute corresponding to the target facial image, that is, the target attribute. Then compare the currently output feature attribute with the attribute identifier of the preset facial feature to calculate a comparison error value, and then adjust the model parameters in the model based on the comparison error value.
- attribute classifier can be residual network (Residual Networks, ResNet) model, as, target face image can be input in attribute classifier, image is processed through the feature extraction of classifier, can output The target attribute corresponding to the target face image.
- ResNet residual Networks
- the target facial image can be used as the input of the attribute classifier, and the classifier can output the corresponding target attribute.
- the algorithm can also be used to process the error between the target attribute corresponding to the image and the attribute identification of the preset facial feature, so as to correct the model parameters of the target facial attribute determination model according to the obtained error result, and improve the training accuracy of the target facial attribute determination model.
- the target face image after adding special effects corresponding to different types of data is obtained, and at the same time
- the parameters in the model are also corrected based on the target facial image, which improves the accuracy of the model, thereby improving the authenticity of adding special effects, and increasing the richness and interest of the video image.
- Fig. 5 is a schematic flow chart of an image processing method provided by Embodiment 3 of the present disclosure.
- a facial attribute determination model to be trained can also be constructed in advance, and the facial attribute determination model to be trained can be trained.
- the target facial attribute determination model is obtained, and its implementation can refer to the technical solution of this embodiment. Wherein, technical terms that are the same as or corresponding to those in the foregoing embodiments will not be repeated here.
- the method includes the following steps:
- the facial attribute determination model to be trained refers to a model in which the model parameters in the model are set to default values, and the model needs to be trained to obtain the target facial attribute determination model.
- training can be performed based on the pre-built facial attribute determination model to be trained, so that after the training of the facial attribute determination model to be trained is completed, the final facial attribute determination model can be obtained.
- An applicable facial attribute determination model that is, a target facial attribute determination model.
- the constructing the facial attribute determination model to be trained includes: editing the sub-model according to the attribute to be trained, and constructing the facial attribute to be trained by pre-training the target confrontation model, the target attribute classification model and the facial matching model Determine the model; wherein, the target attribute classification model is used to determine the facial features of the image output through the target confrontation model; the facial matching model is used to determine the matching degree of the facial image output based on the target confrontation model , the target confrontation model is used to output two facial images, one of which matches the preset facial features set in the attribute editing sub-model to be trained.
- the target confrontation model includes: a feature preprocessing sub-model and an image generation sub-model; the feature preprocessing sub-model includes a first feature extraction module; the image generation sub-model includes a first image generation sub-module and a second image generation sub-model. An image generation sub-module; the feature preprocessing sub-model also includes a second feature extraction module.
- the target confrontation model can be a stylegan model.
- the target attribute classification model (resnet model) is used to determine the facial features of the image output by the second image generation sub-module.
- the face matching model (face recognition model) is used to determine the matching degree of the facial images output by the first image generation sub-module and the second image generation sub-module.
- the first feature extraction module (Mapping Network model) is used to extract the feature vector corresponding to the Gaussian noise.
- the second feature extraction module (Encoder model) is used to extract feature vectors corresponding to facial attributes in the image.
- the first image generation sub-module (Generator model) is used to determine the image corresponding to the feature vector output by the feature preprocessing sub-model.
- the second image generation sub-module (Generator model) is used to determine the image corresponding to the feature vector output by the attribute editing sub-model to be trained.
- the attribute editing sub-model to be trained (Dynamic Network model) is used to concatenate the feature vector output by the feature preprocessing sub-model with the preset feature vector.
- the attribute editing sub-model that needs to be trained is used to concatenate the feature vector output by the feature preprocessing sub-model with the preset feature vector.
- the attribute editing sub-model that needs to be trained. At this time, the output result of the attribute editing sub-model may not have reached the expected result. It needs to be trained to make the output result of the trained model consistent with the expected result.
- the available Applied property editing submodels is used to determine the image corresponding to the feature vector output by the attribute editing sub-model to be trained.
- the image code can be obtained through random noise or image encoder, and two branches of the stylegan generator are designed, wherein one branch directly generates the face image img1 through the trained stylegan generator; the other branch passes through a waiting Train the attribute editing sub-model (the input of the editing module is the attribute value, for example, input 1 for wearing glasses, 0 for not wearing glasses, 1 for smiling, and 0 for not smiling), and then the trained stylegan generator will generate the edited attribute Face image img2. Send img1 and img2 to the pre-trained target attribute classification model and face matching model, so that the difference between the two image attributes and identifiers (Identifier, id) can be calculated as a loss to train the attribute editing sub-model to be trained.
- the attribute editing sub-model the input of the editing module is the attribute value, for example, input 1 for wearing glasses, 0 for not wearing glasses, 1 for smiling, and 0 for not smiling
- the trained stylegan generator will generate the edited attribute Face image img2.
- a large number of facial images can also be collected for attribute labeling, such as whether to wear glasses, and the resnet model is used to train the attribute classifier to obtain the target attribute classification model. And pre-training the face recognition model to get the face matching model.
- the training data can be input to the feature preprocessing sub-model (the first feature extraction module or the second feature extraction module) to obtain the corresponding feature vector;
- the feature vector is used as the input of the attribute editing sub-model to be trained , the feature vector to be processed after splicing the feature vector and the preset feature vector can be obtained;
- the feature vector to be processed is used as the input of the second image generation submodule to output the special effect facial image, and the special effect facial image at this time and the preset facial features may be There are certain deviations.
- the feature vector is used as the input of the first image generating submodule to obtain the facial image corresponding to the feature vector.
- the special effect facial image and the facial image are used as the input of the target attribute classification model and the facial matching model respectively, and the feature difference and facial matching degree of the two images are obtained.
- the facial attribute determination model to be used refers to the training of the facial attribute determination model to be trained, and the trained model.
- the facial attribute determination model to be trained is trained by using the sample data to obtain the facial attribute determination model to be used.
- some modules that will not actually be used in the facial attribute determination model to be used may be trimmed, and the trimmed model may be used as the target facial attribute determination model.
- the target facial attribute determination model is obtained by removing the target attribute classification model, the facial matching model, and the first image generation sub-model in the facial attribute determination model to be used.
- S350 Process the data to be processed based on a target facial attribute determination model to obtain a target facial image corresponding to the data to be processed.
- the facial attribute determination model to be trained is constructed to train the facial attribute determination model to be trained to obtain a high-precision facial attribute determination model to be used, and the facial attribute determination model to be used is trimmed.
- the target facial attribute determination model is obtained, so as to improve the accuracy of the target facial attribute determination model and the efficiency of adding special effects, and then make the special effects added to the image more realistic.
- Fig. 7 is a schematic flow chart of an image processing method provided in Embodiment 4 of the present disclosure.
- the determination of the facial attributes to be used is obtained through the training process of the facial attribute determination model to be trained.
- the model is refined, and its implementation can refer to the technical solution of this embodiment. Wherein, technical terms that are the same as or corresponding to those in the foregoing embodiments will not be repeated here.
- the method includes the following steps:
- the training samples include data to be trained.
- the training sample may be a sample used to train the model, and the parameter values of the model may be adjusted during the training process to make the output result of the model consistent with the expected result.
- the data to be trained may be data used for training the model, and may be Gaussian noise, for example, random noise of Gaussian sampling. It can also be an image. For example, the user subject can be photographed based on different viewing angles, and facial images corresponding to the user subject at different viewing angles can be generated. These images can be used as training data, and correspondingly, multiple training samples can be obtained .
- a large number of facial images can be collected as training samples, and the stylegan model can be trained using facial images, so that after the model training is completed, the stylegan generator can be generated by inputting Gaussian sampling random noise z ⁇ N(0,1) Different types of face pictures.
- Multiple training samples can be stored in a preset database, and then the multiple training samples in the database can be extracted by using the interface.
- the eigenvector of any training sample can be determined as the eigenvector of the current training sample, so as to illustrate that one of the training samples is used as the current training sample.
- the first feature vector refers to the feature vector output by the first feature extraction module or the second feature extraction module. For example, after the current training sample is input to the first feature extraction module or the second feature extraction module, the extracted feature vector can be extracted by the module. eigenvector as the first eigenvector.
- the data to be trained in the training sample is different, it may be Gaussian noise or an image, and then, the training data can be processed differently based on the first feature extraction module and the second feature extraction module, for example, the current training sample can be
- the data to be trained in is input into the feature preprocessing sub-model. If the data to be trained is Gaussian noise, the Gaussian noise can be processed based on the first feature extraction module, and the feature vector corresponding to the Gaussian noise can be obtained; if the data to be trained is Gaussian noise is an image, the image can be processed based on the second feature extraction module, and a feature vector corresponding to the image can be obtained. Both the feature vectors output by the first feature extraction module and the second feature extraction module may be used as the first feature vectors corresponding to the current training sample.
- the attribute feature vector may be a vector representation corresponding to a preset facial feature, and a feature vector corresponding to any preset facial feature may be used as the attribute feature vector.
- the first attribute feature vector may be a feature vector obtained by concatenating the first feature vector and the attribute feature vector, and the vector output by the attribute editing sub-model to be trained may be used as the first attribute feature vector.
- the first feature vector corresponding to the current training sample can be used as the input of the attribute editing sub-model to be trained, and the sub-model can splice the first feature vector and the attribute feature vector corresponding to the preset facial features, and then can output the added preset face
- the first attribute feature vector corresponding to the feature so that the facial image with special effects can be generated based on the first attribute feature vector, and the model parameters can be adjusted.
- the feature image without attributes may be an image without special effects in the facial image, and the image output by the first image generation sub-module may be used as the feature image without attributes.
- the attached attribute feature image may be an image with special effects attached to the facial image, and the image output by the second image generation sub-module may be used as the attached attribute feature image.
- the first feature vector corresponding to the current training sample can be used as the input of the first image generation sub-module, and the model can perform image reconstruction on the first feature vector.
- the first feature vector has not been processed by the attribute editing model to be trained, and no features have been added.
- the model can output images without attribute features.
- the first attribute feature vector corresponding to the current training sample can also be input into the second image generation sub-module, because the first attribute feature vector is a vector after adding special effects, and then the model can output images with attribute features.
- the attribute information to be compared may be image facial features output by the target attribute classification model.
- the facial matching information may be the facial image matching degree output by the facial matching model.
- the image with and without attributes corresponding to the current training sample can be used as the input of the target attribute classification model, and the facial features corresponding to the two images can be output, that is, the attribute information to be compared. It is also possible to use the image with attribute feature and the image without attribute feature as the input of the face matching model, and output the matching degree corresponding to the two images, that is, face matching information.
- the target loss value can be used to characterize the loss between the attribute information to be compared and the preset facial features and the loss between facial matching information.
- the loss function in the attribute editing sub-model to be trained can be used to perform loss processing on the attribute information to be compared and the preset facial features, and then the loss value between the two can be calculated.
- a loss function can also be used to perform loss processing on the face matching information, and then a corresponding loss value can be calculated.
- all the calculated loss values can also be fused, and then the fused loss value can be obtained, which can be used as the target loss value, so that the model parameters in the model can be adjusted based on the target loss value fix.
- the convergence of the preset loss function can be used as the training goal.
- the preset loss function of the attribute editing sub-model to be trained converges, it indicates that the adjustment result meets the requirements of the scheme, and the trained model has been obtained, so as to obtain the facial attribute determination model to be used.
- the attribute feature addition technology can be used to process the first feature vector corresponding to the current training sample, and the attribute editing sub-model to be trained can output the first attribute feature vector corresponding to the current training sample, so that based on the first The attribute feature vector generates the accompanying attribute feature image corresponding to the current training sample.
- the model parameters in the attribute editing sub-model to be trained are uncorrected, there is a corresponding difference between the obtained attribute feature image and the unattached attribute feature image corresponding to the current training sample after the actual feature is added, which can be based on the current
- the attribute information to be compared, facial matching information, and preset facial features corresponding to the two types of images corresponding to the training samples are processed to determine the error value, and then based on the error value, the model parameters in the attribute editing sub-model to be trained can be corrected.
- the training error of the loss function can be used as a condition for detecting whether the loss function is currently converged, such as whether the training error is smaller than the preset error or whether the error trend is stable, or whether the current number of iterations is equal to the preset number.
- the training sample data can be obtained to continue training the sub-model to be trained for attribute editing until the training error of the loss function is within the preset range.
- the attribute editing sub-model to be trained has been trained, so that when the first feature vector is input into the trained attribute editing sub-model to be trained, the model can be accurately the first feature vector Concatenate attribute feature vectors so that images with facial features can be generated.
- S480 Eliminate the target attribute classification model, the face matching model, and the first image generation sub-model from the facial attribute determination models to be used to obtain the target facial attribute determination model.
- the model includes not only the feature preprocessing sub-model and the second image generation sub-module, but also the first image generation sub-module, target attribute classification model and face matching model.
- the first image generation submodule and the target attribute classification model in the facial attribute determination model to be used can be combined and facial matching model culling processing. That is, remove models that will not be used in the application. For example, after the facial attribute determination model is trained, only the branch path of the attribute editing sub-model is reserved, and the edited facial image is generated by inputting attribute values.
- S4100 Process the data to be processed based on a target facial attribute determination model to obtain a target facial image corresponding to the data to be processed.
- the model parameters in the attribute editing sub-model to be trained are continuously optimized, and then the facial attribute determination model to be used is obtained, and the facial attribute determination model to be used is trimmed to obtain
- the target facial attribute determination model is used to improve the accuracy of the target facial attribute determination model and the efficiency of adding special effects, thereby making the special effects added to the image more realistic.
- Fig. 8 is a structural block diagram of an image processing device provided in Embodiment 5 of the present disclosure, which can execute the image processing method provided in any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.
- the device includes: a data acquisition module 510 and a target image determination module 520 .
- the data acquisition module 510 is configured to acquire data to be processed; wherein the data to be processed includes Gaussian noise or an image to be converted; the target image determination module 520 is configured to process the data to be processed based on a target facial attribute determination model, Obtaining a target facial image corresponding to the data to be processed; wherein at least one target feature in the target facial image matches at least one corresponding preset facial feature.
- the target image determination module 520 includes a feature vector determination unit to be spliced, a target feature vector acquisition unit, and a target facial image acquisition unit.
- the feature vector to be spliced determination unit is configured to determine the feature vector to be spliced corresponding to the data to be processed;
- the target feature vector acquisition unit is configured to stitch the feature vector to be spliced with the at least one preset facial feature A corresponding preset feature vector is obtained to obtain a target feature vector corresponding to the target facial image;
- a target facial image acquisition unit is configured to process the target feature vector to obtain the target facial image.
- the feature preprocessing sub-model includes a first feature extraction module and a second feature extraction module, a feature vector determination unit to be spliced, including a first unit for determining a feature vector to be spliced and a feature vector to be spliced determination unit Second unit.
- the feature vector to be spliced determines the first unit, which is set to determine the feature vector to be spliced corresponding to the Gaussian noise based on the first feature extraction module if the data to be processed is the Gaussian noise; the feature vector to be spliced determines the first
- the second unit is configured to determine, based on the second feature extraction module, a feature vector to be spliced corresponding to the image to be converted if the data to be processed is the image to be converted.
- the device further includes: a target facial attribute determination model parameter correction module.
- the target facial attribute determination model parameter correction module is configured to determine at least one target attribute corresponding to the target facial image based on the pre-trained attribute classifier, so as to classify the target face based on the at least one target attribute
- the model parameters in the attribute determination model are corrected; wherein, the at least one target attribute matches the at least one attribute identifier of the preset facial feature.
- the device further includes: a construction module for determining a facial attribute to be trained.
- the facial attribute determination model construction module to be trained is set to edit the sub-model according to the attribute to be trained, the target confrontation model obtained in advance, the target attribute classification model and the facial matching model, and construct the facial attribute determination model to be trained; wherein, the The target attribute classification model is configured to determine the facial features of the image output by the target confrontation model; the facial matching model is configured to determine the matching degree of the facial image output based on the target confrontation model, and the target confrontation model, It is set to output two facial images, one of which matches the preset facial features set in the attribute editing sub-model to be trained.
- the target confrontation model includes: a feature preprocessing sub-model and an image generation sub-model; the feature preprocessing sub-model includes a first feature extraction module; the image generation sub-model includes a first An image generation sub-module and a second image generation sub-module; the feature preprocessing sub-model also includes a second feature extraction module.
- the facial attribute determination model construction module to be trained further includes a facial attribute determination model construction unit to be trained.
- the facial attribute determination model construction unit to be trained is configured to use the output result of the first feature extraction module or the second feature extraction module as the input of the attribute editing sub-model to be trained and the first image generation sub-module,
- the output of the attribute editing sub-model to be trained is used as the input of the second image generation sub-module, and the output of the first image generation sub-module and the output of the second image generation sub-module are used as the target
- the attribute classification model and the input of the facial matching model are used to construct the facial attribute determination model to be trained.
- the facial attribute determination model acquisition unit to be used also includes a training sample acquisition subunit, a first feature vector acquisition subunit, a first attribute feature vector acquisition subunit, and an attribute feature image acquisition subunit , an information acquisition subunit, a target loss value determination subunit, and a facial attribute determination model acquisition subunit to be used.
- the training sample acquisition subunit is set to acquire multiple training samples, wherein the training samples include data to be trained; the first feature vector acquisition subunit is set to input the data to be trained in the current training sample for multiple training samples To the first feature extraction module or the second feature extraction module to obtain the first feature vector corresponding to the current training sample; the first attribute feature vector acquisition subunit is set to be edited based on the attribute to be trained
- the sub-model splices the attribute feature vector corresponding to at least one preset facial feature for the first feature vector to obtain the first attribute feature vector;
- the attribute feature image acquisition subunit is configured to input the first feature vector to In the first image generation sub-module, an image without attribute features is obtained; and, the first attribute feature vector is input into the second image generation sub-module to obtain an image with attribute features;
- the information acquisition subunit It is set to input the feature image with attribute and the feature image without attribute into the target attribute classification model to obtain attribute information to be compared; and, input the feature image with attribute and the feature image without attribute , input into the
- the preset attribute value in the attribute editing sub-model is processed to obtain the target loss value; the facial attribute to be used determines the model acquisition subunit, which is set to the model parameters in the attribute editing sub-model to be trained based on the target loss value Correction is performed, and the convergence of the loss function is used as a training target, and a facial attribute determination model to be used is obtained through training.
- the target facial attribute determination model acquisition unit includes a target facial attribute determination model acquisition subunit.
- the target facial attribute determination model acquisition subunit is configured to eliminate the target attribute classification model, the facial matching model, and the second image generation sub-model in the facial attribute determination model to be used to obtain the target face Attributes determine the model.
- the preset facial features include facial features of wearing at least one kind of jewelry, facial features of different age stages, facial features of different angles, facial features of different hairstyles, facial features of different hairstyles and color matching, and At least one of facial features of different expressions.
- the technical solution of the embodiment of the present disclosure obtains the Gaussian noise or the data to be processed of the image to be converted, and then determines the model based on the target face attribute to process the data to be processed, and obtains the target face image corresponding to the data to be processed after adding special effects, to solve the problem
- the obtained special effect images have low authenticity, which causes the problem of poor user experience, and realizes adding corresponding facial features to the faces of the target objects in the images to be processed, so as to
- the obtained special effects have a high degree of realism, and the effect of increasing the richness and interest of the video image content improves the technical effect of user experience.
- the image processing device provided in the embodiments of the present disclosure can execute the image processing method provided in any embodiment of the present disclosure, and has corresponding functional modules and effects for executing the method.
- the multiple units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the names of multiple functional units are only for the convenience of distinguishing each other , and are not intended to limit the protection scope of the embodiments of the present disclosure.
- FIG. 9 is a schematic structural diagram of an electronic device provided by Embodiment 6 of the present disclosure.
- the terminal equipment in the embodiments of the present disclosure may include but not limited to mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computers (Portable Android Device, PAD), portable multimedia players (Portable Media Player, PMP), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital televisions (Television, TV), desktop computers, etc.
- the electronic device 600 shown in FIG. 9 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
- an electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) Various appropriate actions and processes are performed by a program loaded into a random access memory (Random Access Memory, RAM) 603 by 608. In the RAM 603, various programs and data necessary for the operation of the electronic device 600 are also stored.
- the processing device 601, ROM 602, and RAM 603 are connected to each other through a bus 604.
- An input/output (Input/Output, I/O) interface 605 is also connected to the bus 604 .
- an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; including, for example, a liquid crystal display (Liquid Crystal Display, LCD) , an output device 607 such as a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609.
- the communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data.
- FIG. 9 shows electronic device 600 having various means, it is not required to implement or possess all of the means shown. More or fewer means may alternatively be implemented or provided.
- embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart.
- the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602.
- the processing device 601 When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
- the electronic device provided by the embodiment of the present disclosure belongs to the same concept as the image processing method provided by the above embodiment, and the technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same effect as the above embodiment .
- Embodiment 7 of the present disclosure provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the image processing method provided in the above embodiment is implemented.
- the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
- a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof.
- Examples of computer readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, RAM, ROM, Erasable Programmable Read-Only Memory (EPROM) or flash memory), optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
- a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
- the program code contained on the computer readable medium can be transmitted by any appropriate medium, including but not limited to: electric wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
- the client and the server can communicate using any currently known or future network protocols such as Hypertext Transfer Protocol (HyperText Transfer Protocol, HTTP), and can communicate with digital data in any form or medium
- the communication eg, communication network
- Examples of communication networks include local area networks (Local Area Network, LAN), wide area networks (Wide Area Network, WAN), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently existing networks that are known or developed in the future.
- the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
- the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device:
- the data to be processed includes Gaussian noise or an image to be converted; based on the target facial attribute determination model, the data to be processed is processed to obtain a target facial image corresponding to the data to be processed; wherein , at least one target feature in the target facial image matches corresponding at least one preset facial feature.
- Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages.
- the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
- the remote computer can be connected to the user computer through any kind of network, including a LAN or WAN, or it can be connected to an external computer (eg via the Internet using an Internet Service Provider).
- each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
- the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
- the units involved in the embodiments described in the present disclosure may be implemented by software or by hardware.
- the name of the unit does not constitute a limitation on the unit itself in one case, for example, the first obtaining unit may also be described as "a unit for obtaining at least two Internet Protocol addresses".
- exemplary types of hardware logic components include: Field Programmable Gate Arrays (Field Programmable Gate Arrays, FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (Application Specific Standard Parts, ASSP), System on Chip (System on Chip, SOC), Complex Programmable Logic Device (Complex Programming Logic Device, CPLD) and so on.
- a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
- a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
- a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard drives, RAM, ROM, EPROM or flash memory, optical fibers, CD-ROMs, optical storage devices, magnetic storage devices, or Any suitable combination of the above.
- Example 1 provides an image processing method, the method including:
- the data to be processed includes Gaussian noise or an image to be converted
- Example 2 provides an image processing method, further comprising:
- the determining model based on the target facial attributes processes the data to be processed to obtain a target facial image corresponding to the data to be processed, including:
- the target feature vector is processed to obtain the target facial image.
- Example 3 provides an image processing method, further comprising:
- the determining the feature vector to be spliced corresponding to the data to be processed includes:
- the feature vector to be spliced corresponding to the Gaussian noise is determined based on the first feature extraction module
- the feature vector to be spliced corresponding to the image to be converted is determined.
- Example 4 provides an image processing method, further comprising:
- the target facial image corresponding to the data to be processed After obtaining the target facial image corresponding to the data to be processed, it also includes:
- the at least one target attribute matches the attribute identifier of the at least one preset facial feature.
- Example 5 provides an image processing method, further comprising:
- the target facial attribute determination model is obtained by clipping the to-be-used facial attribute determination model.
- Example 6 provides an image processing method, further comprising:
- Described construction to be trained facial attribute determination model comprises:
- the target confrontation model obtained in advance, the target attribute classification model and the face matching model, construct the facial attribute determination model to be trained;
- the target attribute classification model is used to determine the facial features of the image output by the target confrontation model;
- the facial matching model is used to determine the matching degree of the facial image output based on the target confrontation model,
- the target confrontation model is used to output two facial images, one of which matches the preset facial features set in the attribute editing sub-model to be trained.
- Example 7 provides an image processing method, further comprising:
- the target confrontation model includes: a feature preprocessing sub-model and an image generation sub-model; the feature preprocessing sub-model includes a first feature extraction module; the image generation sub-model includes a first image generation sub-module and a second image generation sub-model. An image generation sub-module; the feature preprocessing sub-model also includes a second feature extraction module.
- Example 8 provides an image processing method, further comprising:
- the construction of the facial attribute determination model to be trained includes: using the output result of the first feature extraction module or the second feature extraction module as the input of the attribute editing sub-model to be trained and the first image generation sub-module , using the output of the attribute editing sub-model to be trained as the input of the second image generation sub-module, and using the output of the first image generation sub-module and the output of the second image generation sub-module as the input of the second image generation sub-module.
- the target attribute classification model and the input of the facial matching model are used to construct the facial attribute determination model to be trained.
- Example 9 provides an image processing method, further comprising:
- the facial attribute determination model to be used is obtained through the training process of the facial attribute determination model to be trained, including:
- training samples include data to be trained
- the model parameters in the attribute editing sub-model to be trained are corrected, and the convergence of the loss function is used as a training target to obtain a facial attribute determination model to be used through training.
- Example 10 provides an image processing method, further comprising:
- the described target facial attribute determination model is obtained by tailoring the facial attribute determination model to be used, including:
- the target facial attribute determination model is obtained by removing the target attribute classification model, the facial matching model, and the first image generation sub-model in the facial attribute determination model to be used.
- Example Eleven provides an image processing method, further comprising:
- the preset facial features include at least one of the facial features of wearing at least one accessory, facial features of different ages, facial features of different angles, facial features of different hairstyles, facial features of different hairstyles and color matching, and facial features of different expressions. A sort of.
- Example 12 provides an image processing device, including:
- a data acquisition module configured to acquire data to be processed; wherein, the data to be processed includes Gaussian noise or an image to be converted;
- the target image determination module is configured to process the data to be processed based on the target facial attribute determination model to obtain a target facial image corresponding to the data to be processed; wherein at least one target feature in the target facial image is the same as corresponding to at least one preset facial feature.
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
- Collating Specific Patterns (AREA)
Abstract
Description
Claims (15)
- 一种图像处理方法,包括:获取待处理数据;其中,所述待处理数据包括高斯噪声或待转换图像;基于目标面部属性确定模型对所述待处理数据进行处理,得到与所述待处理数据相对应的目标面部图像;其中,所述目标面部图像中的至少一个目标特征与相应的至少一种预设面部特征相匹配。
- 根据权利要求1所述的方法,其中,所述基于目标面部属性确定模型对所述待处理数据进行处理,得到与所述待处理数据相对应的目标面部图像,包括:确定与所述待处理数据相对应的待拼接特征向量;为所述待拼接特征向量拼接与所述至少一个预设面部特征相对应的预设特征向量,得到与所述目标面部图像相对应的目标特征向量;对所述目标特征向量进行处理,得到所述目标面部图像。
- 根据权利要求2所述的方法,其中,所述确定与所述待处理数据相对应的待拼接特征向量,包括:在所述待处理数据为所述高斯噪声的情况下,基于第一特征提取模块确定与所述高斯噪声相对应的待拼接特征向量;在所述待处理数据为所述待转换图像的情况下,基于第二特征提取模块,确定与所述待转换图像相对应的待拼接特征向量。
- 根据权利要求1所述的方法,在所述得到与所述待处理数据相对应的目标面部图像之后,还包括:基于预先训练得到的属性分类器,确定与所述目标面部图像相对应的至少一种目标属性,以基于所述至少一种目标属性对所述目标面部属性确定模型中的模型参数进行修正;其中,所述至少一种目标属性与所述至少一种预设面部特征的属性标识相匹配。
- 根据权利要求1所述的方法,还包括:构建待训练面部属性确定模型;通过对所述待训练面部属性确定模型训练处理,得到待使用面部属性确定模型;通过对所述待使用面部属性确定模型剪裁处理,得到所述目标面部属性确 定模型。
- 根据权利要求5所述的方法,其中,所述构建待训练面部属性确定模型,包括:根据待训练属性编辑子模型,预先训练得到的目标对抗模型、目标属性分类模型以及面部匹配模型,构建所述待训练面部属性确定模型;其中,所述目标属性分类模型,用于确定经所述目标对抗模型输出的图像的面部特征;所述面部匹配模型,用于确定基于所述目标对抗模型输出的面部图像的匹配度,所述目标对抗模型,用于输出两幅面部图像,一幅面部图像与所述待训练属性编辑子模型中设置的预设面部特征相匹配。
- 根据权利要求6所述的方法,其中,所述目标对抗模型中包括:特征预处理子模型和图像生成子模型;所述特征预处理子模型中包括第一特征提取模块;所述图像生成子模型包括第一图像生成子模块和第二图像生成子模块;所述特征预处理子模型中还包括第二特征提取模块。
- 根据权利要求7所述的方法,其中,所述构建待训练面部属性确定模型,包括:将所述第一特征提取模块或所述第二特征提取模块的输出结果,作为所述待训练属性编辑子模型和所述第一图像生成子模块的输入,将所述待训练属性编辑子模型的输出作为所述第二图像生成子模块的输入,将所述第一图像生成子模块的输出以及所述第二图像生成子模块的输出,作为所述目标属性分类模型以及所述面部匹配模型的输入,以构建所述待训练面部属性确定模型。
- 根据权利要求7所述的方法,其中,所述通过对所述待训练面部属性确定模型训练处理,得到待使用面部属性确定模型,包括:获取多个训练样本,其中,训练样本中包括待训练数据;针对所述多个训练样本,将当前训练样本中的待训练数据输入至所述第一特征提取模块或所述第二特征提取模块中得到与所述当前训练样本相对应的第一特征向量;基于所述待训练属性编辑子模型为所述第一特征向量拼接与至少一种预设面部特征相对应的属性特征向量,得到第一属性特征向量;将所述第一特征向量输入至所述第一图像生成子模块中,得到未附带属性特征图像;以及,将所述第一属性特征向量输入至所述第二图像生成子模块中,得到附带属性特征图像;将所述附带属性特征图像和所述未附带属性特征图像输入至所述目标属性 分类模型中,得到待比较属性信息;以及,将所述附带属性特征图像和所述未附带属性特征图像,输入至所述面部匹配模型中,得到面部匹配信息;基于所述待训练属性编辑子模型中的损失函数对所述待比较属性信息、所述面部匹配信息以及所述待训练属性编辑子模型中的预设面部特征进行处理,得到目标损失值;基于所述目标损失值对所述待训练属性编辑子模型中的模型参数进行修正,并将所述损失函数收敛作为训练目标,训练得到待使用面部属性确定模型。
- 根据权利要求9所述的方法,其中,所述通过对所述待使用面部属性确定模型剪裁处理,得到所述目标面部属性确定模型,包括:将所述待使用面部属性确定模型中的所述目标属性分类模型、所述面部匹配模型、所述第一图像生成子模型剔除,得到所述目标面部属性确定模型。
- 根据权利要求1-10中任一所述的方法,其中,所述预设面部特征包括佩戴至少一种饰品的面部特征、不同年龄阶段的面部特征、不同角度的面部特征、不同发型的面部特征、不同发型配色的面部特征以及不同表情的面部特征中的至少一种。
- 一种图像处理装置,包括:数据获取模块,设置为获取待处理数据;其中,所述待处理数据包括高斯噪声或待转换图像;目标图像确定模块,设置为基于目标面部属性确定模型对所述待处理数据进行处理,得到与所述待处理数据相对应的目标面部图像;其中,所述目标面部图像中的至少一个目标特征与相应的至少一种预设面部特征相匹配。
- 一种电子设备,包括:至少一个处理器;存储装置,设置为存储至少一个程序;当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如权利要求1-11中任一所述的图像处理方法。
- 一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如权利要求1-11中任一所述的图像处理方法。
- 一种计算机程序产品,包括承载在非暂态计算机可读介质上的计算机程序,所述计算机程序包含用于执行如权利要求1-11中任一所述的图像处理方法的程序代码。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US18/725,684 US20250078566A1 (en) | 2021-12-29 | 2022-12-26 | Image processing method and apparatus, electronic device, and storage medium |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111641195.4A CN114387373B (zh) | 2021-12-29 | 2021-12-29 | 图像处理方法、装置、电子设备和存储介质 |
| CN202111641195.4 | 2021-12-29 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023125366A1 true WO2023125366A1 (zh) | 2023-07-06 |
Family
ID=81199201
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/141795 Ceased WO2023125366A1 (zh) | 2021-12-29 | 2022-12-26 | 图像处理方法、装置、电子设备和存储介质 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20250078566A1 (zh) |
| CN (1) | CN114387373B (zh) |
| WO (1) | WO2023125366A1 (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114387373B (zh) * | 2021-12-29 | 2026-04-21 | 北京字跳网络技术有限公司 | 图像处理方法、装置、电子设备和存储介质 |
| CN114842261B (zh) * | 2022-05-10 | 2025-07-25 | 西华师范大学 | 图像处理方法、装置、电子设备及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10311334B1 (en) * | 2018-12-07 | 2019-06-04 | Capital One Services, Llc | Learning to process images depicting faces without leveraging sensitive attributes in deep learning models |
| CN109948796A (zh) * | 2019-03-13 | 2019-06-28 | 腾讯科技(深圳)有限公司 | 自编码器学习方法、装置、计算机设备及存储介质 |
| CN111292262A (zh) * | 2020-01-19 | 2020-06-16 | 腾讯科技(深圳)有限公司 | 图像处理方法、装置、电子设备以及存储介质 |
| CN111325726A (zh) * | 2020-02-19 | 2020-06-23 | 腾讯医疗健康(深圳)有限公司 | 模型训练方法、图像处理方法、装置、设备及存储介质 |
| CN114387373A (zh) * | 2021-12-29 | 2022-04-22 | 北京字跳网络技术有限公司 | 图像处理方法、装置、电子设备和存储介质 |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103413270A (zh) * | 2013-08-15 | 2013-11-27 | 北京小米科技有限责任公司 | 一种图像的处理方法、装置和终端设备 |
| CN111414928A (zh) * | 2019-01-07 | 2020-07-14 | 中国移动通信有限公司研究院 | 一种人脸图像数据生成方法、装置及设备 |
| CN110909595B (zh) * | 2019-10-12 | 2023-04-18 | 平安科技(深圳)有限公司 | 面部动作识别模型训练方法、面部动作识别方法 |
| US11640684B2 (en) * | 2020-07-21 | 2023-05-02 | Adobe Inc. | Attribute conditioned image generation |
| CN113422910A (zh) * | 2021-05-17 | 2021-09-21 | 北京达佳互联信息技术有限公司 | 视频处理方法、装置、电子设备和存储介质 |
| CN113569780B (zh) * | 2021-08-03 | 2024-10-18 | 东南大学 | 一种基于梯度对抗攻击和生成对抗模型的人脸图片年龄转换方法 |
-
2021
- 2021-12-29 CN CN202111641195.4A patent/CN114387373B/zh active Active
-
2022
- 2022-12-26 US US18/725,684 patent/US20250078566A1/en active Pending
- 2022-12-26 WO PCT/CN2022/141795 patent/WO2023125366A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10311334B1 (en) * | 2018-12-07 | 2019-06-04 | Capital One Services, Llc | Learning to process images depicting faces without leveraging sensitive attributes in deep learning models |
| CN109948796A (zh) * | 2019-03-13 | 2019-06-28 | 腾讯科技(深圳)有限公司 | 自编码器学习方法、装置、计算机设备及存储介质 |
| CN111292262A (zh) * | 2020-01-19 | 2020-06-16 | 腾讯科技(深圳)有限公司 | 图像处理方法、装置、电子设备以及存储介质 |
| CN111325726A (zh) * | 2020-02-19 | 2020-06-23 | 腾讯医疗健康(深圳)有限公司 | 模型训练方法、图像处理方法、装置、设备及存储介质 |
| CN114387373A (zh) * | 2021-12-29 | 2022-04-22 | 北京字跳网络技术有限公司 | 图像处理方法、装置、电子设备和存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| US20250078566A1 (en) | 2025-03-06 |
| CN114387373A (zh) | 2022-04-22 |
| CN114387373B (zh) | 2026-04-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102416558B1 (ko) | 영상 데이터 처리 방법, 장치 및 판독 가능 저장 매체 | |
| CN114419300B (zh) | 风格化图像生成方法、装置、电子设备及存储介质 | |
| WO2023125374A1 (zh) | 图像处理方法、装置、电子设备及存储介质 | |
| CN111476871B (zh) | 用于生成视频的方法和装置 | |
| US20250077761A1 (en) | Character generation method and apparatus, electronic device, and storage medium | |
| CN112132847A (zh) | 模型训练方法、图像分割方法、装置、电子设备和介质 | |
| CN110827379A (zh) | 虚拟形象的生成方法、装置、终端及存储介质 | |
| CN113344776B (zh) | 图像处理方法、模型训练方法、装置、电子设备及介质 | |
| WO2023093897A1 (zh) | 图像处理方法、装置、电子设备及存储介质 | |
| US11792494B1 (en) | Processing method and apparatus, electronic device and medium | |
| WO2023098664A1 (zh) | 特效视频的生成方法、装置、设备及存储介质 | |
| US20230421716A1 (en) | Video processing method and apparatus, electronic device and storage medium | |
| US12592260B2 (en) | Video generation method and apparatus, electronic device, and storage medium | |
| WO2023045710A1 (zh) | 多媒体显示及匹配方法、装置、设备及介质 | |
| WO2023125366A1 (zh) | 图像处理方法、装置、电子设备和存储介质 | |
| WO2023051244A1 (zh) | 图像生成方法、装置、设备及存储介质 | |
| CN112785669A (zh) | 一种虚拟形象合成方法、装置、设备及存储介质 | |
| CN113744286A (zh) | 虚拟头发生成方法及装置、计算机可读介质和电子设备 | |
| CN115002442B (zh) | 一种图像展示方法、装置、电子设备及存储介质 | |
| WO2022233223A1 (zh) | 图像拼接方法、装置、设备及介质 | |
| US20250371877A1 (en) | Video processing method, and electronic device | |
| CN111340865B (zh) | 用于生成图像的方法和装置 | |
| WO2025167333A1 (zh) | 一种图像生成方法、装置、设备、介质、产品 | |
| WO2025002130A1 (zh) | 图像编辑方法及相关设备 | |
| CN113298731B (zh) | 图像色彩迁移方法及装置、计算机可读介质和电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22914620 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 18725684 Country of ref document: US |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 16.10.2024) |
|
| WWP | Wipo information: published in national office |
Ref document number: 18725684 Country of ref document: US |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22914620 Country of ref document: EP Kind code of ref document: A1 |