WO2020186702A1 - 图像生成方法及装置、电子设备和存储介质 - Google Patents

图像生成方法及装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2020186702A1
WO2020186702A1 PCT/CN2019/104230 CN2019104230W WO2020186702A1 WO 2020186702 A1 WO2020186702 A1 WO 2020186702A1 CN 2019104230 W CN2019104230 W CN 2019104230W WO 2020186702 A1 WO2020186702 A1 WO 2020186702A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
condition information
condition
neural network
image feature
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
Application number
PCT/CN2019/104230
Other languages
English (en)
French (fr)
Inventor
刘睿
刘宇
龚新宇
王晓刚
李鸿升
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sensetime Technology Development Co Ltd
Original Assignee
Beijing Sensetime Technology Development Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Sensetime Technology Development Co Ltd filed Critical Beijing Sensetime Technology Development Co Ltd
Publication of WO2020186702A1 publication Critical patent/WO2020186702A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding

Definitions

  • the present disclosure relates to the field of computer vision technology, and in particular to an image processing method and device, electronic equipment, and storage medium.
  • Image generation is an important issue in the field of computer vision and deep learning. Machines are required to learn from a large number of natural images, so that they can generate realistic and logical images. This technology has many application scenarios, such as image synthesis, image conversion, image compression and reconstruction, etc. However, it is difficult for the existing methods to generate high-matching pictures according to the given conditions.
  • the embodiments of the present disclosure provide an image generation method and device, electronic equipment, and storage medium.
  • an image generation method which includes: acquiring predetermined condition information including a pre-generated image; performing encoding processing on the predetermined condition information to generate an image corresponding to the predetermined condition information Image features; based on the image features, a generated image corresponding to the predetermined condition information is obtained.
  • the encoding process of the predetermined condition information to generate the image feature corresponding to the predetermined condition information includes: determining the condition feature corresponding to the predetermined condition information; The feature performs the encoding process to obtain the image feature corresponding to the predetermined condition information.
  • the determining the condition feature corresponding to the predetermined condition information includes: searching for first condition information that matches the predetermined condition information in the condition space; configuring the first condition information A first identifier, and a second identifier is configured for second condition information other than the first condition information in the condition space; the first identifier and the second identifier are combined to obtain the condition feature.
  • the condition space includes posture condition information
  • the determining the condition feature corresponding to the predetermined condition information includes: in response to the predetermined condition information including predetermined posture information, The third identifier of the posture condition information is configured as the predetermined posture information; the first condition information matched by the predetermined condition information other than the predetermined posture information is searched in the condition space; the first identifier is assigned to the first condition information , And configuring a second identifier for the first condition information and the second condition information other than the posture condition information in the condition space; combining the first identifier, the second identifier, and the third identifier, The condition characteristics are obtained.
  • the condition space includes posture condition information
  • the determining the condition feature corresponding to the predetermined condition information includes: in response to the predetermined condition information not including the predetermined posture information, Configuring a fourth identifier for the posture condition information in the condition space; searching for first condition information matching the predetermined condition information in the condition space; configuring a first identifier for the first condition information, and In the condition space, the first condition information and the second condition information other than the posture condition information configure a second identifier; the first identifier, the second identifier, and the fourth identifier are combined to obtain the condition feature .
  • the configuring the fourth identifier for the posture condition information in the condition space includes at least one of the following ways: randomly configuring the fourth identifier for the posture condition information; generating using a neural network Posture information matching the predetermined condition information, and configuring the generated posture information as the fourth identifier.
  • the encoding the predetermined condition information to generate the image feature corresponding to the predetermined condition information includes: performing at least one convolution process and at least one pooling on the condition feature Processing to obtain the image characteristics.
  • the obtaining the image corresponding to the predetermined condition information based on the image feature includes: performing reverse processing on the image feature through a first neural network to obtain the information corresponding to the predetermined condition information.
  • the bidirectional processing includes: forward processing of obtaining image features corresponding to the input image based on the input image, and image features based on the input Reverse processing to obtain an image corresponding to the input image feature.
  • the first neural network includes a flow-based reversible generation network.
  • the method further includes the step of training the first neural network, which includes: obtaining a first training sample, the first training sample including: a first image sample and The first image feature corresponding to the image sample; the first image sample and the first image feature are respectively input into the first neural network to perform the two-way processing to obtain the predicted image feature corresponding to the first image sample, and The predicted image corresponding to the first image feature; based on the obtained predicted image feature and predicted image, determine the first network loss of the first neural network, and adjust the first neural network inversely according to the first network loss, until Meet the first training termination condition.
  • the first image sample and the first image feature are respectively input into the first neural network to perform the bidirectional processing, to obtain the predicted image feature corresponding to the first image sample, and to obtain The predicted image corresponding to the first image feature includes: using the forward processing of the first neural network to obtain the predicted image feature corresponding to the first image sample; and using all of the first neural network The reverse processing is performed to obtain a predicted image corresponding to the first image feature.
  • the first network loss of the first neural network is determined based on the obtained predicted image characteristics and the predicted image, and the first neural network is adjusted inversely according to the first network loss until the
  • the first training termination condition includes: obtaining the first loss value between the first image sample and the predicted image, and the second loss value between the first image feature and the predicted image feature; according to the first loss value And a second loss value to determine the first network loss; in response to a situation where the first network loss is greater than a first loss threshold, the parameters of the first neural network are adjusted until the first training termination condition is satisfied.
  • the method includes: encoding the predetermined condition information through a second neural network to generate image features corresponding to the predetermined condition information, wherein the second neural network includes self Coding network.
  • the method further includes the step of training the second neural network through a supervised network, which includes: acquiring a second training sample, the second training sample including a second image sample and Condition samples corresponding to the second image sample; use the first neural network to perform the forward processing on the second image sample to obtain the second image feature corresponding to the second image sample; use the second neural network
  • the network encodes the condition sample to obtain the third image feature corresponding to the condition sample; the supervision network is used to adjust the second neural network based on the loss value corresponding to the second image feature and the third image feature Until the second training termination condition is met.
  • the supervised network includes a discriminator, a classifier, and a conditional reconstructor, and the supervised network is used to adjust the second image feature and the loss value corresponding to the third image feature.
  • the parameters of the second neural network until the second training termination condition is satisfied including: using the discriminator to perform discrimination and confrontation processing on the second image feature and the third image feature to obtain a second image based on the discrimination network
  • the third loss value between the feature and the third image feature use the classifier to classify the second image feature and the third image feature to obtain the second image feature and the third image based on the classifier
  • the fourth loss value between the features; the condition reconstructor is used to identify the first posture condition corresponding to the third image feature, and the second posture condition input in the second neural network and the first posture condition are obtained
  • a fifth loss value between a posture condition determine the second network loss of the second neural network according to the third loss value, the fourth loss value, and the fifth loss value, and adjust the first network loss according to the second network loss Two neural networks until the second training
  • the second network loss of the second neural network is determined according to the third loss value, the fourth loss value, and the fifth loss value, and the second network loss is adjusted according to the second network loss.
  • the neural network until the second training termination condition is met including: in response to the second network loss being greater than the second loss threshold, adjusting the parameters of the second neural network until the second network loss is less than or equal to The second loss threshold is determined to satisfy the second training termination condition.
  • an image generation device which includes:
  • An obtaining module configured to obtain predetermined condition information including a pre-generated image
  • An encoding module configured to perform encoding processing on the predetermined condition information to generate image features corresponding to the predetermined condition information
  • the generating module is configured to obtain a generated image corresponding to the predetermined condition information based on the image feature.
  • the encoding module includes:
  • a determining unit configured to determine a condition feature corresponding to the predetermined condition information
  • the encoding unit is configured to perform the encoding process on the condition feature to obtain the image feature corresponding to the predetermined condition information.
  • the determining unit is further configured to search for first condition information matching the predetermined condition information in the condition space; configure a first identifier for the first condition information, and set the condition
  • the second condition information other than the first condition information in the space is configured with a second identifier; the first identifier and the second identifier are combined to obtain the condition feature.
  • the condition space includes posture condition information
  • the determining unit is further configured to configure the third identifier of the posture condition information in response to the predetermined condition information including the predetermined posture information.
  • Generate the predetermined posture information search for the first condition information that matches the predetermined condition information other than the predetermined posture information in the condition space; assign a first identifier to the first condition information, and assign the information in the condition space
  • the first condition information and the second condition information other than the posture condition information configure a second identifier; the first identifier, the second identifier, and the third identifier are combined to obtain the condition feature.
  • the condition space includes posture condition information
  • the determining unit is further configured to respond to a situation in which the predetermined posture information is not included in the predetermined condition information, as the posture condition information in the condition space.
  • Configure a fourth identifier search for first condition information matching the predetermined condition information in the condition space; configure a first identifier for the first condition information, and set the first condition information in the condition space
  • Configuring a second identifier with second condition information other than the posture condition information combining the first identifier, the second identifier, and the fourth identifier to obtain the condition feature.
  • the determining unit is configured to configure a fourth identifier for the posture condition information in the condition space in at least one of the following ways: randomly configure a fourth identifier for the posture condition information ; Use a neural network to generate posture information that matches the predetermined condition information, and configure the generated posture information as the fourth identifier.
  • the encoding module is further configured to perform at least one convolution process and at least one pooling process on the condition feature to obtain the image feature.
  • the generation module is further configured to perform reverse processing on the image features through a first neural network to obtain a generated image corresponding to the predetermined condition information; wherein, the first neural network It is configured to be capable of performing bidirectional processing, the bidirectional processing including: a forward process of obtaining an image feature corresponding to the input image based on an input image, and a reverse of obtaining an image corresponding to the input image feature based on the input image feature deal with.
  • the first neural network includes a flow-based reversible generation network.
  • the device further includes a first training module configured to train the first neural network
  • the step of training the first neural network includes: obtaining a first training sample, the first The training sample includes: a first image sample and a first image feature corresponding to the first image sample; the first image sample and the first image feature are respectively input into a first neural network to perform the bidirectional processing, and obtain The predicted image feature corresponding to the first image sample, and the predicted image corresponding to the first image feature is obtained; based on the obtained predicted image feature and predicted image, the first network loss of the first neural network is determined, and based on the A network loss reversely adjusts the first neural network until the first training termination condition is met.
  • the first training module is further configured to use the forward processing of the first neural network to obtain predicted image features corresponding to the first image sample; and use the first neural network The reverse processing of the network obtains the predicted image corresponding to the first image feature.
  • the first training module is further configured to obtain a first loss value between the first image sample and the predicted image, and a second loss between the first image feature and the predicted image feature Value; the first network loss is determined according to the first loss value and the second loss value; in response to the situation that the first network loss is greater than the first loss threshold, the parameters of the first neural network are adjusted until they are satisfied The first training termination condition.
  • the encoding module is further configured to perform encoding processing on the predetermined condition information through a second neural network to generate image features corresponding to the predetermined condition information, wherein the second neural network Including self-encoding network.
  • the device further includes a second training module configured to train the second neural network through a supervisory network
  • the step of training the second neural network includes: obtaining a second training sample,
  • the second training sample includes a second image sample and a condition sample corresponding to the second image sample;
  • the first neural network is used to perform the forward processing on the second image sample to obtain the The second image feature corresponding to the image sample;
  • the second neural network is used to encode the condition sample to obtain the third image feature corresponding to the condition sample;
  • the supervision network is based on the second image feature and the third image
  • the loss value corresponding to the feature adjusts the parameters of the second neural network until the second training termination condition is met.
  • the second training module is further configured to use the discriminator to perform discrimination and confrontation processing on the second image feature and the third image feature to obtain a second image feature based on the discrimination network
  • the third loss value between and the third image feature using the classifier to classify the second image feature and the third image feature to obtain the second image feature and the third image feature based on the classifier
  • the fifth loss value between the attitude conditions; the second network loss of the second neural network is determined according to the third loss value, the fourth loss value, and the fifth loss value, and the second network loss is adjusted according to the second network loss The neural network until the second training termination condition is met.
  • the second training module is further configured to adjust the parameters of the second neural network until the second network loss is greater than the second loss threshold. If it is less than or equal to the second loss threshold, it is determined to satisfy the second training termination condition.
  • an electronic equipment device including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the Any of the methods described.
  • a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the method described in any one of the first aspects is implemented .
  • the embodiment of the present disclosure can obtain the corresponding image feature by performing encoding processing on the predetermined condition information, and obtain the corresponding image according to the image feature, so as to achieve the effect of generating the corresponding image under the given condition, and the embodiment of the present disclosure also has the generated image The characteristic of high matching degree with predetermined condition information.
  • Fig. 1 shows a flowchart of an image generation method according to an embodiment of the present disclosure
  • Fig. 2 shows a flowchart of step S20 in an image generation method according to an embodiment of the present disclosure
  • Fig. 3 shows a flowchart of step S21 in an image generation method according to an embodiment of the present disclosure
  • Fig. 4 shows another flowchart of step S21 in an image generation method according to an embodiment of the present disclosure
  • Fig. 5 shows another flowchart of step S21 in an image generation method according to an embodiment of the present disclosure
  • Fig. 6 shows a flowchart of training a first neural network according to an embodiment of the present disclosure
  • FIG. 7 shows a flowchart of step S43 in the method for training the first neural network in an embodiment of the present disclosure
  • FIG. 8 shows a schematic diagram of a network model structure for performing an image generation method according to an embodiment of the present disclosure
  • FIG. 9 shows a network structure diagram of training a second neural network through a supervisory network according to an embodiment of the present disclosure
  • Fig. 10 shows a flowchart of training a second neural network in an image processing method according to an embodiment of the present disclosure
  • Fig. 11 shows a block diagram of an image processing device according to an embodiment of the present disclosure
  • FIG. 12 shows a block diagram of an electronic device 800 according to an embodiment of the present disclosure
  • FIG. 13 shows a block diagram of an electronic device 1900 according to an embodiment of the present disclosure.
  • the embodiment of the present disclosure provides an image generation method, which can generate an image matching the predetermined condition information according to the received predetermined condition information.
  • the method provided in the embodiments of the present disclosure can be applied to any terminal device or server, or other devices.
  • the terminal device may be a user equipment (UE, User Equipment), mobile device, cellular phone, cordless phone, personal digital assistant (PDA, Personal Digital Assistant), handheld device, computing device, vehicle-mounted device, wearable device, etc.
  • the image generation method can be implemented by a processor calling computer-readable instructions stored in a memory.
  • Fig. 1 shows a flowchart of an image generation method according to an embodiment of the present disclosure, wherein the image generation method of the embodiment of the present disclosure may include:
  • the predetermined condition information includes the predetermined conditions of the image to be generated.
  • the predetermined condition information may include scene information corresponding to the image, object type information included in the image, identification information of the object, expression information of the object, At least one of the posture and position of the object, the attribute information of the object, and other information, that is, the information related to the generated image can be used as the predetermined condition information.
  • the form of the predetermined condition information may be at least one of a voice form, a text form, and a picture form.
  • the predetermined conditions included therein can be obtained.
  • the predetermined condition information is in the form of voice
  • the keywords in the predetermined condition information can be recognized through voice recognition, so as to obtain each predetermined condition in the predetermined condition information.
  • the predetermined condition information is an emoticon picture
  • the type of emoticon in the picture can be identified by means of picture recognition, so as to obtain each predetermined condition in the predetermined condition information.
  • each predetermined condition in the predetermined condition information can be obtained through text recognition or other semantic recognition methods.
  • the embodiment of the present disclosure does not specifically limit the form of the predetermined condition information.
  • the predetermined conditions included therein can be obtained through corresponding analysis methods.
  • the method of acquiring the predetermined condition information may include at least one of the following methods: directly receiving the input predetermined condition information through the input/output interface of the electronic device, and receiving the predetermined condition information transmitted by the external electronic device through the communication component, wherein
  • the input/output interface may include: keyboard, touch screen, audio input, etc.
  • the communication component may include a Bluetooth unit, a wireless fidelity (Wi-Fi, Wireless-Fidelity) unit, a near field communication (NFC, NFC) unit, etc. It is only illustrative, and the embodiments of the present disclosure do not specifically limit this.
  • S20 Perform encoding processing on the predetermined condition information to generate image features corresponding to the predetermined condition information.
  • the image characteristics can be obtained based on the predetermined condition information.
  • the corresponding encoded feature can be obtained by performing encoding processing on the predetermined condition information, that is, the obtained image feature.
  • the encoding process may include at least one convolution process and at least one pooling process.
  • step S20 may be implemented by a neural network, which may be a trained network that can generate image features corresponding to the predetermined condition information according to the received predetermined condition information.
  • the neural network may be a self-encoding network.
  • the encoding process may also be performed using preset encoding parameters, which is not specifically limited in the embodiment of the present disclosure.
  • the image to be generated can be further obtained through the obtained image feature.
  • the generated image is an image corresponding to the received predetermined condition information.
  • the corresponding image can be directly generated from the image feature.
  • the image feature can be in the form of a vector or a matrix.
  • Each element in the image feature can represent the pixel value of each pixel of the image.
  • the corresponding image can be generated.
  • the obtaining the image corresponding to the predetermined condition information based on the image feature includes: performing reverse processing on the image feature through a first neural network to obtain the information corresponding to the predetermined condition information.
  • the bidirectional processing includes: forward processing of obtaining image features corresponding to the input image based on the input image, and image features based on the input Reverse processing to obtain an image corresponding to the input image feature.
  • image features can also be input into the first neural network, and the corresponding image can be obtained through the processing of the first neural network.
  • the first neural network may be a neural network that has been trained and can obtain a higher-precision image according to the characteristics of the received image.
  • the first neural network may be a convolutional neural network.
  • the first neural network may also be implemented as a flow-based reversible generation network.
  • the flow-based reversible generation network may be a network that has been trained to obtain image features corresponding to an image based on the received image, and can obtain an image corresponding to the image feature based on the received image feature.
  • the neural network can perform two-way processing, where the two-way processing includes forward processing of obtaining image features corresponding to the input image based on the input image, and obtaining an image corresponding to the input image feature based on the input image feature The reverse processing.
  • the embodiment of the present disclosure does not specifically limit the selection of the neural network, and it can be set according to requirements.
  • the corresponding image generated according to the received predetermined condition information by performing the corresponding encoding processing on the predetermined condition information, the accurate image characteristics are generated, and the corresponding image characteristics corresponding to the predetermined condition information can be obtained according to the image characteristics.
  • the generated image to improve the matching degree between the generated image and the predetermined condition information.
  • Fig. 2 shows a flowchart of step S20 in an image generation method according to an embodiment of the present disclosure, wherein the encoding process is performed on the predetermined condition information to generate image features corresponding to the predetermined condition information (step S20 ), can include:
  • the predetermined condition information obtained by the embodiments of the present disclosure may be in different forms, such as text, voice, and picture.
  • the analysis operation can be performed to obtain the corresponding information.
  • the predetermined conditions can then be used to determine the condition characteristics corresponding to the predetermined condition information by using the obtained predetermined conditions.
  • the embodiments of the present disclosure can realize the quantization of the predetermined condition information by converting the predetermined condition information into the form of condition characteristics, thereby facilitating the corresponding calculation operation.
  • the conditional feature of the embodiment of the present disclosure may be in the form of a vector or a matrix, and each element in the conditional feature indicates whether there is a corresponding restriction condition.
  • S22 Perform the encoding process on the condition feature to obtain the image feature corresponding to the predetermined condition information.
  • the conditional feature After obtaining the conditional feature, the conditional feature can be encoded.
  • the conditional feature can be in the form of a vector or a matrix.
  • the corresponding encoding processing result can also be in the form of a matrix or a vector.
  • the image feature obtained by encoding represents each pixel of the image.
  • the encoding processing may include at least one layer of convolution processing and at least one layer of pooling processing.
  • Fig. 3 shows a flowchart of step S21 in an image generation method according to an embodiment of the present disclosure, wherein, in some possible implementation manners, the determining the condition feature corresponding to the predetermined condition information (step S21), Can include:
  • a condition space may be preset, and the condition space may include various types of condition information, such as different scene information, object type information, expression information, posture information, and so on.
  • the scene information is used to indicate information such as the location or place corresponding to the image, for example, it may include: outdoor, indoor, park, cafe, school, etc.
  • the type information of the object may indicate the type of the object included in the image, for example, it may include a person, a man, a woman, a baby, a cat, or a dog, or it may be more specific object information, such as "Xiao Ming".
  • the embodiment of the present disclosure may also include an image library, and each image in the image library may have corresponding identification information, and the corresponding identified image can be queried according to the object information "Xiao Ming".
  • the expression information may include: crying, laughing, sadness, sadness, and so on.
  • the posture information may include "head up”, “head down”, “angle of face orientation”, etc., to indicate the posture of the object in the image, or in other embodiments may also include “running”, “jumping", “sleeping” "And other information.
  • the foregoing is only an exemplary description of the condition information included in the condition space.
  • the condition information included in the condition space can be set according to requirements. In other embodiments, other types or quantities of condition information may also be included. This is not the case in the embodiments of the present disclosure. Make specific restrictions.
  • the predetermined condition in the predetermined condition information can be matched with each condition information in the condition space, and the first matching condition information in the condition space can be found.
  • matching means that the found first condition information is the same condition information as the predetermined condition information.
  • the predetermined condition information is bangs and glasses
  • the first condition information is bangs and glasses.
  • each condition information in the condition space can be divided into two categories, one of which is the first condition information, and the other is the second condition information.
  • the first condition information is related to the predetermined condition information.
  • a condition that each predetermined condition matches, and the second condition information is a condition that does not match each predetermined condition in the predetermined condition information.
  • S212 Configure a first identifier for the first condition information, and configure a second identifier for second condition information other than the first condition information in the condition space.
  • a first identifier can be configured for each first condition information, and the first identifier is used to indicate that the corresponding condition information is each predetermined condition in the predetermined condition information .
  • a second identifier for the second condition information other than the first condition information in the condition space, and the second identifier is used to indicate that the corresponding condition information is not any predetermined condition in the predetermined condition information.
  • the first identifier and the second identifier are different identifiers.
  • the first identifier may be "1" and the second identifier may be "0".
  • the first identifier and the second identifier may also be Other identifiers can be used as embodiments of the present disclosure as long as they can distinguish the first condition information from the second condition information.
  • the identifier configured for each condition information in the condition space can be obtained.
  • the first identifier and the second identifier can be arranged and combined to obtain the condition feature vector (condition feature).
  • each condition information included in the condition space has a fixed sequence. After the identifier of each condition information is obtained, the corresponding first identifier and second identifier can be combined according to the order of each condition information in the condition space, Get the corresponding condition characteristics.
  • condition feature can be the identification value corresponding to each condition information in the condition space, so as to realize the quantization of the predetermined condition information and facilitate subsequent encoding processing operations.
  • the predetermined condition information may include posture condition information related to the posture of the object in the image.
  • a corresponding identifier can be configured for the posture condition information and the corresponding condition feature can be generated. Different implementations are described separately below.
  • the condition space includes posture condition information;
  • the predetermined condition information can include predetermined posture information, that is, the predetermined condition information gives the predetermined posture conditions of the object in the image, and it can be directly
  • the predetermined posture information is used as the third identifier of the posture condition information in the condition space.
  • Fig. 4 shows another flowchart of step S21 in an image generation method according to an embodiment of the present disclosure, wherein, in some possible implementation manners, the determining the condition feature corresponding to the predetermined condition information (step S21 ), can also include:
  • the predetermined posture information included in the predetermined condition information can be directly determined as the third identifier of the posture condition information in the condition space.
  • the predetermined posture information included in the predetermined posture information may be any value from "-1" to "1", which indicates the angle of the front of the object in the image.
  • the conversion of the numerical value corresponding to the predetermined posture information can be obtained by analyzing the predetermined condition information. For example, the angle representing the posture condition in the predetermined condition information can be divided by 360 to obtain the corresponding value.
  • the rounded value is used as the above-mentioned third identifier.
  • the above-mentioned value corresponding to the predetermined posture information may also be directly input, which is not specifically limited in the embodiment of the present disclosure.
  • S2112 Search for first condition information that matches predetermined condition information other than the predetermined posture information in the condition space.
  • the embodiments of the present disclosure can divide each condition information in the condition space into two categories.
  • One category is condition information matching predetermined condition information, which may include posture condition information matching the predetermined posture information, and other than posture condition information.
  • the rest of the information other than the first condition information matches the predetermined condition information
  • the second category is the second condition information that does not match the predetermined condition information.
  • S2113 Assign a first identifier to the first condition information, and configure a second identifier for each second condition information other than the first condition information and the posture condition information in the condition space.
  • a first identifier can be configured for each first condition information.
  • the first identifier is used to indicate that the corresponding condition information is each predetermined condition in the predetermined condition information.
  • a second identifier for the second condition information that does not match the predetermined condition information in the condition space, and the second identifier is used to indicate that the corresponding condition information is not any predetermined condition in the predetermined condition information.
  • the first identifier and the second identifier are different identifiers.
  • the first identifier may be "1" and the second identifier may be "0".
  • the first identifier and the second identifier may also be Other identifiers can be used as embodiments of the present disclosure as long as they can distinguish the first condition information from the second condition information.
  • the configuration of the identifiers of the first condition information, the second condition information, and the posture condition information in the condition space is completed.
  • each condition information included in the condition space has a fixed sequence. After the identifier of each condition information is obtained, the corresponding first identifier, second identifier, and corresponding first identifier, second identifier, and corresponding condition information can be combined in the order of each condition information in the condition space.
  • the third mark is to obtain the corresponding condition feature.
  • the predetermined condition information may not include the predetermined posture information.
  • a fourth identifier may be configured for the posture condition information in the condition space.
  • FIG. 5 shows another flowchart of step S21 in an image generation method according to an embodiment of the present disclosure, wherein, in some possible implementation manners, the determination of the condition feature corresponding to the predetermined condition information (step S21 ), can also include:
  • the fourth identifier may be configured for the posture condition information in the condition space in a preset manner.
  • a fourth identifier may be randomly configured for the posture condition information.
  • the fourth indicator can be any value from “-1" to "1", indicating the angle of the front of the object in the image.
  • the fourth identifier may be randomly configured for the posture condition information in the condition space.
  • a neural network may also be used to generate posture information matching the predetermined condition information, and the generated posture information is configured as the fourth identifier. That is, in the embodiments of the present disclosure, a trained neural network can be used to generate posture information matching predetermined condition information.
  • the neural network may be a convolutional neural network, and the neural network may receive predetermined posture information and output posture information matching the predetermined condition information. The combination of the posture information and the predetermined condition information can make the generated image have a better posture angle.
  • the posture information matching the predetermined condition information can be obtained through the neural network completed through the above training, and the obtained posture information can be used as the fourth identifier of the posture condition information in the condition space.
  • S21112 Search for first condition information that matches the predetermined condition information in the condition space.
  • the embodiments of the present disclosure can divide each condition information in the condition space into three categories, one category is the first condition information matching the predetermined condition information, the second category is the posture condition information, and the third category is the predetermined condition information.
  • S21113 Configure a first identifier for the first condition information, and configure a second identifier for second condition information other than the first condition information and the posture condition information in the condition space.
  • a first identifier can be configured for each first condition information.
  • the first identifier is used to indicate that the corresponding condition information is each predetermined condition in the predetermined condition information.
  • a second identifier for the second condition information that does not match the predetermined condition information except for the posture condition information in the condition space, and the second identifier is used to indicate that the corresponding condition information is not any predetermined condition in the predetermined condition information.
  • the first identifier and the second identifier are different identifiers.
  • the first identifier may be "1" and the second identifier may be "0".
  • the first identifier and the second identifier may also be Other identifiers can be used as embodiments of the present disclosure as long as they can distinguish the first condition information from the second condition information.
  • the configuration of the identifiers of the first condition information, the second condition information, and the posture condition information in the condition space is completed.
  • S21114 Combine the first identifier, the second identifier, and the fourth identifier to obtain the condition feature.
  • each condition information included in the condition space has a fixed sequence. After the identifier of each condition information is obtained, the corresponding first identifier, second identifier, and corresponding first identifier, second identifier, and corresponding condition information can be combined in the order of each condition information in the condition space. The fourth mark is to get the corresponding condition feature.
  • the condition feature corresponding to the predetermined condition information can be obtained.
  • encoding processing can be performed on the condition feature to obtain the image feature corresponding to the predetermined condition information.
  • the encoding process may include at least one convolution process and at least one pooling process.
  • the convolution kernel used in each pooling process may be the same or different. For example, a 1*1 convolution kernel may be used, or The 3*3 convolution kernel can be set according to requirements.
  • the pooling process may also use the same parameter or different parameters, which is not specifically limited in the embodiment of the present disclosure.
  • each feature information in conditional features can be further extracted.
  • the dimension of conditional features can be adjusted to the same dimension as that of the image, or the dimension of conditional features can be adjusted to the configured preset. Set the dimension to convert the image feature of the preset dimension into the corresponding image.
  • step S30 may be executed to obtain a corresponding image using the image feature.
  • the pixel value of each pixel indicated in the image feature can be directly used to obtain the corresponding image.
  • a first neural network may be used to obtain corresponding images through image features.
  • the first neural network may be a neural network that can be trained to convert image features into images with higher accuracy.
  • Such as convolutional neural network Such as convolutional neural network.
  • the first neural network may also be a neural network capable of performing bidirectional processing, where the bidirectional processing includes: forward processing of obtaining image features corresponding to the input image based on the input image, and A reverse process of obtaining an image corresponding to the input image feature based on the input image feature.
  • image features can be converted into corresponding images by inputting image features into the first neural network, and the reverse processing of the first neural network can convert image features into corresponding images.
  • the reverse processing process can include: dimensionality reduction processing (sample ), reversible convolution processing (convolution), channel equalization processing (Affine Coupling), regularization processing (ActNom) and lightweight processing (squeeze). Among them, the reversible convolution processing, channel equalization processing, and regularization processing can be repeated multiple times, thereby improving the accuracy of the obtained image.
  • the method includes: encoding the predetermined condition information through a second neural network to generate image features corresponding to the predetermined condition information, wherein the second neural network Neural networks include self-encoding networks.
  • FIG. 8 shows a schematic diagram of a network model for performing an image generation method according to an embodiment of the present disclosure, that is, a first neural network that performs bidirectional processing.
  • the model A may be a first neural network that generates an image corresponding to it based on the obtained image features.
  • the first neural network may be a flow-based reversible generation network.
  • Model B is a second neural network that determines condition features based on predetermined condition information.
  • the second neural network may be a self-encoding neural network. Models A and B can achieve the effect of obtaining corresponding images according to predetermined condition information.
  • the predetermined condition information received by the embodiment of the present disclosure may include "the blonde girl H without glasses", where the predetermined conditions in the predetermined condition information can be obtained: blonde hair, without glasses, girl H (which can be in the image The identification ID of the object), so when the predetermined condition information can be input to the second neural network, the first identification corresponding to the blonde and the girl H in the condition space can be configured as "1", and the identification corresponding to the glasses can be configured as " 0", get the conditional characteristics of the Cs part.
  • the posture condition information in the condition space can also be configured with a posture information identifier Cu (fourth identifier), for example, it can be set to "0.2", and then the Cs and Cu part identifiers are connected to form a condition feature.
  • the condition feature is input into the encoder to perform encoding processing, where the encoding parameters of the encoding processing are determined through training, which is not specifically limited in the embodiments of the present disclosure, and the corresponding image feature Z can be obtained through the encoding processing.
  • the image feature Z can be input to the first neural network, and the image corresponding to the image feature Z can be obtained by using the reverse processing of the first neural network.
  • the first neural network may be individually trained through the first training sample.
  • the first training sample may include a first image sample and a first feature sample corresponding to the first image sample.
  • Fig. 6 shows a flowchart of training a first neural network according to an embodiment of the present disclosure.
  • the training of the first neural network includes:
  • S41 Acquire a first training sample, where the first training sample includes: a plurality of first image samples and a first image feature corresponding to each first image sample.
  • the first image sample is an image
  • the first image feature is an image feature corresponding to the image.
  • the first image sample is used as the input of the network, and the first image feature can be used as the supervision sample.
  • the first image feature is used as the input of the network, and the first image sample is used as the supervision sample.
  • S42 Input the first image sample and the first image feature into the first neural network to perform the bidirectional processing, obtain the predicted image feature corresponding to the first image sample, and obtain the predicted image feature corresponding to the first image feature The predicted image.
  • the forward processing of the first neural network can be used to obtain the predicted image feature corresponding to the first image sample; and the reverse processing of the first neural network can be used to obtain the predicted image feature corresponding to the first image.
  • the predicted image corresponding to the image feature can be used to obtain the predicted image feature corresponding to the image feature.
  • the optimization of the first neural network can be performed according to the obtained prediction result.
  • the embodiment of the present disclosure can determine the first loss value of the first neural network according to the first loss value between the predicted image and the input first image sample and the second loss value between the predicted image feature and the input first image feature.
  • a network loss and adjust the parameters of the first neural network according to the first network loss until the first training termination condition is met, that is, the first network loss is less than or equal to the first loss threshold.
  • FIG. 7 shows a flowchart of step S43 in the method for training the first neural network in an embodiment of the present disclosure.
  • the first network loss of the first neural network is determined based on the obtained predicted image characteristics and predicted image, and the first neural network is adjusted inversely according to the first network loss until the first training termination condition is satisfied, include:
  • S431 Obtain a first loss value between the first image sample and the predicted image, and a second loss value between the first image feature and the predicted image feature.
  • the first loss value may represent the difference between the first image sample and the predicted image
  • the second loss value may represent the difference between the first image feature and the predicted image feature
  • S432 Determine the first network loss according to the first loss value and the second loss value.
  • the first network loss may be equal to the weighted sum of the first loss value and the second loss value, and the weight of each loss value may be preset, such as 0.6 and 0.4, respectively, but the embodiment of the present disclosure There is no specific restriction on this.
  • S433 In response to the situation that the loss of the first network is greater than the first loss threshold, reversely adjust the parameters of the first neural network until the loss of the first network is less than or equal to the first loss threshold, and it is determined that the loss is satisfied The first training termination condition.
  • the obtained first network loss when the obtained first network loss is less than or equal to the first loss threshold, it can be determined to meet the training requirements. At this time, the training of the first neural network can be terminated, and the obtained first neural network can be accurately The corresponding feature can be obtained from the input image, and the corresponding image can be obtained inversely according to the obtained feature. Conversely, when the loss of the first network is greater than the first loss threshold, the parameters of the first neural network can be adjusted, such as adjusting convolution parameters, normalization parameters, etc., specifically determined according to the specific architecture of the neural network, until the first The network loss is less than or equal to the first loss threshold, and it is determined that the first training termination condition is satisfied.
  • FIG. 9 shows a network structure diagram of training a second neural network through a supervisory network according to an embodiment of the present disclosure.
  • Fig. 10 shows a flowchart of training a second neural network in an image processing method according to an embodiment of the present disclosure.
  • the step of training the second neural network through a supervisory network includes:
  • S51 Obtain a second training sample, where the second training sample includes a plurality of second image samples and a condition sample corresponding to each second image sample;
  • S52 Use the first neural network to perform the forward processing on the image sample to obtain a second image feature corresponding to the image sample;
  • S53 Use a second neural network to perform encoding processing on the condition sample to obtain a third image feature corresponding to the condition sample;
  • S54 Use the supervision network to adjust the parameters of the second neural network based on the loss values corresponding to the second image feature and the third image feature until the second training termination condition is satisfied.
  • the image generation processing of the embodiment of the present disclosure can be performed together through the trained first neural network, and the optimized training of the second neural network can be performed according to the generated image.
  • the training samples used in training the second neural network may include image samples and condition samples corresponding to the image samples, and the condition samples may include all condition information of the corresponding image samples.
  • the second image sample can be input to the first neural network, and the forward processing is performed by the first neural network to obtain the second image feature corresponding to the second image sample.
  • the second image feature can be used as a monitoring process True characteristics.
  • conditional sample can also be input to the second neural network, and the conditional feature of the conditional sample can be obtained through the second neural network, and the coding process of the conditional feature is further executed to generate the third image feature corresponding to the conditional sample.
  • the second image feature output by the first neural network and the third image feature output by the second neural network are input to the supervision network, and the second neural network is adjusted based on the loss value between the second image feature and the third image feature through the supervision network The parameters of the network until the training requirements are met.
  • the supervision network includes a discriminator, a classifier, and a conditional reconstructor
  • the utilization supervision network is based on the loss values corresponding to the second image feature and the third image feature
  • Adjusting the parameters of the second neural network until the second training termination condition is satisfied includes: using the discriminator to perform discrimination and confrontation processing on the second image feature and the third image feature to obtain a network based on the discrimination network The third loss value between the second image feature and the third image feature; using the classifier to classify the second image feature and the third image feature to obtain the second image feature based on the classifier
  • the fourth loss value between the third image feature and the third image feature using the condition reconstructor to identify the first posture condition corresponding to the third image feature, and obtain the second posture condition input in the second neural network
  • the fifth loss value between the first posture condition and the first posture condition; the second network loss of the second neural network is determined according to the third loss value, the fourth loss value, and the fifth loss value, and according to the second network loss
  • the second neural network is adjusted until
  • the supervisory network may include three units, namely a discriminator Di, a classifier C, and a conditional reconstructor De.
  • the discriminator Di can be a generative adversarial network, which can be used to distinguish the true and false of the second image feature and the third image feature.
  • the true and false situation between the features indicates that the third image feature generated by the second neural network is close to or reaches the real second image feature.
  • the discriminator Di is a parameterized and adjustable discriminator neural network. Its input is the third image feature, and the output is 0 or 1, indicating whether the third image feature and the second image feature can be distinguished respectively.
  • the discrimination processing can obtain the first loss value based on the third image feature and the second image feature of the discriminator. Wherein, the first loss value can be obtained according to the first way, and the expression of the first way can be:
  • L Di represents the loss function of the discriminator Di
  • Di ⁇ (z) represents the discrimination result of the third image feature z corresponding to each condition sample input by the discriminator Di
  • E z ⁇ p*(z) represents the input image
  • the expectation of the distribution P * (z) of the second image feature Z* corresponding to the sample Represents the expectation of the distribution P(z) of each third image feature z corresponding to the input condition sample.
  • the loss function can be adjusted by feedback so that the discriminator Di finally reaches: input the second image feature z* into the discriminator Di to obtain Calculate the expected log value E z ⁇ p*(z) , make it successfully determine the correct identification '1', input the third image feature z into Di, and find the expected log value Make it successfully judge the error flag '0'.
  • the second image feature and the third image feature can also be input to the classifier C, and the classification process is performed by the classifier C to obtain the classification results of the second image feature and the third image feature.
  • the classification result obtained by C determines the second loss value between the second image feature and the third image feature.
  • the second loss value can be obtained according to the second way, and the expression of the second way can be:
  • the corresponding expectation of the classification result of the corresponding second image feature Z* Represents the expectation corresponding to the classification result of the third image feature z corresponding to each condition sample.
  • the classifier C is a parameterized adjustable classifier neural network.
  • the input of the embodiment of the present disclosure may be the third image feature z, and the output is the condition vector Cs (the vector corresponding to the classification result of the third image feature z).
  • the loss function can be adjusted by feedback to make the classifier finally achieve: input the second image feature Z* and the third image feature z into the classifier C, and obtain the expectation of their log values respectively, so that they can successfully obtain the corresponding conditions
  • the vector Cs that is, the classification results of the second image feature and the third image feature are the same, which indicates that the third image feature Z output by the second neural network corresponds to the real second image feature Z*.
  • the embodiment of the present disclosure can also input the obtained third image feature into the conditional reconstructor De, which can be used to reconstruct the posture condition Cu in the second neural network.
  • the generated third image feature may include the first posture condition
  • the condition sample may include the real second posture condition
  • the condition reconstructor De can obtain the third loss value corresponding to the first posture condition and the second posture condition.
  • the third loss value can be obtained according to the third way, and the expression of the third way can be:
  • L De represents the loss function of the conditional reconstructor De
  • the conditional reconstructor De is a parameterized and adjustable classifier neural network.
  • the input is an image feature z and the output is the hidden condition vector Cu .
  • the loss function can be adjusted by feedback to make the conditional reconstructor De finally reach: input each second image feature z corresponding to the condition sample into De, and obtain the expectation of its log Make it succeed in obtaining the corresponding hidden condition vector Cu.
  • the weighted sum processing of each loss value can be performed to obtain the second network loss of the second neural network, and then the parameters of the second neural network can be feedback adjusted until the training requirement is met.
  • the network loss value of the second neural network can be obtained according to the preset loss function, and the expression of the loss function can be:
  • L represents the loss function of the second neural network
  • ⁇ s is the weight of Ls
  • the L FM is a regularization function
  • the square difference is obtained by extracting a certain layer of feature layer f(z) in the neural network of the supervision module, so that the third image feature z is more easily approached to the second image feature Z*
  • the loss function is the loss function of the flow-based reversible generating network.
  • the second network loss of the second neural network is determined according to the third loss value, the fourth loss value, and the fifth loss value, and adjusted according to the second network loss The second neural network until the second training termination condition is met, including: in response to the second network loss being greater than a second loss threshold, adjusting the parameters of the second neural network until the second network loss If it is less than or equal to the second loss threshold, it is determined to satisfy the second training termination condition.
  • the loss value of the network is obtained, that is, when the second network loss of the second neural network is less than the second loss threshold, it can be determined that the second training termination condition is satisfied, otherwise the second training termination condition is not satisfied. In the case of feedback adjustment of the parameters of the second neural network. Then the optimized second neural network can be obtained.
  • the training of the first neural network and the second neural network can be completed, that is, the image generation process can be performed through each network completed by the training.
  • the embodiments of the present disclosure can obtain corresponding image features by performing encoding processing on predetermined condition information, and obtain corresponding images according to the reverse processing of image features, so as to achieve the effect of generating corresponding images under given conditions.
  • the writing order of the steps does not mean a strict execution order but constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possibility.
  • the inner logic is determined.
  • the present disclosure also provides image generation devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any image generation method provided in the present disclosure.
  • image generation devices electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any image generation method provided in the present disclosure.
  • FIG. 11 shows a block diagram of an image processing apparatus according to an embodiment of the present disclosure.
  • the image processing apparatus of an embodiment of the present disclosure may include:
  • the obtaining module 10 is configured to obtain predetermined condition information including a pre-generated image
  • the encoding module 20 is configured to perform encoding processing on the predetermined condition information to generate image features corresponding to the predetermined condition information;
  • the generating module 30 is configured to obtain a generated image corresponding to the predetermined condition information based on the image feature.
  • the encoding module 20 includes:
  • a determining unit configured to determine a condition feature corresponding to the predetermined condition information
  • the encoding unit is configured to perform the encoding process on the condition feature to obtain the image feature corresponding to the predetermined condition information.
  • the determining unit is further configured to search for first condition information matching the predetermined condition information in the condition space; configure a first identifier for the first condition information, and set the condition
  • the second condition information other than the first condition information in the space is configured with a second identifier; the first identifier and the second identifier are combined to obtain the condition feature.
  • the condition space includes posture condition information
  • the determining unit is further configured to configure the third identifier of the posture condition information in response to the predetermined condition information including the predetermined posture information.
  • Generate the predetermined posture information search for the first condition information that matches the predetermined condition information other than the predetermined posture information in the condition space; assign a first identifier to the first condition information, and assign the information in the condition space
  • the first condition information and the second condition information other than the posture condition information configure a second identifier; the first identifier, the second identifier, and the third identifier are combined to obtain the condition feature.
  • the condition space includes posture condition information
  • the determining unit is further configured to respond to a situation in which the predetermined posture information is not included in the predetermined condition information, as the posture condition information in the condition space.
  • Configure a fourth identifier search for first condition information matching the predetermined condition information in the condition space; configure a first identifier for the first condition information, and set the first condition information in the condition space
  • Configuring a second identifier with second condition information other than the posture condition information combining the first identifier, the second identifier, and the fourth identifier to obtain the condition feature.
  • the determining unit is configured to configure a fourth identifier for the posture condition information in the condition space in at least one of the following ways: randomly configure a fourth identifier for the posture condition information ; Use a neural network to generate posture information that matches the predetermined condition information, and configure the generated posture information as the fourth identifier.
  • the encoding module is further configured to perform at least one convolution process and at least one pooling process on the condition feature to obtain the image feature.
  • the generation module is further configured to perform reverse processing on the image features through a first neural network to obtain a generated image corresponding to the predetermined condition information; wherein, the first neural network It is configured to be capable of performing bidirectional processing, the bidirectional processing including: a forward process of obtaining an image feature corresponding to the input image based on an input image, and a reverse of obtaining an image corresponding to the input image feature based on the input image feature deal with.
  • the first neural network includes a flow-based reversible generation network.
  • the device further includes a first training module configured to train the first neural network
  • the step of training the first neural network includes: obtaining a first training sample, the first The training sample includes: a first image sample and a first image feature corresponding to the first image sample; the first image sample and the first image feature are respectively input into a first neural network to perform the bidirectional processing, and obtain The predicted image feature corresponding to the first image sample, and the predicted image corresponding to the first image feature is obtained; based on the obtained predicted image feature and predicted image, the first network loss of the first neural network is determined, and based on the A network loss reversely adjusts the first neural network until the first training termination condition is met.
  • the first training module is further configured to use the forward processing of the first neural network to obtain predicted image features corresponding to the first image sample; and use the first neural network The reverse processing of the network obtains the predicted image corresponding to the first image feature.
  • the first training module is further configured to obtain a first loss value between the first image sample and the predicted image, and a second loss between the first image feature and the predicted image feature Value; the first network loss is determined according to the first loss value and the second loss value; in response to the situation that the first network loss is greater than the first loss threshold, the parameters of the first neural network are adjusted until they are satisfied The first training termination condition.
  • the encoding module is further configured to perform encoding processing on the predetermined condition information through a second neural network to generate image features corresponding to the predetermined condition information, wherein the second neural network Including self-encoding network.
  • the device further includes a second training module configured to train the second neural network through a supervisory network
  • the step of training the second neural network includes: obtaining a second training sample,
  • the second training sample includes a second image sample and a condition sample corresponding to the second image sample;
  • the first neural network is used to perform the forward processing on the second image sample to obtain the The second image feature corresponding to the image sample;
  • the second neural network is used to encode the condition sample to obtain the third image feature corresponding to the condition sample;
  • the supervision network is based on the second image feature and the third image
  • the loss value corresponding to the feature adjusts the parameters of the second neural network until the second training termination condition is met.
  • the second training module is further configured to use the discriminator to perform discrimination and confrontation processing on the second image feature and the third image feature to obtain a second image feature based on the discrimination network
  • the third loss value between and the third image feature using the classifier to classify the second image feature and the third image feature to obtain the second image feature and the third image feature based on the classifier
  • the fifth loss value between the attitude conditions; the second network loss of the second neural network is determined according to the third loss value, the fourth loss value, and the fifth loss value, and the second network loss is adjusted according to the second network loss The neural network until the second training termination condition is met.
  • the second training module is further configured to adjust the parameters of the second neural network until the second network loss is greater than the second loss threshold. If it is less than or equal to the second loss threshold, it is determined to satisfy the second training termination condition.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • brevity, here No longer refer to the description of the above method embodiments.
  • the embodiments of the present disclosure also provide a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above-mentioned method when executed by a processor.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • An embodiment of the present disclosure also provides an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured as the above method.
  • the electronic device can be provided as a terminal, server or other form of device.
  • FIG. 12 shows a block diagram of an electronic device 800 according to an embodiment of the present disclosure.
  • the electronic device 800 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and other terminals.
  • the electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , And communication component 816.
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the foregoing method.
  • the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components.
  • the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
  • the memory 804 is configured to store various types of data to support operations in the electronic device 800. Examples of these data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc.
  • the memory 804 can be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic Disk Magnetic Disk or Optical Disk.
  • the power supply component 806 provides power for various components of the electronic device 800.
  • the power supply component 806 may include a power management system, one or more power supplies, and other components associated with the generation, management, and distribution of power for the electronic device 800.
  • the multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC).
  • the microphone is configured to receive external audio signals.
  • the received audio signal may be further stored in the memory 804 or transmitted via the communication component 816.
  • the audio component 810 further includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module.
  • the peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
  • the sensor component 814 includes one or more sensors for providing the electronic device 800 with various aspects of state evaluation.
  • the sensor component 814 can detect the on/off status of the electronic device 800 and the relative positioning of the components.
  • the component is the display and the keypad of the electronic device 800.
  • the sensor component 814 can also detect the electronic device 800 or the electronic device 800.
  • the position of the component changes, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration/deceleration of the electronic device 800, and the temperature change of the electronic device 800.
  • the sensor component 814 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact.
  • the sensor component 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof.
  • the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the electronic device 800 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field A programmable gate array (FPGA), controller, microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • ASIC application specific integrated circuits
  • DSP digital signal processors
  • DSPD digital signal processing devices
  • PLD programmable logic devices
  • FPGA field A programmable gate array
  • controller microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • a non-volatile computer-readable storage medium such as a memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to complete the foregoing method.
  • FIG. 13 shows a block diagram of an electronic device 1900 according to an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server. 13
  • the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs.
  • the application program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • a non-volatile computer-readable storage medium such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to complete the foregoing method.
  • the present disclosure may be a system, method, and/or computer program product.
  • the computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the present disclosure.
  • the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory flash memory
  • SRAM static random access memory
  • CD-ROM compact disk read-only memory
  • DVD digital versatile disk
  • memory stick floppy disk
  • mechanical encoding device such as a printer with instructions stored thereon
  • the computer-readable storage medium used here is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
  • the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • the network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
  • the computer program instructions used to perform the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, or in one or more programming languages.
  • Source code or object code written in any combination, the programming language includes object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages.
  • Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to access the Internet connection).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions.
  • the computer-readable program instructions are executed to realize various aspects of the present disclosure.
  • These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processor of the computer or other programmable data processing device , A device that implements the functions/actions specified in one or more blocks in the flowchart and/or block diagram is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner, so that the computer-readable medium storing instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction contains one or more functions for implementing the specified logical function.
  • Executable instructions may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

