Image generation method, device, computer equipment and computer readable storage medium

By identifying the content of the target image, analyzing and classifying the description text information, and generating style images, the problems of low image generation efficiency and poor effect in the prior art are solved, and efficient and effective image generation is achieved.

CN117593392BActive Publication Date: 2025-03-25SHUXING TECH (BEIJING) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311266475.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-25
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

In the prior art, the image generation method is inefficient and the generated image effect is not good. The user needs to describe the required image content in detail, otherwise the generated image does not meet the requirements, resulting in the user needing to re-enter the text.

Method used

By acquiring the target image, content recognition is performed to obtain description text information, text analysis is performed to determine the content composition features and scene text templates, and classification is performed to generate a style image corresponding to the target image.

Benefits of technology

The efficiency and effect of image generation are improved, and the user does not need to enter detailed description text information. The generated style images are more interesting, and the distribution, size and proportion of image content are not affected by the target image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117593392B_ABST
    Figure CN117593392B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose an image generation method, apparatus, computer equipment, and computer-readable storage medium, which acquire a target image, perform content recognition on the target image, and obtain descriptive text information of the image content in the target image; perform text analysis processing on the descriptive text information to obtain content composition features of the target image, and determine a scene text template corresponding to the content composition features, wherein a text category is set under the scene text template; classify the descriptive text information according to the text category under the scene text template to obtain category description text information corresponding to each text category in the scene text template; and generate a style image corresponding to the target image based on the category description text information under the text category. The embodiments of the present application can generate an image with content similar to the target image based on the descriptive text information of the image content of the target image, without the need for the user to input a descriptive text, thereby improving the image generation efficiency and generation effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to an image generation method, apparatus, computer device and computer-readable storage medium. Background Art

[0002] Generating images based on text is currently a popular form of artificial intelligence content creation (AIGC). The image-text generation model can generate high-quality images that meet the text description based on the descriptive text entered by the user. If the user wants to obtain an image that meets his needs, he needs to describe the content of the image to be generated as detailed as possible. If the user misses the input, the generated image will not meet the requirements and the user needs to re-enter the text. Therefore, the efficiency of this image generation method is low and the generated image effect is not good. Summary of the invention

[0003] The embodiments of the present application provide an image generation method, apparatus, computer device, and computer-readable storage medium, which can improve the generation efficiency and generation effect of images.

[0004] An image generation method provided in an embodiment of the present application includes:

[0005] Acquire a target image, perform content recognition on the target image, and obtain descriptive text information of the image content in the target image;

[0006] Performing text analysis on the description text information to obtain content composition features of the target image, and determining a scene text template corresponding to the content composition features, wherein a text category is set under the scene text template;

[0007] Classify the description text information according to the text category under the scene text template to obtain category description text information corresponding to each text category in the scene text template;

[0008] Based on the category description text information under the text category, a style image corresponding to the target image is generated.

[0009] Accordingly, an embodiment of the present application further provides an image generating device, including:

[0010] The recognition unit is used to obtain a target image, perform content recognition on the target image, and obtain descriptive text information of the image content in the target image;

[0011] An analysis unit, configured to perform text analysis on the description text information to obtain content composition features of the target image, and determine a scene text template corresponding to the content composition features, wherein a text category is set under the scene text template;

[0012] A classification unit, configured to classify the description text information according to the text category under the scene text template, and obtain category description text information corresponding to each text category in the scene text template;

[0013] A generating unit is used to generate a style image corresponding to the target image based on the category description text information under the text category.

[0014] In one embodiment, the identification unit includes:

[0015] An object recognition subunit is used to perform object recognition on the target image to obtain category description text information of each object in the target image;

[0016] An element recognition subunit is used to detect elements in the target image and obtain label text information corresponding to the elements in the target image;

[0017] The information generating subunit is used to generate description text information of the image content in the target image according to the category description text information and the label text information.

[0018] In one embodiment, the classification unit comprises:

[0019] A set determination subunit, used to determine a preset description text set corresponding to each text category according to the text category under the scene text template;

[0020] The screening subunit is used to screen the description text information according to the description text set corresponding to the text category to obtain the category description text information under each text category.

[0021] In one embodiment, the classification unit comprises:

