Object attribute editing method, device, electronic device and readable storage medium

By extracting the attribute channels in the preset style feature space and optimizing the channel offset using the style generation model, the problem of feature entanglement in object attribute editing is solved, and efficient multi-attribute editing and detail retention is achieved.

CN114170070BActive Publication Date: 2025-04-29BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111447522.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-04-29
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

The prior art has feature entanglement problems in object attribute editing, making it difficult to effectively edit multiple attributes.

Method used

By extracting the attribute channels corresponding to the target object attributes in the preset style feature space, the initial channel offset is optimized using the style generation model, the target channel offset is generated, and it is superimposed with the attribute channel, and reorganized to generate the target picture.

Benefits of technology

It improves the decoupling of the style-generated model, reduces feature entanglement between object features in the to-processed picture, ensures that the granularity of the target object attributes is small, and the target image retains the image feature details of the original picture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114170070B_ABST
    Figure CN114170070B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an object attribute editing method, device, electronic device and readable storage medium, and relates to the field of computer vision technology. The embodiments of the present disclosure at least solve the problem of feature entanglement in object attribute editing in the related art. The method includes: in response to a target object attribute editing instruction for a picture to be processed, extracting a first attribute channel corresponding to the target object attribute in a preset style feature space; optimizing the initial channel offset according to the first attribute channel, a base picture and a style generation model to generate a target channel offset, wherein the base picture is a picture that does not contain the target object attribute; superimposing the target channel offset with the first attribute channel, recombining the result of the superimposition operation with the preset style feature space, and generating a target picture of the picture to be processed according to the recombined first recombined result, the picture to be processed and the style generation model, wherein the target picture contains the target object attribute.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer vision technology, and in particular to an object attribute editing method, device, electronic device and readable storage medium. Background Art

[0002] Object attribute editing is to generate a new face image that meets the target face attributes by adjusting single or multiple elements in the face image (such as nose, mouth, eyes, eyebrows, beard, hair, height or weight, etc.). It can be applied to entertainment, social networking, facial animation, face recognition and other fields. The target face attributes can be: posture, age, expression or gender.

[0003] In the related technology, an object attribute editing model combining a generative adversarial network and an autoencoder can be constructed; the autoencoder is used as a generator, and the input of the object attribute editing model is a picture and an attribute; the Wasserstein generative model WGAN-GP is used to optimize the generative model GAN ​​loss to achieve the task of using a single generator to perform multiple attribute editing; an attribute classifier is used to ensure that the generated image has the expected attributes correctly; a multi-scale discriminator is used to guide the generator to generate details and capture detail information on the original image; reconstruction loss, attribute classification loss and multi-scale generative model GAN ​​loss are combined for object attribute editing.

[0004] The above technical solution combines attribute classification loss with object attribute editing to optimize multiple attribute editing tasks in a single generator, but it still cannot solve the problem of feature entanglement. Summary of the invention

[0005] The present disclosure provides an object attribute editing method, device, electronic device and readable storage medium to at least solve the problem of feature entanglement in object attribute editing in the related art. The technical solution of the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, an object attribute editing method is provided, comprising: in response to a target object attribute editing instruction for a to-be-processed image, extracting a first attribute channel corresponding to a target object attribute in a preset style feature space; the preset style feature space is obtained by compressing a preset sample into the style feature space through a preset inversion network, the preset style feature space is a column vector with a first preset dimension, and the first attribute channel is a column vector with a second preset dimension; the preset sample comprises: a positive sample containing the target object attribute and a negative sample not containing the target object attribute; according to the first attribute channel, a base image and a style generation model, an initial channel offset is optimized to generate a target channel offset, the base image is an image not containing the target object attribute generated according to the style generation model, and the initial channel offset is obtained by inputting a random initial value into a fully connected layer; the style generation model is pre-trained according to the preset sample; the target channel offset is superimposed on the first attribute channel, the result of the superimposition operation is recombined with the preset style feature space, and a target image of the to-be-processed image is generated according to the recombined first recombined result, the to-be-processed image and the style generation model, the target image containing the target object attribute.

[0007] Optionally, before the above-mentioned “in response to the target object attribute editing instruction for the image to be processed, extracting the first attribute channel corresponding to the target object attribute in the preset style feature space”, the above-mentioned object attribute editing method also includes: training a style generation model according to preset samples; compressing the preset samples to the preset style feature space through a preset inversion network.

[0008] Optionally, the above-mentioned "optimizing the initial channel offset according to the first attribute channel, the base image and the style generative model to generate a target channel offset" includes: performing a superposition operation on the initial channel offset and the first attribute channel, recombining the result of the superposition operation with the preset style feature space, and generating a target attribute image according to the recombined second recombinant result, the base image and the style generative model; updating the parameters of the fully connected layer according to the judgment result of the attribute classifier on whether the target attribute image contains the target object attributes, and re-inputting the random initial value into the updated fully connected layer to obtain the target channel offset.

[0009] Optionally, before the above “updating the parameters of the fully connected layer according to the attribute classifier’s judgment result on whether the target attribute image contains the target object attributes, and re-outputting the random initial value to the fully connected layer to obtain the target channel offset”, the above object attribute editing method also includes: training an attribute classifier of the target object attributes according to preset samples, and the attribute classifier is used to determine whether the image contains the target object attributes.

[0010] Optionally, the above-mentioned “updating the parameters of the fully connected layer according to the judgment result of the attribute classifier on whether the target attribute image contains the target object attribute” includes: inputting the judgment result into a preset loss function to obtain a loss gradient value; and updating the parameters of the fully connected layer according to the loss gradient value.

[0011] Optionally, the above-mentioned "extracting the first attribute channel corresponding to the target object attribute in the preset style feature space" includes: obtaining the first attribute channel corresponding to the target difference dimension from the preset style feature space, the target difference dimension being: a dimension in which the difference between the channel means corresponding to the positive mean channel and the negative mean channel is greater than a preset value, the positive mean channel being the channel mean of the positive samples containing the target object attribute, and the negative mean channel being the channel mean of the negative samples not including the target object.

