Image processing method and device, computer equipment and storage medium

By constructing and adjusting the stylized model, the problems of low efficiency and difficulty in decoupling of multiple styles in the prior art are solved, and efficient and effective multiple styles are generated.

CN119516294APending Publication Date: 2025-02-25BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311000503.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-09
Publication Date
2025-02-25

Smart Images

  • Figure CN119516294A_ABST
    Figure CN119516294A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring images in various styles; determining style description information and content description information corresponding to the image; wherein the content description information corresponding to the images comprises first preset words, the style description information comprises second preset words, and the second preset words contained in the style description information corresponding to the images in the same style are the same; and based on the style description information corresponding to the image and the content description information, constructing prompt information corresponding to the image, and based on the prompt information, adjusting an initial stylized model to obtain a target stylized model, the target stylized model being used for generating the target images of the various styles. In this way, the image generation effect can be improved, and the image generation 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 computer technology, and in particular to an image processing method, apparatus, computer equipment and storage medium. Background Art

[0002] With the rapid development of artificial intelligence technology, artificial intelligence generated content (AIGC) has gradually entered people's daily lives. The network model based on AIGC technology can generate articles, images, audio and other content that match the input content based on input keywords, descriptions or images, thereby realizing the content generation function.

[0003] Taking the generation of stylized images as an example, users can enter prompt information, and then the network model based on AIGC technology generates the corresponding stylized image. In order to improve the generation effect of a certain style, it is generally necessary to train the network model based on images of a specific style. However, the network model trained by this method can only focus on a certain style. If you want to improve the generation effect of multiple styles, you need to train multiple network models, which is inefficient. Summary of the invention

[0004] The embodiments of the present disclosure at least provide an image processing method, apparatus, computer equipment, and storage medium.

[0005] In a first aspect, an embodiment of the present disclosure provides an image processing method, including:

[0006] Get images in multiple styles;

[0007] Determining style description information and content description information corresponding to the image; wherein the content description information corresponding to the image includes a first preset word, the style description information includes a second preset word, and the second preset words included in the style description information corresponding to the images of the same style are the same;

[0008] Based on the style description information corresponding to the image and the content description information, prompt information corresponding to the image is constructed, and based on the prompt information, an initial stylization model is adjusted to obtain a target stylization model, wherein the target stylization model is used to generate target images of the multiple styles.

[0009] In a second aspect, the present disclosure also provides an image processing device, including:

[0010] The acquisition module is used to obtain images in various styles;

[0011] A determination module, configured to determine the style description information and content description information corresponding to the image; wherein the content description information corresponding to the image includes a first preset word, the style description information includes a second preset word, and the second preset words included in the style description information corresponding to the images of the same style are the same;

[0012] An adjustment module is used to construct prompt information corresponding to the image based on the style description information corresponding to the image and the content description information, and to adjust the initial stylization model based on the prompt information to obtain a target stylization model, wherein the target stylization model is used to generate target images of the multiple styles.

[0013] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.

[0014] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.

[0015] The image processing method, apparatus, computer equipment and storage medium provided by the embodiments of the present disclosure can obtain images in a variety of styles, and then construct prompt information corresponding to the image based on the style description information and content description information corresponding to the image; here, since the prompt information includes the style description information, decoupling between different image styles can be achieved. Furthermore, the initial stylization model is adjusted based on the prompt information, and the initial stylization model can be trained to distinguish between various styles, and then target images of various styles can be generated through the adjusted target stylization model; in addition, since the initial stylization model is a pre-trained model and contains relatively rich text prior information, and the style description information includes the first preset word, and the content description information includes the second preset word, in this way, the prior information of the initial stylization model can be eliminated, and the influence of the prior information of common words in the text in the style description information and the content description information on the generated target image can be avoided, thereby improving the effect of generating the image.

[0016] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

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

[0019] Figure 2 A schematic diagram of the architecture of an image processing device provided by an embodiment of the present disclosure is shown;

[0020] Figure 3 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0022] Fine-tuning of a large model can freeze some parameters of the original large model, and build a LoRA model with a small number of parameters. By training the LoRA model, fine-tuning training of the original large model can be achieved. After the LoRA model is trained, when calling the large model, the frozen parameters in the large model and the trained parameters in the LoRA model can be called to achieve data processing.