[0022] A classification processing subunit, used for classifying the description text information according to the scene text template to obtain candidate category description text information under each text category;

[0023] An acquisition subunit, used to acquire similar description text information of the candidate category description text information;

[0024] The information determination subunit is used to determine the category description text information of each text category in response to the selection operation on the candidate category description text and the similar description text information.

[0025] In one embodiment, the style image is an image note, the category description text information includes object description text information and scene description text information, and the generating unit includes:

[0026] The information acquisition subunit is used to acquire the target text information input by the user;

[0027] A carrier subunit, configured to determine, based on the scene description text information, carrier description text information of a display carrier that matches the scene in the target image and is used to display the note text information;

[0028] The image generation subunit is used to generate the style image according to the object description text information, the carrier description text information and the target text information, wherein the style image includes a cartoon image corresponding to the object in the target image, and the target text information is displayed in the display carrier.

[0029] In one embodiment, the image generation subunit includes:

[0030] A first image generation module, used to generate a scene image according to the carrier description text information and the target text information, wherein the scene image includes the display carrier;

[0031] A second image generation module, used for generating a cartoon image of the object in the target image according to the object description text information;

[0032] A fusion module is used to fuse the scene image and the cartoon image to obtain the style image.

[0033] In one embodiment, the image generating device further includes:

[0034] A text determination unit, used to determine category description text information under a target text category in the text category;

[0035] The labeling unit is used to label the style image according to the category description text information under the target text category to obtain a labeled style image.

[0036] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any image generation method provided in the embodiment of the present application.

[0037] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any image generation method provided in the embodiment of the present application.

[0038] The embodiment of the present application acquires a target image, performs content recognition on the target image, and obtains descriptive text information of the image content in the target image; performs text analysis processing on the descriptive text information to obtain content composition features of the target image, and determines a scene text template corresponding to the content composition features, wherein text categories are set under the scene text template; classifies the descriptive text information according to the text categories under the scene text template to obtain category description text information corresponding to each text category in the scene text template; and generates a style image corresponding to the target image based on the category description text information under the text categories.

[0039] The embodiment of the present application generates a style image whose image content is similar to that of a target image based on descriptive text information of the image content of the target image, without the need for the user to input descriptive text information, thereby improving the efficiency and effect of image generation. In addition, since the image is generated based on the descriptive text information, the distribution, size, and proportion of the image content in the style image are not affected by the target image, and the generated image is more interesting. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 is a flow chart of an image generation method provided in an embodiment of the present application;

[0042] Figure 2 is a schematic diagram of an image generating device provided in an embodiment of the present application;

[0043] Figure 3 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0045] The embodiments of the present application provide an image generation method, apparatus, computer device and computer readable storage medium. The image generation apparatus can be integrated in a computer device, which can be a server or a terminal.

[0046] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.

[0047] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.

[0048] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0049] This embodiment will be described from the perspective of an image generating device. The image generating device may be integrated into a computer device, which may be a server or a terminal.

[0050] An image generation method provided in an embodiment of the present application is as follows: Figure 1 As shown, the specific process of the image generation method can be as follows:

[0051] 101. Acquire a target image, perform content recognition on the target image, and obtain descriptive text information of the image content in the target image.

[0052] The target image may include an image used to generate a style image, and there may be at least one target image.

[0053] Content recognition can be the process of identifying image content in a target image, such as background, people, features of people, animals, and other image content.

[0054] The descriptive text information may include texts such as words and phrases that describe the image content. Assuming that a puppy is recognized in the target image, the corresponding descriptive text information may include "dog" or "puppy", etc. The descriptive text information may also include text information describing the hair color of the people in the image, whether they are wearing glasses, etc. The descriptive text may also be two boys, two girls, a couple, a boy, a girl, etc., as well as city streets, sunny days, indoors, realism, blurred backgrounds, and motion blur, etc.

[0055] For example, a user can upload a target image, or select a target image from preset images. The preset image can be a picture provided to the user for selection by the client, and then the target image is identified through a neural network model to determine the image content contained in the target image. The neural network model includes a network structure that can identify the content contained in the image.

[0056] The image content may include objects and elements. The object is the subject of the target image, such as people and animals, and the element may represent the characteristics of the object and the characteristics of the environment, such as red hair, black hair, night, grass, butterfly, etc. The object and the element of the target image may be identified respectively. That is, in one embodiment, the step of "performing content identification on the target image to obtain descriptive text information of the image content in the target image" includes:

[0057] Perform object recognition on the target image to obtain the category description text information of each object in the target image;

[0058] Perform element detection on the target image to obtain label text information corresponding to the elements in the target image;

[0059] Generate descriptive text information of the image content in the target image according to the category description text information and the label text information.

[0060] The category description text information is used to indicate the category of the object, such as a person, a dog, a cat, etc., and the label text information includes text information describing the element.

[0061] For example, in one embodiment, the target image can be input into a target recognition model, and object recognition is performed on the target image through the target recognition model. Objects such as people and animals are identified from the target image, and the target object is input into a labeling model (such as DeepDanbooru), and element detection is performed from the target image through the labeling model to obtain label text information corresponding to the elements in the target image.

[0062] Optionally, the target recognition model may be a face detection model that detects faces contained in the target object so as to determine the number of persons in the target image.

[0063] Optionally, there may be a neural network model including a target recognition network and a labeling network. After the target image is input into the neural network model, the target image is subjected to object recognition through the target recognition network to obtain category description text information, and the target image is subjected to element detection through the labeling network to obtain label text information.

[0064] The category description text information and the label text information are used as the description text information of the image content of the target image.

[0065] In one embodiment, two target images may be acquired, object recognition may be performed on one of the target images to obtain category description text information, and element detection may be performed on the other target image to obtain label text information.

[0066] 102. Perform text analysis on the description text information to obtain content composition features of the target image, and determine a scene text template corresponding to the content composition features, wherein a text category is set under the scene text template.

[0067] Among them, the content composition features can indicate the quantity features and composition features of the objects contained in the target image. For example, the quantity features and composition features of the objects in the target content can include one person, two people, multiple people, one person + one animal, one person + two animals, etc.

[0068] The different content composition features correspond to a scene text template, which indicates a text category for classifying the descriptive text information so as to divide the descriptive text information into texts for generating different image contents.

[0069] For example, if the scene involves one person, two people or multiple people without pets, the corresponding scene text template can be character information + character clothing image + environmental information; if the scene involves one person, two people or multiple people with pets, the corresponding scene text template can be character information + character clothing image + pet information + environmental information, and so on. The scene text template can be adjusted according to the required effect of the scene. For example, in an unmanned scene, a scene text template for a single person can be used, and the default descriptive text information can be used as the text information corresponding to the text category under the scene text template.

[0070] For example, text analysis can be performed on the descriptive text information to obtain the descriptive text information corresponding to the characters and animals in the descriptive text information, and then the number of characters and animals contained in the target image can be determined based on the descriptive text information corresponding to the characters and animals, and then the content composition characteristics of the target image can be obtained based on the number of characters and animals.

[0071] There are scene text templates corresponding to different content composition features, and text categories are set under the scene text templates. The scene text templates are used to indicate the image subject and the features of the image subject to be included in the generated image, that is, the text category under the scene text template indicates the image subject, or indicates the features of the image subject, so the scene text template can represent the standard for dividing the descriptive text information, so as to divide the descriptive text information into several categories of text, so as to generate corresponding content.

[0072] 103. Classify the description text information according to the text category under the scene text template to obtain category description text information corresponding to each text category in the scene text template.

[0073] For example, if the content composition feature indicates that the target image consists of a person and a dog, the corresponding scene text template may include several text categories: person information + person image + pet information + environment information. According to the text category set in the scene text template, the descriptive text information is classified and processed to obtain the category description text information under the text category.

[0074] The classification result can be a woman + pink hair, black shorts, white shirt + puppy + Shiba Inu + city street, night.

[0075] The description text classified under the character information category may also be two boys, two girls, a couple, a boy, a girl, and the like.

[0076] The feature vector of each word in the description text information can be extracted, and then the text category to which the word belongs can be determined through the classification network to obtain the category description text information corresponding to each text category in the scene text template.

[0077] Optionally, each text category may be pre-configured with a description text set to filter out texts matching each text category from the description text information, thereby implementing classification processing of the description text information. That is, in one embodiment, the step of "classifying the description text information according to the text categories included in the text template corresponding to the content composition feature to obtain category description text information under each text category in the text template" may specifically include:

[0078] According to the text categories under the scene text template, determine the preset description text set corresponding to each text category;

[0079] According to the description text set corresponding to the text category, the description text information is screened and processed to obtain the category description text information under each text category.

[0080] The description text set includes text information belonging to a corresponding text category, which is used to filter the description text information.

[0081] For example, for each text category in the scene text template, the corresponding description text set is compared with the description text information to filter out texts identical to the texts in the description text set from the description text information to obtain the category description text information.

[0082] In order to make the generated style image more in line with the user's requirements, similar description text information can be obtained for the user to choose, so that the generated style image meets the user's requirements and the flexibility of image generation is improved. That is, in one embodiment, the step of "classifying the description text information according to the text category included in the scene text template to obtain the category description text information under each text category in the scene text template" can specifically include:

[0083] According to the scene description template, the description text information is classified and processed to obtain candidate category description text information under each text category;

[0084] Obtain similar description text information of the candidate category description text information;

[0085] In response to a selection operation on the candidate category description texts and the similar description text information, category description text information for each text category is determined.

[0086] According to the text categories contained in the scene text template, the description text information is classified and processed to obtain candidate category description text information; for each word in the candidate category description text information, similar words, that is, similar description text information, can be obtained, and the candidate category description text information and the similar description text information can be displayed through the terminal for user selection. For example, for pink hair, similar words can be green hair, orange hair, black hair, etc., so that the user can quickly change the hair color of the character in the generated style image; for the moon, words such as crescent, half moon, and double stars accompanying the moon can be provided.

[0087] In response to the user's selection operation, the category description text information under each text category is determined. For example, for each word in the candidate description text information, if the user selects a similar word, the similar word replaces the corresponding word as the word in the category description text information.

[0088] In one embodiment, the image generation provided by the present application can be applied to generate blind box character images. The user inputs a target image, and the terminal or server generates a blind box character image (ie, a style image) based on the target image.

[0089] 104. Generate a style image corresponding to the target image based on the category description text information under the text category.

[0090] For example, the descriptive text information under each text category can be input into the image generation model, and the image generation model can be used to generate a style image. The style image can be a cartoon image or an abstract image, etc.

[0091] The image generation model can be a pre-trained neural network model used to generate images that match the text description based on the text.

[0092] Optionally, corresponding image content may be generated according to the descriptive text information under each text category, and the generated image content may be fused according to the relationship between the text categories to generate a style image corresponding to the target object.

[0093] With the rapid development of communication technology and Internet technology, Internet social networking has become an increasingly popular trend. People share their lives, knowledge, experiences, and works on the Internet. The diversification of sharing forms is conducive to improving the user experience. A style image that can convey the text content and increase the fun can be generated for the user based on the image uploaded by the user and the text content to be shared by the user. That is, in one embodiment, the step "the category description text information includes object description text information and scene description text information, and the style image corresponding to the target image is generated based on the category description text information under the text category" can specifically include:

[0094] Get the target text information entered by the user;

[0095] Determine, according to the scene description text information, carrier description text information of a display carrier for displaying the note text information that matches the scene in the target image;

[0096] A style image is generated according to the object description text information, the carrier description text information and the target text information. The style image includes a cartoon image corresponding to the object in the target image, and the target text information is displayed in the display carrier.

[0097] Among them, the target text information is the text entered by the user for display in the style image.

[0098] Category description text information may include object description text information and scene description text information. The scene description text information is text information that describes the scene in the target image. According to the scene description text information, the scene of the target image can be determined, and a display carrier that matches the scene for displaying the note text information can be determined. For example, if the scene description text information includes a classroom, the display carrier may be a blackboard, a notebook, or a desk. For example, if the scene description text information includes a wedding, an invitation card may be used as a display carrier, which can be determined specifically according to the scene description text information.

[0099] Then, the object description text information, the carrier description text information and the target text information are input into the image generation model to obtain a style image. For example, the content of a style image may be a note text information displayed on a blackboard with a boy next to the blackboard.

[0100] Optionally, a cartoon image may be generated based on the object description text information, a carrier may be generated based on the carrier description text information, and then the style image may be obtained by fusion. That is, in one embodiment, the step of "generating a style image based on the object description text information, the carrier description text information and the target text information" may specifically include:

[0101] Generate a scene image according to the carrier description text information and the target text information, wherein the scene image includes a display carrier;

[0102] Generate a cartoon image of the object in the target image according to the object description text information;

[0103] The scene image and the cartoon image are fused to obtain a style image.

[0104] According to the object description text information, a corresponding cartoon image can be generated. For example, a person and a puppy can be generated. A scene image is generated according to the cartoon image, display carrier and note text information. The target text information in the scene image is displayed on the display carrier. Then the scene image and the cartoon image are fused to generate a style image.

[0105] Optionally, a scene image and a cartoon image can be displayed to the user, and the cartoon image can be moved under control. The cartoon image can be moved on the scene image in response to the user's movement operation, and a style image can be generated according to the position of the cartoon image selected by the user.

[0106] If the user wants to annotate the specified content in the target image, annotate the outfit of the characters in the target image, or annotate the scene, that is, in one embodiment, after the step of "generating a style image corresponding to the target image based on the category description text information under the text category", the image generation method provided in the embodiment of the present application further includes:

[0107] Determine the category description text information under the target text category in the text category;

[0108] The style image is annotated according to the category description text information under the target text category to obtain an annotated style image.

[0109] For example, after determining the scene text template, the text category of the scene text template can be displayed to the user for the user to select the text category to be annotated, and the target text category is determined according to the user's selection operation. Optionally, the target text category can also be a preset category.

[0110] The category description text information of the target text category is obtained, and the content in the style image that is consistent with the category description text information is annotated to obtain the annotated style image.

[0111] For example, if the target text category is character clothing information, then the clothing of the cartoon characters in the style image can be annotated, such as ear-length hair, denim shorts, pure white T-shirt, red shoes, etc.; the target text category can also be scene description text information, then the elements in the scene can be annotated, such as the moon, fish, grass, flowers, etc.

[0112] As can be seen from the above, the embodiment of the present application obtains a target image, performs content recognition on the target image, and obtains descriptive text information of the image content in the target image; performs text analysis processing on the descriptive text information to obtain content composition features of the target image, and determines a scene text template corresponding to the content composition features, and a text category is set under the scene text template; classifies the descriptive text information according to the text category under the scene text template to obtain category description text information corresponding to each text category in the scene text template; and generates a style image corresponding to the target image based on the category description text information under the text category.

[0113] The embodiment of the present application generates a style image whose image content is similar to that of a target image based on descriptive text information of the image content of the target image, without the need for the user to input descriptive text information, thereby improving the efficiency and effect of image generation. In addition, since the image is generated based on the descriptive text information, the distribution, size, and proportion of the image content in the style image are not affected by the target image, and the generated image is more interesting.

[0114] In order to better implement the image generation method provided in the embodiment of the present application, an image generation device is also provided in one embodiment. The meanings of the terms are the same as those in the above-mentioned image generation method, and the specific implementation details can refer to the description in the method embodiment.

[0115] The image generating device may be integrated into a computer device, such as Figure 2 As shown, the image generation device may include: a recognition unit 301, an analysis unit 302, a classification unit 303 and a generation unit 304, which are specifically as follows:

[0116] (1) The recognition unit 301 is used to obtain a target image, perform content recognition on the target image, and obtain descriptive text information of the image content in the target image.

[0117] In one embodiment, the identification unit 301 includes:

[0118] The object recognition subunit is used to perform object recognition on the target image and obtain the category description text information of each object in the target image;

[0119] The element recognition subunit is used to detect elements in the target image and obtain label text information corresponding to the elements in the target image;

[0120] The information generation subunit is used to generate description text information of the image content in the target image according to the category description text information and the label text information.

[0121] (2) An analysis unit 302 is used to perform text analysis on the description text information to obtain content composition features of the target image and determine a scene text template corresponding to the content composition features. A text category is set under the scene text template.

[0122] (3) A classification unit 303 is used to classify the description text information according to the text category under the scene text template to obtain the category description text information corresponding to each text category in the scene text template.

[0123] In one embodiment, the classification unit 303 includes:

[0124] A set determination subunit, used to determine a preset description text set corresponding to each text category according to the text category under the scene text template;

[0125] The screening subunit is used to screen the description text information according to the description text set corresponding to the text category to obtain the category description text information under each text category.