[0012] Optionally, the above-mentioned "obtaining a first attribute channel corresponding to a target difference dimension from a preset style feature space" includes: obtaining the positive attribute channel of each positive sample from the preset style feature space, and counting the positive mean channel based on the channel mean of the positive attribute channel, wherein both the positive attribute channel and the positive mean channel are column vectors having a second preset dimension; obtaining the negative attribute channel of each negative sample from the preset style feature space, and counting the negative mean channel based on the channel mean of the negative attribute channel, wherein both the negative attribute channel and the negative mean channel are column vectors having a second preset dimension; searching for the target difference dimension based on the positive mean channel and the negative mean channel; and obtaining the first attribute channel corresponding to the target difference dimension.

[0013] Optionally, the above-mentioned "superimposing the target channel offset with the first attribute channel, recombining the result of the superimposition operation with the preset style feature space, and generating a target image of the image to be processed based on the first recombined result, the image to be processed and the style generative model" includes: receiving user input, the user input includes an offset degree parameter, and the offset degree parameter is used to indicate the degree of change in the attributes of the target object; in response to the user input, multiplying the target channel offset with the offset degree parameter, and then superimposing the first attribute channel, recombining the result of the superimposition operation with the preset style feature space, and generating the target image of the image to be processed based on the first recombined result, the image to be processed and the style generative model.

[0014] According to a second aspect of an embodiment of the present disclosure, an object attribute editing device is provided, comprising: a channel extraction unit, an offset generation unit and an image generation unit; the channel extraction unit is used to extract a first attribute channel corresponding to a target object attribute in a preset style feature space in response to a target object attribute editing instruction for a to-be-processed image; the preset style feature space is obtained by compressing a preset sample into a style feature space through a preset inversion network, the preset style feature space is a column vector with a first preset dimension, and the first attribute channel is a column vector with a second preset dimension; the preset samples include: positive samples containing target object attributes and negative samples not containing target object attributes; the offset generation unit is used to extract a first attribute channel corresponding to a target object attribute in a preset style feature space according to the channel extraction unit; the first attribute channel of the image, the base image and the style generation model, optimize the initial channel offset and generate a target channel offset, the base image is a picture generated according to the style generation model and does not contain the attributes of the target object, and the initial channel offset is obtained by inputting a random initial value into the fully connected layer; the style generation model is pre-trained according to preset samples; the image generation unit is used to superimpose the target channel offset generated by the offset generation unit and the first attribute channel extracted by the channel extraction unit, recombining the result of the superposition operation with the preset style feature space, and generating a target image of the image to be processed according to the recombined first recombinant result, the image to be processed and the style generation model, the target image containing the attributes of the target object.

[0015] Optionally, the above-mentioned device also includes: a model training unit and a space compression unit; the model training unit is used for the channel extraction unit to respond to the target object attribute editing instruction for the image to be processed, and before extracting the first attribute channel corresponding to the target object attribute in the preset style feature space, train the style generation model according to preset samples; the space compression unit is used to compress the preset samples to the preset style feature space through a preset inversion network.

[0016] Optionally, an offset generation unit is used to: perform a superposition operation on the initial channel offset and the first attribute channel, reorganize the result of the superposition operation with the preset style feature space, and generate a target attribute image based on the reorganized second reorganization result, the basic image and the style generation model; update the parameters of the fully connected layer based on the judgment result of the attribute classifier on whether the target attribute image contains the target object attribute, and re-input the random initial value into the updated fully connected layer to obtain the target channel offset.

[0017] Optionally, the offset generation unit is also used to: update the parameters of the fully connected layer in the offset generation unit according to the judgment result of the attribute classifier on whether the target attribute image contains the target object attributes, and re-output the random initial value to the fully connected layer before obtaining the target channel offset, and train the attribute classifier of the target object attributes according to preset samples, and the attribute classifier is used to determine whether the image contains the target object attributes.

[0018] Optionally, the offset generation unit is specifically used to: input the judgment result into a preset loss function to obtain a loss gradient value; and update the parameters of the fully connected layer according to the loss gradient value.

[0019] Optionally, the channel extraction unit is used to: obtain a first attribute channel corresponding to a target difference dimension from a preset style feature space, where the target difference dimension is a dimension in which the difference between the channel means corresponding to the positive mean channel and the negative mean channel is greater than a preset value, the positive mean channel is the channel mean of positive samples containing the target object attributes, and the negative mean channel is the channel mean of negative samples that do not include the target object.

[0020] Optionally, the channel extraction unit is specifically used to: obtain the positive attribute channel of each positive sample from the preset style feature space, and count the positive mean channel based on the channel mean of the positive attribute channel, the positive attribute channel and the positive mean channel are both column vectors with a second preset dimension; obtain the negative attribute channel of each negative sample from the preset style feature space, and count the negative mean channel based on the channel mean of the negative attribute channel, the negative attribute channel and the negative mean channel are both column vectors with a second preset dimension; search for the target difference dimension based on the positive mean channel and the negative mean channel; obtain the first attribute channel corresponding to the target difference dimension.

[0021] Optionally, the image generation unit is used to: receive user input, the user input includes an offset degree parameter, the offset degree parameter is used to indicate the degree of change in the attributes of the target object; in response to the user input, multiply the target channel offset by the offset degree parameter, and then perform an overlay operation with the first attribute channel, recombining the result of the overlay operation with a preset style feature space, and generating a target image of the image to be processed based on the first recombinant result, the image to be processed and the style generation model.

[0022] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor, a memory, and a program or instruction stored in the memory and executable on the processor; wherein, when the program or instruction is executed by the processor, the object property editing method provided in the first aspect and any possible design method thereof is implemented.

[0023] According to a fourth aspect of an embodiment of the present disclosure, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, an object property editing method provided by the first aspect and any possible design method thereof is implemented.

[0024] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided. The computer program product is stored in a non-volatile storage medium. When the computer program product is executed by at least one processor, the computer program product implements the object property editing method provided by the first aspect and any possible design method thereof.

