Image processing method and device, electronic equipment and storage medium

By inputting the image stylization model, obtaining the image to be processed and determining the target color identification information, the problem of differentiating the color of the target object in image stylization is solved, and efficient color change processing is achieved.

CN119991411APending Publication Date: 2025-05-13BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311499406.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-10
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The prior art is difficult to achieve color differentiation of specific target objects while stylizing the image, such as changes in pupil color.

Method used

By obtaining the image to be processed, the target color identification information is determined, and inputting it into the image stylized model, a target image is generated, in which the color of the target object is related to the target color identification information.

Benefits of technology

It realizes an automated color change method of target objects in the to-process image, saving editors' time and energy and improving work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991411A_ABST
    Figure CN119991411A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a to-be-processed image; the to-be-processed image comprises a target object; determining target color identification information; inputting the to-be-processed image and the target color identification information into an image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information. The method can be applied to scenes needing to change colors, time and energy of editors can be greatly saved, and working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, electronic device and storage medium. Background Art

[0002] In video or image editing scenarios, image stylization is a widely used technology that can achieve style changes of the main body of the image, such as transforming a photo into an anime style to enhance its appeal. It is often used in social media, photography, film and television, etc. Common beautification methods can only achieve overall image stylization. When facing the same object or the same picture, only fixed image generation results or different full-image stylization results can be output. It is impossible to achieve color differentiation of specific target objects, such as eye color, while stylizing the entire image. Summary of the invention

[0003] In order to solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides an image processing method, device, electronic device and storage medium.

[0004] In a first aspect, the present disclosure provides an image processing method, comprising:

[0005] Acquire an image to be processed; the image to be processed includes a target object;

[0006] Determine target color identification information;

[0007] The image to be processed and the target color identification information are input into an image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information.

[0008] In a second aspect, the present disclosure further provides an image processing device, comprising:

[0009] An acquisition module, used for acquiring an image to be processed; the image to be processed includes a target object;

[0010] A determination module, used to determine target color identification information;

[0011] The changing module is used to input the image to be processed and the target color identification information into the image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information.

[0012] In a third aspect, the present disclosure further provides an electronic device, the electronic device comprising:

[0013] one or more processors;

[0014] A storage device for storing one or more programs;

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described above.

[0016] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the image processing method as described above when executed by a processor.

[0017] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0018] The technical solution provided by the embodiment of the present disclosure is configured to obtain an image to be processed; the image to be processed includes a target object; target color identification information is determined; the image to be processed and the target color identification information are input into an image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information, and a method for automatically changing the color of the target object in the image to be processed is provided, which can be applied to scenes where color changes are required, can greatly save editors' time and energy, and improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0021] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure;

[0022] Figure 2-Figure 4 A schematic diagram of an image processing method provided by an embodiment of the present disclosure;

[0023] Figure 5 is a structural schematic diagram of an image processing device in an embodiment of the present disclosure;

[0024] Figure 6 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0026] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0027] Figure 1 A flowchart of an image processing method provided in an embodiment of the present disclosure. This embodiment is applicable to the case where an image processing method is performed in a client. The method can be executed by an image processing device. The device can be implemented in software and / or hardware. The device can be configured in an electronic device, such as a terminal or a server. The terminal specifically includes but is not limited to a smart phone, a PDA, a tablet computer, a wearable device with a display screen, a desktop computer, a laptop computer, an all-in-one machine, a smart home device, etc.

[0028] like Figure 1 As shown, the method may specifically include:

[0029] S110, obtaining an image to be processed; the image to be processed includes a target object.

[0030] The image to be processed is an image on which a color change process is desired to be performed, and includes a target object.

[0031] The target object may be, for example, an object located in the image to be processed and whose color is desired to be changed. The present application does not limit the specific object referred to by the target object. For example, the target object may be the pupil of a person or an animal.

[0032] S120: Determine target color identification information.

[0033] The target color may be, for example, a color that the target object in the image to be processed is desired to appear after the color of the target object in the image to be processed is changed.