[0126] In one embodiment, the classification unit 303 includes:

[0127] A classification processing subunit is used to classify the description text information according to the scene text template to obtain candidate category description text information under each text category;

[0128] An acquisition subunit is used to acquire similar description text information of the candidate category description text information;

[0129] The information determination subunit is used to determine the category description text information of each text category in response to the selection operation on the candidate category description text and the similar description text information.

[0130] (4) A generating unit 304, configured to generate a style image corresponding to the target image based on the category description text information under the text category.

[0131] In one embodiment, the style image is an image note, the category description text information includes object description text information and scene description text information, and the generation unit 304 includes:

[0132] The information acquisition subunit is used to acquire the target text information input by the user;

[0133] A carrier subunit, used to determine, based on the scene description text information, carrier description text information of a display carrier for displaying the note text information that matches the scene in the target image;

[0134] The image generation subunit is used to generate a style image according to the object description text information, the carrier description text information and the target text information. The style image includes a cartoon image corresponding to the object in the target image, and the target text information is displayed in the display carrier.

[0135] In one embodiment, the image generation subunit includes:

[0136] A first image generation module, used to generate a scene image according to the carrier description text information and the target text information, wherein the scene image includes a display carrier;

[0137] A second image generation module is used to generate a cartoon image of the object in the target image according to the object description text information;

[0138] The fusion module is used to fuse the scene image and the cartoon image to obtain a style image.

[0139] In one embodiment, the image generating device further includes:

[0140] A text determination unit, used for determining category description text information under a target text category in a text category;

[0141] The annotation unit is used to annotate the style image according to the category description text information under the target text category to obtain the annotated style image.

[0142] As can be seen from the above, the image generation device of the embodiment of the present application obtains the target image through the recognition unit 301, performs content recognition on the target image, and obtains descriptive text information of the image content in the target image; the analysis unit 302 performs text analysis processing on the descriptive text information to obtain the content composition features of the target image, and determines the scene text template corresponding to the content composition features, and a text category is set under the scene text template; the classification unit 303 classifies the descriptive text information according to the text category under the scene text template, and obtains the category description text information corresponding to each text category in the scene text template; the generation unit 304 generates a style image corresponding to the target image based on the category description text information under the text category.

[0143] The embodiment of the present application generates a style image whose image content is similar to that of a target image based on descriptive text information of the image content of the target image, without the need for the user to input descriptive text information, thereby improving the efficiency and effect of image generation. In addition, since the image is generated based on the descriptive text information, the distribution, size, and proportion of the image content in the style image are not affected by the target image, and the generated image is more interesting.

[0144] The present application also provides a computer device, which may be a terminal or a server. Figure 3 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:

[0145] The computer device may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will appreciate that Figure 3 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0146] The processor 1001 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and computer programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001.

[0147] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.

[0148] The computer device also includes a power supply 1003 for supplying power to various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1003 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0149] The computer device may further include an input unit 1004, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0150] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically, in this embodiment, the processor 1001 in the computer device will load the executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 will run the computer programs stored in the memory 1002, thereby realizing various functions, as follows:

[0151] Acquire a target image, perform content recognition on the target image, and obtain descriptive text information of the image content in the target image;

[0152] Performing text analysis on the description text information to obtain content composition features of the target image, and determining a scene text template corresponding to the content composition features, wherein a text category is set under the scene text template;

[0153] According to the text categories under the scene text template, the description text information is classified and processed to obtain the category description text information corresponding to each text category in the scene text template;

[0154] Based on the category description text information under the text category, a style image corresponding to the target image is generated.

[0155] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.

[0156] As can be seen from the above, the computer device of the embodiment of the present application can obtain a target image, perform content recognition on the target image, and obtain descriptive text information of the image content in the target image; perform text analysis processing on the descriptive text information to obtain content composition features of the target image, and determine a scene text template corresponding to the content composition features, and a text category is set under the scene text template; according to the text category under the scene text template, the descriptive text information is classified and processed to obtain category description text information corresponding to each text category in the scene text template; based on the category description text information under the text category, a style image corresponding to the target image is generated.