[0025] The technical solution provided by the present disclosure brings at least the following beneficial effects: extracting the first attribute channel corresponding to the target object attribute in the preset style feature space; since the style feature space is the result of feature mapping of the latent vector of the preset sample, manipulating the style generative model in the style feature space can improve the decoupling of the style generative model and reduce the feature entanglement between the features of each object in the image to be processed; at the same time, it can also ensure that the granularity of the target object attribute is small, and the image feature details in the image to be processed can be retained in the target image.

[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0028] Figure 1 This is one of the flowcharts of a method for editing object attributes provided by an embodiment of the present disclosure;

[0029] Figure 2 is a schematic diagram of preset samples provided by an embodiment of the present disclosure;

[0030] Figure 3 This is one of the data structure diagrams for object attribute editing provided by the embodiment of the present disclosure;

[0031] Figure 4 This is a second flow chart of a method for editing object attributes provided by an embodiment of the present disclosure;

[0032] Figure 5 This is a third flow chart of a method for editing object attributes provided by an embodiment of the present disclosure;

[0033] Figure 6 This is the second data structure diagram of object attribute editing provided by the embodiment of the present disclosure;

[0034] Figure 7 This is a fourth flowchart of a method for editing object attributes provided by an embodiment of the present disclosure;

[0035] Figure 8 This is a fifth flowchart of a method for editing object attributes provided by an embodiment of the present disclosure;

[0036] Fig. 9 is a schematic diagram of target images with different degrees of change provided by an embodiment of the present disclosure;

[0037] Fig.10 is a structural schematic diagram of an object attribute editing device provided by an embodiment of the present disclosure;

[0038] Fig.11 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0039] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0041] In addition, in the description of the embodiments of the present disclosure, unless otherwise specified, " / " means or, for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present disclosure, "multiple" means two or more than two.

[0042] With the rapid development of computer vision technology and graphics, pictures have gradually become the main carrier of daily information exchange because of their intuitive representation and convenient transmission, and the ability to contain the most differentiated information. The object attributes in human images can represent a series of biological characteristics of human features. From a macro perspective, object attributes include age, expression, fatness, and race, etc. From a micro perspective, object attributes include eyes, nose, hair color, beard, etc.

[0043] In order to meet user needs such as entertainment, social interaction, and face recognition, the object properties in the image can be edited. In order to solve the feature entanglement problem in object property editing, the embodiment of the present disclosure provides an object property editing method. The method is exemplified below by taking the execution subject as an object property editing device as an example.

[0044] like Figure 1 FIG. 1 is a flow chart of a method for editing object attributes provided by an embodiment of the present disclosure. Figure 1 As shown, the object attribute editing method provided by the embodiment of the present disclosure includes the following steps 101 to 103.

[0045] Step 101: The object attribute editing device extracts a first attribute channel corresponding to the target object attribute in a preset style feature space in response to a target object attribute editing instruction for a to-be-processed image.

[0046] In an embodiment of the present disclosure, the preset style feature space is obtained by compressing preset samples into the style feature space through a preset inversion network, the preset style feature space is a column vector with a first preset dimension, and the first attribute channel is a column vector with a second preset dimension; the preset samples include: positive samples containing target object attributes and negative samples not containing target object attributes.

[0047] It should be noted that the target object attributes may be expression, age, eyes, nose, body shape, etc. Different preset samples are selected according to different target object attributes.