[0034] The color identification information may be, for example, label information for referring to a specific color, which is a unique identifier of the color. Based on the color identification information, different colors can be distinguished. The color identification information is specifically a string consisting of punctuation marks, graphic symbols, or numbers. Exemplarily, the color identification information is a color ID, or an RGB value, etc.

[0035] The target color identification information may be, for example, label information indicating the target color, such as the target color ID, or the target color RGB value.

[0036] There are many specific implementation methods for this step, which are not limited in this application. Exemplarily, the implementation method of this step includes: determining the target color identification information based on the image features of the image to be processed and / or the preset color change rules.

[0037] The image feature of the image to be processed refers to the attribute of the image to be processed, which may specifically be an attribute used to describe the content, style, theme, etc. of the image to be processed.

[0038] Furthermore, the image to be processed also includes candidate objects, which can be, for example, other things in the image to be processed except the target object. For example, if the image to be processed reflects an image of a person standing in front of a table, if the pupil of the person is the target object, the candidate objects are other things in the image to be processed except the pupil, such as the white of the person's eye, the person's face, limbs, torso and the table.

[0039] The image features of the image to be processed may be features of the target object, features of the candidate object, or features presented by the image to be processed as a whole. For example, if the image to be processed reflects an image of a person standing in front of a table, the image features of the image to be processed may include the person's skin color, the color of the person's eyebrows, the shape of the person's eyes, the color of the pupils, the shape of the table, the position of the table, the intensity of the ambient light, etc.

[0040] The preset color change rule may be, for example, a preset color conversion rule. The present application does not limit the specific contents of the preset color change rule. Exemplarily, the preset color change rule defines the correspondence between the image features of the image to be processed and the target color, such as the preset color change rule includes: if the color of the target object in the image to be processed is black, the changed color is red; or, if the skin color of the person in the image to be processed is white, the changed color is red.

[0041] Alternatively, the preset color change rule is a target color determination rule that is independent of the image features of the image to be processed. For example, the preset color change rule specifies that the colors are changed in the order of red, green, yellow, and blue. Specifically, when the image processing method provided by the present application is executed for the first time, no matter what color the target object in the image to be processed is, it is changed to red; when the image processing method provided by the present application is executed for the second time, no matter what color the target object in the image to be processed is, it is changed to green; ...

[0042] S130, inputting the image to be processed and the target color identification information into an image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information.

[0043] The image stylization model is a pre-trained machine learning model that can change the color of the target object in the image to be processed according to the target color identification information. In some embodiments, in addition to changing the color of the target object in the image to be processed, the image stylization model can also perform stylized processing on the target object and / or candidate object in the image to be processed.

[0044] Among them, stylizing an object means adding stylized features to it, and the stylized features may be, for example, sketch portrait style features, cartoon image (animation) style features, and oil painting style features.

[0045] The target image is the image processed by the image stylization model.

[0046] The color of the target object is related to the target color identification information. Specifically, the color of the target object is consistent with or similar to the color indicated by the target color identification information.

[0047] The above technical solution is configured to obtain an image to be processed; the image to be processed includes a target object; target color identification information is determined; the image to be processed and the target color identification information are input into an image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information, and a method for automatically changing the color of the target object in the image to be processed is provided, which can be applied to scenes where color changes are required, and can greatly save editors' time and energy and improve work efficiency.

[0048] It should be emphasized that since the image stylization model can change the color of the target object and stylize the target object and / or candidate object in the processed image, it can achieve the purpose of editing multiple editing items at one time, thereby improving image processing efficiency.

[0049] Based on the above technical method, optionally, the method further includes training an image stylization model. The training method of the image stylization model includes: obtaining first training data; the first training data includes a first sample image, a second sample image, and second sample color identification information; the difference between the second sample image and the first sample image includes a different color of the target object; the color of the target object in the second sample image is related to the second sample color identification information; and using the first training data to train the image stylization model.

[0050] The color of the target object in the second sample image is related to the second sample color identification information. For example, the color of the target object in the second sample image is related to or similar to the color indicated by the second sample color identification information.

