WO2023239302A1 - 图像处理方法、装置、电子设备及存储介质 - Google Patents

图像处理方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2023239302A1
WO2023239302A1 PCT/SG2023/050401 SG2023050401W WO2023239302A1 WO 2023239302 A1 WO2023239302 A1 WO 2023239302A1 SG 2023050401 W SG2023050401 W SG 2023050401W WO 2023239302 A1 WO2023239302 A1 WO 2023239302A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target
feature
encoding
target attribute
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/SG2023/050401
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.)
Lemon Inc Cayman Island
Original Assignee
Lemon Inc Cayman Island
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 Lemon Inc Cayman Island filed Critical Lemon Inc Cayman Island
Priority to US18/873,469 priority Critical patent/US20260030510A1/en
Publication of WO2023239302A1 publication Critical patent/WO2023239302A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0475Generative networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/094Adversarial learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation
    • G06T11/40Filling planar surfaces by adding surface attributes, e.g. adding colours or textures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation
    • G06T11/60Creating or editing images; Combining images with text
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • the present disclosure provides an image processing method, device, electronic device and storage medium, which can change the overall attribute parameters of the image based on the characteristics of the image itself, making the effect of adding special effects more natural.
  • Embodiments of the present disclosure provide an image processing method, which method includes: acquiring an image to be processed; inputting the image to be processed into an image attribute parameter change model to obtain a target image, wherein the target attribute parameter value of the target image is Different from the target attribute parameter value of the image to be processed, the target attribute parameter value of the target image and the target attribute parameter value of the image to be processed correspond to different target attribute expression states.
  • the user can autonomously choose according to the prompt information whether to provide personal information to software or hardware such as electronic devices, applications, servers or storage media that perform the operations of the technical solution of the present disclosure.
  • the method of sending prompt information to the user may be, for example, a pop-up window, and the prompt information may be presented in the form of text in the pop-up window.
  • the pop-up window can also contain a selection control for the user to choose "agree” or "disagree” to provide personal information to the electronic device. It can be understood that the above process of notifying and obtaining user authorization is only illustrative and does not limit the implementation of the present disclosure.
  • Figure 1 is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
  • the embodiment of the present disclosure is suitable for situations where image processing is performed to change image attributes based on the entire image to be processed.
  • This method can be executed by an image processing device.
  • the device can be implemented in the form of software and/or hardware, optionally, through electronic equipment, and the electronic equipment can be a mobile terminal, a personal computer (Personal Computer, PC) or a server, etc.
  • the image processing method includes the following steps.
  • the image to be processed can be an original image whose image attributes need to be changed, or an image obtained by downloading, shooting or uploading.
  • the image to be processed can be obtained as the target image processing object.
  • Image special effects that change the attributes of the image to be processed can be applied to any application that can process images or videos. It is understandable that during the video shooting process or the video call process, image special effects processing of changing the attributes of the image obtained in real time can also be performed.
  • the method of this embodiment can make the combination effect of the change of the target attribute and the original image of the image to be processed more natural and vivid.
  • the target attribute can be a pre-specified characteristic attribute of the object in the image to be processed, for example, the gender attribute, age attribute, hairstyle attribute, etc. of the person in the person image.
  • the gender attribute as the target attribute as an example, assuming that the character object attribute parameters in the image to be processed are classified as male, the image to be processed can be input into the image attribute parameter change model, and the image attribute parameter change model outputs the target image, correspondingly , the target image is an image in which the gender attribute of the character object in the image to be processed is female.
  • the output result of the image attribute parameter changing model in this embodiment can achieve the effect of "thousands of people with thousands of faces", because each picture has
  • the processing process of the image to be processed is > ⁇ The hairstyle, hair color and facial features of the characters and objects in the image are personalized and generated.
  • the diversity is greatly enriched and the degree of naturalness is also increased.
  • the image attribute parameter change model may be a model trained based on image sample pairs including images with different target attribute expression states.
  • the image of one target attribute expression state in the image sample pair can be used as the input of the trained model, and the image of another target attribute expression state can be used as the expected output image of the trained model, and the model training can be performed to obtain The image attribute parameter changing model applied in this embodiment.
  • the image attribute parameter changing model can be obtained through model-training in a generative adversarial manner based on image sample pairs including images with different target attribute expression states.
  • the Pix2Pix network architecture is used to train the model, so that the trained model can learn to "predict pixels based on pixels.”
  • the image sample pair can be constructed by first generating multiple original sample images by a pre-trained image generator.
  • the performance states of the target attributes in the multiple original sample images can be the same or different; then , perform feature encoding on each original sample image, and adjust the target attribute parameters (target attribute features) of the image feature encoding results to obtain the target encoding features; finally, the image generator that generates the original sample image decodes the target encoding features to obtain
  • the target sample image corresponding to the original sample image is an image in which the target attribute performance state obtained after adjusting the target attribute characteristics is different from the original sample image.
  • the construction process of the image sample pair is also based on the encoding process of the overall characteristics of the original sample image, and then the target attribute characteristics of the image feature encoding result are adjusted to finally obtain the corresponding image sample pair.
  • the image attribute parameter change model can be Learn the inherent mapping relationship between pairs of image samples with different attribute representations.
  • the pre-trained image generator can be an image generator obtained by training the StyleGAN model. into a device. During the training of StyleGAN, you can set the resolution of the generated image. For example, if you set the resolution of the generated image to 1024*1024, you can get multiple high-definition and high-quality original sample images.
  • the model trained based on high-quality original sample images can also process high-quality images and obtain high-resolution image processing results.
  • changing the target attributes in the model according to the image attribute parameters can make the output images of StyleGAN during the training process use images with different performance of the target attributes as a reference, and ultimately enable the StyleGAN model to be based on randomly sampled images.
  • a vector of preset dimensions is generated to generate a collection of original sample images containing different performance states of the target attribute.
  • the technical solution of the embodiment of the present disclosure is to obtain the target image by inputting the image to be processed into the image attribute parameter changing model after acquiring the image to be processed, wherein the target attribute parameter value of the target image is the same as the target attribute parameter value of the image to be processed.
  • the target attribute parameter value of the target image and the target attribute parameter value of the image to be processed correspond to different target attribute performance states.
  • the embodiment of the present disclosure uses the entire image to be processed as the processing object to change the image attributes, and solves the problem of using images in related technologies. It solves the problem of unnatural effect of changing image attributes by adding local special effects, and improves the effect of image processing, making the result of changing image attributes more natural.
  • Figure 2 is a schematic flow chart of another image processing method provided by an embodiment of the present disclosure. In the process of implementing the method flow, the training process of the image attribute parameter changing model and the construction process of the training sample image are described.
  • the method can be executed by an image processing device, which can be implemented in the form of software and/or hardware, optionally, by an electronic device, which can be a mobile terminal, a PC or a server. As shown in Figure 2, the image processing method includes the following steps.
  • Step 1 Jointly train the image encoder based on the pre-trained image generator to obtain a target image encoding that enables the image feature encoding result of the original encoding object image to be decoded by the pre-trained image generator into the original encoding object image. device.
  • the working process of the image attribute parameter changing model can be the encoding and decoding process of the image.
  • a target image encoder is trained so that the image feature encoding result of the target image encoder can be pre-trained by the image decoder.
  • StyleGAN model image generator, represented as Gs
  • the image encoder First, input the original encoding object image (i.e., the original sample image) into the image encoder to obtain the image feature encoding vector of the original encoding object image; then, input the image feature encoding vector of the original encoding object image into the image generator and in the preset discriminator; finally, according to the feature decoded image generated by the image generator based on the image feature encoding vector of the original encoding object image and the preset discriminator compares the image feature encoding vector of the original encoding object image with the image generator
  • the image encoder is updated with the discrimination result of the training sampling vector to obtain the target image encoder.
  • the training process of the target image encoder when calculating the loss function during the training process of the image encoder, not only the first loss function between the feature decoded image and the original encoding image is calculated, but also a preset discriminator is set to determine the original image.
  • the second loss function between the image feature encoding vector of the encoding object image and the training sampling vector of the image generator makes the image feature encoding vector of the original encoding object image close to the distribution characteristics of the training sampling vector of the image generator, improving the training effect.
  • the training process of the image encoder is completed, and the target image encoder is obtained.
  • the training process of the target image encoder can refer to the content shown in Figure 3. In Figure 3, two original sample images are shown.
  • the two original sample images will be input to the encoder (Encoder) respectively.
  • the encoder will perform feature encoding on the input image to obtain the feature W.
  • a regularization processing mechanism is also added during the encoder-training process. N represents the number of regularization terms, such as - Represents the loss function in the regularization process.
  • the encoder output result W is superposed with the regularization result, it is multiplied by the value N and then input into the pretrained StyleGAN for feature decoding to obtain the original encoding object image, and during the feature decoding process, input
  • the special features in StyleGAN will also be input into the preset discriminator to determine the difference between the image feature encoding vector and the image generator's training sampling vector.
  • the image feature encoding vector and the image generator's training sampling vector will suffer losses. Constraints on functions like.
  • the training sampling vector is the image feature vector that the image generator randomly samples from the original sample image during the training process.
  • Step 2 Use the target image encoder to encode each of the multiple original sample images with different target attribute performance states generated by the pre-trained image generator, and encode based on the image features of the multiple original sample images.
  • the target attribute feature vector is determined.
  • the feature vector corresponding to the target attribute can be determined.
  • the original sample image is an image with a known label.
  • the image feature encoding result (expressed as W) after the target image encoder encodes each original sample image also has a corresponding label.
  • the image feature encoding result of each original sample image corresponds to the label W ⁇ male (male) or W ⁇ female (female).
  • the feature vector representing the target attribute can be extracted from the classification learning of the image feature encoding results of multiple original sample images.
  • SVM support vector machine classifier Machine
  • W' target attribute feature vector
  • the image to be processed can be directly input into the image attribute parameter change model to obtain the target image, where the target attribute parameter value of the target image is the same as the value of the image to be processed.
  • the target attribute parameter values of are different.
  • the target attribute parameter value of the target image and the target attribute parameter value of the image to be processed correspond to different target attribute performance states.
  • the embodiment of the present application uses the entire image to be processed as the processing object to change the image attributes and solve the problem.
  • FIG 4 is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure.
  • the device is suitable for performing image processing to change image attributes based on the entire image to be processed. It can be implemented in the form of software and/or hardware.
  • the image processing device can be configured in an electronic device, and the electronic device can be a mobile terminal, a PC, a server, etc. As shown in Figure 4, the image processing device includes: an image acquisition module 310 and an image processing module 320.
  • Image acquisition module 310 configured to acquire the image to be processed;
  • Image processing module 32. is set to input the image to be processed into the image attribute parameter changing model to obtain the target image, wherein the target attribute parameter value of the target image is different from the target attribute parameter value of the image to be processed, and the target attribute parameter value of the target image is
  • the target attribute parameter value and the target attribute parameter value of the image to be processed correspond to different target attribute performance states.
  • the technical solution provided by the embodiment of the present application obtains an image to be processed and inputs the image to be processed into an image attribute parameter changing model to obtain a target image, wherein the target attribute parameter value of the target image is the same as the target attribute parameter value to be processed.
  • the target attribute parameter value of the image is different.
  • the image sample pair includes an original sample image generated by a pre-trained image generator, and an image corresponding to the original sample image obtained by decoding the target encoding feature by the pre-trained image generator.
  • Target sample image wherein the target encoding feature is a feature obtained by performing feature encoding on the original sample image and adjusting the target attribute parameters of the image feature encoding result.
  • the image processing device further includes a training sample construction module, configured to: jointly train the image encoder based on the pre-trained image generator to obtain an image that can make the original encoding object
  • the image feature encoding result is decoded by the pre-trained image generator into the target image encoder of the original encoding object image; the target attribute generated by the pre-trained image generator is processed by the target image encoder Perform feature encoding on each of the multiple original sample images with different performance states, and determine the target attribute feature vector based on the image feature encoding results of the multiple original sample images;
  • Based on the target attribute feature vector pair Edit the target attribute parameters of the image feature encoding results of each original sample image to obtain the changed image feature encoding results of each original sample image; input the changed image feature encoding results of each original sample image into the In the above-mentioned pre-trained image generator, a target image corresponding to each of the original sample images is obtained, and an image sample pair is generated.
  • the training sample construction module is configured to: input the original encoding object image into the image encoder to obtain the image feature encoding vector of the original encoding object image;
  • the image feature encoding vector of the original encoding object image is input into the pre-trained image generator and the preset discriminator respectively; according to the pre-trained image generator, the image feature encoding vector of the original encoding object image is generated.
  • the feature decoded image and the preset discriminator update the image encoder with the discrimination result between the image feature encoding vector and the training sampling vector of the pre-trained image generator to obtain a target image encoder.
  • the training sample construction module is configured to: classify the image feature encoding results of the multiple original sample images through a support vector machine classifier; determine based on the classification results to make the The target attributes of multiple original sample images represent target attribute feature vectors with different states.
  • the training sample construction module is configured to: determine the target attribute feature vector according to the target attribute performance state of the original sample image corresponding to the image feature encoding result of each original sample image. Corresponding attribute editing weight value; change the value of each original sample image The image feature encoding result is superimposed on the product of the target attribute feature vector and the attribute editing weight value to obtain the modified image feature encoding result of each original sample image.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Referring now to FIG. 5 , an electronic device (such as the terminal device or server in FIG. 5 ) 40 suitable for implementing embodiments of the present disclosure is shown. Structural diagram.
  • Embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the image processing method provided by the above embodiments is implemented.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard drives, RAM. ROM. Erasable Programmable Read-Only Memory , EPROM) or flash memory, optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM).
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program code is carried. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
  • the client and server can communicate using any currently known or future developed network protocol such as HyperText Transfer Protocol (HTTP), and can communicate with any form or medium.
  • Digital data communications e.g., communications networks interconnections. Examples of communication networks include Local Area Networks (LANs), Wide Area Networks (WANs), the Internet (eg, the Internet), and end-to-end networks (eg, ad hoc end-to-end networks), as well as any current network for knowledge or future research and development.
  • Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages such as Java, Smalltalk > C++, or a combination thereof , also includes conventional procedural programming languages such as "Such as” or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly Execute partially on the user's computer on a remote computer, or execute entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network—including a LAN or WAN—or , can be connected to an external computer (such as through the Internet using an Internet service provider).
  • each box in a flowchart or block diagram may represent a module, segment, or portion of code.
  • the module, segment, or portion of code Contains one or more executable instructions for implementing specified logical functions.
  • the functions noted in the block may occur in a sequence different from that noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may execute in the reverse order, depending upon the functionality involved.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any appropriate combination of the foregoing.
  • Example 1 provides an image processing method, which method includes: acquiring an image to be processed; inputting the image to be processed into an image attribute parameter change model to obtain a target image, wherein the target attribute parameter value of the target image is different from the target attribute parameter value of the image to be processed, and the target attribute parameter value of the target image and the target attribute parameter value of the image to be processed correspond to different targets. Properties represent status.
  • the pre-trained image generator decodes the target coding feature to obtain the target sample image corresponding to the original sample image, wherein the target coding feature is the result of feature encoding the original sample image and encoding the image feature Features obtained by adjusting target attribute parameters; wherein, the target attribute expression state of the original sample image is different from the target attribute expression state of the target sample image corresponding to the original sample image.
  • Example 3 provides an image processing method, including:
  • the number of original sample images is multiple, and the multiple original sample images are the pre-trained
  • the image generator generates multiple original sample images with different target attribute performance states;
  • the generation process of the image sample pair includes: jointly scraping the image encoder based on the pre-scratched image generator to obtain an image that can be used
  • the image feature encoding result of the original encoding object image is decoded by the pre-trained image generator into the target image encoder of the original encoding object image; and the target image encoder generates the image feature encoding result of the pre-trained image generator.
  • Each original sample image in the plurality of original images with different target attribute expression states is feature encoded, and a target attribute feature vector is determined based on the image feature encoding results of the multiple original sample images; based on the target attribute feature vector Edit the target attribute parameters of the image feature encoding results of each original sample image to obtain the changed image feature encoding results of each original sample image; input the changed image feature encoding results of each original sample image into In the pre-trained image generator, a target image corresponding to each original sample image is obtained, and the image sample pair is generated.
  • Example 4 provides an image processing method, further comprising:
  • encoding the image based on the pre-trained image generator perform joint training to obtain a target image encoder that enables the image feature encoding result of the original encoding object image to be decoded by the pre-trained image generator into the original encoding object image, including: converting the original encoding object image The object image is input into the image encoder to obtain the image feature encoding vector of the original encoded object image >; the image feature encoding vector of the original encoded object image is input to the pre-trained image generator and preset discrimination respectively.
  • the device according to the feature decoding image generated by the pre-trained image generator based on the image feature encoding vector of the original encoding object image and the preset discriminator comparing the image feature encoding vector of the original encoding object image with the The image encoder is updated with the discrimination result of the training sampling vector of the pre-trained image generator to obtain the target image encoder.
  • Example 6 provides an image processing method, further comprising:
  • the feature vector based on the target attribute Edit the target attribute parameters on the image feature encoding result of each original sample image to obtain the changed image feature encoding result of each original sample image, including: the original image feature encoding result corresponding to each original sample image
  • the target attribute performance state of the sample image determines the attribute editing weight value corresponding to the target attribute feature vector; superimposes the image feature encoding result of each original sample image with the product of the target attribute feature vector and the attribute editing weight value , to obtain the modified image feature encoding result of each original sample image.
  • the image processing device also includes:
  • the number of the original sample images is multiple, and the multiple original sample images are target attributes with different performance states generated by the pre-trained image generator.
  • a plurality of original sample images; the image processing device also includes a training sample construction module, configured to: jointly train the image encoder based on the pre-trained image generator to obtain image features that enable the original encoding object image The encoding result is decoded by the pre-trained image generator into a target image encoder of the original encoding target image; and the target attribute representation state generated by the pre-trained image generator is generated by the target image encoder.
  • each original sample image is Edit the target attribute parameters of the image feature coding results to obtain the changed image feature coding results of each original sample image; input the changed image feature coding results of each original sample image into the pre-trained image In the generator, a target image corresponding to each original sample image is obtained, and the image sample pair is generated.
  • Example 10 provides an image processing device, further comprising:
  • the training sample construction module is configured to: The original encoding object image is input into the image encoder to obtain the image feature encoding vector of the original encoding object image; the image feature encoding vector of the original encoding object image is input to the pre-trained image generator and preset respectively.
  • Example 12J provides an image processing device, further comprising:
  • the training sample construction module is configured to: according to The image feature encoding result of each original sample image corresponds to the target attribute performance status of the original sample image. Statefully determine the attribute editing weight value corresponding to the target attribute feature vector; superimpose the image feature encoding result of each original sample image with the product of the target attribute feature vector and the attribute editing weight value to obtain each of the The modified image feature encoding result of the original sample image.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