[0048] For example, when the target object attribute is a smiling expression, Figure 2 The schematic diagram of preset samples provided by the embodiment of the present disclosure is shown, wherein the preset samples include: a face image with a smiling face expression ( Figure 2 The left figure shows the face image of a person with a non-smiling expression ( Figure 2 (shown in the middle right).

[0049] In the disclosed embodiment, the target object attribute editing command is used to edit the target object attribute in the image to be processed. The instruction source of the target object attribute editing command can be a screen, a virtual key, a mechanical key of the object attribute editing device, or a remote control, an external keyboard or other external device connected to the object attribute editing device via Bluetooth, infrared or wireless network.

[0050] In the disclosed embodiment, an intermediate vector of a latent space in a style generative model is affine transformed to be compressed into a style feature space, and a preset inversion network is trained. The trained preset inversion network is used to compress preset samples into a preset style feature space.

[0051] It should be noted that if the number of samples in the preset samples is large, a preset number of candidate images may be randomly selected from the positive samples and the negative samples respectively, and the candidate images may be compressed into the preset style feature space.

[0052] In the embodiment of the present disclosure, since the preset style feature space is a column vector with a first preset dimension, the dimension associated with the target object attribute constitutes a first attribute channel. The first attribute channel is a column vector with a second preset dimension, the second preset dimension is smaller than the first preset dimension, and the first attribute channel records the vector position associated with the target object attribute in the preset style feature space and the data value of the vector position.

[0053] In the disclosed embodiment, since the preset style feature space is the changed image attribute, the first attribute channel in the preset style feature space is used to operate the editing target object attribute, the granularity of the object attribute that can be controlled is smaller, the decoupling is better, and the details in the original image can be retained.

[0054] It should be noted that decoupling means that in the process of editing the target object attributes, only the target object attributes are modified, and other object attributes are not related to the target object attributes. In other words, the better the decoupling, the less likely the problem of feature entanglement will occur. For example, if the target object attribute is the eye, then the size of the mouth will not change after editing the eyes.

[0055] Step 102: The object attribute editing device optimizes the initial channel offset according to the first attribute channel, the basic image and the style generation model to generate a target channel offset.

[0056] In the disclosed embodiment, the base image is an image that does not contain attributes of the target object and is generated according to the style generation model. The initial channel offset is obtained by inputting a random initial value into the fully connected layer. The style generation model is pre-trained according to preset samples.

[0057] In the embodiment of the present disclosure, in the process of optimizing the initial channel offset, the model parameters in the style generation model are fixed.

[0058] In the embodiment of the present disclosure, a basic image is input into a style generation model, and the image generation process of the style generation model is controlled through a first attribute channel and an initial offset. Then, it is determined whether the generated image includes the target object attribute. If it does, it means that the initial offset is a parameter for editing the target object attribute. If it does not, the initial offset needs to be optimized.

[0059] In the disclosed embodiment, the initial channel offset may be optimized by modifying a random initial value of the fully connected layer, or by modifying a parameter of the fully connected layer, which is not limited thereto.

[0060] Step 103, the object attribute editing device performs a superposition operation on the target channel offset and the first attribute channel, recombines the result of the superposition operation with the preset style feature space, and generates a target image of the image to be processed based on the recombined first recombinant result, the image to be processed and the style generation model.

[0061] In the embodiment of the present disclosure, the target image includes target object attributes.

[0062] In the disclosed embodiment, the target channel offset is superimposed on the first attribute channel, and the superimposed result is used to manipulate the processing process of the image to be processed by the style generation model to generate a target image containing the attributes of the target object.

[0063] The technical solution provided by the present disclosure brings at least the following beneficial effects: extracting the first attribute channel corresponding to the target object attribute in the preset style feature space; since the style feature space is the result of feature mapping of the latent vector of the preset sample, manipulating the style generative model in the style feature space can improve the decoupling of the style generative model and reduce the feature entanglement between the features of each object in the image to be processed; at the same time, it can also ensure that the granularity of the target object attribute is small, and the image feature details in the image to be processed can be retained in the target image.

[0064] Optionally, in the embodiment of the present disclosure, before extracting the first attribute channel corresponding to the target object attribute in the preset style feature space in step 101, the object attribute editing method provided by the embodiment of the present disclosure further includes: step 1011 and step 1012.

[0065] Step 1011: The object attribute editing device trains a style generation model based on preset samples.

[0066] In the disclosed embodiment, the preset samples include: positive samples containing target object attributes and negative samples not containing target object attributes. It should be noted that the target object attributes may be expression, age, eyes, nose, etc. Different preset samples are selected according to different target object attributes.

[0067] In the disclosed embodiment, the style generative model is a deep learning model that adopts an unsupervised learning method. Its essence is to learn the mapping relationship from one data distribution to another data distribution, and to improve the quality of the generator by making the generator network and the discriminator network confront each other.

[0068] Specifically, the style generation model mainly includes a generator network, a mapping network, a synthesis network, and a discriminator network. The mapping network is used to realize the mapping process from the initial generated code to the intermediate vector. It can be composed of 8 fully connected layers. The initial vector can be set as the hidden space and the intermediate vector as the latent space. The synthesis network is used to generate and input noise to the generator network to improve the resolution of the generated image. The generator network is used to generate an image with specific features by calling the mapping network and the synthesis network. The discriminator is used to determine whether the image generated by the generator has the above-mentioned specific features.

[0069] In the disclosed embodiment, the style generation model is trained by inputting preset samples into the style generation model. A first picture is input into the trained style generation model, and a second picture having target object attributes can be output. It should be noted that the target object attributes included in the preset samples are the same as the target object attributes included in the second picture.

[0070] Step 1012: The object attribute editing device compresses the preset samples into a preset style feature space through a preset inversion network.

[0071] In the disclosed embodiment, an intermediate vector of a latent space in a style generative model is affine transformed to be compressed into a style feature space, and a preset inversion network is trained. The trained preset inversion network is used to compress preset samples into a preset style feature space.

[0072] It should be noted that if the number of samples in the preset samples is large, a preset number of candidate images may be randomly selected from the positive samples and the negative samples respectively, and the candidate images may be compressed into the style feature space.

[0073] The technical solution provided by the present disclosure brings at least the following beneficial effects: a style generative model is trained by using preset samples consisting of positive samples containing target object attributes and negative samples not containing target object attributes, and the preset samples are compressed into a preset style feature space through a preset inversion network, that is, a trained style generative model and a preset style feature space are obtained, so that the target object attribute editing instruction can edit the processed image according to the target object attributes, thereby ensuring that the finally generated target image contains the target object attributes.

[0074] Now, with respect to the above steps 101 to 103, as well as steps 1011 and 1012, Figure 3 One of the data structure diagrams of object attribute editing provided by the embodiment of the present disclosure is shown for example:

[0075] like Figure 3As shown, assuming that the target face attribute is a smiling expression, the two pictures on the left side of the figure are respectively a schematic diagram of a positive sample and a schematic diagram of a negative sample. After step 102, the preset samples are sampled to obtain all or part of the sample space to obtain the style feature space, that is, a column vector of 1*9088; then the first attribute channel of 1*k is extracted from the style feature space, and the first attribute channel is located as the vector position associated with the target face attribute and the data value of the vector position; then the random initial value ΔS k Input the fully connected layer to get the initial channel offset ΔS k ', the initial channel offset ΔS k 'Superimpose with the first attribute channel to generate superposition operation result S k ', and reorganize with the style feature space, and jointly act the first reorganization result with the image to be processed (the image without a smile as shown in I1 in the figure) and the style generation model to generate the target image to be processed (the image containing a smile as shown in I2 in the figure).

[0076] If the target object attributes included in the preset samples are different, then the object attributes edited by the trained style generation model are also different. The purpose of customized training is achieved by the difference in preset samples. For this solution, preset samples corresponding to multiple target object attributes can be collected at the same time to change multiple attributes at the same time. It should be noted that for multiple target object attributes, the method of editing object attributes is similar to the above solution and will not be repeated here.

[0077] Optionally, to accurately calculate the target channel offset, such as Figure 4 The second flowchart of the object attribute editing method provided by the embodiment of the present disclosure is shown. Step 102 provided by the embodiment of the present disclosure can also be implemented through steps 401 and 402.

[0078] Step 401, the object attribute editing device performs a superposition operation on the initial channel offset and the first attribute channel, recombines the result of the superposition operation with the preset style feature space, and generates a target attribute image based on the recombined second recombinant result, the basic image and the style generation model.

[0079] In the embodiment of the present disclosure, the basic image includes an image that does not contain target object attributes and is generated according to a style generation model. A target attribute image that contains target object attributes is generated based on the basic image that does not contain target object attributes. That is, the editing of target object attributes can be achieved through the embodiment of the present disclosure.

[0080] In the disclosed embodiment, the first attribute channel associated with the target object attribute is superimposed with the initial channel offset to obtain a column vector capable of changing the target object attribute. The result of the superposition operation is recombined with the preset style feature space, that is, the preset style feature space is manipulated, and the target attribute image is generated using the second recombined result, the base image and the style generation model. In theory, the target attribute image contains the target object attribute, but in practice, the target attribute image may not contain the target object attribute.

[0081] Step 402: The object attribute editing device updates the parameters of the fully connected layer according to the judgment result of the attribute classifier on whether the target attribute image contains the target object attribute, and re-inputs the random initial value into the updated fully connected layer to obtain the target channel offset.

[0082] Further optionally, before step 402 , the object attribute editing method provided by the embodiment of the present disclosure further includes step 403 .

[0083] Step 403: The object attribute editing device trains an attribute classifier of the target object attributes according to preset samples.

[0084] In the disclosed embodiment, the attribute classifier is used to determine whether the image contains the target object attribute, wherein the image can be a target attribute image or any other image, which is not limited in the disclosed embodiment. It should be noted that the preset samples for training the attribute classifier are the same as the samples for training the style generation model.

[0085] The technical solution provided by the present disclosure brings at least the following beneficial effects: through pre-set sample training, the attribute classifier and the style generation model can ensure the consistency of the judgment results of the same picture, thereby ensuring that the judgment results fed back by the attribute classifier are effective for the style generation model.

[0086] Further optional, such as Figure 5 The third flowchart of the object attribute editing method provided by the embodiment of the present disclosure is shown, and the above step 402 is specifically implemented through steps 501 and 502.

[0087] Step 501: The object attribute editing device inputs the judgment result into a preset loss function to obtain a loss gradient value.

[0088] Step 502: The object attribute editing device updates the parameters of the fully connected layer according to the loss gradient value.

[0089] In the embodiments of the present disclosure, Figure 6The second data structure diagram of an object attribute editing provided by the embodiment of the present disclosure is shown. After the target attribute image is generated, the target attribute image is judged by the attribute classifier, and the judgment result is applied to the fully connected layer. For the target channel offset, the attribute classifier is used to guide the gradient outside the style generation model and return the loss gradient value to supervise the operation result of the preset style feature space on the style generation model to edit the target object attribute.

[0090] Specifically, in the disclosed embodiment, the judgment result is input into a preset loss function, the loss gradient value is obtained through the preset loss function, and then the parameters of the fully connected layer are updated according to the loss gradient value.

[0091] The technical solution provided by the present disclosure brings at least the following beneficial effects: the supervision result of the attribute classifier is fed back through the loss gradient value, and the parameters of the fully connected layer are updated to obtain the target channel offset, thereby improving the accuracy of editing the target object attributes.

[0092] In the disclosed embodiment, after updating the parameters of the fully connected layer, the random initial value is re-input into the fully connected layer to obtain the target channel offset, so that the target channel offset can accurately edit the target object properties.

[0093] The technical solution provided by the present disclosure brings at least the following beneficial effects: by using the attribute classifier to determine whether the target attribute image contains the target object attribute, the initial channel offset is optimized using a positive feedback mechanism so that the generated target channel offset can accurately edit the target object attribute.

[0094] Optionally, in order to accurately calculate the first attribute channel, step 101 provided in the embodiment of the present disclosure specifically includes: the object attribute editing device obtains the first attribute channel corresponding to the target difference dimension from the preset style feature space.

[0095] In the embodiment of the present disclosure, the target difference dimension is: the dimension in which the difference between the channel means corresponding to the positive mean channel and the negative mean channel is greater than a preset value. It should be noted that in the process of compressing the preset samples into the preset style feature space, the positive samples and the negative samples are distinguished and compressed into the preset style feature space respectively, so as to facilitate the subsequent determination of the target difference dimension through the positive mean channel and the negative mean channel.

[0096] In the disclosed embodiment, in order to ensure the speed of subsequent generation of the target image, the target difference dimension may also be: the dimension corresponding to the first K channel means after the channel means corresponding to the positive mean channel and the negative mean channel are arranged.

[0097] Further optional, such as Figure 7The fourth flowchart of the object attribute editing method provided by the embodiment of the present disclosure is shown. The above-mentioned obtaining the first attribute channel corresponding to the target difference dimension from the preset style feature space is specifically implemented through steps 701 to 704.

[0098] Step 701: The object attribute editing device obtains the positive attribute channel of each positive sample from the preset style feature space, and counts the positive mean channel according to the channel mean of the positive attribute channel.

[0099] Step 702: The object attribute editing device obtains the negative attribute channel of each negative sample from the preset style feature space, and counts the negative mean channel according to the channel mean of the negative attribute channel.

[0100] Step 703: The object attribute editing device searches for the target difference dimension according to the positive mean channel and the negative mean channel.

[0101] Step 704: The object attribute editing device obtains a first attribute channel corresponding to the target difference dimension.

[0102] In the embodiment of the present disclosure, the negative attribute channel and the negative mean channel are both column vectors with a second preset dimension. The positive attribute channel and the positive mean channel are both column vectors with a second preset dimension.

[0103] It can be understood that, by using positive samples and negative samples, the first attribute channel corresponding to the target difference dimension is statistically obtained from two perspectives, so that the correlation between the first attribute channel and the target face attribute is closer.

[0104] The technical solution provided by the present disclosure brings at least the following beneficial effects: statistics are performed on positive samples and negative samples respectively to obtain the target difference dimension and the first attribute channel corresponding to the target difference dimension, so as to obtain the first attribute channel that has the greatest impact on the target object attributes, so as to improve the accuracy of editing the target image object attributes.

[0105] The technical solution provided by the present disclosure brings at least the following beneficial effects: distinguishing the positive mean channel and the negative mean channel in the style feature space, and obtaining the first attribute channel that has the greatest impact on the target object attributes by finding the target difference dimension with a larger difference in the channel means, so as to improve the accuracy of editing the target object attributes of the processed image.

[0106] Optional, for the continuity of face attributes, such as Figure 8 The seventh flowchart of the object attribute editing method provided by the embodiment of the present disclosure is shown. Step 103 provided by the embodiment of the present disclosure can also be implemented through steps 801 and 802.

[0107] Step 801: The object attribute editing device receives user input.

[0108] Step 802, the object attribute editing device responds to the user input, multiplies the target channel offset and the offset degree parameter, and then performs a superposition operation with the first attribute channel, recombines the result of the superposition operation with the preset style feature space, and generates a target image of the image to be processed based on the recombined result, the image to be processed and the style generation model.

[0109] In the embodiment of the present disclosure, the user input includes a shift degree parameter and a to-be-processed image, and the shift degree parameter is used to indicate the degree of change in the target object attribute. It is understandable that the degree of change in the target object attribute can be controlled by the user input.

[0110] In the embodiments of the present disclosure, user input may be a message received through an external device such as a mouse, keyboard, infrared device, Bluetooth device, or a message sent through other terminals or a message sent through a smart wearable device, which is not limited in the embodiments of the present disclosure.

[0111] like Fig. 9 A schematic diagram of target images with different degrees of change provided by an embodiment of the present disclosure is shown, wherein the first image is the original image, and by magnifying the offset degree parameters by different multiples, the target image can achieve a gradual change process from not smiling to smiling, and the target image can retain the image details of the original image.

[0112] The technical solution provided by the present disclosure brings at least the following beneficial effects: customized editing of object properties is achieved through offset degree parameters, so that the user can rotate the degree of change of the target object properties according to actual needs.

[0113] The above mainly introduces the scheme of the embodiment of the present disclosure from the perspective of the method. It can be understood that in order to realize the above functions, the object attribute editing device includes at least one of the hardware structure and software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.

[0114] The disclosed embodiment can divide the object attribute editing device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the disclosed embodiment is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0115] Fig.10 FIG. 1 is a schematic diagram showing a structure of an object attribute editing device according to an exemplary embodiment. Fig.11 As shown, the object attribute editing device provided by the embodiment of the present disclosure includes: a channel extraction unit 1001, an offset generation unit 1002 and a picture generation unit 1003;

[0116] The channel extraction unit 1001 is used to extract a first attribute channel corresponding to the target object attribute in the preset style feature space in response to the target object attribute editing instruction for the image to be processed; the preset style feature space is obtained by compressing the preset samples into the style feature space through the preset inversion network, the preset style feature space is a column vector with a first preset dimension, and the first attribute channel is a column vector with a second preset dimension; the preset samples include: positive samples containing the target object attribute and negative samples not containing the target object attribute; for example, Figure 1 As shown, the channel extraction unit 1001 can be used to perform step 101.

[0117] The offset generating unit 1002 is used to optimize the initial channel offset according to the first attribute channel extracted by the channel extracting unit 1001, the base picture and the style generating model, and generate the target channel offset. The base picture is a picture generated according to the style generating model and does not contain the attributes of the target object. The initial channel offset is obtained by inputting a random initial value into the fully connected layer; the style generating model is pre-trained according to the preset samples; for example, Figure 1 As shown, the offset generating unit 1002 can be used to execute step 102 .

[0118] The image generation unit 1003 is used to perform a superposition operation on the target channel offset generated by the offset generation unit 1002 and the first attribute channel extracted by the channel extraction unit 1001, reorganize the result of the superposition operation with the preset style feature space, and generate a target image of the image to be processed according to the reorganized first reorganization result, the image to be processed and the style generation model, wherein the target image includes the target object attributes. Figure 1 As shown, the picture generation unit 1003 can be used to execute step 102.

[0119] Optionally, the above-mentioned device also includes: a model training unit 1004 and a space compression unit 1005; the model training unit 1004 is used for the channel extraction unit 1001 to respond to the target object attribute editing instruction for the image to be processed, and before extracting the first attribute channel corresponding to the target object attribute in the preset style feature space, to train the style generation model according to preset samples; the space compression unit 1005 is used to compress the preset samples to the preset style feature space through a preset inversion network.

[0120] Optionally, the offset generation unit 1002 is used to: perform a superposition operation on the initial channel offset and the first attribute channel, reorganize the result of the superposition operation with the preset style feature space, and generate a target attribute image according to the reorganized second reorganization result, the basic image and the style generation model; update the parameters of the fully connected layer according to the judgment result of the attribute classifier on whether the target attribute image contains the target object attribute, and re-input the random initial value into the updated fully connected layer to obtain the target channel offset. For example, Figure 4 As shown, the offset generating unit 1002 can be used to perform steps 401 and 402.

[0121] Optionally, the offset generation unit 1002 is further used to: update the parameters of the fully connected layer according to the judgment result of the attribute classifier on whether the target attribute picture contains the target object attribute in the offset generation unit 1002, and re-output the random initial value to the fully connected layer to obtain the target channel offset, and train the attribute classifier of the target object attribute according to the preset sample, and the attribute classifier is used to determine whether the picture contains the target object attribute. For example, Figure 4 As shown, the offset generating unit 1002 can be used to execute step 403 .

[0122] Optionally, the offset generation unit 1002 is specifically used to: input the judgment result into a preset loss function to obtain a loss gradient value; and update the parameters of the fully connected layer according to the loss gradient value. Figure 5 As shown, the offset generating unit 1002 can be used to execute steps 501 and 502.

[0123] Optionally, the channel extraction unit 1001 is used to: obtain a first attribute channel corresponding to a target difference dimension from a preset style feature space, where the target difference dimension is a dimension in which the difference between the channel means corresponding to the positive mean channel and the negative mean channel is greater than a preset value, the positive mean channel is the channel mean of positive samples containing attributes of the target object, and the negative mean channel is the channel mean of negative samples that do not include the target object.

[0124] Optionally, the channel extraction unit 1001 is specifically used to: obtain the positive attribute channel of each positive sample from the preset style feature space, and count the positive mean channel according to the channel mean of the positive attribute channel, and the positive attribute channel and the positive mean channel are both column vectors with a second preset dimension; obtain the negative attribute channel of each negative sample from the preset style feature space, and count the negative mean channel according to the channel mean of the negative attribute channel, and the negative attribute channel and the negative mean channel are both column vectors with a second preset dimension; find the target difference dimension according to the positive mean channel and the negative mean channel; obtain the first attribute channel corresponding to the target difference dimension. For example, Figure 7 As shown, the channel extraction unit 1001 can be used to perform steps 701 to 704.

[0125] Optionally, the image generation unit 1003 is used to: receive user input, the user input includes an offset degree parameter, and the offset degree parameter is used to indicate the degree of change in the target object attribute; in response to the user input, multiply the target channel offset with the offset degree parameter, and then perform a superposition operation with the first attribute channel, reorganize the result of the superposition operation with the preset style feature space, and generate a target image of the image to be processed according to the first reorganization result, the image to be processed and the style generation model. For example, Figure 8 As shown, the picture generation unit 1003 can be used to execute steps 801 and 802.

[0126] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0127] Fig.11 Schematic diagram of the structure of an electronic device provided by the present disclosure. Fig.11 The electronic device may include a processor 1101, a memory 1102, and a program or instruction stored in the memory 1102 and executable on the processor 1101; wherein the program or instruction, when executed by the processor 1101, implements the object attribute editing method in the above-mentioned embodiment.