[0157] The embodiment of the present application generates a style image whose image content is similar to that of a target image based on descriptive text information of the image content of the target image, without the need for the user to input descriptive text information, thereby improving the efficiency and effect of image generation. In addition, since the image is generated based on the descriptive text information, the distribution, size, and proportion of the image content in the style image are not affected by the target image, and the generated image is more interesting.

[0158] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations in the above-mentioned embodiments.

[0159] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0160] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute any image generation method provided in the embodiment of the present application.

[0161] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0162] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0163] Since the computer program stored in the computer-readable storage medium can execute any image generation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any image generation method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0164] The above is a detailed introduction to an image generation method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image generation method, characterized in that: include: Acquire a target image, perform object recognition and element recognition on the target image, and obtain descriptive text information of objects and elements in the target image, wherein the object is the main body of the target image, and the element is used to represent the characteristics of the object; Performing text analysis processing on the description text information to obtain quantity features and composition features of the object in the target image, and determining a scene text template corresponding to the target image based on the quantity features and the composition features, wherein a text category is provided under the scene text template, and the text category is used to divide the description text information into category description text information for generating different image contents, and indicate an image subject or features of an image subject; According to a preset description text set corresponding to the text category under the scene text template, the description text information is screened to obtain category description text information corresponding to each text category in the scene text template; Based on the category description text information under the text category, a style image corresponding to the target image is generated.

2. The method according to claim 1, characterized in that The step of acquiring a target image, performing object recognition and element recognition on the target image, and obtaining descriptive text information of objects and elements in the target image includes: Performing object recognition on the target image to obtain category description text information of each object in the target image; Performing element detection on the target image to obtain label text information corresponding to the elements in the target image; Descriptive text information of the image content in the target image is generated according to the category description text information and the label text information.

3. The method according to claim 1, characterized in that The method of screening the description text information according to the preset description text set corresponding to the text category under the scene text template to obtain the category description text information corresponding to each text category in the scene text template includes: Classify the description text information according to the scene text template to obtain candidate category description text information under each text category; Acquire similar description text information of the candidate category description text information; In response to a selection operation on the candidate category description text and the similar description text information, category description text information of each text category is determined.

4. The method according to any one of claims 1 to 3, characterized in that: The style image is an image note, the category description text information includes object description text information and scene description text information, and generating the style image corresponding to the target image based on the category description text information under the text category includes: Get the target text information entered by the user; Determining, according to the scene description text information, carrier description text information of a display carrier for displaying the note text information that matches the scene in the target image; The style image is generated according to the object description text information, the carrier description text information and the target text information, the style image includes a cartoon image corresponding to the object in the target image, and the target text information is displayed in the display carrier.

5. The method according to claim 4, characterized in that The generating the style image according to the object description text information, the carrier description text information and the target text information includes: Generate a scene image according to the carrier description text information and the target text information, wherein the scene image includes the display carrier; Generating a cartoon image of the object in the target image according to the object description text information; The scene image and the cartoon image are fused to obtain the style image.

6. The method according to any one of claims 1 to 3, characterized in that: After generating the style image corresponding to the target image based on the category description text information under the text category, the method further includes: Determine category description text information under a target text category in the text category; The style image is annotated according to the category description text information under the target text category to obtain an annotated style image.

7. An image generating device, characterized in that: include: The recognition unit is used to obtain a target image, perform object recognition and element recognition on the target image, and obtain descriptive text information of the object and element in the target image, wherein the object is the main body of the target image, and the element is used to represent the object feature; an analysis unit, configured to perform text analysis processing on the description text information to obtain quantity features and composition features of the object in the target image, and determine a scene text template corresponding to the target image based on the quantity features and the composition features, wherein a text category is provided under the scene text template, and the text category is used to divide the description text information into category description text information for generating different image contents, and indicate an image subject or features of an image subject; A classification unit, configured to filter the description text information according to a preset description text set corresponding to the text category under the scene text template, to obtain category description text information corresponding to each text category in the scene text template; A generating unit is used to generate a style image corresponding to the target image based on the category description text information under the text category.

8. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the image generation method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the image generating method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Virtual content generation method and device, electronic equipment and storage medium

    CN114904270A

  • Picture generation method, live broadcast room image generation method and device

    CN116320524A

  • Image generation method and device, electronic equipment and storage medium

    CN116580408A

  • Image processing method and device, computer equipment and storage medium

    CN116758362A