[0023] When LoRA training is applied to the field of image processing, it is generally necessary to first obtain text-image pairs of a specific style as training data, and obtain a large number of images of general styles as regression data, and then establish a correspondence between the regression data and the training data, that is, the training data is a subclass of the regression data, and the image style of the training data is one of the general styles of the regression data. For example, if the training data is wedding photo data of a certain style, then the regression data is general wedding photo data containing various styles. Then, some parameters of the pre-trained large model are frozen, and fine-tuning training is performed by opening a small part of the parameters of the large model.

[0024] However, in this LoRA training method, since the training data is a text-image pair of a specific style, the trained LoRA model has a better processing effect on the specific style, and an average or poor processing effect on other styles; and since the LoRA model cannot distinguish between training data of multiple styles, it is impossible to train the LoRA model with training data of multiple styles; if you want to improve the processing effect of multiple styles, you need to train multiple LoRA models, which is inefficient.

[0025] Based on the above research, the present disclosure provides an image processing method, apparatus, computer equipment and storage medium, which can obtain images in various styles, and then construct prompt information corresponding to the image based on the style description information and content description information corresponding to the image; here, since the prompt information includes the style description information, decoupling between different image styles can be achieved. Furthermore, the initial stylization model is adjusted based on the prompt information, and the initial stylization model can be trained to distinguish between various styles, and then target images of various styles can be generated through the adjusted target stylization model; in addition, since the initial stylization model is a pre-trained model, it contains relatively rich text prior information, and the style description information includes a first preset word, and the content description information includes a second preset word, in this way, the prior information of the initial stylization model can be eliminated, and the influence of the prior information of common words in the text in the style description information and the content description information on the generated target image can be avoided, thereby improving the effect of generating the image.

[0026] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0027] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0028] 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.

[0029] 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.

[0030] 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.

[0031] 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.

[0032] To facilitate understanding of the present embodiment, an image processing method disclosed in the present embodiment is first introduced in detail. The execution subject of the image processing method provided in the present embodiment is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the image processing method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0033] See also Figure 1FIG. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure, wherein the method includes steps 101 to 103, wherein:

[0034] Step 101: Obtain images in multiple styles.

[0035] Step 102: determine the style description information and content description information corresponding to the image; wherein the content description information corresponding to the image includes a first preset word, the style description information includes a second preset word, and the second preset words contained in the style description information corresponding to images of the same style are the same.

[0036] Step 103: construct prompt information corresponding to the image based on the style description information corresponding to the image and the content description information, and adjust the initial stylization model based on the prompt information to obtain a target stylization model, wherein the target stylization model is used to generate target images of the multiple styles.

[0037] The following is a detailed description of the above steps.

[0038] For step 101,

[0039] The multiple styles may refer to styles to be optimized, for example, multiple styles selected by a user; or may be multiple styles whose popularity information satisfies preset conditions and is screened out based on popularity information corresponding to each style.

[0040] Acquiring images in multiple styles may refer to acquiring multiple images in any style. Optionally, the number of multiple images acquired in each style may be the same. Exemplarily, if there are N styles and M images are acquired in each style, a total of M*N images may be acquired.

[0041] In a possible implementation, when acquiring images in multiple styles, images in multiple styles uploaded by users may be received, and the images in multiple styles may be uploaded by at least one user. The above implementation is only an example of how to acquire images, and the present disclosure does not limit it.

[0042] It should be noted that the above process of acquiring the image is obtained after the user's authorization. In the following steps, the attribute detection of the image is also correspondingly authorized by the user. The specific authorization process refers to the description of paragraphs 10 to 13 of the specific implementation method.

[0043] For step 102,

[0044] The style description information is information used to describe the style of the image, for example, it may be a style name.

[0045] The content description information is information used to describe the content object contained in the image. The content description information may include the content object and the descriptive words corresponding to the content object. For example, the content description information may be "curly hair", "fair skin", "round eyes", etc., where "hair", "skin", "eyes", etc. are content objects, and "curly", "fair", "round" are descriptive words.

[0046] The content description information includes a first preset word, which may be a first rare word, which may be understood as an uncommon word, for example, a word generated by a random combination of characters; the style description information includes a second preset word, which and the first preset word are both rare words, and are referred to here as the first preset word and the second preset word only to distinguish between the preset words included in the style description information and the preset words included in the content description information.

[0047] In a possible implementation manner, for any image, when determining the content description information corresponding to the image, the following steps may be performed:

[0048] Step a1: for any image, perform attribute detection on the image to determine the initial content description information corresponding to the image; wherein the initial content description information includes the name of the content object in the image and the description words for the content object.

[0049] Step a2: replacing the description words of the content object based on the first preset words contained in the first preset word library to obtain content description information corresponding to the image.