[0128] In addition, the electronic device may further include a communication bus 1103 and at least one communication interface 1104 .

[0129] The processor 1101 may be a central processing unit (CPU), a microprocessing unit, an application specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the disclosed solution.

[0130] The communication bus 1103 is a signal path for transmitting information between the above components.

[0131] The communication interface 1104 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0132] The memory 1102 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1102 may exist independently and be connected to the processor 1101 via the communication bus 1104. The memory 1102 may also be integrated with the processor 1101.

[0133] The memory 1102 is used to store instructions for executing the solution of the present disclosure, and the execution is controlled by the processor 1101. The processor 1101 is used to execute the program or instructions stored in the memory 1102, so as to realize the functions in the method of the present disclosure.

[0134] As an example, combining Fig.10 The functions implemented by the channel extraction unit 1001, the offset generation unit 1002 and the picture generation unit 1003 in the object attribute editing device are similar to those Fig.11 The function of processor 1101 in is the same.

[0135] In a specific implementation, as an embodiment, the processor 1101 may include one or more CPUs, such as Fig.11 CPU0 and CPU1 in.

[0136] In a specific implementation, as an embodiment, the electronic device may include multiple processors 1101. Each of these processors 1101 may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor 1101 here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0137] In a specific implementation, as an embodiment, the electronic device may further include an output device 1105 and an input device 1106. The output device 1105 communicates with the processor 1101 and may display information in a variety of ways. For example, the output device 1105 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 1106 communicates with the processor 1101 and may receive user input in a variety of ways. For example, the input device 1106 may be a mouse, a keyboard, a touch screen device, or a sensor device.