本申请实施例公开了一种图像处理方法、装置、电子设备及存储介质,其中,方法包括:获取待处理图像;将所述待处理图像输入至图像属性参数变更模型,得到目标图像,其中,所述目标图像的目标属性参数值与所述待处理图像的目标属性参数值不同,所述目标图像的目标属性参数值和所述待处理图像的目标属性参数值对应不同的目标属性表现状态。

Description

图像 处理方 法、 装置、 电子设备及存 储介质 本 申请要求在 2022年 06月 10 0提交中国专 利局、申请号为 202210658013.2 的 中国专利 申请的优 先权, 该申请的全部内容 通过引 用结合在 本申请 中。 技术 领域 本公 开实施例 涉及图 像处理技 术领域 , 例如涉及一种 图像处理 方法. 装置、 电 子设备及 存储介质 。 背景 技术 在具 有图像 编辑功 能的应用 中 , 可以在图像 上增加 不同的特 效来增加 图像 的趣 味性 。 在对图像编辑 时, 可通过在图 像上添加 不同 的 .发型或妆容等特效以 改 变图像中 属性参数 。 但是 , 针对不同的 图像改 变其属性 参数时 , 均是通过添加相 同的妆 容或发 型特 效实现 的, 效果较为单 一; 而且统一的妆容或 发饰对 一些 图像来说 并不适 配 , 还会导致整体效 果不够 自然、 协调。 发 明内容 本公 开提供 了一种 图像处理 方法 . 装置、 电子设备及存储介 质, 可以基于 图像 中本身 的特征变 更图像 的整体属 性参数 , 使添加特效的效 果更加 自然。 本公 开实施 例提供 了一种 图像处理 方法, 该方法包括: 获取待处理图像 ; 将 所述待处 理图像 输入至 图像属性 参数变 更模型 , 得到目标图像, 其中, 所述 目标 图像的 目标属 性参数值 与所述 待处理 图像的 目标属性 参数值 不同, 所述目 标 图像的 目标属性 参数值 和所述待 处理图 像的 目标属性参 数值对 应不同 的目标 属性 表现状 态。 本公 开实施 例还提供 了一种 图像处 理装置 , 该装置包才舌: 图像获取模块, 设 置为获取 待处理 图像; 图像处理模 块, 设置为将 所述待处 理图像 输入至 图像 属性 参数 变更模型 , 得到目标图像 , 其中, 所述目标图像 的目标 属性参数 值与 所述 待处理 图像的 目标属性 参数值 不同, 所述目标图像 的目标属 性参数 值和所 述待 处理图 像的目标 属性参数 值对应 不同的 目标属性表 现状 态。 本公 开实施 例还提供 了一种 电子设 备, 所述电子设 备包括 : 至少一个处 理 器 ; 存储装置, 设置为存储 至少一个 程序, 当所述至少一个 程序被 所述至 少一 个处 理器执 行 , 使得所述至 少一个处 理器实 现如本公 开实施 例任一 所述的 图像 处理 方法。 本公 开实施 例还提供 了一种 包含计 算机可执 行指令 的有储 介质, 所述计算 机可 '执行指令在由计 算机处 理器执 行时用 于执行如 本公开 实施例 任一所述 的图 像处 理方法 。 附 图说明 图 1是本公开 实施例所提 供的一 种图像处 理方法 流程示意 图; 图 2是本公开 实施例所提 供的一 种图像 处理方法 流程示意 图; 图 3是本公开 实施例所提 供的一 种图像编 码器训 练过程示 意图; 图 4是本公开 实施例所提 供的一 种图像处 理装置 结构示意 图; 图 5是本公开 实施例所提 供的一 种电子设 备的结 构示意 图。 具体 实施方 式 下面 将参照 附图描述 本公开 的实施 例。 虽然附图 中显示 了本公开 的一些 实 施例 , 然而应当理解 的是 , 本公开可以通 过多种形 式来 ■实现, 而且不应该被解 释为 限于这 里阐述 的实施例 , 相反提供这 些实施 例是为 了更加透 彻和完整 地理 解本 公开。 应当理解的是 , 本公开的附图 及实施例 仅用于 示例性 作用, 并非用 于 限制本公 开的保护 范围。 应 当理解, 本公开的方法 实施方式 中记载 的多个 步骤 .可'以按照不同的顺序 执行 , 和/ '或并行执行。 此外, 方法实施方式可以包括附加的 步骤和 /或省略执行 示 出的步骤 ■。 本公开的范国在此方面 不受限制 O 本文 使用的术 语 “包括 ”及其变形是开放性 包括",即 “包括但不限于”。术语 •“基 于 "是“至少部分地 基于”。 术语 “-一个实施例 ”表示 "至少一个实施例”; 术语*另一 实施 例 ”表示 “至少一个另外 的实施例” ; 术语"一'些实施例 ”表示 "至少一'些实施 例”。 其他术语的相关 定义将在 下文描述 中给 出。 需要 注意, 本公开中提 及的 "第一 ”、 “第二 ”等概念仅用于对不同的装置、模 块或 单元进 行区分 , 并非用于限定 这些装 置、 模块或单元 所执行 的功能 的顺序 或者 相互依存 关系。 需要 注意 , 本公开中提及 的 J 个”、 “多个 ”的修饰是示意性 而非限制 性的, 本领 域技术人 员应 当理解, 除非在上 下文另有 明确指 出, 否则应该理解 为“一个 或多 个”。 可以 理解的 是, 在使用本公 开多个 实施例公 开的技 术方案 之前, 均应当依 据相 关法律 法规通 过恰当 的方式对 本公开 所涉及个 人信息 的类型 、 使用范围、 使用 场景等告 知用户 并获得用 尸的授,权。 例如 , 在响应于接收 到用户 的主动请 求时 , 向用户发送提 示信息 , 以明确 地提 示用户 , 其请求执行的操 作将需 要获取 和使用 到用,户的个人信息。 从而, 使得 用户可 以根据提 示信 息来自主 地选择 是否向执 行本公 开技术 方案的操 作的 电子 设备、 应用程序. 服务器或 存储介质 等软件 或硬件提 供个人 信息。 作为 一种可 选的但非 限定性 的实现 方式, 响应于接收到用 户的主动 请求 , 向用 户发送 提示信 息的方式 例如可 以是弹 窗的方式 , 弹窗中可以 以文字的 方式 呈现 提示信 息。 此外, 弹窗中还可 以承载供 用户选 择 “同意” 或者 “不同意” 向 电子设备提 供个人 信息的选 择控件 。 可以 理解的 是, 上述通知和 获取用 户授权过 程仅是 示意性 的, 不对本公开 的 实现方式 构成限 定, 其它满足相 关法律 法规的方 式也可 应用于 本公开 的实现 方式 中。 图 1 为本公开实施 例所提 供的一种 图像处 理方法的 流程示 意图, 本公开实 施例 适用于基 于待 处理图像 的整体 进行图像 处理改 变图像 属性的 情形, 该方法 可 以由图像 处理装置 来执行 , 该装置可以通 过软件和 /'或硬件的形式实现, 可选 的 , 通过电子设备来 实现, 该电子设备 可以是 移动终端. 个人计 •算机 ( Personal Computer , PC )端或服务 器等。 如图 1所示, 所述图像 处理方法 包括如 下步骤。
S110. 获取待 •处理图像。 待处 理图像 可以是需 要进行 图像属 性变更 的原始 图像, 可以是通 过下载 、 拍摄 或上传 等方式 获取的 图像。 在需要对待 处理 图像进行 属性变 更的图像 特效 场景 下, 当检测到对图像特 效的触 发操作 时, 便可以获取 到待处 理图像 , 作为 目标 图像处 理对象。 对待 处理图像 进行属 性变更 的图像 特效, 可以应用于任意 一个可 以对图像 或视 频进行 处理的应 用中 。 可以理解的是 , 也可以在视频 拍 4聂过程中或是视频 :通话过程中 , 对实时获取到 的图像进 行属性 变更的图像 特效处 理。
S120. 将所述待处 理图像输 入至 图像属性 参数变 更模型 , 得到目标图像 , 其 中, 所述目标图像 的目标 属性参 数值与 所述待处 理图像 的目标 属性参数 值不 同 , 所述目标图像的 目标属性 参数值 与所述待 处理 图像的 目标属性 参数值对 应 不 同的目标 属性表现 状态。 在获 取到待 处理图像 之后 , 将待处理图像整 体作为 图像处 理的对 象, 输入 到 图像属性 参数变 更模型 中, 得到目标图像 。 相当于通过 图像属 性参数 变更模 型对 待处理 对象整体 进行特 征的提 取与分 析, 并基于特征 提取结 果进行 中间处 理, 最终输 出一 '张待变更的目标属性 与待处 理图像 中原始属 性值不 同的 目标图 像 。 相比于通过在待 处理 图像局部 添加用 于 ■改变目标属性的特效 的方式 , 本实 施例 的方式 可以使 目标属性 的改变 与待处 理图像原 图的结 合效果 更加的 自然生 动 。 目标 属性可 以是待处 理图像 中对象 的预先指 定的一 个特征 属性, 例如, 人 物 图像中人 物的性 别属性, 年龄属性 、 发型属性等 。 以性别属性作 为目标属 性 为例 , 假设待处理 图像中 的人物对 象属性 参数分 类为男性 , 可以通过将 待处理 图像 输入到 图像属性 参数变 更模型中 , 由图像属性参数 变更模 型输出 目标图像, 相应 的, 目标图像则 为待处理 图像中 的人物对 象的性别 属性表现 为女性 的图像 。 相 比于在性 别属性 为男性 的人物面 部添加 红唇、 长发等妆容特效 的方式 , 本实 施例 的图像 属性参数 变更模 型输 出的结果 实现能 够实现 "千人千面 " 的效果, 因 为每张待 处理图像 的处理 过程都 是> ■于图像中人物对 象本身发 型. 发色 . 五 官特 征个性化 生成 , 多样性极大丰富 , 自然程度也有 所增加。 图像 属性参 数变更模 型可 以是基 于包括 目标属性表 现状 态不同的 图像的 图 像样 本对进 行训练得 到的模 型。 可以以图 像样本对 中一 ■种目标属性表现 状态的 图像 作为被 训练模 型的输入 , 以另夕卜一种目标属性表现 状态的 图像作 为被训练 模型 的期望 输出图像 , 进行 .模型训练, 以得到本实施例 中所应用 的图像 属性参 数 变更模型 。 在一一种可选的实施 方式 中, 可以基于 ■包括目标属性表现 状态不 同的图像 的 图像 样本 对通过 生成对 抗的 方式进 行模型-训练得 到所 述图像 属性参 数变 更模 型 。 例如, 采用 Pix2Pix的网络架构进行模型 的训练, 使被训练 模型学会 “根据 像素 预测像 素” 。 图像 样本对 的构建方 式, 可以是先 由经过预 -训练的图像生成器生 成多个原 始样 本图像 , 多个原始样本 图像 中的目标 属性的表 现状 态可以是 相同的 , 也可 以是 不同的 ; 然后, 对每个原始样 本图像 进行特征 编码 , 并对图像特征 编码结 果进 行目标 属性参数 (目标属性特 征)调 整得到 目标编码 特征; 最后, 由生成 原始 样本 图像的图像 生成 器对目标 编码特 征进行解 码得到 与原始 样本图像 对应 的 目标样本 图像, 即经过目标属性 特征调 整后得 到的 目标属性表 现状态 与原始 样本 图像不 同的图像 。 对图像样本 对的构造 过程也 是基于 原始样 本图像 的整体 特征 进行编 码处理 , 再对图像特征 编码结 果进行 目标属性 特征的 调整, 才最终 得到 对应的 图像样 本对, 因此, 可以使图像属性 参数变更 模型学 习到不 同属性 表现 的图像样 本对之 间内在 的映射关 系。 经过 预训练 的图像生 成器可 以是对 StyleGAN 模型进 行训练得 到的 图像生 成 器。 在训练 StyleGAN过程 中, 可以设置生成 图像的分 辨率, 例如, 将生成图 像 的分辨率 设置为 1024*1024, 那么便可 以得到 多个高清 高质量 的原始 样本图 像 。 相应的, 基于高质量 的原始样 本图像-训练得到 的模型 也能够 处理高质 量的 图像 , 得到高分辨率 的图像处 理结果 。 此外, 在 StyleGAN模型训练过程 中, 根 据 图像属性 参数变更 模型中 的目标属 性,可以使 StyleGAN在训练 过程中的 输出 图像 以目标 属性的表 现不同 的图像作 为参考 ,最终使 StyleGAN模型 能够根 据随 机 采样的预 设维度 的向量, 生成包含 有目标 属性的 不同表现 状态的 原始样 本图 像 集合。 本公 开实施 例的技 术方案 , 通过在获取待 处理图像 之后; 将待处理图像输 入 至图像属 性参数 变更模型 , 得到目标图 像, 其中, 目标图像的 目标属 性参数 值 与待处理 图像的 目标属性 参数值 不同 , 目标图像的目标属 性参数 值和待 处理 图像 的目标 属性参数 值对应 不同的 目标属 性表现状 态, 本公开实 施例以待 处理 图像 整体作 为处理 对象以 改变图像 属性, 解决了相关技术 中以 图像局部 增加特 效 的方式改 变图像 属性效果 不自然 的问题 , 实现了提升 图像处理 的效果 , 使图 像属 性改变 结果更加 自然。 图 2 为本公开实施 例所提 供的又一 图像处 理方法 的流程示 意图, 在实现该 方 法流程的 过程中, 描述了 图像属性 参数变 更模型 的训练过 程, 训练样本图像 的构 造过程 。 该方法可以由 图像处理 装置来执 行, 该装置可 以通过软 件和 /或硬 件 的形式 实现, 可选的, 通过电子 设备来 实现, 该电子设备可以 是移动终 端、 PC 端或 服务器等 。 如 图 2所示, 所述图像处理方法 包括如 下步骤。
S210、 构造用于训 练图像 属性参数 变更模 型的图像 样本对 。 构造 用于模型 -训练的图像样本对的过 .程,即是基于预先-训练的 StyleGAN模 型生 成的原 始样本 图像, 构建每个 原始样 本图像 与所述原 始样本 图像对应 的目 标属 性表现 状态不 同的 目标生成 图像之间 特征映射 关系 的过程 , 最终以构造的 图像 样本对 引导被训 练图像 属性参 数变更模 型的 学习方向 。 图像样本对 的构造 过程 如下述 步骤。 步骤 一: 基于预-训练的图像 生成器 对图像 编码器进 行联合 训练, 得到能够 使原 编码对 象图像 的图像特 征编码 结果被 所述预训 练的 图像生成 器解码 为原编 码对 象图像 的目标 图像编码 器。 图像 属性参 数变更模 型的工 作过程 , 可以是图像的编 码与解 码过程 , 在步 骤-一中, 训练一个 目标图像 编码器 , 使目标图像编 码器 的图像特 征编码 结果能 够被 图像解码 器-预先训 练的 StyleGAN模型 (图像生成器, 表示为 Gs)正确解 码得 到相应 的被编码 的原始样 本图像 。 首先 , 将原编码对 象图像 (即原始 样本图像 )输入 到图像 编码器 中, 得到 原编 码对象 图像的 图像特征 编码向 量; 然后, 将原编码对 象图像 的图像特 征编 码向 量分别 输入到 图像生成 器和预 设判别 器中; 最终, 根据图像 生成器基 于所 述原 编码对 象图像 的图像特 征编码 向量生 成的特征 解码 图像以及 预设判 别器对 所述 原编码 对象图像 的图像 特征编 码向量 与图像 生成器的 训练采 样向量 的判别 结果 更新所 述图像 编码器 , 得到目标图像 编码器 。 在本买施例中 , 在计算图像 编码 器训练 过程中 的损失 函数时 , 不仅计算特征解 码图像 与原编 码时象 图像之 间 的第一损 失函数 , 还设置了一个 预设判 别器, 判别原编 码对象 图像的 图像特 征编 码向量 与图像 生成器 的训练采 样向量之 间的第 二损失 函数, 使原编码 对象 图像 的图像 特征编码 向量接 近图像 生成器 的训练 采样向量 的分布 特征, 提升训 练效 果。 当第一损失函数和 第二损 失函数 同时满足 预设的 条件时 , 完成图像编 码 器的训练 过程, 得到目标 图像编码 器。 示例 性的, 目标图像编码器的 训练过程 可参考 图 3所示的 内容。 在图 3中, 展示 了两张原 始样本 图像, 两张原始样本 图像会被 分别输入 到编码 器(Encoder) 中 , 编码器会对输入 的图像进 行特征 编码得到 特征 W。 此外, 为了编码器在 编 码过 程中能 够对输入 的原始 样本 图像进行 均匀的 随机采样 , 在编码器-训练的过 程 中还加入 了正则化 处理机制 , N表示正则 化项的个 数,如-皿 表示 正则化 过程 中 的损失函数 。 编码器输出结 果 W与正则 化处理 结果进行 叠加后, 乘以数值 N 之后 再输入 至预先 -训练( Pretrained)的 StyleGAN中, 进行特征解码, 得到原编 码对 象图像 , 且在特征解码过程 中, 输入到 StyleGAN中的 特彳正也会输入到预设 判别 器中, 判别图像特征编 码向量 与图像 生成器 的-训练采样向量 之间差别 , 图 像特 征编码 向量与图 像生成 器的训练 采样向量 会受到损 失函数 如如的约束 。训练 采样 向量为 训练过程 中图像 生成器 对原始样 本图像 进行 随机采样 的图像特 征向 重 。 步骤 二: 通过目标 图像编码 器对预 训练的 图像生成 器生成 的目标 属性表现 状 态不同的 多个原 始样本 图像中每 个原始样 本图像 进行编 码, 并基 .于多个原始 样本 图像的 图像特征 编码结果 确定 目标属性特 征向量 。 通过 该步骤, 可以确定 目标属 性对应 的特征向 量 (目标属性特征向 量) 。 原始 样本图 像是标签 已知 的图像, 相应的 , 目标图像编码器对 每个原 始样本 图 像进 行编码后 的图像 特征编码 结果 (表示为 W )也是有对 应的标签 的。 仍以性 别属 性作为 目标属 性为例 , 每-一张原始样本图像 的图像特 征编码 结果均对 应着 标签 W~male(男性 )或者 W~female(女性) 。 可以 通过多 个原始样 本图像 的图像 特征编码 结果 的分类学 习, 从中提取 出 代表 目标属 性的特征 向量。 例如, 可以通过 支持向量机 分类器 (Support Vector Machine, SVM )对多个原始 样本图像 的图像 特征编码 结果进 行分类; 然后, 基 于分 类结果 确定使 多个原始 样本 图像的所 述目标属 性表现 状态不 同的 目标属性 特征 向量 (表示为 W') , 从而将目标 属性进行 属性解耦 。 这是由于在 SVM 对 多个 原始样 本图像 的图像特 征编码 结果进 行学习 分类的过 程中 , 会对特征编码 向 童中的成 !分进行分析, 可以从成 分分析 过程中彳寻到的协方差 矩阵中提 取到 能 够使 分类结 果不同 的主要成 分, 即对应的目标属 性特征 向量。 目标属性特征向 量 的值相 当于不同 目标属性表 现状态 的一个分 界线。 步骤 三: 基于所述 目标属性特 征向量 对每个原 始样本 图像的 图像特 征编码 结果 进行 目标属性 参数编辑 , 得到所述每 个原始样 本图像 的变更 后的图像 特征 编码 结果。
Figure imgf000009_0001
步 ■骤四: 将每个原始样本 图像的变 更后的 图像特征 编码结 果输入 到图像 生 成 器中, 得到与所述 每个原 始样本 图像对应 的目标图像 , 生成图像样 本对。 最终 , 将经过目标 属性编辑 后的 图像特征 编码结 果输入到 图像生 成器中便 可 以得到 目标属性表 现状 态与原始 样本图 像不同 的目标 图像, 可以与原始 样本 图像 组成一 组图像样 本对。
S220 ” 基于所述图 像样本 时通过生 成对抗 的方式 进行模型 训练得 到所述 图 像属 性参数 变更模型 。 通过 上述步 骤得到 的图像样 本对进 行模型训 练, 可以得到 —个直接 能够改 变 目标属性 表现状 态的图像 属性参 数变更模 型, 避免了特 征编辑 的中间过 程, 可 以减少 图像处理 的时间 , 使图像属性参 数变更模 型更广 泛的应 用" 例如 , 嵌 入到 对应的 图像处理 应用中 , 进行在线的使用 。 S230. 荻取待处理 图像。
S240、 将所述待 处理图像 输入至 图像属性 参数变更 模型 , 得到目标图 像。 在 图像属性 参数变 更模型 的应用过 程中, 若需要进行 变更 图像中 目标属性 值 的特效处 理, 可以直接将待 处理 图像输入 到图像属 性参数 变更模 型中, 得到 对应 的目标 属性表现 状态不 同的目标 图像。 本 申请实施 例的技 术方案 , 通过预先训练 的图像生 成器 , 由预训练的图像 生成 器生成 多个高质 量的原 始样本 图像, 并基于每 个原始样 本图像 进行特征 提 取和 特征编 辑以改 变目标属 性的表 现状态 , 最终由图像生 成器对 经过属性 编辑 的编 码特征 进行解码 得到每 个原始 样本图 像对应 的样本对 , 并基于样本对 进行 模型 训练得 到图像属 性参数 变更模型 。 在图像属性参数 变更模 型的应用 过程中 , 可 以在获取待 处理 图像之后 , 直接将待处理图像 输入至 图像属 性参数 变更 •模型, 得到 目标 图像, 其中, 目标图像的目标属 性参数值 与待处 理图像 的目标属 性参 数值 不同, 目标图像 的目标属 性参数 值与待 处理图像 的目标 属性参 数值对 应不 同 的目标属 性表现 状态 , 本申请实施 例以待 处理图像 整体作 为处理 对象以 改变 图像 属性 , 解决了相关技 术中以 图像局部 增加特 效的方式 改变图像 属性效 果不 自然的问题 , 实现了 "千人千面 ” 的特效处理 结果, 提升图像 处理的 效果, 使 图像 属性改 变结果更 加自然 。 图 4 为本公开实 施例所提 供的一种 图像处 理装置结 构示意 图, 该装置适用 于基 于待处 理图像 的整体进 行图像处 理改变 图像属性 的情形 , 可以通过软件 和/ 或硬 件的形 式实现 , 可选的, 图像处理装 置可配 置于电子 设备来 , 该电子设备 可 以是移动 终端、 PC端 或服务器 等。 如 图 4所示 , 所述图像处理 装置包括 : 图像获取 .模块 310和图像处理模 块 320。 图像 获 4 ■叉模块 310, 设置为获取待处理图像; 图像处理模块 32。, 设置为将 所述 待处理 图像输入 至图像 属性参 数变更模 型, 得到 目标图像, 其中, 所述目 标 图像的 目标属性 参数值与 所述待 处理图 像的 目标属性参 数值不 同, 所述目标 图像 的目标 属性参数 值与所 述待处 理图像 的目标属 性参数 值对应 不同的 目标属 性表 现状态 。 本 申请实施 例所提供 的技术 方案, 通过获取待 处理 图像; 将所述待处 理图 像输 入至 图像属性 参数变 更模型 , 得到目标图像, 其中 , 所述目标图像 的目标 属性 参数值 与所述待 处理 图像的 目标属性 参数值 不同, 所述目标 图像的 目标属 性 参数值与 所述待 处理图像 的目标 属性参 数值对应 不同 的目标属 性表现状 态, 本 申请实施 例以待 处理图像 整体作 为处理 对象以 改变图像 属性 , 解决了相关技 术 中以图像 局部增加 特效 的方式改 变图像 属性效果 不自然 的问题 , 实现了提升 图像 处理的 效果, 使图像属性 改变结 果更加 自然。 在一一种可选的实 施方式 中, 所述图像处 理装置还 包括模 型刮练模 块, 设置 为 : 基于图像样本 对通过生 成对抗 的方式 进行模型 训练得 到所述 图像属性 参数 变 更模型。 所述 图像样 本对包括 由经过 预训练 的图像 生成器生 成的原 始样本 图像, 以 及 由所述预 训练的 图像生成 器对 目标编码 特彳正进行解码得到的 与所述原 始样'本 图像 对应的 目标样 本图像 , 其中, 所述目标编码特 征是对 所述原 始样本 图像进 行特 征编码 并对图像 特征编码 结果进 行目标属 性参数 调整得到 的特征 。 在一 种可选 的实施 方式中, 所述图像 处理装 置还包括-训练样 本构造模 块, 设置 为: 基于所述预 训练 的图像生 成器对 图像编码 器进行 联合训 练, 得到能够 使原 编码对 象图像 的图像特 征编码 结果被 所述预训 练的 图像生成 器解码 为所述 原编 码对象 图像的 目标图像 编码器 ; 通过所述 目标图像编 码器对 所述预 训练的 图像 生成器 生成的 所述 目标属性表 现状态 不同的 多个原始 样本 图像中的 每个原 始样 本图像 进行特征 编码 , 并基于所述多 个原始样 本图像 的图像 特征编码 结果 确定 所述 目标属性特 征向量 ; 基于所述 目标属性特 征向量 对每个 原始样 本图像 的 图像特征 编码结 果进行 目标属性 参数编 辑, 得到所述每 个原始 样本图 像的变 更后 的图像 特征编码 结果 ; 将每个原始样 本图像 的变更后 的图像 特征编 码结果 输入 到所述 预训练 的图像生 成器 中 , 得到与所述每 个原始样 本图像 对应的 目标 图像 , 生成图像样本 对。 在一 种可选 的实施 方式中 , 所述训练样本 构造模块 , 是设置为: 将所述原 编码 对象 图像输入 到图像编 码器 中, 得到所述原 编码对 象图像的 图像特征 编码 向量 ; 将所述原编码 对象 图像的 图像特征 编码向量 分别输 入到所 述预训 练的图 像生 成器和 预设判 别器中 ; 根据所述预训 练的图像 生成器 基于所 述原编码 对象 图像 的图像 特征编码 向量生 成的特 征解码 图像以及 所述预 设判别 器弑所 述图像 特征 编码向 量与所 述预训 练的图像 生成器 的训练采 样向量 的判别 结果更 新所述 图像 编码器 , 得到目标图像编 码器。 在 i种 可选的 实施方 式中, 所述训练 样本构造 模块 , 是设置为: 通过支持 向量 机分类 器对所 述多个原 始样本 图像的 图像特征 编码结 果进行 分类; 基于分 类结 果确定 使所述 多个原始 样本 图像的所 述目标属 性表现 状态不 同的 目标属性 特征 向量。 在一 •种可选的实施 方式中 , 所述训练样本 构造模块 , 是设置为: 根据每个 原始 样本 图像的图像 特征编 码结果 对应的 原始样 本图像 的目标属 性表现 状态确 定所 述目标 属性特征 向量对 应的属 性编辑 权重值 ; 将所述每个原 始样本 图像的 图像 特征编 码结果 与所述 目标属性 特征向 量和所 述属性编 辑权重 值的乘 积相叠 加 , 得到所述每个原 始样本 图像的变 更后的 图像特征 编码结果 。 本公 开实施 例所提供 的图像 处理装 置可执 行本公开 任意 实施例所 提供的 图 像处 理方法 , 具备执行方法相 应的功 能模块 。 值得 注意的 是, 上述装 .置所包括的多个单 元和模块 只是按 照功能 逻辑进 行 划 分的, 但并不局 限于上述 的划分 , 只要能够实现 相应 的功能即 可; 另外, 多 个 功能单元 的名称 也只是 为了便于 相互区 分, 并不用于 限制本公 开实施例 的保 护 范围。 图 5为本公开 实施例所提 供的一 种电子设 备的结 构示意 图。 下面参考图 5 , 其示 出了适 于用来实 现本公开 实施例 的电子设 备, (例如图 5 中的终端设备或 服 务 器 ) 40。的结构示意图。 本公开实施例 中的终端设 备可以 包括但不 限于诸如 移 动 电话、笔记本电 脑 "数字广播接 收器、个人数 字助理 ( Personal Digital Assistant, PDA )、平板电脑 ( Portable Android Device , PAD )、便携式多媒体播方攵器 ( Portable Media Player, PMP ) 、 车载终端 (例如车载导航终端) 等 的移动终 端以及诸 如 数字 电< ( Television, TV ) . 台式计算机等等的固定终端。 图 5示出的电子设 备 400仅仅是一个 示例, 不应对本 公开实施 例的功 能和使用 范围带来 任何限 制。 如 图 5所示 , 电子设 # 400可以 包括处理 装置 (例如中央处 理器. 图形处 理 器等) 401 , 其可以根据存储在只读 有储器 ( Read-Only Memory, ROM ) 402 中 的程序或 者从存储 装置 408加载,到随机访问存储器 ( Random Access Memory, RAM ) 403中的程 序而执 行多种适 当的动作 和处理 。 在 RAM 403中, 还存储有 电子 设备 400操作所需的 多种程序 和数据 。 处理装置 401、 ROM 402以及 RAM 403 通过总线 404彼此相连 。 输入 /输出 ( Input/Chitput, I/O )接口 405也连接至 总线 404 o 通常 , 以下装置可以连接 至 I/O接口 405: 包括例如触摸屏,触摸 板, 键盘、 鼠标 、 摄像头、 麦克风、 加速度计、 陀螺仪等的输 入装置 406; 包括例如液晶 显 示 器 ( Liquid Ciystal Display, LCD )、 扬声器、 振动器等的输出装置 407; 包括 例如 磁带、 硬盘等的 存储装置 408; 以及通信装 置 409 o 通信装置 409可以允许 电 子设备 400与其他设 备进行 无线或有 线通信 以交换数 据。 虽然图 5示出了具 有 多种装置 的电子设 备 400, 但是应理解 的是, 并不要求实施 或具备所 有示 出的 装置 。 可以替 ■代地实施或具备更多或 更少的装 置。 根据 本公开 的实施例 , 上文参考流 程图描 述的过程 可以被 实现为 计算机软 件程 序。 例如, 本公开的 实施例 包括一种 计算机程 序产品 , 其包括承载在 非暂 态计 算机可 读介质 上的计算 机程序 , 该计算机程序 包含用 于执行 流程图 所示的 方 法的程序 代码。 在这样的 实施例中 , 该计算机程序 可以通过 通信装 置 409从 网络 上被下载 和安装 , 或者从存储装 置 408被安装 , 或者从 ROM 402被安装 。 在该 计算机程 序被处 理装置 401 执行时, 执行本公开 实施例 的方法 中限定的 上 述功 能。 本公 开实施 方式中 的多个装 置之间 所交互 的消息或 者信息 的离称 仅用于说 明性 的目的 , 而并不是用于对 这些消 息或信 息的范围 进行限制 。 本公 开实施 例提供 的电子设 备与上 述实施 例提供 的图像处 理方法 属于 ■同 -- 发 明构思, 未在本实施例中详 尽描述 的技术 细节可参见 上述 实施例。 本公 开实施 例提供 了一种计 算机存 储介质 , 其上存储有计 算机程序, 该程 序被 处理器执 行时 实现上述 英施例所 提供的 图像处理 方法。 需要 说明的 是, 本公开上述 的计算 机可读介 质可 以是计算 机可读信 号介质 或者 计算机 可读存储 介质或 者是上 述两者 的任意组 合。 计算机可读 存储介 质例 如 可以是 - 但 不限于 - 电、 磁. 光、 电磁、 红外线、 或半导体的 系统、 装 置或 器件 , 或者任意以上 的组合 。 计算机可读存储 介质 的例子可 以包才舌但不限 于 : 具有一个或多个 导线的 电连接、 便携式计算机磁盘 、 硬盘、 RAM. ROM. 可擦 式可编程 只读存 储器 ( Erasable Programmable Read-Only Memory, EPROM ) 或 闪存、 光纤、 便携式紧凑磁 盘只读存 储器 ( Compact Disc Read-Only Memory, CD-ROM ) . 光存储器件 、 磁存储器件 、 或者上述的任 意合适的 组合。 在本公 开 中, 计算机可读存 储介质 可以是 任何包 含或存储 程序 的有形介质 , 该程序可 以被 指令执 行系统 、 装置或者器件 使用或 者与其 结合使用 。 而在本公开 中, 计 算机 可读信 号介质 可以包括 在基带 中或者 作为载,波一 ■部分传播的数据信号, 其 中承 载了计 算机可读 的程序 代码 。 这种传播的数据 信号可 以采用 多种形 式, 包 括但 不限 于电磁信 号、 光信号或上 述的任 意合适 的组合。 计算机可读信号 介质 还可 以是计 算机可读 存储介 质以外 的任何 计算机 可读介质 , 该计算机可读 信号 介质 可以发 送、 传播或者传 输用于 由指令 执行系统 、 装置或者器 件使用或 者与 其结 合使用 的程序 。 计算机可读介质 上包 含的程序 代码可 以用任 何适当 的介质 传输 , 包括但不限于 : 电线、 光缆、 射频 ( Radio Frequency, RF )等, 或者上 述 的任意合 适的组合 。 在 一 ■些实施方式 中, 客户端、 服务器可 以利 用诸 如超 文 本传 输协议 ( HyperText Transfer Protocol , HTTP )之类的任何当前已知或未来研发的网络 协议 进行通信 , 并且可以与任 意形式 或介质的 数字数据 通信 (例如, 通信网络) 互连 。 通信网络的示例 包括局域 网 ( Local Area Network , LAN ) , 广域网 ( Wide Area Network, WAN ) , 网际网 (例如, 互联网 )以及端对端网络 (例如, ad hoc 端对 端网络) , 以及任何当前 已知或未 来研发的 网络。 上述 计算机可 读介质 可以是上 述电子设 备中所 包含的 ; 也可以是单独存在 , 而 未装配入 该电子设 备中。 上述 计算机 可读介质 承载有 一个或 者多个程 序, 当上述一个或者 多个程序 被 该电子设 备执行 时, 使得该电子 设备: 获取待处理图像; 将所述 待处理 图像 输入 至图像 属性参数 变更模 型, 得到目标 图像, 其中, 所述目标 图像的 目标属 性 参数值与 所述待 处理图像 的目标 属性参 数值不 同, 所述目标 图像的 目标属性 参数 值与所 述待处理 图像的 目标属性 参数值对 应不同 的目标属 性表现 状态。 可以 以一 ~种或多种程序设计 语言或 其组合 来编写用 于执行 本公开 的操作 的 计 算机程序 代码, 上述程序设计语 言包括 但不限 于面向对 象的程 序设计 ■语言一 诸如 Java. Smalltalk > C++, 还包括常规的过程式程序设计 语言一诸 "如 语言 或类 似的程 序设计语 言。 程序代码 可以完 全地在用 户计算 机上执 行、 部分地在 用 户计算机 上执行 、 作为一个独立 的软件 包执行, 部分在用 户计算 ■机上部分在 远程 计算机 上执行 、 或者完全在远 程计算 机或服 务器上执 行。 在涉及远程 计算 机 的情形中 , 远程计算机可 以通过任 意种类 的网络 — 包括 LAN 或 WAN— 连 接到 用户计 算机, 或者, 可以连接到外部 计 •算机 (例如利用因特 网服务提供 商 来通 过因特 网连接) 。 附 图中的流 程图和框 图, 图示了按照本公开 多种 实施例的 系统、 方法和计 算机 程序产 品的可 能实现 的体系架 构、 功能和操作 。 在这点上, 流程图或框图 中 的每个方框 可以代 表一个模 块、 程序 ■段、 或代码的 -一部分, 该模块. 程序段. 或代 码的一 部分包含 一个或 多个用 于实现 规定的逻 辑功 能的可执 行指令 。 也应 当 注意, 在有些作 为替换 的实现 中, 方框中所标 注的功能 也可以 以不同 于附图 中 所标注的 顺序发 生。 例如, 两个接连地 表示的方 框实际 上可以基 本并行 地执 行 , 它们名时也可 以按相反 的顺序 执行, 这依所涉及的功 能而定 。 也要注意的 是 , 框图和/或流程图中的 每个方框 、 以及框图和 /'或流程图中的方框的组合 , 可 以用 执行规 定的功 能或操作 的专用 的基于硬 件的 系统来 实现, 或者可以用 专用 硬件 与计算机 指令的 组合来 实现。 描述 于本公 开实施例 中所 涉及到的 单元可 以通过软 件的方 式实现 , 也可以 通过 硬件的 方式来 实现。 单元的名 称在一 种情况 下并不构 成对该 单元本 身的限 定 , 例如, 第一获取单元还可 以被描 述为 "获取至少两个 网际协议 地址的 单元”。 本文 中以 上描述 的功 能可以 至少部 分地 由一个或 多个硬 件逻 辑部件 来执 行 。 例如, 非限制性地, 可以使用 的示范 类型的硬 件逻辑 部件 包括: 现场可编 程 门阵列 ( Field Programmabie Gate Array, FPG A ) . 专用集成电路 ( Application Specific Integrated Circuit, ASIC ) . 专用才示准产品 ( Application Specific Standard Parts, ASSP ) *片上系统 ( System on Chip , SOC )、复杂可编程逻辑设备 ( Complex Programmable Logic Device , CPLD )等 „ 在本 公开的 上下文 中, 机器可读介 质可以是 有形 的介质 , 其可以包含或存 储 以供指令 执行系 统、 装置或设备 使用或 与指令执 行系统 . 装置或设备结合 地 使用 的程序 。 机器可读介质 可以是 机器可 读信号介 质或机 器可读 储存介质 。 机 器可 读介质 可以包 括但不 限于电子 的、 磁性的、 光学的、 电磁的、 红外的、 或 半导 体系统 、 装置或设备 , 或者上述内容 的任何佥 适组合 。 机器可读存储 介质 的 更具体示 例会包 括基于一 个或多 个线的 电气连接 、 便携式计算 机盘、 硬盘、 RAM 、 ROM, EPROM 或快 闪存储器 、 光纤、 CD-ROM. 光学储存 设备、 磁储 存设 备、 或上述内容 的任何合 适组合 。 根据 本公开 的一个或 多个 实施例, £示例一 ]提供 了一种 图像处理 方法, 该 方法包括 : 获取待处理 图像; 将所述待 处理图像 输入至 图像属 性参 .数变更模 型 , 得到目标图像, 其中, 所述目标 图像的 目标属性参 数值与 所述待 处理图像 的 目标属性 参数值 不同, 所述目标图像的 目标属性 参数值 与所述 待处理 图像的 目标 属性参 数值对应 不同的 目标属性 表现状 态。 根据 本公开 的 -一个或多个实施例, F示例二 』提供 了一种 图像处理 方法, 还 包括: 在一些可 选的实现 方式 中, 所述图像属性 参数 变更模型 的训练 过程, 包括 : 基于图像样 本对通过 生成对 抗的方 式进行模 型刮练 得到所 述图像属 性参 数 变 •更模型; 其中, 所述图像样本对包括 由经过预 "训练的图像生成器生成 的原 始样 本图像 , 以及由所述预 洌练的 图像生 成器弑 目标编码 特征进 行解码得 到的 与所 述原始 样本图像 对应 的目标样 本图像, 其中 , 所述目标编 码特征 是对所述 原始 样本 图像进行 特征编码 并对 图像特征 编码结 果进行 目标属性 参数调 整得到 的特 征; 其中, 所述原始样本 图像的 目标属 性表现状 态与所 述原始 样本图像 对 应 的目标样 本图像的 目标属性 表现状 态不同 。 才艮据本公开的一 个或多个 实施例 , T示例三』提供 了 -一种图像处理方法 , 包括 : 在一些可选 的实现 方式中 , 所述原始样本 图像的数 量为多 个, 所述多个 原始 样本 图像为所 述预训练 的图像 生成器 生成的 目标属性 表现状 态不同 的多个 原始 样本 图像; 所述图像样 本对的 生成过 程, 包括: 基于所述预 刮练的 图像生 成 器对图像 编码器 进行联合 刮练, 得到能够使原编 码对 象图像的 图像特征 编码 结 果被所 述预训 练的 图像生 成器解 码为所 述原编 码对 象图像 的目标 图像 编码 器 ; 通过所述目标 图像编码 器对所 述预训 练的图像 生成 器生成的 所述 目标属性 表现 状态不 同的多 个原始 图像中 的每个原 始样本 图像进行 特征编 码, 并基于所 述 多个原始 样本图像 的图像 特征编 码结果 确定目标 属性特 征向量; 基于所述 目 标属 性特征 向量对 每个原始 样本 图像的图 像特征 编码结果 进行 目标属性 参数编 辑 , 得到所述每个原 始样本 图像的变 更后的 图像特征 编码结 果; 将每个原 始样 本 图像的 变更后的 图像特征 编码结 果输入 到所述预 训练 的图像生 成器中 , 得到 与所 述每个原 始样本 图像对应 的目标 图像, 生成所述图像样本 对。 根据 本公开 的 -一个或多个实施例, F示例四 』提供 了一种 图像处理 方法, 还 包括: 在一些可 选的实现 方式 中, 所述基于所述 预训练 的图像 生成器 对图像 编码 器进行 联合训 练, 得到能够使 所述,原编码对象图像 的图像 特征编 码结果被 所 述预训练 的图像生 成器解码 为所述 原编码对 象图像 的目标 图像编码 器, 包括: 将 所述原编 码对象 图像输入 到图像 编码器 中, 得到所述原 编码对 象图像 的图像 特征 编码向 >; 将所述原编 码对 象图像的 图像特征 编码 向量分别 输入到 所述预 训练 的图像 生成器 和预设判 别器 中; 根据所述预训 练的 图像生成 器基于 所述原 编码 对象 图像的图像 特征编 码向量 生成的 特征解码 图像 以及所述 预设判 别器对 所 述原编码 对象图像 的图像 特征编 码向量 与所述预 训练 的图像生 成器的训 练采 样 向量的判 别结果更 新所述 图像编码 器, 得到所述 目标图像编 码器。 根据 本公开 的- ~个或多个实施 例, 示 例五』提 供了 一种图像 处理方 法, 还 包括: 在一些可 选的实现 方式 中, 所述基于所 述多个原 始图像 的图像 特征编 码结 果确定 目标属 性特征向 量, 包括: 通过支持向量机分 类器对 所述多 个原始 样本 图像的 图像特征 编码结 果进行 分类; 基于分类 结果确 定使所 述多个原 始样 本 图像的所 述目标属 性表现状 态不 同的目标属 性特征 向量。 根据 本公开 的一 -个或多个实施例, [示例六]提供 了一种 图像处 理方法 , 还 包括 ”: 在一些可选的实现方式 中, 所述基 ■于所述目标属性的特 征向量 对每个 原始 样本 图像的图像 特征编 码结果 进行 目标属性 参数编辑 , 得到所述每 个原始 样本 图像的 变更后 的图像特 征编码 结果, 包括: 根据每个原始样 本图像 的图像 特征 编码结 果对应 的原始样 本图像 的目标 属性表现 状态确 定所述 目标属性 特征 向量 对应的 属性编 辑权重值 ; 将每个原始 样本图像 的图像 特征编 码结果 与所述 目标 属性特 征向量 和所述属 性编辑 权重值 的乘积相 叠加 , 得到所述每个原 始样 本 图像的变 更后的 图像特征编 码结果 。 根据 本公开 的 ~~个或多个实施 例, 示 例七』提 供了 一种图像 处理装 置, 包括: 图像获 取模块, 设置为获 取待处 理图像 ; 图像处理模块 , 设置为将所 述 待处 理图像 输入至 图像属性 参数变 更模型 , 得到目标图像, 其中, 所述目标图 像 的目标属 性参数值 与所述 待处理 图像的 目标属性 参数值 不同, 所述目标图像 的 目标属性 参数值 和所述待 处理 图像的 目标属性参 数值对 应不 同的目标 属性表 现状 态。 根据 本公开 的一个或 多个 实施例 , 【示例八】提供 了一种 图像处理 装置, 还 包括: 在一种可 选的实施 方式 中, 所述图像处理 装置还 包括模 型训练模 块, 设置 为: 基于图像样 本对通 过生成 对抗的 方式进行 模型训 练得到 所述图像 属性 参数 变更模 型; 其中 , 所述图像样本 对包括 由经过预 训练的 图像生 成器生成 的 原始 样本 图像, 以及由所述 预训练 的图像 生成器对 目标编 码特征 进行解码 得到 的与 所述原 始样本 图像对应 的目标 样本图 像, 其中, 所述目标编 码特征是 对所 述原 始样本 图像进行 特征编 码并对 图像特 征编码 结果进行 目标属 性参数调 整得 到 的特征; 其中, 所述原始样本 图像的 目标属性表 现状态 与所述 原始样本 图像 对应 的目标样 本图像 的目标属 性表现 状态不 同 O 才艮据本公开的一个 或多个 实施例 , T示例九』提供 了 --种图像处理 装置, 还 包括: 在一 '种可选的实施方 式中 , 所述原始样本 图像的数 量为多 个, 所述多个原 始样 本图像 为所述预 训练 的图像生 成器生 成的目标 属性表 现状态 不同的 多个原 始样 本图像 ; 所述图像处理 装 .置还包括训练样本构 造模块 , 设置为: 基于所述 预训 练的 图像生成 器对图像 编码器 进行联 合训练 , 得到能够使原 编码对 象图像 的 图像特征 编码结 果被所述 预训练 的图像 生成器解 码为所 述原编 码对象 图像的 目标 图像编 码器; 通过所述 目标 图像编码 器对所述 预训练 的图像 生成 T器生成的 所述 目标属 性表现状 态不 同的多个 原始样 本图像 中每个原 始样本 图像进行 特征 编码 , 并基于所述 多个原始 样本 图像的图 像特征 编码结 果确定 目标属性特 征向 量 ; 基于所述目标属 性特征 向量对 每个原 始样本 图像的 图像特征 编码结 果进行 目标 属性参数 编辑, 得到所述每 个原始 样本图像 的变更 后的图像 特征编 码结果; 将每 个原始 样本图像 的变 更后的 图像特征 编码结 果输入到 所述预 训练的 图像生 成器 中, 得到与所述每 个原始 样本图像 对应的 目标图像 , 生成所述图像 样本对 。 根据 本公开 的一个或 多个 实施例, 【示例十]提供 了一种 图像处 理装置 , 还 包括: 在一种可选 的实施 方式 中, 所述训练样本 构造模 块, 是设置为 : 将所 述原 编码对 象图像输 入到 图像编码 器中, 得到所 述原编码 对象图 像的图像 特征 编码 向量; 将所述原编码对 象图像 的图像 特征编码 向量分 别输入 到所述预 训练 的 图像生成 器和预设 判别器 中; 根据所述 预训练 的图像生 成器基 于所述原 编码 对 象图像的 图像特征 编码向 量生成 的特征 解码图像 以及所 述预设 判别器对 所述 图像 特征编 码向量 与所述预 刮练的 图像生 成器的训 练采样 向量的 判别结果 更新 所述 图像编码 器, 得到所述 目标图像 编码器 。 根据 本公开 的一个或 多个实施 例, 【示例十一]提供 了 -一种图像处理装置, 还 包括: 在一种可选 的实施 方式 中, 所述训练样 本构造模 块, 是设置为 : 通过 支持 向量机 分类器对 所述 多个原始 样本图 像的图像 特征编 码结果 进行分类 ; 基 于分 类结果 确定使 所述多 个原始样 本图像 的所述 目标属性 表现状 态不同 的目标 属性 特征向 量。 根据 本公开 的一个或 多个实施 例, |[示例十二 J提供了一种图像处 理装置 , 还 包括: 在一种可选 的实施 方式 中, 所述训练样 本构造模 块, 是设置为 : 根据 每个 原始样 本图像 的图像特 征编码 结果对应 的原始 样本 图像的 目标属性表 现状 态确 定所述 目标属性 特征向 量对应 的属性 编辑权重 值; 将每个原 始样本 图像的 图像 特征编 码结果 与所述 目标属性 特征向 量和所述 属性编 辑权重 值的乘 积相叠 加 , 得到所述每个原 始样本 图像的变 更后的 图像特征 编码结果 。 以上 描述仅 为本公开 的实施 例以及 对所运用 技术原 理的说 明。 本领域技术 人 员应当理 解, 本公开中所 涉及的 公开范 围, 并不限于上 述技术 特征的特 定组 合 而成的技 术方案 , 同时也应涵盖 在不脱 离上述公 开构思 的情况 下, 由上述技 术特 征或其 等同特征 进行任 意组合 而形成 的其它技 术方案 。 例如上述特征 与本 公开 中公开 的 (但不限于)具有类 似功能 的技术特 征进行 互相替 换而形成 的技 术方 案。 此外 , 虽然采用特定次 序 ■描绘了多种操作, 但是这 不应当理 解为要 求这些 操作 以所示 出的特 定次序或 以顺序 次序执 行来执行 。 在一定环境 下, 多任务和 并行 处理可 能是有 利的。 同样地, 虽然在上面论述 中包含 了多个 实现细 节, 但 是这 些不应 当被解释 为对本 公开的 范围的 限制。 在单独的 实施例 的上下文 中描 述 的一些特 征还可 以组合地 实现在 单个实 施例中 。 相反地, 在单个实施例 的上 下文 中描述 的多种 特征也可 以单独 地或以任 何合适 的子组 .合的方式买现在 多个 实施 例中。

Claims

权 利 要 求 书
L .一种图像处理方 法, 包括: 获取 待处理 图像; 将所 述待处 理图像输 入至 图像属性 参数变 更模型 , 得到目标图像, 其中, 所述 目标图 像的 目标属性参 数值与 所述待 处理图像 的目标 属性参 数值不 同, 所 述 目标图像 的目标 属性参数 值和所 述待处 理图像 的目标属 性参数 值对应 不同的 目标 属性表现 状态。
2.根据权利 要求 1所述的方法 , 其中, 所述图像属性参数变 .更 .模型的训练过 程 , 包括: 基于 图像样 本对通过 生成对 抗的方 式进行模 型训练 得到所 述图像属 性参数 变更 模型; 其 中, 所述图像样本 对包括曲 经过 预训练 的图像生 成器生 成的原 始样本 图 像 , 以及由所述预训 练的 图像生成 器对 目标编码特 征进行 解码得 到的与 所述原 始样 本图像 对应的 目标样本 图像, 其中, 所述目标编 码特征 是对所 述原始样 本 图像 进行特征 编码并 对图像特 征编码 结果进行 目标属性 参数调 整得到 的特征; 其 中, 所述原始样本 图像的 目标属 性表现状 态与所 述原始 样本图像 对应 的 目标 样本图像 的目标 属性表现 状态不 同。
3.根据权利 要求 2所述的方法 , 其中, 所述原始样本图像 的数量为 多个, 所 述多 个原始 样本图像 为所述 预-训练的图像 生成器生 成的 目标属性 表现状 态不同 的多 个原始样 本图像 ; 所述 图像样本 对的生 成过程 , 包括: 基于 所述预训 练的 图像生成 器对图 像编码 器进行联 合训练 , 得到能够使原 编码 对象图 像的图像 特征编 码结果 被所述 预训练 的图像生 成器解 码为所 述原编 码对 象图像 的目标图 像编码 器; 通过 所述 目标图像编 码器对 所述预 训练的 图像生成 器生成 的所述 目标属 性 表现 状态不 同的多 个原始样 本图像 中的每 个原始样 本图像 进行特 征编码 , 并基 于所 述多个原 始样本 图像的 图像特征 编码结果 确定 目标属性特 征向量 ; 基于 所述 目标属性特 征向量 对每个 原始样 本图像 的图像特 征编码 结果进行 目标 属性参数 编辑, 得到所述每 个原始 样本图像 的变更 后的图像 特征编 码结果; 将每 个原始样 本图像 的变更 后的图 像特征 编码结果 输入到 所述预 训练的 图 像生 成器中 , 得到与所述每 个原始 样本图 像对应 的目标 图像, 生成所述 图像样 本对 。
4.根据权利 要求 3所述的方法 , 其中, 所述基于所述预训练 的图像生 成器对 图像 编码器 进行联合 训练 , 得到能够使所 述原编码 对象 图像的图 像特征 编码结 果被 所述预 训练的 图像生成 器解码 为所述 原编码对 象图像 的目标 图像编码 器, 包括 : 将所 述原编码 对象 图像输入 到图像 编码器 中, 得到所述原 编码对 象图像 的 图像 特征编码 向量; 将所 述原编码 对象 图像的 图像特征 编码向 量分别输 入到所 述预训 练的图像 生成 器和预设 判别器 中; 根据 所述预训 练的 图像生成 器基于 所述原 编码对 象图像的 图像特 征编码 向 量生 成的特 征解码 图像以及 所述预 设判别 器对所 述原编码 对象图 像的图像 特征 编码 向量与 所述预 洌练的 图像生成 器的-训练采样 向量的判 别结果 更新所述 图像 编码 器, 得到所述 目标图像编 码器。
5.根据权利 要求 3所述的方法 , 其中, 所述基于所述多个原 始样本 图像的图 像特 征编码 结果确定 目标属性 特征向量 , 包括: 通过 支持向 量机分类 器对所 述多个 原始样 本图像 的图像特 征编码 结果进行 分类 ; 基于 分类结 果确定使 所述多 个原始 样本图像 的所述 目标属 性表现状 态不 同 的 目标属性特 征向量 。
6.根据权利 要求 5所述的方法 , 其中 , 所述基于所述目标属性特 征向量 对每 个原 始样本 图像的 图像特征 编码结 果进行 目标属性 参数编 辑, 得到所述每 个原 始样 本图像 的变更后 的图像特 征编码 结果, 包括: 根据 每个原 始样本 图像的 图像特征 编码结 果对应 的原始样 本图像 的目标属 性表 现>状态确定所述目标属 性特征 向量对应 的属性编 辑权重 值; 将所 述每个原 始样本 图像的 图像特 征编码 结果与所 述目标 属性特征 向量 和 所述 属性编 辑权重值 的乘积 相叠加 , 得到所述每个 原始样 本图像 的变更后 的图 像特 征编码 结果。
7 —种图像处 理装置 , 包括: 图像 获取模块 , 设置为获取待 处理图像 ; 图像 处理模 块, 设置为将所 述待处 理图像输 入至 图像属性 参数变 更模型 , 得到 目标图 像, 其中 , 所述目标图像的 目标属 性参数值 与所述 待处理 图像的 目 标属 性参数 值不同 , 所述目标图像 的目标 属性参数 值和所 述待处 理图像 的目标 属性 参数值对 应不 同的目标属 性表现 状态。
8,一种电子 设备, 包括: 19 至少一 个处理 器; 存储装 置, 设置为存储 至少一 个程序 , 当所 述至少一 个程序 被所述 至少一个 处理 器执行, 使得所述至少一 个处理 器实 现如权利 要求 1-6中任一所述的 图像处理 方法。
9.一种计算机 可读存 储介质 , 其上存储有计算机 程序, 其中, 该程序被处理 器执 行时实现 如权利要 求 1-6中任一所述的图 像处理方 法。
PCT/SG2023/050401 2022-06-10 2023-06-05 图像处理方法、装置、电子设备及存储介质 Ceased WO2023239302A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/873,469 US20260030510A1 (en) 2022-06-10 2023-06-05 Image processing method and apparatus, electronic device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210658013.2A CN117252954A (zh) 2022-06-10 2022-06-10 图像处理方法、装置、电子设备及存储介质
CN202210658013.2 2022-06-10

Publications (1)

Publication Number Publication Date
WO2023239302A1 true WO2023239302A1 (zh) 2023-12-14

Family

ID=89118659

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/SG2023/050401 Ceased WO2023239302A1 (zh) 2022-06-10 2023-06-05 图像处理方法、装置、电子设备及存储介质

Country Status (3)

Country Link
US (1) US20260030510A1 (zh)
CN (1) CN117252954A (zh)
WO (1) WO2023239302A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111292262A (zh) * 2020-01-19 2020-06-16 腾讯科技(深圳)有限公司 图像处理方法、装置、电子设备以及存储介质
CN111325657A (zh) * 2020-02-18 2020-06-23 北京奇艺世纪科技有限公司 图像处理方法、装置、电子设备和计算机可读存储介质
CN112241741A (zh) * 2020-08-25 2021-01-19 华中农业大学 基于分类对抗网的自适应图像属性编辑模型和编辑方法
CN114239717A (zh) * 2021-12-15 2022-03-25 北京欧珀通信有限公司 模型训练方法、图像处理方法及装置、电子设备、介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111292262A (zh) * 2020-01-19 2020-06-16 腾讯科技(深圳)有限公司 图像处理方法、装置、电子设备以及存储介质
CN111325657A (zh) * 2020-02-18 2020-06-23 北京奇艺世纪科技有限公司 图像处理方法、装置、电子设备和计算机可读存储介质
CN112241741A (zh) * 2020-08-25 2021-01-19 华中农业大学 基于分类对抗网的自适应图像属性编辑模型和编辑方法
CN114239717A (zh) * 2021-12-15 2022-03-25 北京欧珀通信有限公司 模型训练方法、图像处理方法及装置、电子设备、介质

Also Published As

Publication number Publication date
US20260030510A1 (en) 2026-01-29
CN117252954A (zh) 2023-12-19

Similar Documents

Publication Publication Date Title
US20260030809A1 (en) Image processing method and apparatus, storage medium, and electronic device
WO2023125361A1 (zh) 文字生成方法、装置、电子设备及存储介质
WO2023138560A1 (zh) 风格化图像生成方法、装置、电子设备及存储介质
CN112581635B (zh) 一种通用的快速换脸方法、装置、电子设备和存储介质
CN114049417B (zh) 虚拟角色图像的生成方法、装置、可读介质及电子设备
CN111967397A (zh) 人脸影像处理方法和装置、存储介质和电子设备
US20250095112A1 (en) Image processing method and apparatus, device, and medium
WO2023202543A1 (zh) 文字处理方法、装置、电子设备及存储介质
US20240386640A1 (en) Method, apparatus, device and storage medium for generating character style profile image
CN114863214A (zh) 图像生成模型训练、图像生成方法、装置、介质及设备
CN116596748A (zh) 图像风格化处理方法、装置、设备、存储介质和程序产品
WO2024037556A1 (zh) 图像处理方法、装置、设备及存储介质
CN115546575A (zh) 驱动模型的训练方法、驱动方法、装置、可读介质和设备
WO2023231918A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2023140787A2 (zh) 视频的处理方法、装置、电子设备、存储介质和程序产品
CN111402133A (zh) 图像处理方法、装置、电子设备及计算机可读介质
CN111402113A (zh) 图像处理方法、装置、电子设备及计算机可读介质
WO2023027628A1 (zh) 图像生成方法、装置、设备及存储介质
CN111933122B (zh) 语音识别方法、装置、电子设备和计算机可读介质
WO2023239302A1 (zh) 图像处理方法、装置、电子设备及存储介质
EP4435724A2 (en) Video generation method and device
US20250356578A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN115937338B (zh) 图像处理方法、装置、设备及介质
CN116030321A (zh) 生成图像的方法、装置、电子设备和存储介质
CN115953597A (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: 23820197

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18873469

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 23820197

Country of ref document: EP

Kind code of ref document: A1

WWP Wipo information: published in national office

Ref document number: 18873469

Country of ref document: US