[0050] Here, when performing attribute detection on the image, the detection may be performed through a general labeling model, for example, a Bootstrapping Language-Image Pre-training (BLIP) model.

[0051] Optionally, after performing attribute detection based on the universal labeling model, the attributes may be expanded according to a preset paradigm. Exemplarily, attribute detection is performed based on the universal labeling model, and the detection result includes attribute A and attribute B. The preset paradigm may also include attribute C and attribute D. Then, attribute C and attribute D may be detected on the image to determine the attribute values ​​of attribute C and attribute D. Attribute A, attribute B, attribute C, and attribute D together constitute the initial content description information of the image.

[0052] The first preset word library may include multiple first preset words, and the preset words may be rare words generated by random combination of characters. The rare words may not contain existing words, that is, the rare words are words other than common words included in the common word library; the number of characters contained in different preset words in the first preset word library and the specific characters contained may be different.

[0053] In a possible implementation, the first preset word library may include, in addition to the first preset words, a first correspondence between some of the first preset words and historical description words, wherein the some of the first preset words are associated with the content objects described by the historical description words.

[0054] Here, the historical description words may refer to description words in content description information of other images, and the other images may refer to images that have been replaced with preset words, that is, images whose content description information has been determined.

[0055] Since the part of the first preset words is associated with the content object described by the historical description word, if the same historical description word describes different content objects, the same historical description word may correspond to different first preset words, that is, in the first corresponding relationship, there may be a situation where the same historical description word corresponds to different first preset words.

[0056] Exemplarily, if the historical description word is "Orange", the historical description information is "Orange makeup" and "Orange lips", and the content objects described by the historical description words are "makeup" and "lips" respectively, and the content objects described by the two are different. Therefore, the historical description word "Orange" has two corresponding first preset words in the first correspondence, for example, "asd" and "mmc" respectively. Accordingly, after the historical description information is replaced with the description words based on the first preset words, "Orange makeup" is replaced with "asd makeup" and "Orange lips" is replaced with "mmc lips".

[0057] In step a2, when replacing the descriptive word of the content object based on the first preset word contained in the first preset word library, it can be determined first whether there is a first preset word corresponding to the descriptive word of the content object in the first corresponding relationship; if so, the description word of the content object is directly replaced based on the determined first preset word to obtain the content description information corresponding to the image; if not, the description word of the content object is replaced based on other first preset words in the first preset word library except some of the first preset words in the first corresponding relationship to obtain the content description information corresponding to the image.

[0058] Among them, when determining whether there is a first preset word corresponding to the descriptive word of the content object in the first corresponding relationship, it can be determined first whether the first corresponding relationship contains the descriptive word to be replaced (that is, the descriptive word of the content object in the current initial content description information); if not, it is directly determined that there is no first preset word corresponding to the descriptive word of the content object in the first corresponding relationship; if the first corresponding relationship contains the descriptive word to be replaced, it can be determined whether the content object associated with the first preset word corresponding to the descriptive word contained in the first corresponding relationship is the same as the content object described by the descriptive word to be replaced; if they are the same, it is determined that there is a first preset word corresponding to the descriptive word of the content object in the first corresponding relationship.

[0059] Exemplarily, if the content description information is “orange hair” and the descriptive word to be replaced in the content description information is “orange”, it is possible to first determine whether “orange” exists in the first correspondence. If so, it is possible to further determine what the content object associated with the first preset word (for example, dfg) corresponding to “orange” in the first correspondence is. If it is “lipstick”, which is inconsistent with the content object “hair” in the content description information, then a preset word other than the preset word in the first correspondence (for example, wer) is randomly selected from the first preset word library to replace “orange” in the content description information. The content description information after replacement is “wer hair”; if the content object associated with the first preset word (for example, dfg) corresponding to “orange” is “hair”, which is the same as the content object in the content description information, the content description information can be replaced with “dfg hair”.

[0060] Furthermore, after replacing the description words of the content object based on other first preset words in the first preset word library except some of the first preset words in the first corresponding relationship, the first corresponding relationship can also be updated based on the other first preset words and the description words of the content object.

[0061] Specifically, a correspondence relationship between the other first preset words and the description words of the content object may be established in the first correspondence relationship, and the other first preset words may be associated with the content object.

[0062] Continuing with the above example, after replacing "orange" based on "wer", a correspondence between "wer" and "orange" can be established in the first correspondence, and "wer" can be associated with "hair".