[0051] In some embodiments, the difference between the second sample image and the first sample image includes a different color of the target object, and a different style of the target object and / or the candidate object.

[0052] Optionally, training the image stylization model using the first training data includes: inputting the first sample image and the second sample color identification information into the image stylization model to be trained to obtain a second reference image; determining a loss function based on the second reference image and at least one of the first sample image, the second sample image, and the second sample color identification information; and adjusting parameters in the image stylization model according to the loss function.

[0053] For example, see Figure 2 , assuming that the image stylization model is a generative adversarial model, the image stylization model includes a generator and a discriminator. The difference between the second sample image and the first sample image includes the different colors of the pupils of the characters in the images. The color of the pupils of the characters in the first sample image is black, the color of the pupils of the characters in the second sample image is red, and the second sample color identification information is a red ID. During training, the first sample image and the second sample color identification information are input into the generator in the image stylization model to be trained to obtain a second reference image; the discriminator calculates the similarity between the second reference image and the first sample image, the second sample image, and the second sample color identification information, and adjusts the parameters in the generator based on the similarity between the second reference image and the first sample image, the second sample image, and the second sample color identification information, and finally obtains a trained image stylization model.

[0054] Furthermore, in practice, there are many methods for obtaining the first training data, and this application does not limit this. Exemplarily, the first training data can be generated with the help of a model that already has the ability to change color. Here, it should be noted that the image stylization model mentioned in this application is a model that is expected to be deployed on the terminal. Usually, the hardware configuration of the terminal is poor and is not suitable for running a large model. The "model that already has the ability to change color" in the above text can be, for example, a large model running on a server. "Generate the first training data with the help of a model that already has the ability to change color" can be understood as using an existing model with multiple functions (including a color change function) to generate the first training data, and using the first training data to train a model (i.e., an image stylization model) with a few functions (including a color change function and a stylization function). This makes it easy to deploy the image stylization model on the terminal, so that the user is not restricted by the strength of the network signal, time, and location when processing the image, which is suitable for different usage scenarios and is also conducive to protecting user privacy.

[0055] The specific method of generating the first training data with the help of a model that already has the ability to change color may include: obtaining a first sample image and a first color description text information; inputting the first sample image and the first color description text information into a color change marking model to obtain a second sample image and a second sample color identification information; the second sample image is an image after the color of the target object in the first sample image is changed; the color of the target object in the second sample image is related to the first color description text information; the second sample color identification information is related to the first color description text information; and establishing a binding relationship between the first sample image, the second sample image, and the second sample color identification information to obtain the first training data.

[0056] The first sample image is the image before the color change, which is the original image. The first color description text information is the color of the target object in the changed image that is expected to be presented after the color change of the first sample image. The second sample image is the image obtained after the color change of the first sample image.

[0057] The color of the target object in the second sample image is related to the first color description text information. For example, the color of the target object in the second sample image may be the same as or similar to the color specified by the first color description text information.

[0058] The second sample color identification information is related to the first color description text information. For example, the second sample color identification information and the first color description text information may refer to the same or similar color.

[0059] The color change marking model may be, for example, a model that already has the color change capability. As mentioned above, the volume of the color change marking model is larger than the volume of the image stylization model. The color change marking model is used to be deployed on a server. The color change marking model also has a marking function and can output second sample color identification information. The second sample color identification information refers to the color presented by the target object in the second sample image.

[0060] See for example Figure 3 , assuming that the pupil color of the person in the first sample image is green, and the first color description text information is "the pupil color is red", the first sample image and the first color description text information are input into the color change labeling model, and the second sample image is obtained. The pupil color of the person in the second sample image is red and the second sample color identification information is red ID. A binding relationship is established between the first sample image, the second sample image, and the second sample color identification information to obtain a first training data.

[0061] By adopting this method, a large number of first sample images are input while keeping the first color description text information unchanged, and a large number of first training data will be obtained, which is conducive to improving the performance, generalization ability and robustness of the subsequently trained image stylization model.

[0062] Furthermore, in order to enable the color change marking model to have color change function and marking function, the color change marking model can be pre-controlled to learn the correspondence between the color of the target object and the color text description information, and the correspondence between the color text description information and the color identification information.

