Picture generation method, display method, device, storage medium and program product
By reducing and expanding the text data in the text image generation technology, more accurate and comprehensive prompt text is generated, and target images are generated using a large model, the problem of insufficient image generation accuracy in the existing technology is solved, and higher image generation accuracy is achieved.
Patent Information
- Application Number
- CN202510400074.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-03-31
AI Technical Summary
It is difficult for the prior art to generate accurate pictures, especially in cross-modal tasks of text-generating pictures, where accuracy and comprehensiveness are problems.
By obtaining the descriptive data related to the target text from the database, dimensionality reduction processing is performed to obtain concept dimensions, and text augmentation is performed on these concept dimensions to generate a text database containing multiple prompt texts. Then, divide the prompt text according to the preset image content dimension, select the target prompt text, and use the big model to generate the target picture.
Improve the accuracy and comprehensiveness of the prompt text, thereby improving the accuracy of the selected target prompt text and the generated target picture.
Smart Images

Figure CN119919525A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing, and in particular to an image generation method, a display method, a device, a storage medium, and a program product. Background Art
[0002] With the rapid development of data science and deep learning, the research on artificial intelligence generated content (AIGC), such as text-generated images, has become more and more in-depth and has been applied in many fields. Taking text-generated images as an example, it means that a text description is input and one or more pictures with relevant descriptions are generated by the computer. It aims to establish an interpretable mapping between the image space and the text semantic space, and convert the low-dimensional semantic information of the text into high-dimensional image information. It is a challenging cross-modal task.
[0003] Therefore, how to generate accurate pictures has become a problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of the present application provide a picture generation method, a display method, a device, a storage medium and a program product to improve the accuracy of picture generation.
[0005] In a first aspect, an embodiment of the present application provides a method for generating an image, comprising: In response to the image generation request, determining a target text; Acquire descriptive data related to the target text from a database, and perform dimensionality reduction processing on the descriptive data to obtain multiple concept dimensions corresponding to the target text; Performing text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, wherein the text database includes multiple prompt texts; Divide the multiple prompt texts according to multiple preset image content dimensions to obtain prompt texts corresponding to the multiple image content dimensions respectively; According to the image content generation requirement, selecting a target prompt text from the prompt texts corresponding to the multiple image content dimensions respectively; Based on the target prompt text, a target image is generated using a first large model.
[0006] In a second aspect, an embodiment of the present application provides a display method, including: Display the user interface; Based on the input operation on the user interface, a target text is determined, and a picture generation request is generated based on the target text, and the picture generation request is sent to a server, so that the server can obtain description data related to the target text from a database, and perform dimensionality reduction processing on the description data to obtain multiple concept dimensions corresponding to the target text; perform text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, and the text database includes multiple prompt texts; divide the multiple prompt texts according to multiple preset picture content dimensions to obtain prompt texts corresponding to the multiple picture content dimensions respectively; Acquire and display the multiple image content dimensions and corresponding prompt texts in the user interface; Based on the user operation on the user interface, an operation request is generated and sent to the server, so that the server determines the image content generation requirement based on the user operation, and selects a target prompt text from the prompt texts corresponding to the multiple image content dimensions respectively according to the image content generation requirement; based on the target prompt text, a target image is generated using the first large model; The target image is acquired and displayed in the user interface.
[0007] In a third aspect, an embodiment of the present application provides a method for generating an image, including: In response to a request for image generation, target concept text for mental health is identified; Acquire descriptive data related to the target concept text from a database, and perform dimensionality reduction processing on the descriptive data to obtain multiple concept dimensions corresponding to the target concept text; Performing text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, wherein the text database includes multiple prompt texts; Divide the multiple prompt texts according to multiple preset image content dimensions to obtain prompt texts corresponding to the multiple image content dimensions respectively; According to the image content generation requirement, selecting a target prompt text from the prompt texts corresponding to the multiple image content dimensions respectively; Based on the target prompt text, a target image is generated using a first large model; wherein the target image is used to analyze the user's mental health status.
[0008] In a fourth aspect, an embodiment of the present application provides a computing device, comprising a storage component and a processing component; the storage component stores one or more computer program instructions, the computer program instructions are called and executed by the processing component, and the processing component executes the one or more computer program instructions to implement the image generation method described in the first aspect, or the display method described in the second aspect, or the image generation method described in the third aspect.
[0009] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a computer to implement the image generation method described in the first aspect, or the display method described in the second aspect, or the image generation method described in the third aspect.
[0010] In a sixth aspect, an embodiment of the present application provides a computer program product storing a computer program, wherein when the computer program is executed by a computer, the image generation method described in the first aspect, the display method described in the second aspect, or the image generation method described in the third aspect is implemented.
[0011] In the scheme of the embodiment of the present application, the server can respond to the image generation request, determine the target text, obtain the description data related to the target text from the database and perform dimensionality reduction processing, obtain multiple concept dimensions corresponding to the target text, perform text expansion processing on the multiple concept dimensions respectively, and obtain the text database corresponding to the multiple concept dimensions respectively, wherein each database may include multiple prompt texts, divide the multiple prompt texts according to the preset multiple image content dimensions, obtain the prompt texts corresponding to the multiple image content dimensions respectively, and select the target prompt text from the prompt texts corresponding to the multiple image content dimensions respectively according to the image content generation requirements, so as to generate the target image based on the target prompt text using the first large model. By obtaining the description data related to the target text from the database and performing dimensionality reduction processing on it, multiple concept dimensions corresponding to the target text are obtained, and text expansion processing is performed on the multiple concept dimensions respectively to obtain the corresponding text database containing multiple prompt texts, thereby improving the accuracy and comprehensiveness of the prompt text, and then improving the accuracy of the target prompt text selected therefrom and the target image generated based on the target prompt text.
[0012] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0014] Figure 1 A flowchart of an embodiment of a method for generating a picture provided by the present application is shown; Figure 2 A flowchart of an embodiment of a picture evaluation method provided by the present application is shown; Figure 3 A flow chart of an embodiment of a display method provided by the present application is shown; Figure 4 A system architecture diagram in a practical application is shown; Figure 5 A schematic diagram showing the structure of an embodiment of a picture generating device provided by the present application is shown; Figure 6 A schematic structural diagram of an embodiment of a display device provided by the present application is shown; Figure 7 A schematic structural diagram of an embodiment of a computing device provided by the present application is shown. DETAILED DESCRIPTION
[0015] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0016] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, units, etc., and do not represent the order of precedence, nor do they limit the "first" and "second" to be different types.
[0017] As described in the aforementioned background technology section, in order to improve the accuracy of text-generated images, the inventors have proposed a technical solution of the present application, including determining a target text in response to an image generation request; acquiring descriptive data related to the target text from a database, and performing dimensionality reduction processing on the descriptive data to obtain a plurality of concept dimensions corresponding to the target text; performing text expansion processing on the plurality of concept dimensions respectively to obtain a text database corresponding to the plurality of concept dimensions respectively, wherein the text database includes a plurality of prompt texts; dividing the plurality of prompt texts according to a plurality of preset image content dimensions to obtain prompt texts corresponding to the plurality of image content dimensions respectively; selecting a target prompt text from the prompt texts corresponding to the plurality of image content dimensions respectively according to image content generation requirements; and generating a target image based on the target prompt text using a first large model.
[0018] By obtaining descriptive data related to the target text from the database and performing dimensionality reduction processing on it, multiple concept dimensions corresponding to the target text are obtained, and text expansion processing is performed from multiple concept dimensions respectively to obtain a corresponding text database containing multiple prompt texts, thereby improving the accuracy and comprehensiveness of the prompt text, and further improving the accuracy of the target prompt text selected therefrom and the target image generated based on the target prompt text.
[0019] 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.
[0020] The technical solution of the embodiment of the present application can be applied to a system architecture including a client and a server, and the client and the server are connected through a network. The network provides a medium for the communication link between the client and the server. The network can include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0021] The client can interact with the server through the network to send image generation requests or receive prompt text, target images, etc.
[0022] Among them, the client can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language5, Hypertext Markup Language Version 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client can be deployed in an electronic device and needs to rely on the device to run or some apps in the device to run, etc. The electronic device can, for example, have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. For ease of understanding, various other types of applications can usually be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0023] The service end may include servers that provide various services, such as a server that responds to a picture generation request sent by a client, a server that generates a target picture using a large model, etc.
[0024] It should be noted that the server can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with blockchain. The server can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0025] It should be noted that the image generation method provided in the embodiment of the present application is generally executed by the server, and the display method is generally executed by the client. The corresponding image generation device is generally deployed in the server, and the display device is generally deployed in the client. However, in other embodiments of the present application, the client may also have similar functions to the server, so as to execute the image generation method provided in the embodiment of the present application. In other embodiments, the image generation method provided in the embodiment of the present application can also be jointly executed by the client and the server.
[0026] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described in this article within the scope permitted by applicable laws and regulations, subject to the requirements of applicable laws and regulations of the country where the user is located (for example, with the user's explicit consent, effective notification to the user, etc.).
[0027] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0028] It should be noted that the technical solution of the embodiment of the present application is applicable to a network virtual environment. The users described generally refer to "virtual users". Real users can register a user account in the server through registration to obtain a user identity in the network environment.
[0029] like Figure 1 As shown, it is a flowchart of an embodiment of a method for generating an image provided by the present application, which can be executed by the server. The method may include the following steps: 101: In response to a request for generating an image, determine a target text.
[0030] The image generation request may be generated and sent by the client in response to a user operation. The image generation request includes a target text. The target text may include a variety of forms such as words, phrases, and sentences. In a practical application, the target text may be, for example, a mental health concept word, such as social anxiety disorder.
[0031] 102: Obtain descriptive data related to the target text from the database, and perform dimensionality reduction processing on the descriptive data to obtain multiple concept dimensions corresponding to the target text.
[0032] The database may refer to a general database in the technical field corresponding to the target text, and may include a search engine, etc. The descriptive data related to the target text may include descriptive data such as the definition, structure, and characteristics of the target text. Specifically, a preset data acquisition algorithm may be used to obtain the descriptive data from the database. The data acquisition algorithm may include, for example, a Scrapy crawler framework (a fast, high-level screen crawling and web crawling framework suitable for Python, used to crawl web sites and extract structured data from pages), a data crawling algorithm combined with BeautifulSoup (a library for parsing HTML (Hyper Text Markup Language) and XML (Extensible Markup Language) documents) and Requests (a library for sending HTTP requests), etc.
[0033] Optionally, various forms of descriptive data related to the target text may be obtained from various databases, such as text, scales, etc. Taking the target text as social anxiety disorder as an example, various forms of descriptive data related to social anxiety disorder, such as definitions, scales, clinical information, film and television works, etc. may be obtained from various databases.
[0034] After obtaining the description data, the preset dimensionality reduction processing algorithm can be used to perform dimensionality reduction processing on the description data to obtain multiple concept dimensions corresponding to the target text. Dimensionality reduction processing algorithms may include, for example, PCA technology (principal components analysis), t-SNE (t-distributed Stochastic Neighbor Embedding, t-distributed-random neighbor embedding, a nonlinear dimensionality reduction technology), UMAP (Uniform Manifold Approximation and Projection, a nonlinear dimensionality reduction technology), etc., and this application does not limit this. Optionally, the description data can be preprocessed before the dimensionality reduction processing is performed. Taking the descriptive data in text form as an example, preprocessing operations such as word segmentation, stop word removal, and word form restoration can be performed on it, and then the dimensionality reduction processing algorithm can be used to reduce the feature dimension to simplify the data and improve efficiency.
[0035] Conceptual dimensions can be used to characterize different aspects of the target text. For example, if the target text is social anxiety disorder and the descriptive data obtained include the definition, scale, clinical information, and film and television works of social anxiety, the multiple conceptual dimensions obtained after dimensionality reduction processing can include the three conceptual dimensions of emotional expression, social dominance, and eye contact. Social dominance can refer to the key position and environment of a group or individual in social relations in a certain social structure.
[0036] 103: Perform text expansion processing on multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, wherein the text database includes multiple prompt texts.
[0037] Specifically, based on multiple concept dimensions, for each concept dimension, a preset text analysis algorithm and a text expansion algorithm can be used to perform text expansion processing to generate multiple prompt texts corresponding to the concept dimension, and the multiple prompt texts constitute a text database corresponding to the concept dimension. The prompt text can include multiple forms such as characters, words, sentences, etc. In an actual application, the prompt text can be in the form of words.
[0038] Among them, the text analysis algorithm may include, for example, NLTK (Natural Language Toolkit, a Python library that provides a large number of natural language processing functions), SpaCy (a Python library that provides semantic analysis, dependency parsing and other efficient natural language processing functions), Scikit-learn (a Python library that provides a large number of machine learning and deep learning functions), Word2Vec (a word vector representation model based on neural networks), TF-IDF (Term Frequency-Inverse Document Frequency, a statistical method for text mining and information retrieval), VADER (Valence Aware Dictionary and sEntimentReasoner, a dictionary and rule-based sentiment analysis tool), BERT for Sentiment Analysis (a sentiment analysis method based on the BERT (Bidirectional Encoder Representations from Transformers) model), etc. The text expansion algorithm may include, for example, a similar word expansion algorithm based on a word vector, an expansion algorithm based on a synonym dictionary, a context-based dynamic generation algorithm such as a Transformer model, an expansion algorithm based on data enhancement technology, a fine-tuning algorithm based on a pre-trained language model, etc., and this application does not limit this.
[0039] 104: Divide the multiple prompt texts according to the preset multiple image content dimensions to obtain the prompt texts corresponding to the multiple image content dimensions respectively.
[0040] The image content dimension can be used to characterize different aspects of the image content. In this embodiment, the image content dimension may include three preset dimensions: spatial environment, character object, and behavior action. According to the preset image content dimension, the preset text recognition algorithm can be used to divide and process the multiple prompt texts generated above to obtain prompt texts corresponding to multiple image content dimensions. The text recognition algorithm may include, for example, BoW (Bag of Words), Word2Vec, etc., which is not limited in this application.
[0041] 105: According to the image content generation requirement, select a target prompt text from the prompt texts corresponding to the multiple image content dimensions.
[0042] The image content generation requirement may be an image generation requirement for an image content dimension, which is used to instruct the generation of a target image that reflects the content of the specified image content dimension. For example, the image content generation requirement may be an image dimension that specifies a spatial environment, that is, instructing the generation of a target image that reflects the content of the spatial environment. At this time, the target prompt text may be selected from the prompt text corresponding to the spatial environment dimension.
[0043] The image content generation requirements can be automatically set by the server, and of course can also support user settings to meet user needs, which will be explained in subsequent embodiments.
[0044] 106: Based on the target prompt text, generate a target image using the first model.
[0045] The large model (also called the foundation model, i.e., Foundation Model) involved in the embodiments of the present application includes the first large model and the second large model, the third large model, etc. involved below, which refers to a machine learning model with a large number of parameters and complex structures, capable of processing massive amounts of data and completing various complex tasks, such as natural language processing, computer vision, speech recognition, etc. It is an AI (Artificial Intelligence) model. The large model can be implemented using LLM (Large Language Model) or MLM (Multimodal Large Model), etc., and this application does not limit this.
[0046] Specifically, in this embodiment, the first large model can be a large image generation model such as Dalle-2 (a text generation image system), Stable Diffusion XL (an image generation model), etc. Inputting the target prompt text into the first large model can generate one or more target images.
[0047] In this embodiment, descriptive data related to the target text is obtained from the database and dimensionality reduction processing is performed on it to obtain multiple concept dimensions corresponding to the target text. Text expansion processing is performed on each of the multiple concept dimensions to obtain a corresponding text database containing multiple prompt texts, thereby improving the accuracy and comprehensiveness of the prompt text, and further improving the accuracy of the target prompt text selected therefrom and the target image generated based on the target prompt text.
[0048] In order to further improve the accuracy of the image, in some embodiments, the above method may further include: Extract feature vector of target text; Based on the feature vector, searching from the target semantic network for at least one associated text associated with the target text and an associated weight corresponding to the at least one associated text; wherein the target semantic network is pre-constructed based on a data set of a target domain where the target text is located; At least one associated text is added to the text database in descending order of the associated weights to serve as a prompt text.
[0049] The target semantic network can be pre-built based on the data set of the target field where the target text is located. For example, if the target text is social anxiety disorder, the target field can be the field of mental health. The corresponding data set can be collected using data crawling technologies such as the Scrapy crawler framework, and can include multiple mental health concept texts and their corresponding definitions, symptom manifestations and other information.
[0050] Specifically, the target text can be parsed using natural language processing (NLP) technology to extract the feature vector of the target text. Of course, the feature vector of the target text can also be extracted using a feature extraction model, etc., and there is no restriction on this. Afterwards, the extracted feature vector is input into the target semantic network, and the relationship between the target text and other texts in the target semantic network is calculated using algorithms such as graph neural network (GNN), knowledge graph technology, etc., such as calculating the semantic similarity between the target text and other texts, the frequency of common occurrence, etc., so as to find out at least one associated text associated with the target text and the corresponding association weights, which can characterize the degree of association between the target text and the associated text. The higher the association weight, the deeper the degree of association. According to the order of association weight from high to low, the at least one associated text can be added to the text database as a prompt text. For example, if the target text is social anxiety disorder, at least one associated text can include anxiety, emotional tension, sweating, etc., and the associated text can be used as a prompt text.
[0051] By constructing a target semantic network within the field where the target text is located and establishing associations between different texts, for a new target text, it is possible to find other texts associated with it and calculate the degree of association, so that the associated text can be used as prompt text, thereby improving the richness and accuracy of the prompt text, and thus improving the accuracy of image generation.
[0052] In some embodiments, the above method may further include: Sending at least one associated text and first selection prompt information to the client; Based on a selection operation on at least one associated text, a target associated text is determined.
[0053] At this time, according to the image content generation requirements, selecting the target prompt text from the prompt texts corresponding to the multiple image content dimensions may include: According to the requirements for generating the image content, target prompt texts including target-related texts are selected from the prompt texts corresponding to the multiple image content dimensions, thereby satisfying the personalized needs of users on the basis of enriching the prompt texts.
[0054] In practical applications, the target semantic network may also be updated. Therefore, in some embodiments, the method may further include: Send the target prompt text and update prompt information to the client; Based on the confirmation operation on the update prompt information, when the update condition is met, the target semantic network is updated based on the target prompt text.
[0055] Among them, the update prompt information can be used to prompt the user whether to accept the update of the target semantic network based on the target prompt text. Based on the confirmation operation triggered by the user, the target semantic network can be updated using the target prompt text. Specifically, the update condition can be pre-set, for example, when the number of prompt texts used for updating reaches a threshold, the target semantic network is updated. The threshold can be set according to actual needs, such as 1000, 10000, etc.
[0056] This enables the dynamic update of the target semantic network, improves the comprehensiveness and accuracy of the target semantic network, better adapts to new target texts, and provides more comprehensive support for the search of related texts.
[0057] In order to further improve the accuracy of the image, in some embodiments, the above method may further include: Obtain prompt text corresponding to historical text related to the target text from the target platform.
[0058] In this embodiment, a target platform can be provided to support multiple users to upload and share pictures that are generated based on text and are accurate and meet their own needs. For the sake of description, they are called historical pictures and the corresponding texts are called historical texts. The target platform can store historical texts uploaded by multiple users, historical pictures corresponding to the historical texts, and prompt texts. The prompt text can be generated based on the historical texts or historical pictures.
[0059] Based on this, the prompt text corresponding to the historical text related to the target text can be obtained from the target platform, such as using a preset text similarity algorithm to determine the historical text that meets the requirements of similarity with the target text, and obtain the prompt text of the historical text. After that, the steps of performing text expansion processing on multiple concept dimensions respectively and obtaining the text database corresponding to the multiple concept dimensions are continued.
[0060] By providing a target platform and supporting multi-user information sharing, prompt text corresponding to historical text related to the target text can be obtained, further improving the accuracy of the prompt text, thereby improving the accuracy of the target prompt text and the target image.
[0061] In order to ensure that the generated target image meets the user's personalized needs, the image generation requirements can be specified by the user. In some embodiments, the above method may also include: Sending multiple image content dimensions and corresponding prompt texts to the client to be displayed in the user interface; Based on user actions in the user interface, image content generation requirements are determined.
[0062] Among them, user operations may include input, selection, sliding operations, etc., without limitation.
[0063] Optionally, based on a user operation in the user interface, determining the image content generation requirement may include: Based on the weight values set by the user for multiple image content dimensions, the image content generation requirements are determined.
[0064] The sum of the weight values corresponding to the multiple image content dimensions is 1, and the image content dimension with a large weight value indicates that the priority or importance of the image content is higher than that of the image content dimension with a small weight value. For example, the weight values set for the three image content dimensions of spatial scene, character image, and behavior action are 70%, 20%, and 10% respectively, then the image content generation requirement can be to indicate that the image highly reflects the spatial scene content, the character image content is moderately reflected, and the behavior action content is lowly reflected.
[0065] By generating requirements according to the picture content specified by the user, selecting the target prompt text, and generating a target picture that meets the requirements, the user's personalized needs are met and the user experience is improved.
[0066] In order to further meet user needs, in some embodiments, the above method may further include: Sending multiple candidate picture styles and second choice prompt information to the client; Based on the selection operation for any candidate picture style, a target picture style is determined.
[0067] Among them, the picture style may refer to the visual style of the picture, which may include cartoon style, abstract style, realistic style, etc., and may be preset according to actual needs.
[0068] Optionally, based on the user's input operation, the picture style input by the user may be used as the target picture style.
[0069] On this basis, generating the target image using the first model may include: According to the style of the target image, the first model is used to generate the target image.
[0070] Specifically, we can use style transfer technology (a technology that uses deep learning algorithms to combine the content of one image with the style of another image), GAN (Generative Adversarial Networks), and other machine learning algorithms to apply the target image style selected or input by the user to the generated target image, ensuring that the target image meets the user's aesthetic preferences.
[0071] In practical applications, the generated images can also be evaluated. Figure 2 As shown, it is a flowchart of an embodiment of a picture evaluation method provided by the present application, which can be executed by the server. The method may include the following steps: 2001: In response to a request for generating an image, a target text is determined.
[0072] 2002: Obtain descriptive data related to the target text from the database, and perform dimensionality reduction on the descriptive data to obtain multiple conceptual dimensions corresponding to the target text.
[0073] 2003: Perform text expansion processing on multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, and the text database includes multiple prompt texts.
[0074] 2004: Divide the plurality of prompt texts according to the plurality of preset image content dimensions to obtain prompt texts corresponding to the plurality of image content dimensions respectively.
[0075] 2005: According to the requirements for generating the image content, a target prompt text is selected from the prompt texts corresponding to the multiple image content dimensions.
[0076] 2006: Generate target images using the first large model based on target prompt text.
[0077] The implementation process of steps 2001 to 2006 is Figure 1 The implementation of steps 101 to 106 in the illustrated embodiment is consistent and will not be described in detail here.
[0078] 2007: Use the second largest model to generate description text corresponding to the target image.
[0079] Among them, the second largest model can be a large text generation model for CogVLM (a powerful open source visual language basic model, a picture-to-text model), ClipCap ( is an image description model based on deep learning), BLIP-2 (a multimodal visual-text large language model), etc. Input the target image into the second largest model to generate a description text of the target image. The description text can be in various forms such as characters, words, sentences, etc. In a practical application, the description text can be in the form of words.
[0080] 2008: Based on the description text, target text and target prompt text, calculate the relevance score corresponding to the target image and calculate the logic score corresponding to the target image.
[0081] Specifically, based on the description text, target text, and target prompt text, a preset semantic similarity model, such as SimCSE (Simple Contrastive Learning of Sentence Embeddings, a contrastive learning model for sentence embedding), can be used to calculate the relevance score corresponding to the target image.
[0082] Based on the target image, a preset visual-language model, such as CLIP (Contrastive Language-Image Pre-Training, a multimodal pre-training neural network), can be used to calculate the logic score of the target image. The logic score can be used to characterize the degree to which the target image conforms to the visual logic of the real world.
[0083] 2009: Evaluate target images based on logical scores and relevance scores.
[0084] 2010: Based on the evaluation result, determine whether the target image meets the evaluation requirements. If the judgment result is no, adjust the text database and image content generation requirements, and return to step 2004 to continue execution; if the judgment result is yes, execute step 2011.
[0085] 2011: Obtain target images that meet evaluation requirements.
[0086] The logic score and the association score may be normalized and then weighted to obtain the evaluation score of the target image, and the evaluation score may be compared with the preset evaluation score to determine whether the target image meets the evaluation requirements. For example, if the evaluation score is greater than or equal to the preset evaluation score, it is determined to meet the evaluation requirements, otherwise it does not meet the evaluation requirements.
[0087] When the evaluation requirements are not met, the text database and the image content generation requirements can be adjusted, wherein the adjustment of the text database can include, for example, adding, deleting, replacing, etc. of the prompt text, and the adjustment of the image content generation requirements can include, for example, adjusting the weight values corresponding to multiple image content dimensions. Then, the step of step 2004 can be returned to continue execution until a target image that meets the evaluation requirements is obtained.
[0088] Optionally, in the above-mentioned evaluation iteration process, the target prompt text and update prompt information selected in each iteration can be sent to the client, and based on the user's confirmation operation on the update prompt information, if the update conditions are met, the target semantic network can be updated based on the target prompt text to further improve the accuracy of the target semantic network.
[0089] In this embodiment, by adopting an evaluation method that combines logic and relevance, and through an automated iterative optimization mechanism, it is ensured that the quality and effect of the generated images are continuously improved, thereby further improving the accuracy of the images.
[0090] In some embodiments, the above method may further include: Send the target image that meets the evaluation requirements to the client; Get user response information for the target image; According to multiple preset scoring dimensions and based on user response information, the third model is used to score the target images that meet the evaluation requirements to obtain the scoring results.
[0091] Among them, user response information can be obtained in multiple forms such as text, voice, gesture, physiological signals, etc. Taking the target text as social anxiety disorder as an example, multiple preset scoring dimensions can include five scoring dimensions: user's social anxiety score, valence, arousal, immersion, and picture-text consistency. The social anxiety score can refer to the score obtained by the user in a social anxiety medical test, which can be obtained from the data stored in the corresponding medical database. The valence can refer to the efficacy unit of a substance causing a biological reaction. The arousal can refer to the degree of physiological and cognitive arousal brought about by the user's emotions when viewing the picture. Immersion can refer to the degree of user involvement in viewing the picture. The picture-text consistency can refer to the consistency between the picture and the text.
[0092] In this embodiment, the third large model can be an artificial neural network large model, such as building an image scoring system with ResNet50 (deep residual network) as a training model. According to multiple preset scoring dimensions, it can automatically score the target images that meet the evaluation requirements based on user response information to obtain the scoring results of the target images.
[0093] It should be noted that in the aforementioned embodiment, the evaluation of the image is implemented based on the logic of the image itself and the relevance to the target text as evaluation dimensions, while in this embodiment, the user's reaction information to the image is implemented according to the preset dimensions related to the user's reaction as the scoring dimension.
[0094] In some embodiments, the above method may further include: The target prompt text and description text corresponding to the target image that meets the evaluation requirements are subjected to dimensionality reduction processing, and the target prompt text after dimensionality reduction processing is compared with the description text, and the image content dimension is adjusted according to the comparison result.
[0095] The dimension reduction processing algorithm has been described in the above embodiments and will not be described here. Adjusting the image content dimension may include, for example, adding, deleting, replacing, etc. For example, based on the comparison result, it is determined that the generated image is not related to the image content dimension of the character image, but is related to the brightness of the image. In this case, the image content dimension of the character image can be deleted and the image content dimension of the brightness can be added.
[0096] At this time, according to multiple preset scoring dimensions and based on user response information, scoring the target images that meet the evaluation requirements using the third model may include: According to multiple preset scoring dimensions and the adjusted image content dimensions, based on user response information, the third model is used to score the target images that meet the evaluation requirements.
[0097] Specifically, according to the adjusted image content dimensions, for each image content dimension, according to multiple preset scoring dimensions, based on user response information, the third model is used to score the target images that meet the evaluation requirements to improve the accuracy of the scoring results.
[0098] The above one or more embodiments describe the technical solution of the present application from the perspective of the server. The following describes the technical solution of the present application from the perspective of the client. Figure 3 As shown, it is a flowchart of an embodiment of a display method provided by the present application, which can be executed by a client and may include the following steps; 301: Display the user interface.
[0099] 302: Based on the input operation on the user interface, determine the target text, generate an image generation request based on the target text, and send the image generation request to the server, so that the server can obtain description data related to the target text from the database, and perform dimensionality reduction processing on the description data to obtain multiple concept dimensions corresponding to the target text; perform text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, and the text database includes multiple prompt texts; divide the multiple prompt texts according to the preset multiple image content dimensions to obtain prompt texts corresponding to the multiple image content dimensions respectively.
[0100] 303: Acquire and display multiple image content dimensions and corresponding prompt texts in the user interface.
[0101] 304: Based on the user operation on the user interface, an operation request is generated and sent to the server, so that the server can determine the image content generation requirements based on the user operation, and select target prompt text from the prompt texts corresponding to multiple image content dimensions according to the image content generation requirements; based on the target prompt text, a target image is generated using the first large model.
[0102] 305: Acquire and display the target image in the user interface.
[0103] In this embodiment, an operation request is generated based on the user operation on the user interface and sent to the server. The server determines the image content generation requirements based on the user operation, selects the target prompt text and generates the target image according to the image content generation requirements, thereby meeting the user's personalized needs while improving the accuracy of the image.
[0104] In some embodiments, the above method may further include: Get and display the target prompt text in the user interface; Based on the upload operation, the target text, target image and target prompt text are uploaded to the target platform.
[0105] In some embodiments, the above method may further include: Based on a save operation on at least one prompt text, the at least one prompt text is saved locally.
[0106] By displaying the target prompt text on the user interface, users are supported to upload the target prompt text and the corresponding target text and target image to the target platform to realize multi-user information sharing, and users are supported to save them locally.
[0107] The following uses the target text as an example of a concept in the field of mental health to illustrate the technical solution of the present application. The present application embodiment also provides a method for generating an image, which may include: In response to a request for image generation, target concept text for mental health is identified; Obtaining descriptive data related to the target concept text from the database, and performing dimensionality reduction processing on the descriptive data to obtain multiple concept dimensions corresponding to the target concept text; Performing text expansion processing on multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, wherein the text database includes multiple prompt texts; Divide the multiple prompt texts according to the preset multiple image content dimensions to obtain the prompt texts corresponding to the multiple image content dimensions respectively; According to the image content generation requirements, select the target prompt text from the prompt texts corresponding to the multiple image content dimensions; Based on the target prompt text, a target image is generated using the first large model; wherein the target image can be used to analyze the user's mental health status.
[0108] In this embodiment, the target concept text may refer to concepts in the field of mental health, such as social anxiety disorder, happiness, stress, etc. By obtaining descriptive data related to the target concept text from the database and performing dimensionality reduction processing on it, multiple concept dimensions corresponding to the target concept text are obtained, and text expansion processing is performed from multiple concept dimensions respectively to obtain a corresponding text database containing multiple prompt texts, thereby improving the accuracy and comprehensiveness of the prompt text, and further improving the accuracy of the target prompt text selected therefrom and the target image generated based on the target prompt text.
[0109] In some embodiments, the above method may further include: Sending multiple image content dimensions and corresponding prompt texts to the client to be displayed in the user interface; Based on user actions in the user interface, image content generation requirements are determined.
[0110] In some embodiments, based on the user operation in the user interface, determining the image content generation requirement may include: Based on the weight values set by the user for multiple image content dimensions, the image content generation requirements are determined.
[0111] In some embodiments, the above method may further include: Extract feature vector of target concept text; Based on the feature vector, searching from the target semantic network for at least one associated text associated with the target concept text and an associated weight corresponding to the at least one associated text; wherein the target semantic network is pre-constructed based on a data set in the field of mental health; At least one associated text is added to the text database in descending order of the associated weights to serve as a prompt text.
[0112] In some embodiments, the above method may further include: Sending at least one associated text and first selection prompt information to the client; Determining a target associated text based on a selection operation on at least one associated text; According to the image content generation requirements, selecting a target prompt text from the prompt texts corresponding to the multiple image content dimensions may include: According to the image content generation requirement, a target prompt text including a target associated text is selected from prompt texts corresponding to a plurality of image content dimensions.
[0113] In some embodiments, the above method may further include: Send the target prompt text and update prompt information to the client; Based on the confirmation operation on the update prompt information, when the update condition is met, the target semantic network is updated based on the target prompt text.
[0114] In some embodiments, the above method may further include: Use the second largest model to generate the description text corresponding to the target image; Based on the description text, target concept text and target prompt text, calculate the relevance score corresponding to the target image; Calculate the logical score corresponding to the target image; Evaluate the target image based on the logic score and relevance score; Based on the evaluation results, if it is determined that the target image does not meet the evaluation requirements, the text database and the image content generation requirements are adjusted, and the process of dividing the multiple prompt texts according to the preset multiple image content dimensions and obtaining the prompt texts corresponding to the multiple image content dimensions is continued until the generated target image meets the evaluation requirements.
[0115] In some embodiments, the above method may further include: Obtain prompt text corresponding to historical text related to the target concept text from the target platform; wherein the target platform stores historical concept texts uploaded by multiple users, historical pictures corresponding to the historical concept texts, and prompt texts.
[0116] In some embodiments, the above method may further include: Sending multiple candidate picture styles and second choice prompt information to the client; Determine a target picture style based on a selection operation for any candidate picture style; Generating a target image using the first model may include: According to the style of the target image, the first model is used to generate the target image.
[0117] In some embodiments, the above method may further include: Send the target image that meets the evaluation requirements to the client; Get user response information for the target image; According to multiple preset scoring dimensions and based on user response information, the third model is used to score the target images that meet the evaluation requirements to obtain the scoring results.
[0118] In some embodiments, the above method may further include: Perform dimensionality reduction processing on the target prompt text and description text corresponding to the target image that meets the evaluation requirements, and compare the target prompt text after dimensionality reduction processing with the description text, and adjust the image content dimension according to the comparison result; According to multiple preset scoring dimensions and based on user response information, scoring target images that meet the evaluation requirements using the third model may include: According to multiple preset scoring dimensions and adjusted image content dimensions, based on user response information, the third model is used to score target images that meet the evaluation requirements.
[0119] For ease of understanding, let’s take the concept of mental health as an example. Figure 4 The system architecture diagram shown in the figure provides a detailed description of the technical solution of this application. Figure 4 As shown, the system may include a client 41 and a server 42. It should be noted that Figure 4 The client 41 and server 42 presented are only exemplary and do not limit their implementation forms. For easy viewing, the client diagram is represented by a device image, such as a computer image in the figure, and the server diagram is represented by a device image, such as a server image in the figure.
[0120] The server 42 may include a data acquisition module 421 , a data processing module 422 , a prompt text processing module 423 , a picture content generation requirement setting module 424 , a picture generation module 425 , a picture evaluation module 426 and a picture effect evaluation module 427 .
[0121] Specifically, the client 41 may determine, in response to the user's input operation, that the mental health concept input by the user is, for example, social anxiety disorder, and generate a picture generation request and send it to the server 42 .
[0122] The data acquisition module 421 in the server 42 can use data acquisition algorithms such as the Scrapy crawler framework to obtain descriptive data related to social anxiety disorder, such as the social anxiety scale, clinical information of social anxiety disorder patients, etc. from general databases in the field of mental health.
[0123] The data processing module 422 can use PCA technology and other dimensionality reduction processing algorithms to perform dimensionality reduction processing on the description data to obtain multiple concept dimensions corresponding to social anxiety disorder, for example, the three concept dimensions of emotional expression, social dominance and eye contact can be included. In addition, a text expansion algorithm such as NLTK and a similar word expansion algorithm based on word vectors can be used to perform text expansion processing on each concept dimension to obtain a text database corresponding to each concept dimension, and each text database can include multiple prompt texts.
[0124] The prompt text processing module 423 can divide the above multiple prompt texts according to the preset multiple picture content dimensions, such as the three picture content dimensions of space environment, character image and behavior action, using text recognition algorithms such as BoW to obtain prompt texts corresponding to each picture content dimension. And according to the picture content generation requirements, the target prompt text can be selected from the prompt texts corresponding to the multiple picture content dimensions.
[0125] Optionally, the server 42 may further include a picture content generation requirement setting module 424. The server 42 may further send multiple picture content dimensions and corresponding prompt texts to the client 41 for display in the user interface. The picture content generation requirement setting module 424 may determine the picture content generation requirements specified by the user based on the weight values set by the user for the multiple picture content dimensions, and select the target prompt text from the prompt texts corresponding to the multiple picture content dimensions according to the picture content generation requirements, so as to meet the personalized needs of the user and improve the user experience.
[0126] The image generation module 425 can generate a target image based on the target prompt text using the first large model such as Dalle-2, StableDiffusion XL and other image generation large models. By obtaining the description data related to the target text from the database and performing dimensionality reduction processing on it, multiple concept dimensions corresponding to the target text are obtained, and text expansion processing is performed from the multiple concept dimensions respectively to obtain a corresponding text database containing multiple prompt texts, thereby improving the accuracy and comprehensiveness of the prompt text, and further improving the accuracy of the target prompt text selected therefrom and the target image generated based on the target prompt text.
[0127] Optionally, the server 42 can also include a picture evaluation module 426. The picture evaluation module 426 can utilize the second largest model such as CogVLM and other text generation large models to generate the description text corresponding to the target picture, and based on the description text, the target text and the target prompt text, calculate the corresponding association score of the target picture, and calculate the corresponding logic score of the target picture, and evaluate the target picture based on the logic score and the association score. If it is judged that the target picture does not meet the evaluation requirements, the text database and the picture content generation requirements can be adjusted, and the division of the prompt text and the selection step of the target prompt text are returned to continue to execute, and the target picture that meets the evaluation requirements is obtained through multiple iterations. By adopting the evaluation method combining two aspects of logic and relevance, and by the automatic iteration optimization mechanism, it is ensured that the generated picture is constantly improved in quality and effect, and the accuracy of the picture is further improved.
[0128] Optionally. The server 42 may also include a picture effect evaluation module 427. The server 42 may send a target picture that meets the evaluation requirements to the client 41, and obtain user response information for the target picture, such as voice, gesture, physiological signal and other forms. The picture effect evaluation module 427 may score the target picture according to multiple preset scoring dimensions, such as the user's social anxiety score, valence, arousal, immersion and text-image consistency, based on the user response information, using a third model such as an artificial neural network model, to obtain a multi-dimensional scoring result. Optionally, the target prompt text and the description text corresponding to the target picture that meets the evaluation requirements may be subjected to dimensionality reduction processing, and the target prompt text after dimensionality reduction processing may be compared with the description text, and the picture content dimension may be adjusted according to the comparison result, and the target picture that meets the evaluation requirements may be scored using the third model based on the user response information according to multiple preset scoring dimensions and the adjusted picture content dimension. Based on the target picture whose score meets the preset requirements, the user's mental health condition may be analyzed, such as the user's social anxiety disorder condition, which is helpful to provide timely diagnosis and treatment to the user.
[0129] By providing a comprehensive intelligent system that integrates a series of functions such as text generation of images, image evaluation, image effect evaluation, iterative update, etc., it can accurately identify and judge users' needs and preferences, generate target images with a high degree of compliance, and output multi-dimensional scores of target images to assist in analysis, diagnosis and treatment of users' mental health conditions.
[0130] like Figure 5 FIG. 1 is a schematic diagram of a structure of an embodiment of a picture generation device provided by the present application. The device may include the following units: A first determining unit 501 is used to determine a target text in response to a picture generation request; A first text processing unit 502 is used to obtain description data related to the target text from a database, and perform dimensionality reduction processing on the description data to obtain multiple concept dimensions corresponding to the target text; A text expansion unit 503 is used to perform text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, wherein the text database includes multiple prompt texts; A division unit 504 is used to divide the multiple prompt texts according to multiple preset picture content dimensions to obtain prompt texts corresponding to the multiple picture content dimensions respectively; An extraction unit 505 is used to select a target prompt text from the prompt texts corresponding to the multiple picture content dimensions respectively according to the picture content generation requirement; The generating unit 506 is used to generate a target image based on the target prompt text by using the first large model.
[0131] Figure 5 The picture generating device shown can be used to implement Figure 1 The picture generation method shown, its implementation principle and technical effect are not repeated here. Figure 5 One or more units of the picture generation device shown can constitute the server in the above system architecture. The specific way in which each unit of the picture generation device in the above embodiment performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0132] like Figure 6 FIG. 1 is a schematic diagram of a structure of an embodiment of a display device provided by the present application. The device may include the following units: A first display unit 601, used to display a user interface; The first sending unit 602 is used to determine the target text based on the input operation on the user interface, generate an image generation request based on the target text, and send the image generation request to the server, so that the server can obtain description data related to the target text from the database, and perform dimensionality reduction processing on the description data to obtain multiple concept dimensions corresponding to the target text; perform text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, and the text database includes multiple prompt texts; divide the multiple prompt texts according to multiple preset image content dimensions to obtain prompt texts corresponding to the multiple image content dimensions respectively; The second display unit 603 is used to obtain and display the multiple image content dimensions and corresponding prompt texts in the user interface; The second sending unit 604 is used to generate an operation request based on the user operation on the user interface and send it to the server, so that the server determines the image content generation requirement based on the user operation, selects a target prompt text from the prompt texts corresponding to the multiple image content dimensions respectively; and generates a target image based on the target prompt text using the first large model; The third display unit 605 is used to obtain and display the target image in the user interface.
[0133] Figure 6 The display device shown can be used to implement Figure 3 The display method shown, its implementation principle and technical effect are not described in detail. Figure 6 One or more units of the display device shown may constitute the client in the above system architecture. The specific manner in which each unit of the display device in the above embodiment performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0134] like Figure 7 , which is a schematic diagram of a structure of an embodiment of a computing device provided by the present application, the device may include a storage component 701 and a processing component 702; The storage component 701 can be used to store one or more computer program instructions, wherein the one or more computer program instructions are called and executed by the processing component 702 to implement Figure 1 The image generation method shown, Figure 2 The picture evaluation method shown, or Figure 3 The display method shown.
[0135] Of course, the above computing device may also include other components, such as input / output interfaces, communication components, etc.
[0136] The input / output interface provides an interface between the processing component and the peripheral interface unit, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.
[0137] It should be noted that the above computing device is used to implement Figure 1 The image generation method shown, or Figure 2 The image evaluation method shown can be a physical device or an elastic computing host provided by a cloud computing platform, etc. It can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device.
[0138] The above computing device is used to implement Figure 3The display method shown can be implemented as an electronic device. The electronic device can refer to a device used by a user and having the functions of surfing the Internet, computing, communicating, etc. required by the user, such as a mobile phone, a tablet computer, a personal computer, a wearable device, etc. It can be understood that the above electronic device must also include a display component, an input / output interface, a communication component, and other components, which will not be repeated.
[0139] In one or more of the above embodiments, the processing component may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component can also be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0140] The storage component is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0141] The display component may be an electroluminescent (EL) element, a liquid crystal display or a micro display having a similar structure, or a retinal direct display or a similar laser scanning display.
[0142] The present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, Figure 1 The image generation method shown, Figure 2 The picture evaluation method shown, or Figure 3 The computer readable medium may be included in the computing device described in the above embodiments; or it may exist independently without being assembled into the computing device.
[0143] The computer-readable storage medium may be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above.
[0144] The present application also provides a computer program product, which includes a computer program carried on a computer-readable storage medium, and when the computer program is executed by a computer, Figure 1 The image generation method shown, Figure 2The picture evaluation method shown, or Figure 3 The display method shown.
[0145] In such an embodiment, the computer program may be downloaded and installed from a network, and / or installed from a removable medium. When the computer program is executed by a processor, various functions defined in the system of the present application are performed.
[0146] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0147] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating an image, characterized in that: include: In response to the image generation request, determining a target text; Acquire descriptive data related to the target text from a database, and perform dimensionality reduction processing on the descriptive data to obtain multiple concept dimensions corresponding to the target text; Performing text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, wherein the text database includes multiple prompt texts; Divide the multiple prompt texts according to multiple preset image content dimensions to obtain prompt texts corresponding to the multiple image content dimensions respectively; According to the image content generation requirement, selecting a target prompt text from the prompt texts corresponding to the multiple image content dimensions respectively; Based on the target prompt text, a target image is generated using a first large model.
2. The method according to claim 1, characterized in that Also includes: Sending the multiple image content dimensions and corresponding prompt texts to the client for display in the user interface; Based on the user operation in the user interface, the image content generation requirement is determined.
3. The method according to claim 2, characterized in that The determining of the image content generation requirement based on the user operation in the user interface includes: Based on the weight values respectively set by the user for the multiple image content dimensions, the image content generation requirements are determined.
4. The method according to claim 1, characterized in that Also includes: Extracting a feature vector of the target text; Based on the feature vector, searching from a target semantic network for at least one associated text associated with the target text and the associated weights respectively corresponding to the at least one associated text; wherein the target semantic network is pre-constructed based on a data set of a target domain where the target text is located; The at least one associated text is added to the text database in descending order of the associated weights to serve as a prompt text.
5. The method according to claim 4, characterized in that Also includes: Sending the at least one associated text and the first selection prompt information to the client; Determining a target associated text based on a selection operation on the at least one associated text; The step of selecting target prompt text from the prompt texts corresponding to the plurality of picture content dimensions respectively according to the picture content generation requirement comprises: According to the image content generation requirement, the target prompt text including the target associated text is selected from the prompt texts corresponding to the multiple image content dimensions respectively.
6. The method according to claim 5, characterized in that Also includes: Sending the target prompt text and update prompt information to the client; Based on a confirmation operation on the update prompt information, and when an update condition is met, the target semantic network is updated based on the target prompt text.
7. The method according to claim 1, characterized in that Also includes: Generate a description text corresponding to the target image using the second largest model; Calculating a relevance score corresponding to the target image based on the description text, the target text, and the target prompt text; Calculate the logical score corresponding to the target image; Based on the logic score and the relevance score, evaluating the target image; Based on the evaluation results, if it is determined that the target image does not meet the evaluation requirements, the text database and the image content generation requirements are adjusted, and the step of dividing the multiple prompt texts according to the preset multiple image content dimensions and obtaining the prompt texts corresponding to the multiple image content dimensions is continued until the generated target image meets the evaluation requirements.
8. The method according to claim 1, characterized in that Also includes: Obtain prompt text corresponding to historical text related to the target text from a target platform; wherein the target platform stores historical texts uploaded by multiple users, historical pictures corresponding to the historical texts, and prompt texts.
9. The method according to claim 2, characterized in that: Also includes: Sending a plurality of candidate picture styles and second selection prompt information to the client; Determine a target picture style based on a selection operation for any candidate picture style; The generating of the target image by using the first large model comprises: According to the style of the target image, the target image is generated using the first large model.
10. The method according to claim 7, characterized in that Also includes: Send the target image that meets the evaluation requirements to the client; Obtaining user response information for the target image; According to a plurality of preset scoring dimensions and based on the user response information, the target images meeting the evaluation requirements are scored using a third model to obtain a scoring result.
11. The method according to claim 10, characterized in that Also includes: Performing dimensionality reduction processing on the target prompt text and description text corresponding to the target image that meets the evaluation requirements, and comparing the target prompt text after dimensionality reduction processing with the description text, and adjusting the image content dimension according to the comparison result; The step of scoring the target images meeting the evaluation requirements by using the third model according to the plurality of preset scoring dimensions and based on the user response information includes: According to a plurality of preset scoring dimensions and the adjusted picture content dimensions, based on the user response information, a third model is used to score the target pictures that meet the evaluation requirements.
12. A display method, characterized in that: include: Display the user interface; Based on the input operation on the user interface, a target text is determined, and a picture generation request is generated based on the target text, and the picture generation request is sent to a server, so that the server can obtain description data related to the target text from a database, and perform dimensionality reduction processing on the description data to obtain multiple concept dimensions corresponding to the target text; perform text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, and the text database includes multiple prompt texts; divide the multiple prompt texts according to multiple preset picture content dimensions to obtain prompt texts corresponding to the multiple picture content dimensions respectively; Acquire and display the multiple image content dimensions and corresponding prompt texts in the user interface; Based on the user operation on the user interface, an operation request is generated and sent to the server, so that the server determines the image content generation requirement based on the user operation, and selects the target prompt text from the prompt texts corresponding to the multiple image content dimensions respectively according to the image content generation requirement; Based on the target prompt text, generate a target image using the first large model; The target image is acquired and displayed in the user interface.
13. The method according to claim 12, characterized in that Also includes: Acquire and display the target prompt text in the user interface; Based on the upload operation for the target prompt text, the target text, the target image and the target prompt text are uploaded to the target platform.
14. The method according to claim 12, characterized in that Also includes: Based on a save operation on at least one prompt text, the at least one prompt text is saved locally.
15. A method for generating an image, characterized in that: include: In response to a request for image generation, target concept text for mental health is identified; Acquire descriptive data related to the target concept text from a database, and perform dimensionality reduction processing on the descriptive data to obtain multiple concept dimensions corresponding to the target concept text; Performing text expansion processing on the multiple concept dimensions respectively to obtain text databases corresponding to the multiple concept dimensions respectively, wherein the text database includes multiple prompt texts; Divide the multiple prompt texts according to multiple preset image content dimensions to obtain prompt texts corresponding to the multiple image content dimensions respectively; According to the image content generation requirement, selecting a target prompt text from the prompt texts corresponding to the multiple image content dimensions respectively; Based on the target prompt text, a target image is generated using a first large model; wherein the target image is used to analyze the user's mental health status.
16. A computing device, characterized in that It comprises a storage component and a processing component; the storage component stores one or more computer program instructions, the computer program instructions are called and executed by the processing component, and the processing component executes the one or more computer program instructions to implement the image generation method as described in any one of claims 1 to 11, or the display method as described in any one of claims 12 to 14, or the image generation method as described in claim 15.
17. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program is executed by a computer to implement the image generation method according to any one of claims 1 to 11, or the display method according to any one of claims 12 to 14, or the image generation method according to claim 15.
18. A computer program product, characterized in that A computer program is stored, and when the computer program is executed by a computer, the image generation method according to any one of claims 1 to 11, the display method according to any one of claims 12 to 14, or the image generation method according to claim 15 is implemented.
Citation Information
Patent Citations
Content text generation method and device and music comment text generation method
CN112115718A
Picture generation method and device, electronic equipment and storage medium
CN117221645A
Image generation method and data processing method for image generation
CN117409109A
Picture generation method and device and electronic equipment
CN117635748A
Picture generation method and device, electronic equipment and storage medium
CN117765112A