一种图像生成方法及装置、电子设备和存储介质,所述方法包括:获取包含预生成图像的预定条件信息(S10);对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征(S20);基于所述图像特征得到与所述预定条件信息对应的生成图像(S30)。所述方法能够简单方便的通过预定条件信息生成对应的图像。

Description

图像生成方法及装置、电子设备和存储介质
相关申请的交叉引用
本申请基于申请号为201910205219.8、申请日为2019年3月18日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。
技术领域
本公开涉及计算机视觉技术领域,尤其涉及一种图像处理方法及装置、电子设备和存储介质。
背景技术
图像生成是计算机视觉和深度学习领域的重要问题,要求机器可以从大量自然图像中进行学习,从而可以生成逼真的、符合自然逻辑的图片。该技术有很多应用场景,比如图像合成、图像转换、图像的压缩与重构等。然而已有的方法很难根据给定的条件生成高匹配度的图片的技术问题。
发明内容
本公开实施例提供了一种图像生成方法及装置、电子设备和存储介质。
根据本公开实施例的第一方面,提供了一种图像生成方法,其包括:获取包含预生成图像的预定条件信息;对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征;基于所述图像特征得到与所述预定条件信息对应的生成图像。
在一些可能的实施方式中,所述对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,包括:确定与所述预定条件信息对应的条件特征;对所述条件特征执行所述编码处理,得到与所述预定条件信息对应的图像特征。
在一些可能的实施方式中,所述确定与所述预定条件信息对应的条件特征,包括:在条件空间中查找与所述预定条件信息匹配的第一条件信息;为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息以外的第二条件信息配置第二标识;对所述第一标识和所述第二标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述条件空间包括姿态条件信息,所述确定与所述预定条件信息对应的条件特征,包括:响应于所述预定条件信息中包括预定姿态信息的情况,将所述姿态条件信息的第三标识配置成所述预定姿态信息;在条件空间中查找所述预定姿态信息以外的预定条件信息所匹配的第一条件信息;为所述第一条件信息分配第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;对所述第一标识、所述第二标识和第三标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述条件空间包括姿态条件信息,所述确定与所述预定条件信息对应的条件特征,包括:响应于所述预定条件信息中不包括预定姿态信息的情况,为所述条件空间中的姿态条件信息配置第四标识;在所述条件空间中查找与所述预定条件信息匹配的第一条件信息;为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;对所述第一标识、所述第二标识和第四标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述为所述条件空间中的姿态条件信息配置第四标识,包括以下方式中的至少一种:为所述姿态条件信息随机配置第四标识;利用神经网络生成与所述预定条件信息匹配的姿态信息,并将生成的所述姿态信息配置成所述第四标识。
在一些可能的实施方式中,所述对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,包括:对所述条件特征执行至少一次卷积处理和至少一次池化处理,得到所述图像特征。
在一些可能的实施方式中,所述基于所述图像特征得到与所述预定条件信息对应的图像,包括:通过第一神经网络对所述图像特征执行反向处理,得到与所述预定条件信息对应的生成图像;其中,所述第一神经网络配置为能够执行双向处理,所述双向处理包括:基于输入图像获得与所述输入图像对应的图像特征的正向处理,以及基于输入的图像特征获得与该输入的图像特征对应的图像的反向处理。
在一些可能的实施方式中,所述第一神经网络包括基于流的可逆生成网络。
在一些可能的实施方式中,所述方法还包括训练所述第一神经网络的步骤,其包括:获取第一训练样本,所述第一训练样本包括:第一图像样本和与所述第一图像样本对应的第一图像特征;将所述第一图像样本和第一图像特征分别输入至第一神经网络中执行所述双向处理,得到与第一图像样本对应的预测图像特征,以及得到与所述第一图像特征对应的预测图像;基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件。
在一些可能的实施方式中,所述将所述第一图像样本和第一图像特征分别输入至第一神经网络中执行所述双向处理,得到与第一图像样本对应的预测图像特征,以及得到与所述第一图像特征对应的预测图像,包括:利用所述第一神经网络的所述正向处理,得到与第一图像样本对应的预测图像特征;以及利用所述第一神经网络的所述反向处理,得到与所述第一图像特征对应的预测图像。
在一些可能的实施方式中,所述基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件,包括:获得第一图像样本和预测图像之间的第一损失值,以及第一图像特征和所述预测图像特征之间的第二损失值;根据所述第一损失值和第二损失值确定所述第一网络损失;响应于所述第一网络损失大于第一损失阈值的情况,调整所述第一神经网络的参数,直至满足所述第一训练终止条件。
在一些可能的实施方式中,所述方法包括:通过第二神经网络对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,其中,所述第二神经网络包括自编码网络。
在一些可能的实施方式中,所述方法还包括:通过监督网络训练所述第二神经网络的步骤,其包括:获取第二训练样本,所述第二训练样本包括第二图像样本以及与所述第二图像样本对应的条件样本;利用所述第一神经网络对所述第二图像样本执行所述正向处理,得到与所述第二图像样本对应的第二图像特征;利用第二神经网络对所述条件样本进行编码处理,得到与所述条件样本对应的第三图像特征;利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足第二训练终止条件。
在一些可能的实施方式中,所述监督网络包括辨别器、分类器和条件重构器,所述利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足所述第二训练终止条件,包括:利用所述辨别器对所述第二图像特征和第三图像特征进行辨别对抗处理,得到基于所述辨别网络的第二图像特征和第三图像特征之间的第三损失值;利用所述分类器对所述第二图像特征和第三图像特征进行分类处理,得到基于所述分类器的第二图像特征和第三图像特征之间的第四损失值;利用所述条件重构器识别所述第三图像特征对应的第一姿态条件,并得到所述第二神经网络中的输入的第二姿态条件和所述第一姿态条件之间的第五损失值;根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足所述第二训练终止条件。
在一些可能的实施方式中,所述根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足第二训练终止条件,包括:响应于所述第二网络损失大于第二损失阈值的情况,调整所述第二神经网络的参数,直至所述第二网络损失小于或者等于所述第二损失阈值,确定为满足所述第二训练终止条件。
根据本公开实施例的第二方面,提供了一种图像生成装置,其包括:
获取模块,配置为获取包含预生成图像的预定条件信息;
编码模块,配置为对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征;
生成模块,配置为基于所述图像特征得到与所述预定条件信息对应的生成图像。
在一些可能的实施方式中,所述编码模块包括:
确定单元,配置为确定与所述预定条件信息对应的条件特征;
编码单元,配置为对所述条件特征执行所述编码处理,得到与所述预定条件信息对应的图像特征。
在一些可能的实施方式中,所述确定单元还配置为在条件空间中查找与所述预定条件信息匹配的第一条件信息;为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息以外的第二条件信息配置第二标识;对所述第一标识和所述第二标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述条件空间包括姿态条件信息,所述确定单元还配置为响应于所述预定条件信息中包括预定姿态信息的情况,将所述姿态条件信息的第三标识配置成所述预定姿态信息;在条件空间中查找所述预定姿态信息以外的预定条件信息所匹配的第一条件信息;为所述第一条件信息分配第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;对所述第一标识、所述第二标识和第三标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述条件空间包括姿态条件信息,所述确定单元还配置为响应于所述预定条件信息中不包括预定姿态信息的情况,为所述条件空间中的姿态条件信息配置第四标识;在所述条件空间中查找与所述预定条件信息匹配的第一条件信息;为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;对所述第一标识、所述第二标识和第四标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述确定单元,配置为通过以下方式中的至少一种方式为所述条件空间中的姿态条件信息配置第四标识:为所述姿态条件信息随机配置第四标识;利用神经网络生成与所述预定条件信息匹配的姿态信息,并将生成的所述姿态信息配置成所述第四标识。
在一些可能的实施方式中,所述编码模块还配置为对所述条件特征执行至少一次卷积处理和至少一次池化处理,得到所述图像特征。
在一些可能的实施方式中,所述生成模块还配置为通过第一神经网络对所述图像特征执行反向处理,得到与所述预定条件信息对应的生成图像;其中,所述第一神经网络配置为能够执行双向处理,所述双向处理包括:基于输入图像获得与所述输入图像对应的图像特征的正向处理,以及基于输入的图像特征获得与该输入的图像特征对应的图像的反向处理。
在一些可能的实施方式中,所述第一神经网络包括基于流的可逆生成网络。
在一些可能的实施方式中,所述装置还包括第一训练模块,配置为训练所述第一神经网络,并且训练所述第一神经网络的步骤包括:获取第一训练样本,所述第一训练样本包括:第一图像样本和与所述第一图像样本对应的第一图像特征;将所述第一图像样本和第一图像特征分别输入至第一神经网络中执行所述双向处理,得到与第一图像样本对应的预测图像特征,以及得到与所述第一图像特征对应的预测图像;基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件。
在一些可能的实施方式中,所述第一训练模块还配置为利用所述第一神经网络的所述正向处理,得到与第一图像样本对应的预测图像特征;以及利用所述第一神经网络的所述反向处理,得到与所述第一图像特征对应的预测图像。
在一些可能的实施方式中,所述第一训练模块还配置为获得第一图像样本和预测图像之间的第一损失值,以及第一图像特征和所述预测图像特征之间的第二损失值;根据所述第一损失值和第二损失值确定所述第一网络损失;响应于所述第一网络损失大于第一损失阈值的情况,调整所述第一神经网络的参数,直至满足所述第一训练终止条件。
在一些可能的实施方式中,所述编码模块还配置为通过第二神经网络对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,其中,所述第二神经网络包括自编码网络。
在一些可能的实施方式中,所述装置还包括第二训练模块,配置为通过监督网络训练所述第二神经网络的步骤,该训练第二神经网络的步骤包括:获取第二训练样本,所述第二训练样本包括第二图像样本以及与所述第二图像样本对应的条件样本;利用所述第一神经网络对所述第二图像样本执行所述正向处理,得到与所述第二图像样本对应的第二图像特征;利用第二神经网络对所述条件样本进行编码处理,得到与所述条件样本对应的第三图像特征;利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足第二训练终止条件。
在一些可能的实施方式中,所述第二训练模块还配置为利用所述辨别器对所述第二图像特征和第三图像特征进行辨别对抗处理,得到基于所述辨别网络的第二图像特征和第三图像特征之间的第三损失值;利用所述分类器对所述第二图像特征和第三图像特征进行分类处理,得到基于所述分类 器的第二图像特征和第三图像特征之间的第四损失值;利用所述条件重构器识别所述第三图像特征对应的第一姿态条件,并得到所述第二神经网络中的输入的第二姿态条件和所述第一姿态条件之间的第五损失值;根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足所述第二训练终止条件。
在一些可能的实施方式中,所述第二训练模块还配置为响应于所述第二网络损失大于第二损失阈值的情况,调整所述第二神经网络的参数,直至所述第二网络损失小于或者等于所述第二损失阈值,确定为满足所述第二训练终止条件。
根据本公开实施例的第三方面,提供了一种电子设备装置,其包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为:执行第一方面中任意一项所述的方法。
根据本公开实施例的第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现第一方面中任意一项所述的方法。
本公开实施例能够通过对预定条件信息执行编码处理,得到对应的图像特征,并根据图像特征得到相应的图像,从而达到给定条件生成相应图像的效果,并且本公开实施例还具有生成的图像与预定条件信息的匹配度较高的特点。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开实施例。
根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开实施例的一种图像生成方法的流程图;
图2示出根据本公开实施例的一种图像生成方法中步骤S20的流程图;
图3示出根据本公开实施例的一种图像生成方法中步骤S21的流程图;
图4示出根据本公开实施例的一种图像生成方法中步骤S21的另一流程图;
图5示出根据本公开实施例的一种图像生成方法中步骤S21的另一流程图;
图6示出根据本公开实施例训练第一神经网络的流程图;
图7示出本公开实施例训练第一神经网络的方法中步骤S43的流程图;
图8示出根据本公开实施例中执行图像生成方法的网络模型结构示意图;
图9示出根据本公开实施例通过监督网络训练第二神经网络的网络结构图;
图10示出根据本公开实施例的一种图像处理方法中训练第二神经网络的流程图;
图11示出根据本公开实施例的一种图像处理装置的框图;
图12示出根据本公开实施例的一种电子设备800的框图;
图13示出根据本公开实施例的一种电子设备1900的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。
本公开实施例提供了一种图像生成方法,其可以根据接收的预定条件信息,生成与该预定条件信息匹配的图像。本公开实施例提供的方法可以应用在任意的终端设备或者服务器,或者其他设备中。终端设备可以为用户设备(UE,User Equipment)、移动设备、蜂窝电话、无绳电话、个人数字处理(PDA,Personal Digital Assistant)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该图像生成方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。上述仅为设备的示例性说明,不作为本公开实施例的具体限定,在其他实施例中,也可以通过其他能够执行图像处理的设备实现。
图1示出根据本公开实施例的一种图像生成方法的流程图,其中,本公开实施例的所述图像生成方法可以包括:
S10:获取包含预生成图像的预定条件信息。
本公开实施例中,预定条件信息包括所要生成的图像的预定条件,例如该预定条件信息可以包括图像所对应的场景信息、图像中包括的对象类型信息、对象的标识信息、对象的表情信息、对象的姿态和位置、对象的属性信息等信息中的至少一种信息,即与生成的图像有关的信息都可以作为预定条件信息。
在一些可能的实施方式中,预定条件信息的形式可以为语音形式、文字形式、图片形式等中的至少一种,通过对预定条件信息进行解析,即可以获取其中包括的各预定条件。例如,在预定条件信息为语音形式时,可以通过语音识别的方式识别出其中的关键词,从而获得预定条件信息中的各预定条件。或者,在预定条件信息为表情图片时,则可以通过图片识别的方式识别其中的表情类型,从而获得预定条件信息中的各预定条件。或者,在预定条件信息为文字形式时,可以通过文字识别或者其他语义识别的方式得到预定条件信息中的各预定条件。本公开实施例对预定条件信息的形式不作具体限制,对于不同类型的预定条件信息,可以通过相应的解析方式得到其中所包括的预定条件。
另外,获取预定条件信息的方式可以包括以下方式中的至少一种:通过电子设备的输入/输出接口直接接收输入的所述预定条件信息,通过通信组件接收外部电子设备传输的预定条件信息,其中输入/输出接口可以包括:键盘、触控屏、音频输入等,通信组件可以包括蓝牙单元、无线保真(Wi-Fi,Wireless-Fidelity)单元、近场通信(NFC,NFC)单元等,上述仅为示例性说明,本公开实施例对此不做具体限定。
S20:对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征。
本公开实施例中,在获得预定条件信息之后,即可以基于预定条件信息得到图像特征。其中,可以通过对预定条件信息执行编码处理,得到相应的编码后的特征,即为得到的图像特征。其中编码处理可以包括至少一次卷积处理和至少一次池化处理。
在一些可能的实施方式中,步骤S20可以通过神经网络实现,该神经网络可以为经过训练的可以根据接收的预定条件信息对应的生成与该预定条件信息对应的图像特征的网络。例如,该神经网络可以为自编码网络。或者在其他实施例中,编码处理也可以利用预设的编码参数来执行,本公开实施例对此不作具体限定。
S30:基于所述图像特征得到与所述预定条件信息对应的生成图像。
在通过步骤S20获得图像特征之后,即可以通过得到的该图像特征进一步获得所要生成的图像。该生成图像即为与接收的预定条件信息对应匹配的图像。
在一些可能的实施方式中,可以直接通过图像特征生成对应的图像,例如图像特征可以为向量或矩阵形式,图像特征中的各元素可以表示图像的各像素点的像素值,根据各像素值即可以生成相应的图像。
在一些可能的实施方式中,所述基于所述图像特征得到与所述预定条件信息对应的图像,包括:通过第一神经网络对所述图像特征执行反向处理,得到与所述预定条件信息对应的生成图像;其中,所述第一神经网络配置为能够执行双向处理,所述双向处理包括:基于输入图像获得与所述输入图像对应的图像特征的正向处理,以及基于输入的图像特征获得与该输入的图像特征对应的图像的反向处理。
本实施方式中还可以将图像特征输入至第一神经网络中,通过第一神经网络的处理得到对应的图像。其中,该第一神经网络可以为经过训练的,且能够根据接收的图像特征得到较高精度的图像的神经网络。例如该第一神经网络可以为卷积神经网络。或者,在其他实施例中,该第一神经网络也可以为基于流的可逆生成网络实现。该基于流的可逆生成网络可以为经过训练能够根据接收的图像得到与图像对应的图像特征,以及能够根据接收的图像特征得到与该图像特征对应的图像的网络。 即该神经网络能够执行双向处理,其中,所述双向处理包括基于输入图像获得与所述输入图像对应的图像特征的正向处理,以及基于输入的图像特征获得与该输入的图像特征对应的图像的反向处理。对于神经网络的选取本公开实施例对此不做具体限定,其可以根据需求进行设定。
通过上述实施例的配置,即可以实现根据接收的预定条件信息生成的对应的图像,通过对预定条件信息执行相应的编码处理,生成精确的图像特征,并根据该图像特征得到与预定条件信息对应的生成图像,从而提高生成的图像与预定条件信息的匹配度。
下面对本公开实施例的各过程进行详细说明。图2示出根据本公开实施例的一种图像生成方法中步骤S20的流程图,其中,所述对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征(步骤S20),可以包括:
S21:确定与所述预定条件信息对应的条件特征。
如上述实施例所述,本公开实施例获取的预定条件信息可以为不同形式的信息,如可以文字、语音、图片形式,在获得不同形式的预定条件信息之后,可以执行解析操作,得到对应的预定条件,继而可以利用得到的各预定条件确定预定条件信息对应的条件特征。本公开实施例通过将预定条件信息转换成条件特征的形式可以实现预定条件信息的量化,从而方便相应的运算操作。本公开实施例的条件特征可以为向量或者矩阵形式,条件特征中的各元素表示是否具有相应的限定条件。
S22:对所述条件特征执行所述编码处理,得到与所述预定条件信息对应的所述图像特征。
在获得条件特征之后,即可以对条件特征进行编码处理,其中条件特征可以为向量或者矩阵形式,对应的得到的编码处理结果也可以为矩阵或者向量形式,编码得到的图像特征表示图像的各像素点的像素值信息。其中,编码处理可以包括至少一层的卷积处理以及至少一层的池化处理。
通过上述实施例,即可以实现通过预定条件信息得到对应的图像特征,下面对步骤S20的各步骤进行详细说明。图3示出根据本公开实施例的一种图像生成方法中步骤S21的流程图,其中,在一些可能的实施方式中,所述确定与所述预定条件信息对应的条件特征(步骤S21),可以包括:
S211:在条件空间中查找与所述预定条件信息匹配的第一条件信息;
本公开实施例中,可以预先设定有条件空间,该条件空间中可以包括各种类型的条件信息,例如可以包括不同的场景信息、对象类型信息、表情信息、姿态信息等。其中,场景信息用于表示该图像对应的位置或者场所等信息,例如可以包括:户外、室内、公园、咖啡厅、学校等等。对象的类型信息可以表示图像中包括的对象的类型,例如可以包括人、男人、女人、婴儿,猫、狗,或者也可以为更为具体的对象信息,例如可以为“小明”。对应的,本公开实施例还可以包括图像库,图像库中的各图像可以具有相应的标识信息,根据对象信息“小明”即可以查询到与之对应标识的图像。表情信息可以包括:哭、笑、悲伤、难过等等。姿态信息可以包括“抬头”、“低头”、“面部朝向的角度”等等,以用来表示图像中对象的姿态,或者在其他实施例中也可以包括“跑”、“跳”、“睡觉”等信息。上述仅为示例性说明条件空间中包括的条件信息,条件空间中包括的条件信息可以根据需求设定,在其他实施例中也可以包括其他类型或者数量的条件信息,本公开实施例对此不做具体限定。
由于预先设定有条件空间,因此,在获得预定条件信息之后,可以将该预定条件信息中的预定条件与条件空间中的各条件信息进行匹配,查找到条件空间中与预定条件信息匹配的第一条件信息。其中,匹配是指,查找到的第一条件信息是与预定条件信息相同的条件信息,例如,预定条件信息为刘海、眼镜,则第一条件信息为刘海、眼镜。在本公开实施例中,可以将条件空间中的各项条件信息分成两类,其中一类为第一条件信息,另一类为第二条件信息,第一条件信息是与预定条件信息中的各预定条件匹配的条件,第二条件信息是与预定条件信息中各预定条件不匹配的条件。
S212:为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息以外的第二条件信息配置第二标识。
对应的,在查找到与预定条件信息匹配的第一条件信息之后,即可以为各第一条件信息配置第一标识,第一标识用于表示相应的条件信息为预定条件信息中的各预定条件。以及还可以为条件空间中的第一条件信息以外的第二条件信息配置第二标识,该第二标识用于表示相应的条件信息不是预定条件信息中的任意预定条件。其中,第一标识和第二标识为不同的标识,例如第一标识可以为“1”,第二标识可以为“0”,在其他的实施例中,第一标识和第二标识也可以为其他的标识,只要能够区分第一条件信息和第二条件信息即可以作为本公开实施例。
S213:对所述第一标识和所述第二标识进行组合,得到所述条件特征。
基于步骤S212,即可以获得为条件空间中各条件信息配置的标识,如第一标识或者第二标识,本公开实施例可以将各第一标识和第二标识排列组合,得到条件特征向量(条件特征)。本公开实施 例中,条件空间中包括的各条件信息具有固定的顺序,在得到各条件信息的标识之后,可以按照条件空间中的各条件信息的顺序组合相应的第一标识和第二标识,得到对应的条件特征。
在本公开实施例中,条件特征即可以为与条件空间中的各条件信息对应的标识值,从而实现预定条件信息的量化,方便后续的编码处理操作。
上述实施例为条件空间中与预定条件信息匹配的第一条件信息和与预定条件信息不匹配的第二条件信息分配不同的标识,实现条件特征的确定过程。在另一些可能的实施方式中,预定条件信息中可以包括与图像中的对象姿态相关的姿态条件信息,本公开实施例可以为该姿态条件信息配置相应的标识,并对应的生成条件特征。下面针对不同的实施方式进行分别说明。
在本公开的另一些实施方式中,所述条件空间包括姿态条件信息;预定条件信息中可以包括预定姿态信息,即预定条件信息中给出了关于图像中对象的预定姿态条件,此时可以直接将该预定姿态信息作为条件空间中的姿态条件信息的第三标识。图4示出根据本公开实施例的一种图像生成方法中步骤S21的另一流程图,其中,在一些可能的实施方式中,所述确定与所述预定条件信息对应的条件特征(步骤S21),还可以包括:
S2111:响应于所述预定条件信息中包括预定姿态信息的情况,将所述姿态条件信息的第三标识配置成所述预定姿态信息。
即如上述所述,可以直接将预定条件信息中包括的预定姿态信息确定为条件空间中的姿态条件信息的第三标识。例如。本公开实施例中,预定姿态信息中包括的预定姿态信息可以为从“-1”到“1”之间的任意数值,表示对象的正面在图像中朝向角度。该预定姿态信息对应的数值的转换可以是对预定条件信息进行解析的过程得到的,例如将预定条件信息中的表示姿态条件的角度除以360,即可以得到对应的数值,将该数值或者该数值取整后的数值作为上述第三标识,在其他实施例中,上述与预定姿态信息对应的数值也可以是直接输入的,本公开实施例对此不作具体限定。
S2112:在条件空间中查找所述预定姿态信息以外的预定条件信息所匹配的第一条件信息。
同理,本公开实施例可以将条件空间中的各条件信息分成两类,一类是与预定条件信息匹配的条件信息,其中,可以包括与预定姿态信息匹配的姿态条件信息,以及除了姿态条件信息以外的其余与预定条件信息匹配的第一条件信息,第二类是与预定条件信息不匹配的第二条件信息。
S2113:为所述第一条件信息分配第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的各第二条件信息配置第二标识。
同样的,在查找到与预定条件信息匹配的第一条件信息之后,即可以为各第一条件信息配置第一标识,第一标识用于表示相应的条件信息为预定条件信息中的各预定条件。以及还可以为条件空间中与预定条件信息不匹配的第二条件信息配置第二标识,该第二标识用于表示相应的条件信息不是预定条件信息中的任意预定条件。其中,第一标识和第二标识为不同的标识,例如第一标识可以为“1”,第二标识可以为“0”,在其他的实施例中,第一标识和第二标识也可以为其他的标识,只要能够区分第一条件信息和第二条件信息即可以作为本公开实施例。
通过上述实施例,即完成了条件空间中第一条件信息、第二条件信息以及姿态条件信息的标识的配置。
S2114:对所述第一标识、所述第二标识和第三标识进行组合,得到所述条件特征。
基于上述步骤,即可以获得为条件空间中各条件信息配置的标识,如第一标识、第二标识或者第三标识,本公开实施例可以将各第一标识、第二标识和第三标识排列组合,得到条件特征向量(条件特征)。本公开实施例中,条件空间中包括的各条件信息具有固定的顺序,在得到各条件信息的标识之后,可以按照条件空间中的各条件信息的顺序组合相应的第一标识、第二标识和第三标识,得到对应的条件特征。
在另一些可能的实施方式中,预定条件信息中可能不包括预定姿态信息,此时可以为条件空间中的姿态条件信息配置第四标识。图5示出根据本公开实施例的一种图像生成方法中步骤S21的另一流程图,其中,在一些可能的实施方式中,所述确定与所述预定条件信息对应的条件特征(步骤S21),还可以包括:
S21111:响应于所述预定条件信息中不包括预定姿态信息的情况,为所述条件空间中的姿态条件信息配置第四标识。
本公开实施例中,在预定条件信息中不包括预定姿态信息的情况下,可以按照预设的方式为条件空间中的姿态条件信息配置第四标识。
在一些可能的实施方式中,可以为所述姿态条件信息随机配置第四标识。例如,同第三标识一样,第四标识可以为从“-1”到“1”之间的任意数值,表示对象的正面在图像中朝向角度。本公开 实施例在生成条件特征的过程中,可以随机的为条件空间中的姿态条件信息配置第四标识。
或者,在另一些可能的实施方式中,也可以利用神经网络生成与所述预定条件信息匹配的姿态信息,并将生成的所述姿态信息配置成所述第四标识。即在本公开实施例中,可以通过一个经过训练的神经网络生成与预定条件信息匹配的姿态信息。该神经网络可以为卷积神经网络,并且该神经网络可以接收预定姿态信息,输出与该预定条件信息匹配的姿态信息。该姿态信息与预定条件信息的结合,能够使得生成的图像具有较好的姿态角度。
本公开实施例,即可以通过上述训练完成的神经网络得到与预定条件信息匹配的姿态信息,并可以将该得到的姿态信息作为条件空间中的姿态条件信息的第四标识。
S21112:在所述条件空间中查找与所述预定条件信息匹配的第一条件信息。
同理,本公开实施例可以将条件空间中的各条件信息分成三类,一类是与预定条件信息匹配的第一条件信息,第二类为姿态条件信息,第三类是与预定条件信息不匹配的且不是姿态条件信息的第二条件信息。
S21113:为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识。
同样的,在查找到与预定条件信息匹配的第一条件信息之后,即可以为各第一条件信息配置第一标识,第一标识用于表示相应的条件信息为预定条件信息中的各预定条件。以及还可以为条件空间中除了姿态条件信息以外的与预定条件信息不匹配的第二条件信息配置第二标识,该第二标识用于表示相应的条件信息不是预定条件信息中的任意预定条件。其中,第一标识和第二标识为不同的标识,例如第一标识可以为“1”,第二标识可以为“0”,在其他的实施例中,第一标识和第二标识也可以为其他的标识,只要能够区分第一条件信息和第二条件信息即可以作为本公开实施例。
通过上述实施例,即完成了条件空间中第一条件信息、第二条件信息以及姿态条件信息的标识的配置。
S21114:对所述第一标识、所述第二标识和第四标识进行组合,得到所述条件特征。
基于上述步骤,即可以获得为条件空间中各条件信息配置的标识,如第一标识、第二标识或者第四标识,本公开实施例可以将各第一标识、第二标识和第四标识排列组合,得到条件特征向量(条件特征)。本公开实施例中,条件空间中包括的各条件信息具有固定的顺序,在得到各条件信息的标识之后,可以按照条件空间中的各条件信息的顺序组合相应的第一标识、第二标识和第四标识,得到对应的条件特征。
通过上述实施例可以得到预定条件信息对应的条件特征,在得到条件特征之后,可以对条件特征执行编码处理进而得到与预定条件信息对应的图像特征。其中编码处理可以包括至少一次卷积处理和至少一次池化处理,其中,每次池化处理所采用的卷积核可以相同也可以不同,例如可以采用1*1的卷积核,也可以采用3*3的卷积核,具体可以根据需求设定。另外,池化处理也可以采用相同的参数或者也可以采用不同的参数,本公开实施例对此不作具体限定。通过卷积处理和池化处理可以进一步提取条件特征中的各特征信息,同时还可以将条件特征的维度调整成为与图像的维度相同的维度,或者说可以将条件特征的维度调整成配置的预设维度,从而将该预设维度的图像特征转换成相应的图像。
在公开的一种可选实施例中,在得到图像特征之后,即可以执行步骤S30利用该图像特征得到相应的图像。
在一些可能的实施方式中,可以直接利用图像特征中表示的各像素点的像素值得到相应的图像。
在一些可能的实施方式中,可以通过第一神经网络实现通过图像特征得到相应的图像,该第一神经网络可以为经过训练后可以实现从图像特征转换成精确度较高的图像的神经网络,如卷积神经网络。
在另一些可能的实施方式中,第一神经网络也可以为能够执行双向处理的神经网络,其中所述双向处理包括:基于输入图像获得与所述输入图像对应的图像特征的正向处理,以及基于输入的图像特征获得与该输入的图像特征对应的图像的反向处理。本公开实施例可以通过将图像特征输入至该第一神经网络中,通过第一神经网络的反向处理将图像特征转换为对应的图像,其中反向处理的过程可以包括:降维处理(sample)、可逆卷积处理(convolution)、通道均分处理(Affine Coupling)、正则化处理(ActNom)以及轻量化处理(squeeze)。其中,可逆卷积处理、通道均分处理、正则化处理可以重复多次,从而提高得到的图像的精确度。
在本公开的一种可能的实施方式中,所述方法包括:通过第二神经网络对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,其中,所述第二神经网络包括自编码网络。
为了更加清楚的体现本公开实施例的具体过程,下面举例说明。图8示出根据本公开实施例中执行图像生成方法的网络模型,即执行双向处理的第一神经网络的结构示意图。其中,模型A可以为基于得到的图像特征生成与之对应的图像的第一神经网络,例如第一神经网络可以为基于流的可逆生成网络。模型B为基于预定条件信息确定条件特征的第二神经网络,例如第二神经网络可以为自编码神经网络。通过模型A和B即可以实现根据预定条件信息得到相应的图像的效果。具体过程如下:本公开实施例接收的预定条件信息可以包括“不带眼镜的金发女孩H”,其中可以获得预定条件信息中的预定条件为:金发、不带眼镜、女孩H(可以是图像中对象的标识ID),因此可以将该预定条件信息输入至第二神经网络时,在条件空间中金发和女孩H对应的第一标识即可以配置成“1”,眼镜对应的标识可以配置成“0”,得到Cs部分的条件特征。进一步地,还可以为条件空间中的姿态条件信息配置一姿态信息的标识Cu(第四标识),例如可以设置成“0.2”,进而将Cs和Cu部分的标识连接,并构成条件特征。将该条件特征输入至编码器中执行编码处理,其中,编码处理的编码参数为经过训练确定的,本公开实施例对此不作具体限定,通过编码处理即可以得到对应的图像特征Z。
在得到图像特征Z之后,即可以将图像特征Z输入至第一神经网络,利用第一神经网络的反向处理即可以得到与图像特征Z对应的图像。
上述仅为本公开实施例的示例性说明,不作为本公开实施例的具体限定。
下面对本公开实施例的第一神经网络和第二神经网络的训练过程进行具体说明。其中,对于第一神经网络可以通过第一训练样本进行单独的训练,例如第一训练样本可以包括第一图像样本以及与第一图像样本对应的第一特征样本。图6示出根据本公开实施例训练第一神经网络的流程图。其中,所述训练所述第一神经网络,包括:
S41:获取第一训练样本,所述第一训练样本包括:多个第一图像样本和与每个第一图像样本对应的第一图像特征。
其中,第一图像样本为图像,第一图像特征为与图像对应的图像特征。在正向处理过程中,第一图像样本作为网络的输入,第一图像特征可以作为监督样本,在反向处理过程中第一图像特征作为网络的输入,第一图像样本作为监督样本。
S42:将所述第一图像样本和第一图像特征分别输入至第一神经网络中执行所述双向处理,得到与第一图像样本对应的预测图像特征,以及得到与所述第一图像特征对应的预测图像。
本公开实施例可以利用所述第一神经网络的所述正向处理得到与第一图像样本对应的预测图像特征;以及利用所述第一神经网络的所述反向处理得到与所述第一图像特征对应的预测图像。
在得到预测图像特征以及预测图像之后,可以根据得到的预测结果执行第一神经网络的优化。
S43:基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件。
其中,本公开实施例可以根据预测图像与输入的第一图像样本之间的第一损失值以及预测图像特征与输入的第一图像特征之间的第二损失值,确定第一神经网络的第一网络损失,并根据该第一网络损失调整第一神经网络的参数,直至满足第一训练终止条件,即所述第一网络损失小于或者等于所述第一损失阈值。
其中,图7示出本公开实施例训练第一神经网络的方法中步骤S43的流程图。其中,所述基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件,包括:
S431:获得第一图像样本和预测图像之间的第一损失值,以及第一图像特征和所述预测图像特征之间的第二损失值。
其中,第一损失值可以表示第一图像样本和预测图像之间的差值,以及第二损失值可以表示第一图像特征和所述预测图像特征之间的差值。
S432:根据所述第一损失值和第二损失值确定所述第一网络损失。
本公开实施例中,第一网络损失可以等于第一损失值和第二损失值的加权和,各损失值的权重可以为预先设定的,如可以分别为0.6和0.4,但本公开实施例对此不做具体限定。
S433:响应于所述第一网络损失大于第一损失阈值的情况,反向调节所述第一神经网络的参数,直至所述第一网络损失小于或者等于所述第一损失阈值,确定为满足所述第一训练终止条件。
本公开实施例,在得到的第一网络损失小于或等于第一损失阈值时,即可以确定为满足训练要求,此时可以终止第一神经网络的训练,得到的第一神经网络即可以精确的通过输入的图像得到其对应的特征,并能够根据得到的特征反向得到对应的图像。反之,在第一网络损失大于第一损失阈 值时,可以调整第一神经网络的参数,例如调节卷积参数、归一化参数等等,具体根据神经网络的具体架构确定,直至所述第一网络损失小于或者等于所述第一损失阈值,确定为满足所述第一训练终止条件。
对于第二神经网络的训练,本公开实施例可以引入监督网络对其进行训练。图9示出根据本公开实施例通过监督网络训练第二神经网络的网络结构图。图10示出根据本公开实施例的一种图像处理方法中训练第二神经网络的流程图。所述通过监督网络训练所述第二神经网络的步骤,包括:
S51:获取第二训练样本,所述第二训练样本包括多个第二图像样本以及与每个第二图像样本对应的条件样本;
S52:利用第一神经网络对所述图像样本执行所述正向处理,得到与所述图像样本对应的第二图像特征;
S53:利用第二神经网络对所述条件样本进行编码处理,得到与所述条件样本对应的第三图像特征;
S54:利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足第二训练终止条件。
其中,在对第二神经网络进行训练时,可以通过训练好的第一神经网络一起执行本公开实施例的图像生成处理,并根据生成的图像执行第二神经网络的优化训练。
在训练第二神经网络时采用的训练样本可以包括图像样本以及与所述图像样本对应的条件样本,该条件样本可以包括对应的图像样本的全部条件信息。
其中,可以将第二图像样本输入至第一神经网络,通过第一神经网络执行正向处理得到与该第二图像样本对应的第二图像特征,该第二图像特征可以用于作为监督过程的真实特征。
另外,还可以将条件样本输入至第二神经网络,通过第二神经网络可以获得条件样本的条件特征,并进一步执行条件特征的编码处理,进而生成条件样本对应的第三图像特征。
将第一神经网络输出的第二图像特征以及第二神经网络输出的第三图像特征输入至监督网络,通过监督网络基于第二图像特征和第三图像特征之间的损失值,调节第二神经网络的参数,直至满足训练要求。
在本公开的一种可选实施例中,所述监督网络包括辨别器、分类器和条件重构器,所述利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足所述第二训练终止条件,包括:利用所述辨别器对所述第二图像特征和第三图像特征进行辨别对抗处理,得到基于所述辨别网络的第二图像特征和第三图像特征之间的第三损失值;利用所述分类器对所述第二图像特征和第三图像特征进行分类处理,得到基于所述分类器的第二图像特征和第三图像特征之间的第四损失值;利用所述条件重构器识别所述第三图像特征对应的第一姿态条件,并得到所述第二神经网络中的输入的第二姿态条件和所述第一姿态条件之间的第五损失值;根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足所述第二训练终止条件。
在一示例中,如图9所示,监督网络可以包括三个单元,分别为辨别器Di、分类器C和条件重构器De。辨别器Di可以为生成对抗网络,其可以用于辨别第二图像特征和第三图像特征的真假情况,在第二神经网络优化完成时,辨别器无法分辨出第二图像特征和第三图像特征之间的真假情况,此时说明第二神经网络生成的第三图像特征接近或者达到真实的第二图像特征。辨别器Di为一个参数化可调节的辨别器神经网络,其输入为第三图像特征,输出为0或1,分别表示能否辨别出第三图像特征和第二图像特征,通过该辨别器的辨别处理可以得到基于辨别器的第三图像特征和第二图像特征的第一损失值。其中,可以根据第一方式得到该第一损失值,第一方式的表达式可以为:
Figure PCTCN2019104230-appb-000001
其中,L Di表示辨别器Di的损失函数,D iφ(z)表示辨别器Di针对输入的各条件样本对应的第三图像特征z的辨别结果,E z~p*(z)表示输入的图像样本对应的第二图像特征Z*的分布P *(z)的期望,
Figure PCTCN2019104230-appb-000002
表示输入的条件样本对应的各第三图像特征z的分布P(z)的期望,该损失函数可以通过反馈调节使得该辨别器Di最终达到:将第二图像特征z*输入辨别器Di,求出其log值的期望E z~p*(z),使其成功判断出正确标识‘1’,将第三图像特征z输入Di,求出其log值的期望
Figure PCTCN2019104230-appb-000003
使其成功判断出错误标识‘0’。
另外,还可以将第二图像特征和第三图像特征输入至分类器C,通过分类器C进行分类处理得到与第二图像特征和第三图像特征的分类结果,对应的,还可以基于分类器C得到的分类结果确定第二图像特征和第三图像特征之间的第二损失值。其中,可以根据第二方式得到该第二损失值,第二方式的表达式可以为:
Figure PCTCN2019104230-appb-000004
其中,Lc表示分类器C对应的损失函数,其中分类器C的分类结果表示为C=logq φ(Cs|z),E z~p*(z),Cs~p(Cs)表示各图像样本对应的第二图像特征Z*的分类结果对应的期望,
Figure PCTCN2019104230-appb-000005
表示各条件样本对应的第三图像特征z的分类结果对应的期望。分类器C为一个参数化可调节的分类器神经网络,本公开实施例的输入可以为第三图像特征z,输出为条件向量Cs(对于第三图像特征z的分类结果对应的向量)。该损失函数可以通过反馈调节使得该分类器最终达到:将第二图像特征Z*和第三图像特征z输入分类器C,分别求出其log值的期望,均使其成功得出相应的条件向量Cs,即第二图像特征和第三图像特征的分类结果相同,此时表明第二神经网络输出的第三图像特征Z与真实的第二图像特征Z*对应。
进一步地,本公开实施例还可以将得到的第三图像特征输入至条件重构器De中,该条件重构器De可以用于重构第二神经网络中的姿态条件Cu。其中,生成的第三图像特征可以包括第一姿态条件,条件样本中可以包括真实的第二姿态条件,条件重构器De可以获得该第一姿态条件和第二姿态条件对应的第三损失值。其中,可以根据第三方式得到该第三损失值,第三方式的表达式可以为:
Figure PCTCN2019104230-appb-000006
其中,L De表示条件重构器De的损失函数,条件重构器De的重构结果De=q φ(Cu|z),
Figure PCTCN2019104230-appb-000007
表示各条件样本对应的第三图像特征的重构结果Cu的分布期望,该条件重构器De为一个参数化可调节的分类器神经网络,输入为一个图像特征z,输出为隐藏条件向量Cu。该损失函数可以通过反馈调节使得该条件重构器De最终达到:将条件样本对应的各第二图像特征z输入De,求出其log值的期望
Figure PCTCN2019104230-appb-000008
使其成功得出相应的隐藏条件向量Cu。
在得到各损失值后,即可以将各损失值执行加权和处理得到第二神经网络的第二网络损失,进而反馈调节第二神经网络的参数,直至满足训练要求。其中,可以按照预设损失函数得到第二神经网络的网络损失值,该损失函数的表达式可以为:
Figure PCTCN2019104230-appb-000009
其中,L表示第二神经网络的损失函数,λ s为Ls的权重,
Figure PCTCN2019104230-appb-000010
该L FM为一正则化函数,通过将监督模块神经网络中的某一层特征层f(z)提取出来求平方差,使得第三图像特征z更容易接近到第二图像特征Z*,
Figure PCTCN2019104230-appb-000011
该损失函数为基于流的可逆生成网络的损失函数。基于流的可逆生成网络通过将图像x输入可逆流网络F得到图像特征Z*=F(x)。通过最小化某一先验分布p*(z)和图像-特征变化函数F的雅可比矩阵dF/dx的log-determinant,最终达到图像x与特征Z*一一对应的关系。
在本公开的一种可选实施例中,所述根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足第二训练终止条件,包括:响应于所述第二网络损失大于第二损失阈值的情况,调整所述第二神经网络的参数,直至所述第二网络损失小于或者等于所述第二损失阈值,确定为满足所述第二训练终止条件。
本实施例中,在得到网络的损失值之后,即可以在第二神经网络的第二网络损失小于第二损失阈值时,确定为满足第二训练终止条件,否则在不满足第二训练终止条件的情况下,则反馈调节第二神经网络的参数。继而可以得到优化完成的第二神经网络。
基于上述,即可以完成第一神经网络和第二神经网络的训练,即可以通过训练完成的各网络执行图像的生成过程。
综上所述,本公开实施例能够通过对预定条件信息执行编码处理,得到对应的图像特征,并根据图像特征的反向处理得到相应的图像,从而达到给定条件生成相应图像的效果。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。
此外,本公开还提供了图像生成装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种图像生成方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。
图11示出根据本公开实施例的一种图像处理装置的框图,本公开实施例的图像处理装置可以包括:
获取模块10,配置为获取包含预生成图像的预定条件信息;
编码模块20,配置为对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征;
生成模块30,配置为基于所述图像特征得到与所述预定条件信息对应的生成图像。
在一些可能的实施方式中,所述编码模块20包括:
确定单元,配置为确定与所述预定条件信息对应的条件特征;
编码单元,配置为对所述条件特征执行所述编码处理,得到与所述预定条件信息对应的图像特征。
在一些可能的实施方式中,所述确定单元还配置为在条件空间中查找与所述预定条件信息匹配的第一条件信息;为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息以外的第二条件信息配置第二标识;对所述第一标识和所述第二标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述条件空间包括姿态条件信息,所述确定单元还配置为响应于所述预定条件信息中包括预定姿态信息的情况,将所述姿态条件信息的第三标识配置成所述预定姿态信息;在条件空间中查找所述预定姿态信息以外的预定条件信息所匹配的第一条件信息;为所述第一条件信息分配第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;对所述第一标识、所述第二标识和第三标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述条件空间包括姿态条件信息,所述确定单元还配置为响应于所述预定条件信息中不包括预定姿态信息的情况,为所述条件空间中的姿态条件信息配置第四标识;在所述条件空间中查找与所述预定条件信息匹配的第一条件信息;为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;对所述第一标识、所述第二标识和第四标识进行组合,得到所述条件特征。
在一些可能的实施方式中,所述确定单元,配置为通过以下方式中的至少一种方式为所述条件空间中的姿态条件信息配置第四标识:为所述姿态条件信息随机配置第四标识;利用神经网络生成与所述预定条件信息匹配的姿态信息,并将生成的所述姿态信息配置成所述第四标识。
在一些可能的实施方式中,所述编码模块还配置为对所述条件特征执行至少一次卷积处理和至少一次池化处理,得到所述图像特征。
在一些可能的实施方式中,所述生成模块还配置为通过第一神经网络对所述图像特征执行反向处理,得到与所述预定条件信息对应的生成图像;其中,所述第一神经网络配置为能够执行双向处理,所述双向处理包括:基于输入图像获得与所述输入图像对应的图像特征的正向处理,以及基于输入的图像特征获得与该输入的图像特征对应的图像的反向处理。
在一些可能的实施方式中,所述第一神经网络包括基于流的可逆生成网络。
在一些可能的实施方式中,所述装置还包括第一训练模块,配置为训练所述第一神经网络,并且训练所述第一神经网络的步骤包括:获取第一训练样本,所述第一训练样本包括:第一图像样本和与所述第一图像样本对应的第一图像特征;将所述第一图像样本和第一图像特征分别输入至第一神经网络中执行所述双向处理,得到与第一图像样本对应的预测图像特征,以及得到与所述第一图像特征对应的预测图像;基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件。
在一些可能的实施方式中,所述第一训练模块还配置为利用所述第一神经网络的所述正向处理,得到与第一图像样本对应的预测图像特征;以及利用所述第一神经网络的所述反向处理,得到与所述第一图像特征对应的预测图像。
在一些可能的实施方式中,所述第一训练模块还配置为获得第一图像样本和预测图像之间的第一损失值,以及第一图像特征和所述预测图像特征之间的第二损失值;根据所述第一损失值和第二损失值确定所述第一网络损失;响应于所述第一网络损失大于第一损失阈值的情况,调整所述第一神经网络的参数,直至满足所述第一训练终止条件。
在一些可能的实施方式中,所述编码模块还配置为通过第二神经网络对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,其中,所述第二神经网络包括自编码网络。
在一些可能的实施方式中,所述装置还包括第二训练模块,配置为通过监督网络训练所述第二神经网络的步骤,该训练第二神经网络的步骤包括:获取第二训练样本,所述第二训练样本包括第二图像样本以及与所述第二图像样本对应的条件样本;利用所述第一神经网络对所述第二图像样本执行所述正向处理,得到与所述第二图像样本对应的第二图像特征;利用第二神经网络对所述条件样本进行编码处理,得到与所述条件样本对应的第三图像特征;利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足第二训练终止条件。
在一些可能的实施方式中,所述第二训练模块还配置为利用所述辨别器对所述第二图像特征和第三图像特征进行辨别对抗处理,得到基于所述辨别网络的第二图像特征和第三图像特征之间的第三损失值;利用所述分类器对所述第二图像特征和第三图像特征进行分类处理,得到基于所述分类器的第二图像特征和第三图像特征之间的第四损失值;利用所述条件重构器识别所述第三图像特征对应的第一姿态条件,并得到所述第二神经网络中的输入的第二姿态条件和所述第一姿态条件之间的第五损失值;根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足所述第二训练终止条件。
在一些可能的实施方式中,所述第二训练模块还配置为响应于所述第二网络损失大于第二损失阈值的情况,调整所述第二神经网络的参数,直至所述第二网络损失小于或者等于所述第二损失阈值,确定为满足所述第二训练终止条件。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是非易失性计算机可读存储介质。
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为上述方法。
电子设备可以被提供为终端、服务器或其它形态的设备。
图12示出根据本公开实施例的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。
参照图12,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动 和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。
图13示出根据本公开实施例的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图13,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于是电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆 的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (34)

  1. 一种图像生成方法,包括:
    获取包含预生成图像的预定条件信息;
    对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征;
    基于所述图像特征得到与所述预定条件信息对应的生成图像。
  2. 根据权利要求1所述的方法,其中,所述对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,包括:
    确定与所述预定条件信息对应的条件特征;
    对所述条件特征执行所述编码处理,得到与所述预定条件信息对应的图像特征。
  3. 根据权利要求2所述的方法,其中,所述确定与所述预定条件信息对应的条件特征,包括:
    在条件空间中查找与所述预定条件信息匹配的第一条件信息;
    为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息以外的第二条件信息配置第二标识;
    对所述第一标识和所述第二标识进行组合,得到所述条件特征。
  4. 根据权利要求2所述的方法,其中,所述条件空间包括姿态条件信息,所述确定与所述预定条件信息对应的条件特征,包括:
    响应于所述预定条件信息中包括预定姿态信息的情况,将所述姿态条件信息的第三标识配置成所述预定姿态信息;
    在条件空间中查找所述预定姿态信息以外的预定条件信息所匹配的第一条件信息;
    为所述第一条件信息分配第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;
    对所述第一标识、所述第二标识和第三标识进行组合,得到所述条件特征。
  5. 根据权利要求2所述的方法,其中,所述条件空间包括姿态条件信息,所述确定与所述预定条件信息对应的条件特征,包括:
    响应于所述预定条件信息中不包括预定姿态信息的情况,为所述条件空间中的姿态条件信息配置第四标识;
    在所述条件空间中查找与所述预定条件信息匹配的第一条件信息;
    为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;
    对所述第一标识、所述第二标识和第四标识进行组合,得到所述条件特征。
  6. 根据权利要求5所述的方法,其中,所述为所述条件空间中的姿态条件信息配置第四标识,包括以下方式中的至少一种:
    为所述姿态条件信息随机配置第四标识;
    利用神经网络生成与所述预定条件信息匹配的姿态信息,并将生成的所述姿态信息配置成所述第四标识。
  7. 根据权利要求1-6中任意一项所述的方法,其中,所述对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,包括:
    对所述条件特征执行至少一次卷积处理和至少一次池化处理,得到所述图像特征。
  8. 根据权利要求1-7中任意一项所述的方法,其中,所述基于所述图像特征得到与所述预定条件信息对应的图像,包括:
    通过第一神经网络对所述图像特征执行反向处理,得到与所述预定条件信息对应的生成图像;其中,所述第一神经网络配置为能够执行双向处理,所述双向处理包括:基于输入图像获得与所述输入图像对应的图像特征的正向处理,以及基于输入的图像特征获得与该输入的图像特征对应的图像的反向处理。
  9. 根据权利要求8所述的方法,其中,所述第一神经网络包括基于流的可逆生成网络。
  10. 根据权利要求8或9所述的方法,其中,所述方法还包括训练所述第一神经网络的步骤,其包括:
    获取第一训练样本,所述第一训练样本包括:第一图像样本和与所述第一图像样本对应的第 一图像特征;
    将所述第一图像样本和第一图像特征分别输入至第一神经网络中执行所述双向处理,得到与第一图像样本对应的预测图像特征,以及得到与所述第一图像特征对应的预测图像;
    基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件。
  11. 根据权利要求10所述的方法,其中,所述将所述第一图像样本和第一图像特征分别输入至第一神经网络中执行所述双向处理,得到与第一图像样本对应的预测图像特征,以及得到与所述第一图像特征对应的预测图像,包括:
    利用所述第一神经网络的所述正向处理,得到与第一图像样本对应的预测图像特征;以及
    利用所述第一神经网络的所述反向处理,得到与所述第一图像特征对应的预测图像。
  12. 根据权利要求10或11所述的方法,其中,所述基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件,包括:
    获得第一图像样本和预测图像之间的第一损失值,以及第一图像特征和所述预测图像特征之间的第二损失值;
    根据所述第一损失值和第二损失值确定所述第一网络损失;
    响应于所述第一网络损失大于第一损失阈值的情况,调整所述第一神经网络的参数,直至满足所述第一训练终止条件。
  13. 根据权利要求8-12中任意一项所述的方法,其中,所述方法包括:
    通过第二神经网络对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,其中,所述第二神经网络包括自编码网络。
  14. 根据权利要求13所述的方法,其中,所述方法还包括:通过监督网络训练所述第二神经网络的步骤,其包括:
    获取第二训练样本,所述第二训练样本包括第二图像样本以及与所述第二图像样本对应的条件样本;
    利用所述第一神经网络对所述第二图像样本执行所述正向处理,得到与所述第二图像样本对应的第二图像特征;
    利用第二神经网络对所述条件样本进行编码处理,得到与所述条件样本对应的第三图像特征;
    利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足第二训练终止条件。
  15. 根据权利要求14所述的方法,其中,所述监督网络包括辨别器、分类器和条件重构器,所述利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足所述第二训练终止条件,包括:
    利用所述辨别器对所述第二图像特征和第三图像特征进行辨别对抗处理,得到基于所述辨别网络的第二图像特征和第三图像特征之间的第三损失值;
    利用所述分类器对所述第二图像特征和第三图像特征进行分类处理,得到基于所述分类器的第二图像特征和第三图像特征之间的第四损失值;
    利用所述条件重构器识别所述第三图像特征对应的第一姿态条件,并得到所述第二神经网络中的输入的第二姿态条件和所述第一姿态条件之间的第五损失值;
    根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足所述第二训练终止条件。
  16. 根据权利要求15所述的方法,其中,所述根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足第二训练终止条件,包括:
    响应于所述第二网络损失大于第二损失阈值的情况,调整所述第二神经网络的参数,直至所述第二网络损失小于或者等于所述第二损失阈值,确定为满足所述第二训练终止条件。
  17. 一种图像生成装置,包括:
    获取模块,配置为获取包含预生成图像的预定条件信息;
    编码模块,配置为对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征;
    生成模块,配置为基于所述图像特征得到与所述预定条件信息对应的生成图像。
  18. 根据权利要求17所述的装置,其中,所述编码模块包括:
    确定单元,配置为确定与所述预定条件信息对应的条件特征;
    编码单元,配置为对所述条件特征执行所述编码处理,得到与所述预定条件信息对应的图像特征。
  19. 根据权利要求18所述的装置,其中,所述确定单元还配置为在条件空间中查找与所述预定条件信息匹配的第一条件信息;为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息以外的第二条件信息配置第二标识;对所述第一标识和所述第二标识进行组合,得到所述条件特征。
  20. 根据权利要求18所述的装置,其中,所述条件空间包括姿态条件信息,所述确定单元,还配置为响应于所述预定条件信息中包括预定姿态信息的情况,将所述姿态条件信息的第三标识配置成所述预定姿态信息;在条件空间中查找所述预定姿态信息以外的预定条件信息所匹配的第一条件信息;为所述第一条件信息分配第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;对所述第一标识、所述第二标识和第三标识进行组合,得到所述条件特征。
  21. 根据权利要求18所述的装置,其中,所述条件空间包括姿态条件信息,所述确定单元,还配置为响应于所述预定条件信息中不包括预定姿态信息的情况,为所述条件空间中的姿态条件信息配置第四标识;在所述条件空间中查找与所述预定条件信息匹配的第一条件信息为所述第一条件信息配置第一标识,以及为所述条件空间中所述第一条件信息和所述姿态条件信息以外的第二条件信息配置第二标识;对所述第一标识、所述第二标识和第四标识进行组合,得到所述条件特征。
  22. 根据权利要求21所述的装置,其中,所述确定单元,配置为通过以下方式中的至少一种方式为所述条件空间中的姿态条件信息配置第四标识:为所述姿态条件信息随机配置第四标识;利用神经网络生成与所述预定条件信息匹配的姿态信息,并将生成的所述姿态信息配置成所述第四标识。
  23. 根据权利要求17-22中任意一项所述的装置,其中,所述编码模块还配置为对所述条件特征执行至少一次卷积处理和至少一次池化处理,得到所述图像特征。
  24. 根据权利要求17-23中任意一项所述的装置,其中,所述生成模块还配置为通过第一神经网络对所述图像特征执行反向处理,得到与所述预定条件信息对应的生成图像;其中,所述第一神经网络配置为能够执行双向处理,所述双向处理包括:基于输入图像获得与所述输入图像对应的图像特征的正向处理,以及基于输入的图像特征获得与该输入的图像特征对应的图像的反向处理。
  25. 根据权利要求24所述的装置,其中,所述第一神经网络包括基于流的可逆生成网络。
  26. 根据权利要求24或25所述的装置,其中,所述装置还包括第一训练模块,配置为训练所述第一神经网络,并且训练所述第一神经网络的步骤包括:获取第一训练样本,所述第一训练样本包括:第一图像样本和与所述第一图像样本对应的第一图像特征;将所述第一图像样本和第一图像特征分别输入至第一神经网络中执行所述双向处理,得到与第一图像样本对应的预测图像特征,以及得到与所述第一图像特征对应的预测图像;基于得到的预测图像特征和预测图像,确定第一神经网络的第一网络损失,并根据该第一网络损失反向调节所述第一神经网络,直至满足第一训练终止条件。
  27. 根据权利要求26所述的装置,其中,所述第一训练模块还配置为利用所述第一神经网络的所述正向处理,得到与第一图像样本对应的预测图像特征;以及利用所述第一神经网络的所述反向处理,得到与所述第一图像特征对应的预测图像。
  28. 根据权利要求26或27所述的装置,其中,所述第一训练模块还配置为获得第一图像样本和预测图像之间的第一损失值,以及第一图像特征和所述预测图像特征之间的第二损失值;根据所述第一损失值和第二损失值确定所述第一网络损失;响应于所述第一网络损失大于第一损失阈值的情况,调整所述第一神经网络的参数,直至满足所述第一训练终止条件。
  29. 根据权利要求24-28中任意一项所述的装置,其中,所述编码模块还配置为通过第二神经网络对所述预定条件信息进行编码处理,生成与所述预定条件信息对应的图像特征,其中,所述第二神经网络包括自编码网络。
  30. 根据权利要求29所述的装置,其中,所述装置还包括第二训练模块,配置为通过监督网 络训练所述第二神经网络的步骤,该训练第二神经网络的步骤包括:获取第二训练样本,所述第二训练样本包括第二图像样本以及与所述第二图像样本对应的条件样本;利用所述第一神经网络对所述第二图像样本执行所述正向处理,得到与所述第二图像样本对应的第二图像特征;利用第二神经网络对所述条件样本进行编码处理,得到与所述条件样本对应的第三图像特征;利用监督网络基于所述第二图像特征和第三图像特征对应的损失值,调节所述第二神经网络的参数,直至满足第二训练终止条件。
  31. 根据权利要求30所述的装置,其中,所述第二训练模块还配置为利用所述辨别器对所述第二图像特征和第三图像特征进行辨别对抗处理,得到基于所述辨别网络的第二图像特征和第三图像特征之间的第三损失值;利用所述分类器对所述第二图像特征和第三图像特征进行分类处理,得到基于所述分类器的第二图像特征和第三图像特征之间的第四损失值;利用所述条件重构器识别所述第三图像特征对应的第一姿态条件,并得到所述第二神经网络中的输入的第二姿态条件和所述第一姿态条件之间的第五损失值;根据所述第三损失值、第四损失值和第五损失值确定第二神经网络的第二网络损失,并根据该第二网络损失调节所述第二神经网络,直至满足所述第二训练终止条件。
  32. 根据权利要求31所述的装置,其中,所述第二训练模块还配置为响应于所述第二网络损失大于第二损失阈值的情况,调整所述第二神经网络的参数,直至所述第二网络损失小于或者等于所述第二损失阈值,确定为满足所述第二训练终止条件。
  33. 一种电子设备装置,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为:执行权利要求1至16中任意一项所述的方法。
  34. 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现权利要求1至16中任意一项所述的方法。