[0138] Those skilled in the art will understand that Fig.11 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or adopt a different component arrangement. Fig.11 The electronic device in the system may be a server, a client or other device.

[0139] In addition, the present disclosure also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the electronic device can execute the object attribute editing method provided in the above embodiment.

[0140] In addition, the present disclosure also provides a computer program product, including the computer program product being stored in a non-volatile storage medium, and when the computer program product is executed by at least one processor, the electronic device executes the object attribute editing method provided in the above embodiment.

[0141] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A method for editing object attributes, characterized in that: include: In response to a target object attribute editing instruction for a to-be-processed image, extract a first attribute channel corresponding to a target object attribute in a preset style feature space; the preset style feature space is obtained by compressing a preset sample into a style feature space through a preset inversion network, the preset style feature space is a column vector with a first preset dimension, and the first attribute channel is a column vector with a second preset dimension; the preset samples include: positive samples containing the target object attribute and negative samples not containing the target object attribute; Performing a superposition operation on the initial channel offset and the first attribute channel, recombining the result of the superposition operation with the preset style feature space, and generating a target attribute image according to the second recombined result, a basic image and a style generation model, wherein the basic image is an image generated according to the style generation model and does not contain the attributes of the target object, the initial channel offset is obtained by inputting a random initial value into a fully connected layer, and the style generation model is pre-trained according to the preset samples; According to the result of the attribute classifier determining whether the target attribute image contains the target object attribute, the parameters of the fully connected layer are updated, and the random initial value is re-input into the updated fully connected layer to obtain the target channel offset; The target channel offset is superimposed on the first attribute channel, the result of the superposition operation is recombined with the preset style feature space, and a target image of the image to be processed is generated according to the first recombined result, the image to be processed and the style generation model, wherein the target image includes the target object attributes.

