Poster generation method and device and storage medium
By receiving and analyzing poster description data, and using the pre-trained poster generation model to generate posters, the problems of low poster generation efficiency and poor quality are solved, and efficient and high-quality poster generation is achieved.
Patent Information
- Application Number
- CN202510156102.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-06-06
AI Technical Summary
The poster generation efficiency is low, and the quality and effect of the generated posters are poor.
By receiving and parsing poster description data, extracting key description data and semantic data, and inputting them into a pre-trained poster generation model to generate target posters. The model is based on a neural network and uses poster sample data for pre-training.
The efficiency and effect of poster generation have been improved, and the quality and user satisfaction of the generated poster are significantly improved.
Smart Images

Figure CN120107413A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a poster generation method, device and storage medium. Background Art
[0002] In today's digital age, posters, as an important visual communication tool, are widely used in many fields such as advertising, publicity, and cultural activities.
[0003] Traditional poster production usually relies on professional designers to use graphic design software for manual drawing and layout. This method not only requires designers to have high professional skills and aesthetic level, but also the production process is cumbersome, time-consuming, and relatively costly. With the development of computer technology, some automated poster generation tools have emerged. These tools are usually based on preset templates and limited element libraries. Users can only select and combine within a given range, which cannot meet the needs and intentions of users. The quality and effect of the generated posters are poor, and the efficiency of poster generation is low. Summary of the invention
[0004] The present invention provides a poster generation method, device and storage medium to solve the problems of low poster generation efficiency and poor quality and effect of generated posters.
[0005] According to one aspect of the present invention, a poster generation method is provided, the method comprising:
[0006] Receiving input poster description data, parsing the poster description data to obtain key description data and semantic data corresponding to the poster description data, wherein the key description data includes description data of at least one poster element presented in the poster, and the poster elements include theme, content, style and color;
[0007] The key description data and the semantic data are input into a pre-trained poster generation model, and a first target poster is generated based on an output result of the model, wherein the poster generation model is obtained by pre-training a pre-established neural network model based on poster sample data.
[0008] According to another aspect of the present invention, a poster generating device is provided, the device comprising:
[0009] A data parsing module, configured to receive input poster description data, parse the poster description data to obtain key description data and semantic data corresponding to the poster description data, wherein the key description data includes description data of at least one poster element presented in the poster, and the poster elements include theme, content, style and color;
[0010] A poster generation module is used to input the key description data and the semantic data into a pre-trained poster generation model, and generate a first target poster based on the output result of the model, wherein the poster generation model is obtained by pre-training a pre-established neural network model based on poster sample data.
[0011] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the poster generating method described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the poster generation method described in any embodiment of the present invention when executed.
[0016] The technical solution of the embodiment of the present invention receives input poster description data, parses the poster description data to obtain key description data and semantic data corresponding to the poster description data, wherein the key description data includes description data of at least one poster element presented in the poster, and the poster elements include theme, content, style and color; accurately parses the poster description data, and then inputs the key description data and the semantic data into a pre-trained poster generation model, and generates a first target poster based on the output result of the model, wherein the poster generation model is obtained by pre-training a pre-established neural network model based on poster sample data, thereby solving the problems of low poster generation efficiency and poor quality and effect of the generated posters, and achieving the beneficial effect of improving poster generation efficiency and generation effect.
[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 is a flowchart of a poster generation method provided according to Embodiment 1 of the present invention;
[0020] Figure 2 is a flowchart of a poster generation method provided according to Embodiment 2 of the present invention;
[0021] Figure 3 is a structural schematic diagram of a poster generating device provided according to Embodiment 3 of the present invention;
[0022] Figure 4 It is a structural schematic diagram of an electronic device for implementing the poster generating method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", "target", "original", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] Embodiment 1
[0026] Figure 1A flowchart of a poster generation method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of automatic poster generation. The method can be executed by a poster generation device. The poster generation device can be implemented in the form of hardware and / or software. The poster generation device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0027] S110, receiving input poster description data, and parsing the poster description data to obtain key description data and semantic data corresponding to the poster description data.
[0028] The key description data includes description data of at least one poster element presented in the poster, and the poster elements include theme, content, style and color; the poster description data can be understood as text description data of poster requirements, and the poster description data includes information such as the poster theme, color scheme, font style, image requirements, key information and layout guidance. Semantic data can be understood as semantic relationship, grammatical structure and logical order data between words.
[0029] Specifically, the poster description data input by the user is received, including the theme, color scheme, font style, image requirements, key information, layout guidance and other information of the poster. The input text is deeply analyzed by natural language processing technology, the text is decomposed into words, phrases and sentences, and the semantic relationship, grammatical structure and logical order between them are analyzed to obtain the description data of at least one poster element presented in the poster corresponding to the poster description data and the semantic relationship, grammatical structure and logical order data between the texts.
[0030] S120, inputting the key description data and the semantic data into a pre-trained poster generation model, and generating a first target poster based on an output result of the model.
[0031] Among them, the first target poster can be understood as the initial poster output by the model.
[0032] Specifically, the key description data and the semantic data are input into a pre-trained poster generation model. The poster generation model searches and matches the most suitable materials and templates based on the key description data and the semantic data, preliminarily combines and typesets the screened materials and templates to generate an initial poster, processes the details of the graphics of the initial poster, adjusts the font size, color and spacing, etc., to generate a first target poster.
[0033] The poster generation model is obtained by pre-training a pre-established neural network model based on poster sample data. The poster generation model includes a label determination module, a poster element matching module, a poster generation module and a poster optimization module.
[0034] Optionally, after generating the target poster based on the output result of the model, the method further includes:
[0035] Receive input adjustment description data, input the adjustment description data and the first target poster into the poster generation model, and generate a second target poster based on the model output result.
[0036] The adjusted description data may be understood as text description data of the adjusted poster, and the second target poster may be understood as the adjusted poster.
[0037] Specifically, the poster generation model displays the optimized first target poster. Receive adjustment description data input by the user, such as adjusting the position of an element, changing a color combination, or modifying text content. The poster generation model adjusts and improves the first target poster accordingly based on the adjustment description data and the first target poster to generate a second target poster. It is understandable that the user's adjustment description data can be received multiple times, and the target poster generated last time can be modified based on the user's current adjustment description data on the basis of the target poster generated last time, until a poster that meets the user's needs is generated.
[0038] In the embodiment of the present invention, the input adjustment description data, the poster generation model quickly makes corresponding adjustments and improvements based on the user's adjustment description data and the first target poster, and generates a new plan again to improve user satisfaction.
[0039] Optionally, before inputting the poster customization requirement data into a pre-trained poster generation model, it also includes: constructing a data set based on a preset number of sample poster data, and dividing the data set into a training set and a test set, wherein the sample poster data includes sample poster description data and sample poster generation data corresponding to the sample poster description data; iteratively training a pre-established neural network model based on the training set, and during the training process, updating the model parameters based on the validation set until the model loss function converges; determining the poster generation performance index of each completed training model based on the test set, and determining the poster generation model based on at least one poster generation performance index.
[0040] Specifically, a sample poster data set containing sample poster description data and corresponding sample poster generation data is collected. The sample poster description data may include text descriptions, tags, or other forms of metadata, while the sample poster generation data is the actual image data. The collected sample poster data is preprocessed, including image scaling, normalization, data enhancement, and cleaning and encoding of text descriptions. The preprocessed data set is divided into a training set and a test set. The model is iteratively trained using the training set. In each iteration, a batch of sample poster description data and corresponding generation data are input into the model, the loss function is calculated, and the model parameters are updated through the back-propagation algorithm. The performance of the model is evaluated using the test set to obtain a poster generation performance indicator, and a poster generation model is determined based on at least one poster generation performance indicator.
[0041] The technical solution of the embodiment of the present invention receives input poster description data, parses the poster description data to obtain key description data and semantic data corresponding to the poster description data, wherein the key description data includes description data of at least one poster element presented in the poster, and the poster elements include theme, content, style and color; accurately parses the poster description data, and then inputs the key description data and the semantic data into a pre-trained poster generation model, and generates a first target poster based on the output result of the model, wherein the poster generation model is obtained by pre-training a pre-established neural network model based on poster sample data, thereby solving the problems of low poster generation efficiency and poor quality and effect of the generated posters, and achieving the beneficial effect of improving poster generation efficiency and generation effect.
[0042] Embodiment 2
[0043] Figure 2A flowchart of a poster generation method provided for Embodiment 2 of the present invention. This embodiment is a further refinement of how to input the key description data and the semantic data into a pre-trained poster generation model in the above embodiment, and generate a first target poster based on the output result of the model. Optionally, the poster generation model includes a label determination module, a poster element matching module, a poster generation module and a poster optimization module; accordingly, the key description data and the semantic data are input into a pre-trained poster generation model, and a first target poster is generated based on the output result of the model, including: inputting the key description data and the semantic data into the label determination module of the pre-trained poster generation model to obtain an element type label corresponding to the key description data and an emotion label corresponding to the semantic data; inputting the element type label and the emotion label matching data into the poster element matching module of the poster generation model to obtain at least one first poster element matching the element type label and a second poster element matching the emotion label; wherein the first poster element includes image material, graphic element, font style and layout template; the second poster element includes a color combination composed of two or more colors; inputting the first poster element and the second poster element into the poster generation module of the poster generation model to generate an initial poster; and inputting the initial poster into the poster optimization module of the poster generation model to generate the first target poster.
[0044] like Figure 2 As shown, the method includes:
[0045] S210: receiving input poster description data, and parsing the poster description data to obtain key description data and semantic data corresponding to the poster description data.
[0046] S220, inputting the key description data and the semantic data into the label determination module of the pre-trained poster generation model to obtain the element type label corresponding to the key description data and the emotion label corresponding to the semantic data.
[0047] Specifically, the key description data and the semantic data are input into the label determination module of the pre-trained poster generation model, the key description data is parsed, and the element type therein is identified, and then a corresponding element type label is assigned to each element to obtain an element type label corresponding to the key description data, such as "sunshine", "beach", etc. The semantic data is analyzed, and the emotional tendency is determined, and an emotional label corresponding to the semantic data is generated, such as "positive", "negative", etc.
[0048] S230. Input the element type label and the emotion label matching data into the poster element matching module of the poster generation model to obtain at least one first poster element matching the element type label and a second poster element matching the emotion label; wherein the first poster element includes image materials, graphic elements, font styles and layout templates; and the second poster element includes a color combination composed of two or more colors.
[0049] Specifically, the element type label and the emotional label matching data are input into the poster element matching module of the poster generation model. The poster element matching module selects a poster element that matches the label from a preset element library. The element library contains various image materials, graphic elements, font styles, layout templates, and color combinations. The input label is matched with the elements in the element library through a preset matching algorithm. The preset matching algorithm includes at least one of keyword matching, semantic similarity calculation, and machine learning model prediction. According to the element type label, the poster element matching module selects image materials, graphic elements, font styles, and layout templates that match the label from the element library. For example, if the label is "sunshine", a graphic element containing a sunshine image or sunshine effect is selected. According to the emotional label, one or more color combinations are selected to convey the corresponding emotions. For example, for a "positive" emotional label, the module may select a bright and vivid color combination; while for a "negative" emotional label, a dull and cold color combination may be selected.
[0050] S240: Input the first poster element and the second poster element into the poster generation module of the poster generation model to generate an initial poster.
[0051] Specifically, after obtaining the matching first poster element and second poster element, the first poster element and the second poster element are input into the poster generation module of the poster generation model, and the poster generation model combines all elements together to form a complete poster design. Exemplarily, the image material and graphic elements are placed in the appropriate position in the layout template, the corresponding font style is applied, and the overall tone is adjusted using a matching color combination.
[0052] S250: Input the initial poster into the poster optimization module of the poster generation model to generate the first target poster.
[0053] Specifically, after the initial poster is generated, in order to improve the quality and attractiveness of the poster, it is usually input into the poster optimization module of the poster generation model for further optimization.
[0054] Optionally, the poster optimization module includes at least one of an element adjustment unit, a color adjustment unit and a font adjustment unit; the step of inputting the initial poster into the poster optimization module of the poster generation model includes at least one of the following operations: inputting the initial poster into the element adjustment unit of the poster generation model to adjust the element position and size of the initial poster; inputting the initial poster into the color adjustment unit of the poster generation model to adjust the color of the initial poster; inputting the initial poster into the font adjustment unit of the poster generation model to adjust the font of the initial poster.
[0055] Specifically, after the initial poster is input into the element adjustment unit, the unit will analyze the spatial relationship, contrast and visual hierarchy between elements, and adjust the position and size of the elements according to these analysis results. For example, move a certain image material to make it more prominent, or adjust the size of a certain graphic element to make it more coordinated with the overall layout. After the initial poster is input into the color adjustment unit, the unit will analyze the effect of the current color combination and adjust it as needed. This may include changing the background color, element border color or text color. The color adjustment unit will also consider the principles of color psychology to ensure that the selected colors resonate with the target audience and convey the right emotions or information. After the initial poster is input into the font adjustment unit, the unit will analyze the effect of the current font style and adjust it as needed. Including changing the font, adjusting the font size or changing the arrangement of the text. The font adjustment unit will also ensure that the selected font matches the overall style of the poster.
[0056] Optionally, the inputting the initial poster into the element adjustment unit of the poster generation model to adjust the element position and size of the initial poster includes: inputting the initial poster into the element adjustment unit of the poster generation model, determining the element center point coordinate data of each first element in the initial poster and the element visual weight corresponding to each first poster element through the element adjustment unit; determining the visual center of gravity of the poster compared with the initial poster based on multiple element center point coordinate data and element visual weights, and determining the position difference between the visual center of gravity of the poster and a preset visual center of gravity; when the position difference is greater than a preset difference threshold, adjusting the element position data and / or element size data.
[0057] Among them, the first element can be understood as a graphic element.
[0058] Specifically, for each first element in the initial poster, the element adjustment unit calculates the coordinate data of its center point on the poster. The center point can be the geometric center of the first element or a weighted center determined according to the shape and visual importance of the element. Visual weights are assigned to elements based on factors such as the type, size, color, contrast, etc. of the first element. The center point coordinate data of each element is multiplied by its visual weight, and then summed and divided by the total weight. The element adjustment unit compares the calculated visual center of gravity of the poster with the preset visual center of gravity. If the position difference between the visual center of gravity of the poster and the preset visual center of gravity is greater than the preset difference threshold, the element adjustment unit adjusts the position data and / or size data of the element.
[0059] Exemplarily, the visual center of gravity of the poster is calculated by the following formula:
[0060]
[0061] Among them, X c and Y c are the x and y coordinates of the visual center of gravity of the poster, w i is the weight of the first element of the i-th column, x i and i are the x and y coordinates of the center point of the ith first element, and n is the number of elements.
[0062] Optionally, the inputting the initial poster into the color adjustment unit of the poster generation model to adjust the color of the initial poster includes: inputting the initial poster into the color adjustment unit of the poster generation model, so that the color adjustment unit determines a color harmony index corresponding to the color combination of the initial poster based on a color harmony evaluation model, and when the color harmony index is lower than a preset color harmony index, adjusting the color combination of the initial poster.
[0063] Specifically, the color harmony index corresponding to the color combination of the initial poster is determined based on the Moon-Spencer color harmony evaluation model. When the color harmony index is greater than the preset harmony index, it indicates that the colors are harmonious. The larger the color harmony index is, the better the harmony and beauty of the color combination is. When the color harmony index is lower than the preset color harmony index, the color combination of the initial poster is adjusted, including changing the color type, adjusting the hue, lightness or saturation value, and rearranging the colors. The adjusted poster is subjected to color analysis, and the color harmony index is recalculated to ensure that the color harmony index reaches or exceeds the preset color harmony index.
[0064] Exemplarily, the color harmony evaluation model is expressed by the following formula:
[0065] M = O / C;
[0066] Among them, M is the color harmony, C represents the color types and color differences of the color combination, and O represents the orderliness of the color combination.
[0067] It is worth mentioning that the orderliness of color combinations can be determined based on the hue difference, brightness difference and saturation difference of the color combinations.
[0068] Optionally, the initial poster further includes text content; and the step of inputting the initial poster into a font adjustment unit of the poster generation model to adjust the font of the initial poster includes:
[0069] The initial poster is input into the font adjustment unit of the poster generation model, and the text content is semantically analyzed by the font adjustment unit to obtain at least one key text data and a text priority corresponding to the key text data, and the font of the key text data is adjusted based on the text priority; wherein the key text data includes at least one of keywords, phrases and sentences.
[0070] Specifically, the text content in the initial poster, including all text information, is automatically identified, and the identified text content is input into the font adjustment unit. The font adjustment unit uses a semantic analysis algorithm to conduct an in-depth analysis of the text content, identify and extract key text data such as keywords, phrases and sentences in the text. According to the results of the semantic analysis, a text priority is assigned to each key text data. According to the text priority, a suitable font style is selected from a preset font library. Exemplarily, text with a high priority may use a more eye-catching and easy-to-read font, while text with a low priority may use a more concise and unobtrusive font. The font size can also be adjusted according to the text priority. Exemplarily, text with a high priority is usually set to a larger font to attract the audience's attention. The adjusted font style and size are applied to the corresponding text content in the initial poster.
[0071] The technical solution of the embodiment of the present invention is to input the key description data and the semantic data into the label determination module of the pre-trained poster generation model to obtain the element type label corresponding to the key description data and the emotion label corresponding to the semantic data; accurately map the key description data to the specific element type label, and then input the element type label and the emotion label matching data into the poster element matching module of the poster generation model to obtain at least one first poster element matching the element type label and the second poster element matching the emotion label; wherein the first poster element includes image material, graphic element, font style and layout template; the second poster element includes a color combination composed of two or more colors; accurately screen out the first poster element (such as image, graphic, font, layout) and the second poster element that best matches the input data; then input the first poster element and the second poster element into the poster generation module of the poster generation model to generate an initial poster; input the initial poster into the poster optimization module of the poster generation model to generate the first target poster. Through the dual guarantee of the poster generation module and the poster optimization module, high-quality posters that meet the requirements can be generated. The poster generation module is responsible for combining the selected elements into a preliminary poster design, while the poster optimization module further refines and adjusts the poster to ensure the best final output effect. The poster generation process is highly automated, but users can still influence the poster generation results by inputting data and selecting preferences, thereby enhancing participation and satisfaction.
[0072] As an optional example of the first embodiment of the present invention, the poster generation method of this embodiment specifically includes the following steps:
[0073] Accept the interface to input poster description data. This interface can be a web page, a mobile application or a dedicated software interface. The poster description data can be a detailed description of the poster theme, content, style, color preference, etc. The poster description data is parsed using advanced natural language processing technology and deep learning algorithms to obtain key description data and semantic data corresponding to the poster description data. After the poster generation model receives the key description data and the semantic data, it searches and matches in the database. This database contains a large amount of image materials, graphic elements, font styles, color combinations and various layout templates. The most suitable materials and templates will be intelligently selected according to the theme, emotional tendency and style requirements of the text. The poster generation model will preliminarily combine and sort the selected materials and templates. Consider multiple factors such as visual balance, color coordination, information hierarchy, etc. to generate an initial poster. After the initial poster is generated, the initial poster is optimized and refined. The details of the graphics of the initial poster are processed, the font size, color and spacing are adjusted, and the color contrast and saturation are optimized. The poster generation model presents the optimized first target poster to the user. The user can propose modification suggestions for the plan at this stage, such as adjusting the position of an element, changing a color scheme, or modifying text content, etc. The poster generation model receives the input adjustment description data, inputs the adjustment description data and the first target poster into the poster generation model, and generates a second target poster based on the model output result.
[0074] The technical solution of the embodiment of the present invention uses image processing technology and natural language processing technology to transform text descriptions into specific, vivid, and visually impactful graphics, colors, and layouts, so that the poster can accurately convey the meaning and emotions contained in the text. It can quickly generate multiple poster design solutions in a short period of time, greatly shortening the production cycle, meeting the user's poster generation needs in emergency situations, and improving the user experience.
[0075] Embodiment 3
[0076] Figure 3 This is a schematic diagram of the structure of a poster generation device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a data parsing module 310 and a poster generating module 320.
[0077] Among them, the data parsing module 310 is used to receive input poster description data, parse the poster description data to obtain key description data and semantic data corresponding to the poster description data, wherein the key description data includes description data of at least one poster element presented in the poster, and the poster elements include theme, content, style and color; the poster generation module 320 is used to input the key description data and the semantic data into a pre-trained poster generation model, and generate a first target poster based on the output result of the model, wherein the poster generation model is obtained by pre-training a pre-established neural network model based on poster sample data.
[0078] Optionally, the poster generation model includes a label determination module, a poster element matching module, a poster generation module and a poster optimization module; the poster generation module includes:
[0079] A label acquisition unit, used for inputting the key description data and the semantic data into the label determination module of the pre-trained poster generation model to obtain an element type label corresponding to the key description data and an emotion label corresponding to the semantic data;
[0080] A poster element matching unit, used for inputting the element type label and the emotion label matching data into the poster element matching module of the poster generation model to obtain at least one first poster element matching the element type label and a second poster element matching the emotion label; wherein the first poster element includes image material, graphic element, font style and layout template; the second poster element includes a color combination composed of two or more colors;
[0081] An initial poster generating unit, configured to input the first poster element and the second poster element into a poster generating module of the poster generating model to generate an initial poster;
[0082] An optimization unit is used to input the initial poster into a poster optimization module of the poster generation model to generate the first target poster.
[0083] Optionally, the poster optimization module includes at least one of an element adjustment unit, a color adjustment unit and a font adjustment unit; accordingly,
[0084] The optimization unit includes at least one of the following operations:
[0085] A first adjustment subunit, used for inputting the initial poster into the element adjustment unit of the poster generation model to adjust the element position and size of the initial poster;
[0086] a second adjustment subunit, configured to input the initial poster into a color adjustment unit of the poster generation model to perform color adjustment on the initial poster;
[0087] The third adjustment subunit is used to input the initial poster into the font adjustment unit of the poster generation model to adjust the font of the initial poster.
[0088] Optionally, the first adjusting subunit is specifically configured to:
[0089] Inputting the initial poster into the element adjustment unit of the poster generation model, and determining the element center point coordinate data of each first element in the initial poster and the element visual weight corresponding to each first poster element through the element adjustment unit;
[0090] Determine the visual center of gravity of the poster and the initial poster based on the coordinate data of the center points of the multiple elements and the visual weights of the elements, and determine the position difference between the visual center of gravity of the poster and the preset visual center of gravity;
[0091] When the position difference is greater than a preset difference threshold, the element position data and / or the element size data are adjusted.
[0092] Optionally, the second adjusting subunit is specifically configured to:
[0093] The initial poster is input into the color adjustment unit of the poster generation model, so that the color adjustment unit determines the color harmony index corresponding to the color combination of the initial poster based on the color harmony evaluation model, and when the color harmony index is lower than the preset color harmony index, the color combination of the initial poster is adjusted.
[0094] Optionally, the initial poster further includes text content; accordingly, the third adjustment subunit is specifically configured to:
[0095] The initial poster is input into the font adjustment unit of the poster generation model, and the text content is semantically analyzed by the font adjustment unit to obtain at least one key text data and a text priority corresponding to the key text data, and the font of the key text data is adjusted based on the text priority; wherein the key text data includes at least one of keywords, phrases and sentences.
[0096] The device also includes an adjustment module.
[0097] Among them, the adjustment module is used to receive input adjustment description data after the target poster is generated based on the output result of the model, input the adjustment description data and the first target poster into the poster generation model, and generate a second target poster based on the model output result.
[0098] The device also includes a data set construction module, a model training module and a model determination module.
[0099] The data set construction module is used to construct a data set based on a preset number of sample poster data and divide the data set into a training set and a test set before inputting the poster customization demand data into a pre-trained poster generation model, wherein the sample poster data includes sample poster description data and sample poster generation data corresponding to the sample poster description data;
[0100] The model training module is used to iteratively train the pre-established neural network model based on the training set, and during the training process, update the model parameters based on the validation set until the model loss function converges;
[0101] The model determination module is used to determine the poster generation performance index of each completed training model based on the test set, and determine the poster generation model based on at least one poster generation performance index.
[0102] The poster generating device provided in the embodiment of the present invention can execute the poster generating method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0103] Embodiment 4
[0104] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0105] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0106] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0107] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 performs the various methods and processes described above, such as method poster generation.
[0108] In some embodiments, method poster generation may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method poster generation described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform method poster generation in any other appropriate manner (e.g., by means of firmware).
[0109] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0110] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0111] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0112] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0113] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0114] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0115] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0116] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A poster generation method, characterized in that: include: Receiving input poster description data, parsing the poster description data to obtain key description data and semantic data corresponding to the poster description data, wherein the key description data includes description data of at least one poster element presented in the poster, and the poster elements include theme, content, style and color; The key description data and the semantic data are input into a pre-trained poster generation model, and a first target poster is generated based on an output result of the model, wherein the poster generation model is obtained by pre-training a pre-established neural network model based on poster sample data.
2. The method according to claim 1, characterized in that The poster generation model includes a label determination module, a poster element matching module, a poster generation module and a poster optimization module; the key description data and the semantic data are input into a pre-trained poster generation model, and a first target poster is generated based on the output result of the model, including: Inputting the key description data and the semantic data into the label determination module of the pre-trained poster generation model to obtain the element type label corresponding to the key description data and the emotion label corresponding to the semantic data; Input the element type label and the emotion label matching data into the poster element matching module of the poster generation model to obtain at least one first poster element matching the element type label and a second poster element matching the emotion label; wherein the first poster element includes image material, graphic element, font style and layout template; the second poster element includes a color combination composed of two or more colors; Inputting the first poster element and the second poster element into a poster generation module of the poster generation model to generate an initial poster; The initial poster is input into the poster optimization module of the poster generation model to generate the first target poster.
3. The method according to claim 2, characterized in that: The poster optimization module includes at least one of an element adjustment unit, a color adjustment unit, and a font adjustment unit; The step of inputting the initial poster into the poster optimization module of the poster generation model comprises at least one of the following operations: Inputting the initial poster into the element adjustment unit of the poster generation model to adjust the element position and size of the initial poster; Inputting the initial poster into the color adjustment unit of the poster generation model to perform color adjustment on the initial poster; The initial poster is input into the font adjustment unit of the poster generation model to adjust the font of the initial poster.
4. The method according to claim 3, characterized in that: The step of inputting the initial poster into the element adjustment unit of the poster generation model to adjust the element position and size of the initial poster includes: Inputting the initial poster into the element adjustment unit of the poster generation model, and determining the element center point coordinate data of each first element in the initial poster and the element visual weight corresponding to each first poster element through the element adjustment unit; Determine the visual center of gravity of the poster and the initial poster based on the coordinate data of the center points of the multiple elements and the visual weights of the elements, and determine the position difference between the visual center of gravity of the poster and the preset visual center of gravity; When the position difference is greater than a preset difference threshold, the element position data and / or the element size data are adjusted.
5. The method according to claim 3, characterized in that: The step of inputting the initial poster into the color adjustment unit of the poster generation model to adjust the color of the initial poster includes: The initial poster is input into the color adjustment unit of the poster generation model, so that the color adjustment unit determines the color harmony index corresponding to the color combination of the initial poster based on the color harmony evaluation model, and when the color harmony index is lower than the preset color harmony index, the color combination of the initial poster is adjusted.
6. The method according to claim 3, characterized in that: The initial poster also includes text content; inputting the initial poster into the font adjustment unit of the poster generation model to adjust the font of the initial poster includes: The initial poster is input into the font adjustment unit of the poster generation model, and the text content is semantically analyzed by the font adjustment unit to obtain at least one key text data and a text priority corresponding to the key text data, and the font of the key text data is adjusted based on the text priority; wherein the key text data includes at least one of keywords, phrases and sentences.
7. The method according to claim 1, characterized in that After generating the target poster based on the output result of the model, the method further includes: Receive input adjustment description data, input the adjustment description data and the first target poster into the poster generation model, and generate a second target poster based on the model output result.
8. The method according to claim 1, characterized in that: Before inputting the poster customization requirement data into the pre-trained poster generation model, the method further includes: Constructing a data set based on a preset number of sample poster data, and dividing the data set into a training set and a test set, wherein the sample poster data includes sample poster description data and sample poster generation data corresponding to the sample poster description data; Iteratively training the pre-established neural network model based on the training set, and during the training process, updating the model parameters based on the validation set until the model loss function converges; A poster generation performance index is determined based on the test set and each completed training model, and a poster generation model is determined based on at least one poster generation performance index.
9. A poster generating device, characterized in that: include: A data parsing module, configured to receive input poster description data, parse the poster description data to obtain key description data and semantic data corresponding to the poster description data, wherein the key description data includes description data of at least one poster element presented in the poster, and the poster elements include theme, content, style and color; A poster generation module is used to input the key description data and the semantic data into a pre-trained poster generation model, and generate a first target poster based on the output result of the model, wherein the poster generation model is obtained by pre-training a pre-established neural network model based on poster sample data.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the poster generation method according to any one of claims 1 to 8 when executed.
Citation Information
Cited By
Video poster display method based on artificial intelligence
CN120676202A