PCT/CN2019/104230 2019-03-18 2019-09-03 图像生成方法及装置、电子设备和存储介质 Ceased WO2020186702A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910205219.8 2019-03-18
CN201910205219.8A CN109920016B (zh) 2019-03-18 2019-03-18 图像生成方法及装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2020186702A1 true WO2020186702A1 (zh) 2020-09-24

Family

ID=66965358

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/104230 Ceased WO2020186702A1 (zh) 2019-03-18 2019-09-03 图像生成方法及装置、电子设备和存储介质

Country Status (3)

Country Link
CN (1) CN109920016B (zh)
TW (1) TWI735112B (zh)
WO (1) WO2020186702A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113506229A (zh) * 2021-07-15 2021-10-15 清华大学 神经网络训练和图像生成方法及装置
CN116091873A (zh) * 2023-04-10 2023-05-09 宁德时代新能源科技股份有限公司 图像生成方法、装置、电子设备及存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109920016B (zh) * 2019-03-18 2021-06-25 北京市商汤科技开发有限公司 图像生成方法及装置、电子设备和存储介质
CN110634167B (zh) * 2019-09-27 2021-07-20 北京市商汤科技开发有限公司 神经网络训练方法及装置和图像生成方法及装置
CN111311483A (zh) * 2020-01-22 2020-06-19 北京市商汤科技开发有限公司 图像编辑及训练方法、装置、电子设备和存储介质
TWI870063B (zh) * 2023-05-04 2025-01-11 愛進化科技股份有限公司 用於產生圖像的方法、計算機裝置、電腦可讀取記錄媒體以及電腦程式產品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150262363A1 (en) * 2014-03-13 2015-09-17 Megachips Corporation Object detection apparatus
CN108510435A (zh) * 2018-03-28 2018-09-07 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN109189959A (zh) * 2018-09-06 2019-01-11 腾讯科技(深圳)有限公司 一种构建图像数据库的方法及装置
CN109285112A (zh) * 2018-09-25 2019-01-29 京东方科技集团股份有限公司 基于神经网络的图像处理方法、图像处理装置
CN109920016A (zh) * 2019-03-18 2019-06-21 北京市商汤科技开发有限公司 图像生成方法及装置、电子设备和存储介质

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016108318A1 (ko) * 2014-12-31 2016-07-07 연세대학교 산학협력단 오류에 강인한 압축 영역에서의 영상 합성 방법, 장치 및 시스템
CN108090082B (zh) * 2016-11-22 2021-06-11 腾讯科技(北京)有限公司 信息处理方法及信息处理装置
CN106844442A (zh) * 2016-12-16 2017-06-13 广东顺德中山大学卡内基梅隆大学国际联合研究院 基于fcn特征提取的多模态循环神经网络图像描述方法
US11113800B2 (en) * 2017-01-18 2021-09-07 Nvidia Corporation Filtering image data using a neural network
CN108229492B (zh) * 2017-03-29 2020-07-28 北京市商汤科技开发有限公司 提取特征的方法、装置及系统
CN108959322B (zh) * 2017-05-25 2021-09-10 富士通株式会社 信息处理方法和基于文本生成图像的装置
CN110599557B (zh) * 2017-08-30 2022-11-18 深圳市腾讯计算机系统有限公司 图像描述生成方法、模型训练方法、设备和存储介质
CN108197525B (zh) * 2017-11-20 2020-08-11 中国科学院自动化研究所 人脸图像生成方法及装置
CN108491836B (zh) * 2018-01-25 2020-11-24 华南理工大学 一种自然场景图像中中文文本整体识别方法
CN108460717A (zh) * 2018-03-14 2018-08-28 儒安科技有限公司 一种基于双判别器的生成对抗网络的图像生成方法
CN108446667A (zh) * 2018-04-04 2018-08-24 北京航空航天大学 基于生成对抗网络数据增强的人脸表情识别方法和装置
CN109299716B (zh) * 2018-08-07 2021-07-06 北京市商汤科技开发有限公司 神经网络的训练方法、图像分割方法、装置、设备及介质
CN109147010B (zh) * 2018-08-22 2023-07-25 广东工业大学 带属性人脸图像生成方法、装置、系统及可读存储介质
CN109377532B (zh) * 2018-10-18 2023-01-31 众安信息技术服务有限公司 基于神经网络的图像处理方法及装置
CN109377535A (zh) * 2018-10-24 2019-02-22 电子科技大学 面部属性自动编辑系统、方法、存储介质和终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150262363A1 (en) * 2014-03-13 2015-09-17 Megachips Corporation Object detection apparatus
CN108510435A (zh) * 2018-03-28 2018-09-07 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN109189959A (zh) * 2018-09-06 2019-01-11 腾讯科技(深圳)有限公司 一种构建图像数据库的方法及装置
CN109285112A (zh) * 2018-09-25 2019-01-29 京东方科技集团股份有限公司 基于神经网络的图像处理方法、图像处理装置
CN109920016A (zh) * 2019-03-18 2019-06-21 北京市商汤科技开发有限公司 图像生成方法及装置、电子设备和存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113506229A (zh) * 2021-07-15 2021-10-15 清华大学 神经网络训练和图像生成方法及装置
CN113506229B (zh) * 2021-07-15 2024-04-12 清华大学 神经网络训练和图像生成方法及装置
CN116091873A (zh) * 2023-04-10 2023-05-09 宁德时代新能源科技股份有限公司 图像生成方法、装置、电子设备及存储介质
CN116091873B (zh) * 2023-04-10 2023-11-28 宁德时代新能源科技股份有限公司 图像生成方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
TWI735112B (zh) 2021-08-01
CN109920016A (zh) 2019-06-21
TW202036462A (zh) 2020-10-01
CN109920016B (zh) 2021-06-25