[0063] When determining the content description information of other images again, the corresponding first preset word may be determined according to the above method based on the corresponding relationship.

[0064] In a possible implementation manner, for any image, when determining the style description information corresponding to the image, any one of the following methods may be used:

[0065] Method 1: for the style setting instruction of the image, based on the second preset word carried in the style setting instruction, determine the style description information corresponding to the image.

[0066] Specifically, the user can select a second preset word from the second preset word library, and generate a style setting instruction based on the selected preset word. In this way, the second preset word in the style description information can be directly set.

[0067] Alternatively, in another possible implementation, the user can directly set the style type of the image, and then determine the second preset word corresponding to the style type set by the user based on a second correspondence between the style type and the second preset word in a second preset vocabulary to determine the corresponding style description information of the image.

[0068] Exemplarily, if the style type of the image set by the user is style A, and in the second corresponding relationship, the second preset word corresponding to style A is "qwe", then "qwe" can be used as the style description information corresponding to the image.

[0069] If the second preset word corresponding to the style type set by the user is not found in the second corresponding relationship, any other second preset word in the second preset word library except the preset word in the second corresponding relationship can be used as the style description information corresponding to the image.

[0070] Correspondingly, after using any other second preset word in the second preset word library except the preset word in the second corresponding relationship as the style description information corresponding to the image, the second corresponding relationship can also be updated based on any other second preset word and the style type.

[0071] Method 2: Perform style detection on the image to determine initial style description information corresponding to the image, and replace the initial style description information based on a second preset word in a second preset word library to obtain style description information corresponding to the image.

[0072] Exemplarily, when performing style detection on the image, the style detection can be performed on the image through a pre-trained style detection model. The initial style description information can be understood as the style type to which the image belongs before the preset word is replaced. The replacement of the initial style description information based on the second preset word in the second preset vocabulary can be based on the second corresponding relationship. The specific replacement method refers to the description in method 1 and will not be repeated here.

[0073] For step 103,

[0074] In a possible implementation, constructing the prompt information corresponding to the image based on the style description information and the content description information corresponding to the image may mean that, for any image, the style description information and the content description information corresponding to the image are concatenated in a preset order to obtain the prompt information.

[0075] Exemplarily, the preset order may mean that the style description information is in front and the content description information is in the back, that is, style description information+content description information.

[0076] The initial stylized model may refer to a pre-trained model, and the process of adjusting the initial stylized model based on the prompt information may be understood as a fine-tuning training process.

[0077] In a possible implementation, the initial stylized model may be a LoRA model. A specific method for constructing the LoRA model will be described below.

[0078] Optionally, when adjusting the initial stylization model based on the prompt information, the prompt information can be input into the initial stylization model to obtain a predicted image output by the initial stylization model, and then the initial stylization model is adjusted based on the predicted image and the prompt information.

[0079] In the Wensheng picture scene, theoretically, after the prompt information is input into the initial stylization model, the image content of the predicted image output by the initial stylization model should be consistent with the prompt information. Therefore, the model performance of the initial stylization model can be reflected by the difference between the image content of the predicted image and the prompt information.

[0080] Specifically, when the initial stylization model is adjusted based on the predicted image and the prompt information, the predicted image can be subjected to attribute detection to determine the content description information of the predicted image, and then based on the difference information between the content description information of the predicted image and the prompt information, the loss value in this adjustment process can be determined, and based on the loss value, the initial stylization model can be adjusted.

[0081] In the image-generated-image scenario, in addition to the prompt information, the input to the initial stylization model may also include an image corresponding to the prompt information. Theoretically, the difference between the predicted image generated by the initial stylization model based on the prompt information and the image corresponding to the prompt information should be small. Therefore, the model performance of the initial stylization model can be reflected by the difference between the predicted image and the image corresponding to the prompt information.

[0082] Specifically, when adjusting the initial stylization model, the prompt information can be input into the initial stylization model to obtain a predicted image output by the initial stylization model, and then the first feature of the predicted image can be extracted respectively, and the second feature of the image corresponding to the prompt information can be extracted, and then the feature similarity between the first feature and the second feature is calculated, and the loss value in this adjustment process is determined based on the feature similarity, and the initial stylization model is adjusted based on the loss value.

[0083] Since the prompt information includes style description information, the styles of various images can be explicitly distinguished through the style description information, so that the adjusted complete target stylized model has the ability to generate images of various styles; in addition, since both the style description information and the content description information include preset words, this can avoid the influence of the prior information in the initial stylized model on the generated image, thereby improving the image generation effect.