[0063] A specific method for controlling a color change labeling model to learn the correspondence between the color of a target object in an image and color text description information may include: obtaining multiple image text sets, the image text sets including one or more traction maps and traction text description information; the traction map including the target object; the traction text description information is used to describe the color of the target object in the traction map; in the same image text set, the colors of target objects in different traction maps are the same; in different image text sets, the colors of target objects in different traction maps are different; and using multiple image text sets to train the color change labeling model.

[0064] The traction map can be, for example, an image used to assist the color change marking model in learning the correspondence between color and color text description information. In practice, the traction map can have a certain style, such as cartoon style, oil painting style, etc. The traction map can be hand-drawn, generated by a Wensheng map model, or computer rendering. The traction text description information is used to describe the color presented by the target object in the traction map.

[0065] For example, see Figure 4 , assuming that three image-text sets are obtained, each of which includes 10 traction images and one traction text description information. Figure 4 In image text set 1, the pupil color of each character in the traction image is red, and the traction text description information is "the pupil color is red". In image text set 2, the pupil color of each character in the traction image is green, and the traction text description information is "the pupil color is green". In image text set 3, the pupil color of each character in the traction image is blue, and the traction text description information is "the pupil color is blue". By inputting each image text set into the color change labeling model, the color change labeling model can learn the correspondence between the color of the target object in the image (i.e., pupil color) and the color text description information.

[0066] Similarly, inputting the correspondence between the color text description information and the color identification information into the color change marking model can enable the color change marking model to learn the correspondence between the color text description information and the color identification information.

[0067] Furthermore, the size of the image stylization model is smaller than that of the color change labeling model; the image stylization model is used to be deployed on the terminal; and the color change labeling model is used to be deployed on the service.

[0068] Furthermore, the image stylization model is built based on the generative adversarial network; the color change labeling model is built based on the diffusion model.

[0069] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0070] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0071] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0072] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0073] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0074] Figure 5 Schematic diagram of the structure of an image processing device in an embodiment of the present disclosure. The image processing device provided in the embodiment of the present disclosure can be configured in a client or in a server. Figure 5 , the image processing device specifically comprises:

[0075] The acquisition module 510 is used to acquire an image to be processed; the image to be processed includes a target object;

[0076] A determination module 520 is used to determine target color identification information;

[0077] The changing module 530 is used to input the image to be processed and the target color identification information into the image stylization model to obtain a target image; in the target image, the color of the target object is related to the color indicated by the target color identification information.

[0078] Further, the determination module 520 is used to:

[0079] The target color identification information is determined based on the image features of the image to be processed and / or preset color change rules.

[0080] Furthermore, the device also includes a training module, which is used to:

[0081] Acquire first training data; the first training data includes a first sample image, a second sample image, and second sample color identification information; the difference between the second sample image and the first sample image includes a different color of the target object; the color of the target object in the second sample image is related to the second sample color identification information;

[0082] The image stylization model is trained using the first training data.

[0083] Furthermore, the device also includes a training module, which is used to:

[0084] Acquire a first sample image and first color description text information;

[0085] The first sample image and the first color description text information are input into the color change marking model to obtain a second sample image and second sample color identification information; the second sample image is an image after the color of the target object in the first sample image is changed; the color of the target object in the second sample image is related to the first color description text information; the second sample color identification information is related to the first color description text information;

[0086] A binding relationship is established between the first sample image, the second sample image, and the second sample color identification information to obtain first training data.

[0087] Furthermore, the device also includes a training module, which is used to:

[0088] Before inputting the first sample image and the first color description text information into the color change marking model to obtain the second sample image and the second sample color identification information, a plurality of image text sets are obtained, wherein the image text set includes one or more traction diagrams and traction text description information; the traction diagram includes a target object; the traction text description information is used to describe the color of the target object in the traction diagram; in the same image text set, the colors of the target objects in different traction diagrams are the same; in different image text sets, the colors of the target objects in different traction diagrams are different;