2. The object attribute editing method according to claim 1, characterized in that: Before extracting the first attribute channel corresponding to the target object attribute in the preset style feature space in response to the target object attribute editing instruction for the image to be processed, the method further includes: According to the preset samples, training a style generation model; The preset samples are compressed into a preset style feature space through the preset inversion network.

3. The object attribute editing method according to claim 2, characterized in that: Before updating the parameters of the fully connected layer according to the result of the attribute classifier determining whether the target attribute image contains the target object attribute and re-outputting the random initial value to the fully connected layer to obtain the target channel offset, the method further includes: According to the preset samples, an attribute classifier of the target object attribute is trained, and the attribute classifier is used to determine whether a picture contains the target object attribute.

4. The object attribute editing method according to claim 2, characterized in that: The updating of the parameters of the fully connected layer according to the result of the attribute classifier determining whether the target attribute image contains the target object attribute comprises: Inputting the judgment result into a preset loss function to obtain a loss gradient value; According to the loss gradient value, the parameters of the fully connected layer are updated.

5. The object attribute editing method according to claim 1, characterized in that: The step of extracting a first attribute channel corresponding to the target object attribute in the preset style feature space includes: From the preset style feature space, obtain a first attribute channel corresponding to a target difference dimension, wherein the target difference dimension is a dimension in which the difference between the channel means corresponding to the positive mean channel and the negative mean channel is greater than a preset value, the positive mean channel is the channel mean of positive samples containing the target object attributes, and the negative mean channel is the channel mean of negative samples not including the target object.