[0084] In one possible implementation, the initial stylized model is a LoRA model corresponding to the multi-style model; the multi-style model is a pre-trained model; the target model includes a first parameter frozen in the multi-style model and a second parameter in the adjusted LoRA model.

[0085] The following is a detailed introduction to the construction process of the above initial stylization model and the specific training process.

[0086] First, training data may be obtained, including sample images and content description information corresponding to the sample images. The method for determining the specific content description information may refer to the description of the above embodiment. Here, the content description information of the sample image is the description information that has not been replaced with preset words.

[0087] Then, based on the training data, fine-tuning training can be performed on the basis of the basic model to obtain the SD model. The basic model can be, for example, a chilloutmix model, an image generation model based on deep learning.

[0088] Since the generation effect of the SD model may be poor in some aspects after fine-tuning training, the SD model can be fused with the open source style model to obtain a base model. Here, the base model is the multi-style model mentioned above; the open source style model can be a model with the same inference target as the final target stylized model.

[0089] Then, through the method of steps 101 to 103, the prompt information is determined, and the LoRA model is constructed based on the base model, and the LoRA model is trained based on the prompt information. After the LoRA model training is completed, the model parameters frozen in the base model and the model parameters of the trained LoRA model together constitute the target stylized model.

[0090] For a detailed description of the above steps, please refer to the above embodiments and will not be repeated here.

[0091] The image processing method provided by the embodiment of the present disclosure can obtain images in various styles, and then construct prompt information corresponding to the image based on the style description information and content description information corresponding to the image; here, since the prompt information includes the style description information, decoupling between different image styles can be achieved. Furthermore, the initial stylization model is adjusted based on the prompt information, and the initial stylization model can be trained to distinguish between various styles, and then target images of various styles can be generated through the adjusted target stylization model; in addition, since the initial stylization model is a pre-trained model and contains relatively rich text prior information, and the style description information includes the first preset word, and the content description information includes the second preset word, in this way, the prior information of the initial stylization model can be eliminated, and the influence of the prior information of common words in the text in the style description information and the content description information on the generated target image can be avoided, thereby improving the effect of generating the image.

[0092] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0093] Based on the same inventive concept, an image processing device corresponding to the image processing method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned image processing method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0094] Reference Figure 2 , which is a schematic diagram of the architecture of an image processing device provided by an embodiment of the present disclosure, the device comprises: an acquisition module 201, a determination module 202, and an adjustment module 203; wherein,

[0095] An acquisition module 201 is used to acquire images in various styles;

[0096] The determination module 202 is used to determine the style description information and content description information corresponding to the image; wherein the content description information corresponding to the image includes a first preset word, the style description information includes a second preset word, and the second preset word included in the style description information corresponding to the images of the same style is the same;

[0097] The adjustment module 203 is used to construct the prompt information corresponding to the image based on the style description information corresponding to the image and the content description information, and adjust the initial stylization model based on the prompt information to obtain a target stylization model, wherein the target stylization model is used to generate the target images of the multiple styles.

[0098] In a possible implementation, for any image, the determination module 202, when determining the content description information corresponding to the image, is configured to:

[0099] Performing attribute detection on the image to determine initial content description information corresponding to the image; wherein the initial content description information includes the name of the content object in the image and a descriptive word for the content object;

[0100] The description word of the content object is replaced based on the first preset word included in the first preset word library to obtain content description information corresponding to the image.

[0101] In a possible implementation manner, the first preset word library includes first preset words, and first corresponding relationships between some of the first preset words and historical description words; wherein the some of the first preset words are associated with content objects described by the historical description words;

[0102] The determination module 202, when replacing the description word of the content object based on the first preset word included in the first preset word library to obtain the content description information corresponding to the image, is used to:

[0103] Determining whether there is a first preset word corresponding to the description word of the content object in the first corresponding relationship;

[0104] If yes, directly replace the description word of the content object based on the determined first preset word to obtain content description information corresponding to the image;

[0105] If not, the description words of the content object are replaced based on other first preset words in the first preset word library except for some of the first preset words in the first corresponding relationship to obtain content description information corresponding to the image.

[0106] In a possible implementation, the device also includes an updating module 204, which is used to update the first correspondence based on the other first preset words and the description words of the content object after replacing the description words of the content object based on the other first preset words in the first preset word library except for some of the first preset words in the first correspondence.

[0107] In a possible implementation, for any image, the determination module 202, when determining the style description information corresponding to the image, is used to:

[0108] For the style setting instruction of the image, based on the second preset word carried in the style setting instruction, determine the style description information corresponding to the image; or,

[0109] Performing style detection on the image to determine initial style description information corresponding to the image, and replacing the initial style description information based on a second preset word in a second preset word library to obtain style description information corresponding to the image.

[0110] In a possible implementation, the adjustment module 203, when adjusting the initial stylized model based on the prompt information, is configured to:

[0111] Inputting the prompt information into the initial stylization model to obtain a predicted image output by the initial stylization model;

[0112] The initial stylization model is adjusted based on the predicted image and the prompt information.

[0113] In a possible implementation manner, the preset words are words generated based on a random combination of characters; the preset words include other words except the common words included in the common word library.

[0114] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0115] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 3 , which is a schematic diagram of the structure of a computer device 300 provided in an embodiment of the present disclosure. The computer device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters. Figure 3 The computer 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.

[0116] like Figure 3 As shown, the computer device 300 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only storage device (ROM) 302 or a program loaded from a storage device 305 to a random access storage device (RAM) 303. In the RAM 303, various programs and data required for the operation of the computer device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0117] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the computer device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The computer device 300 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.

[0118] 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 computer-readable medium, and the computer program contains program code for executing the image processing method. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 309, or installed from a storage device 308, or installed from a ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0119] The present disclosure also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the image processing method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0120] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the image processing method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0121] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0122] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0124] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0125] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0126] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. An image processing method, characterized in that: include: Get images in multiple styles; Determining style description information and content description information corresponding to the image; wherein the content description information corresponding to the image includes a first preset word, the style description information includes a second preset word, and the second preset words included in the style description information corresponding to the images of the same style are the same; Based on the style description information corresponding to the image and the content description information, the prompt information corresponding to the image is constructed, and based on the prompt information, the initial stylization model is adjusted to obtain a target stylization model, wherein the target stylization model is used to generate target images of the multiple styles.

2. The method according to claim 1, characterized in that Determining content description information corresponding to the image includes: Performing attribute detection on the image to determine initial content description information corresponding to the image; wherein the initial content description information includes the name of the content object in the image and a descriptive word for the content object; The description word of the content object is replaced based on the first preset word included in the first preset word library to obtain content description information corresponding to the image.

3. The method according to claim 2, characterized in that The first preset word library includes first preset words, and a first correspondence between some of the first preset words and historical description words; wherein the some of the first preset words are associated with the content object described by the historical description words; The replacing the description word of the content object based on the first preset word included in the first preset word library to obtain the content description information corresponding to the image includes: Determining whether there is a first preset word corresponding to the description word of the content object in the first corresponding relationship; If yes, directly replace the description word of the content object based on the determined first preset word to obtain content description information corresponding to the image; If not, the description words of the content object are replaced based on other first preset words in the first preset word library except for some of the first preset words in the first corresponding relationship to obtain content description information corresponding to the image.

4. The method according to claim 3, characterized in that After replacing the description words of the content object based on the other first preset words in the first preset word library except for some of the first preset words in the first corresponding relationship, the method further includes: The first corresponding relationship is updated based on the other first preset words and the description words of the content object.

5. The method according to claim 1, characterized in that For any image, determine the style description information corresponding to the image, including: For the style setting instruction of the image, based on the second preset word carried in the style setting instruction, determine the style description information corresponding to the image; or, Performing style detection on the image to determine initial style description information corresponding to the image, and replacing the initial style description information based on a second preset word in a second preset word library to obtain style description information corresponding to the image.

6. The method according to claim 1, characterized in that The adjusting the initial stylized model based on the prompt information includes: Inputting the prompt information into the initial stylization model to obtain a predicted image output by the initial stylization model; The initial stylization model is adjusted based on the predicted image and the prompt information.

7. The method according to claim 1, characterized in that The preset words are words generated based on random combinations of characters; the preset words are other words except the common words included in the common word library.

8. An image processing device, characterized in that: include: The acquisition module is used to obtain images in various styles; A determination module, configured to determine the style description information and content description information corresponding to the image; wherein the content description information corresponding to the image includes a first preset word, the style description information includes a second preset word, and the second preset words included in the style description information corresponding to the images of the same style are the same; An adjustment module is used to construct prompt information corresponding to the image based on the style description information corresponding to the image and the content description information, and to adjust the initial stylization model based on the prompt information to obtain a target stylization model, wherein the target stylization model is used to generate target images of the multiple styles.

9. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the image processing method according to any one of claims 1 to 7 are performed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 7 are executed.