[0089] The color change labeling model is trained using the multiple image-text sets.

[0090] Further, the volume of the image stylization model is smaller than the volume of the color change marking model;

[0091] The image stylization model is used to be deployed on a terminal;

[0092] The color change marking model is used to be deployed on a service.

[0093] Furthermore, the image stylization model is constructed based on a generative adversarial network;

[0094] The color change marking model is constructed based on a diffusion model.

[0095] The image processing device provided in the embodiment of the present disclosure can execute the steps executed by the client or server in the image processing method provided in the embodiment of the method of the present disclosure, and has the execution steps and beneficial effects, which will not be repeated here.

[0096] Figure 6 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 6 , which shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing the embodiment of the present disclosure. The electronic device 1000 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0097] like Figure 6As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 to a random access memory (RAM) 1003 to implement the image processing method of the embodiment described in the present disclosure. In the RAM 1003, various programs and information required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0098] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange information. Although Figure 6 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0099] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the image processing method as described above. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1009, or installed from a storage device 1008, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0100] It should be noted that the computer-readable medium disclosed above 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. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include an information signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated information signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0101] In some embodiments, the client and the server may communicate using any known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital information communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any known or future developed network.

[0102] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0103] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0104] Acquire an image to be processed; the image to be processed includes a target object;

[0105] Determine target color identification information;

[0106] The image to be processed and the target color identification information are input into an image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information.

[0107] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0108] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0111] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0112] In the context of the present disclosure, 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, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0113] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:

[0114] one or more processors;

[0115] A memory for storing one or more programs;

[0116] When the one or more programs are executed by the one or more processors, the one or more processors implement any image processing method provided in the present disclosure.

[0117] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the image processing method as described in any one of the present disclosure is implemented.

[0118] The embodiments of the present disclosure further provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the image processing method described above is implemented.

[0119] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0120] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image processing method, characterized in that: include: Acquire an image to be processed; the image to be processed includes a target object; Determine target color identification information; The image to be processed and the target color identification information are input into an image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information.

2. The method according to claim 1, characterized in that The step of determining the target color identification information includes: The target color identification information is determined based on the image features of the image to be processed and / or preset color change rules.

3. The method according to claim 1, characterized in that The training method of the image stylization model includes: Acquire first training data; the first training data includes a first sample image, a second sample image, and second sample color identification information; the difference between the second sample image and the first sample image includes a different color of the target object; the color of the target object in the second sample image is related to the second sample color identification information; The image stylization model is trained using the first training data.

4. The method according to claim 3, characterized in that The acquiring of the first training data comprises: Acquire a first sample image and first color description text information; The first sample image and the first color description text information are input into the color change marking model to obtain a second sample image and second sample color identification information; the second sample image is an image after the color of the target object in the first sample image is changed; the color of the target object in the second sample image is related to the first color description text information; the second sample color identification information is related to the first color description text information; A binding relationship is established between the first sample image, the second sample image, and the second sample color identification information to obtain first training data.

5. The method according to claim 4, characterized in that Before inputting the first sample image and the first color description text information into the color change marking model to obtain the second sample image and the second sample color identification information, the method further includes: Acquire multiple image-text sets, wherein the image-text sets include one or more traction images and traction text description information; the traction image includes a target object; the traction text description information is used to describe the color of the target object in the traction image; in the same image-text set, the colors of the target objects in different traction images are the same; in different image-text sets, the colors of the target objects in different traction images are different; The color change labeling model is trained using the multiple image-text sets.

6. The method according to claim 4, characterized in that Also includes: The volume of the image stylization model is smaller than the volume of the color change marking model.

7. The method according to claim 6, characterized in that Also includes: The image stylization model is constructed based on a generative adversarial network; The color change marking model is constructed based on a diffusion model.

8. An image processing device, characterized in that: include: An acquisition module, used for acquiring an image to be processed; the image to be processed includes a target object; A determination module, used to determine target color identification information; The changing module is used to input the image to be processed and the target color identification information into the image stylization model to obtain a target image; in the target image, the color of the target object is related to the target color identification information.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.