6. The object attribute editing method according to claim 5, characterized in that: The step of acquiring a first attribute channel corresponding to a target difference dimension from the preset style feature space includes: From the preset style feature space, a positive attribute channel of each of the positive samples is obtained, and a positive mean channel is counted according to the channel mean of the positive attribute channel, wherein both the positive attribute channel and the positive mean channel are column vectors having the second preset dimension; From the preset style feature space, a negative attribute channel of each of the negative samples is obtained, and a negative mean channel is counted according to the channel mean of the negative attribute channel, wherein both the negative attribute channel and the negative mean channel are column vectors having the second preset dimension; According to the positive mean channel and the negative mean channel, searching for a target difference dimension; Obtain a first attribute channel corresponding to the target difference dimension.

7. The object attribute editing method according to claim 1, characterized in that: The step of performing a superposition operation on the target channel offset and the first attribute channel, recombining the result of the superposition operation with the preset style feature space, and generating a target image of the image to be processed according to the first recombined result, the image to be processed and the style generation model, comprises: receiving a user input, wherein the user input includes a shift degree parameter, and the shift degree parameter is used to indicate a change degree of the target object attribute; In response to the user input, the target channel offset is multiplied by the offset degree parameter, and then superimposed with the first attribute channel, the result of the superposition operation is recombined with the preset style feature space, and a target image of the image to be processed is generated based on the first recombined result, the image to be processed and the style generation model.

8. An object attribute editing device, characterized in that: include: Channel extraction unit, offset generation unit and picture generation unit; The channel extraction unit is used to extract a first attribute channel corresponding to a target object attribute in a preset style feature space in response to a target object attribute editing instruction for a to-be-processed image; the preset style feature space is obtained by compressing a preset sample into a style feature space through a preset inversion network, the preset style feature space is a column vector with a first preset dimension, and the first attribute channel is a column vector with a second preset dimension; the preset samples include: positive samples containing the target object attribute and negative samples not containing the target object attribute; The offset generating unit is used to perform a superposition operation on the initial channel offset and the first attribute channel, reorganize the result of the superposition operation with the preset style feature space, and generate a target attribute image according to the reorganized second reorganization result, a basic image and a style generation model, wherein the basic image is an image generated according to the style generation model and does not contain the attributes of the target object, the initial channel offset is obtained by inputting a random initial value into a fully connected layer; and the style generation model is obtained by pre-training according to the preset samples; The offset generating unit is further used to update the parameters of the fully connected layer according to the judgment result of the attribute classifier on whether the target attribute picture contains the target object attribute, and re-input the random initial value into the updated fully connected layer to obtain the target channel offset; The image generation unit is used to perform a superposition operation on the target channel offset generated by the offset generation unit and the first attribute channel extracted by the channel extraction unit, reorganize the result of the superposition operation with the preset style feature space, and generate a target image of the image to be processed based on the first reorganization result of the reorganization, the image to be processed and the style generation model, wherein the target image includes the target object attributes.

9. The object attribute editing device according to claim 8, characterized in that: The device also includes: a model training unit and a space compression unit; The model training unit is used for training the style generation model according to the preset samples before the channel extraction unit extracts the first attribute channel corresponding to the target object attribute in the preset style feature space in response to the target object attribute editing instruction for the image to be processed; The space compression unit is used to compress the preset samples into a preset style feature space through the preset inversion network.

10. The object attribute editing device according to claim 8, characterized in that: The offset generating unit is further used for: The offset generation unit updates the parameters of the fully connected layer according to the judgment result of the attribute classifier on whether the target attribute picture contains the target object attribute, and re-outputs the random initial value to the fully connected layer before obtaining the target channel offset. According to the preset sample, the attribute classifier of the target object attribute is trained, and the attribute classifier is used to determine whether the picture contains the target object attribute.

11. The object attribute editing device according to claim 8, characterized in that: The offset generating unit is specifically used for: Inputting the judgment result into a preset loss function to obtain a loss gradient value; According to the loss gradient value, the parameters of the fully connected layer are updated.

12. The object attribute editing device according to claim 8, characterized in that: The channel extraction unit is used for: From the preset style feature space, obtain a first attribute channel corresponding to a target difference dimension, wherein the target difference dimension is a dimension in which the difference between the channel means corresponding to the positive mean channel and the negative mean channel is greater than a preset value, the positive mean channel is the channel mean of positive samples containing the target object attributes, and the negative mean channel is the channel mean of negative samples not including the target object.

13. The object attribute editing device according to claim 12, characterized in that: The channel extraction unit is specifically used for: From the preset style feature space, a positive attribute channel of each of the positive samples is obtained, and a positive mean channel is counted according to the channel mean of the positive attribute channel, wherein both the positive attribute channel and the positive mean channel are column vectors having the second preset dimension; From the preset style feature space, a negative attribute channel of each of the negative samples is obtained, and a negative mean channel is counted according to the channel mean of the negative attribute channel, wherein both the negative attribute channel and the negative mean channel are column vectors having the second preset dimension; According to the positive mean channel and the negative mean channel, searching for a target difference dimension; Obtain a first attribute channel corresponding to the target difference dimension.

14. The object attribute editing device according to claim 8, characterized in that: The picture generating unit is used for: receiving a user input, wherein the user input includes a shift degree parameter, and the shift degree parameter is used to indicate a change degree of the target object attribute; In response to the user input, the target channel offset is multiplied by the offset degree parameter, and then superimposed with the first attribute channel, the result of the superposition operation is recombined with the preset style feature space, and a target image of the image to be processed is generated based on the first recombined result, the image to be processed and the style generation model.

15. An electronic device, characterized in that: include: A processor, a memory, and a program or instruction stored in the memory and executable on the processor; wherein the program or instruction, when executed by the processor, implements the object attribute editing method as described in any one of claims 1-7.

16. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the object attribute editing method according to any one of claims 1 to 7 is implemented.

17. A computer program product comprising instructions, characterized in that The computer program product is stored in a non-volatile storage medium, and when the computer program product is executed by at least one processor, the object attribute editing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for recommending target object, computing device and computer storage medium

    CN111523044A

  • On-demand marshalling and de-marshalling of network messages

    US20100293283A1