Similar Documents

Publication Publication Date Title
TWI710964B (zh) 圖像聚類方法及裝置、電子設備和儲存介質
TWI735112B (zh) 圖像生成方法、電子設備和儲存介質
TWI717923B (zh) 面部識別方法及裝置、電子設備和儲存介質
CN109829433B (zh) 人脸图像识别方法、装置、电子设备及存储介质
CN114266840B (zh) 图像处理方法、装置、电子设备及存储介质
TWI732338B (zh) 文本序列的識別方法、電子設備和電腦可讀存儲介質
CN110909815B (zh) 神经网络训练、图像处理方法、装置及电子设备
WO2021164469A1 (zh) 目标对象的检测方法、装置、设备和存储介质
CN111259967B (zh) 图像分类及神经网络训练方法、装置、设备及存储介质
CN108960283B (zh) 分类任务增量处理方法及装置、电子设备和存储介质
CN107944447B (zh) 图像分类方法及装置
WO2020192252A1 (zh) 图像生成方法及装置、电子设备和存储介质
WO2021208666A1 (zh) 字符识别方法及装置、电子设备和存储介质
CN111612070A (zh) 基于场景图的图像描述生成方法及装置
WO2020172979A1 (zh) 数据处理方法和装置、电子设备和存储介质
WO2020192113A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2020155713A1 (zh) 图像处理方法及装置、网络训练方法及装置
CN111582383B (zh) 属性识别方法及装置、电子设备和存储介质
TW202029062A (zh) 網路優化方法及裝置、圖像處理方法及裝置、儲存媒體
CN116543211B (zh) 图像属性编辑方法、装置、电子设备和存储介质
CN112328809A (zh) 实体分类方法、装置及计算机可读存储介质
CN114996515A (zh) 视频特征提取模型的训练方法、文本生成方法及装置
CN109447258B (zh) 神经网络模型的优化方法及装置、电子设备和存储介质
CN110135349A (zh) 识别方法、装置、设备及存储介质
CN111524518A (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: 19920610

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19920610

Country of ref document: EP

Kind code of ref document: A1