Website poster generation method and device based on multiple elements, medium and equipment
By obtaining the initial poster image and target description text input by the user, the priority of key description statements and key descriptive words is used to filter out the target element objects, which solves the problems of low poster generation efficiency and quality in the prior art, and achieves more efficient and personalized poster generation.
Patent Information
- Application Number
- CN202411925748.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The prior art is difficult to quickly and efficiently generate website posters that meet users' personalized needs, and traditional methods are time-consuming and labor-intensive, lack flexibility and personalization.
By obtaining the initial poster image, target description text, target object name and preset element database input by the user, the target element object is filtered out using the priority of the key description statement and key descriptive words, and the target poster image is generated in combination with the initial poster image.
It reduces the interference of redundant and invalid statements in the target description text, focuses on the key needs of generating posters, improves the matching between the poster and the target description text, and thus improves the efficiency and quality of the poster generation.
Smart Images

Figure CN119782646A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image generation, and in particular to a method, device, medium and equipment for generating a website poster based on multiple elements. Background Art
[0002] In today's digital age, website posters, as an important visual communication medium, are widely used in various online platforms, e-commerce websites, social media promotion and other scenarios. With the growing demand for personalized and diversified posters from users, the traditional method of generating posters with a single template or simple image editing can no longer meet the requirements. On the one hand, users expect posters to accurately convey specific information and themes, which often involve multiple different objects and rich descriptions. On the other hand, it is a very challenging task to quickly screen and reasonably combine elements that meet the poster theme and user intentions from a massive element library. .
[0003] The current website poster generation methods mostly rely on existing poster templates and manual creations of professional designers, which are not only time-consuming and labor-intensive, but also lack flexibility and personalization. The selection of elements requires users to have certain design skills and experience. For ordinary users, it is difficult to generate personalized posters that meet their needs, resulting in poor efficiency and quality in poster production. It is difficult to generate unique posters based on users' specific needs to meet the rapidly changing market demands.
[0004] Therefore, how to improve the efficiency and quality of poster generation to meet the needs of different users has become an urgent problem to be solved. Summary of the invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is a method for generating a website poster based on multiple elements, and the method for generating a website poster based on multiple elements comprises the following steps:
[0006] S1, obtaining an initial poster image, a target description text, a plurality of preset target object names, a first priority corresponding to each target object name, and a preset element database input by a user.
[0007] S2, based on several target object names and a preset element database, obtain several key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and the reference element object corresponding to each key description word in the preset element database, wherein each key description sentence includes at least one target object name.
[0008] S3, according to all target object names and corresponding key descriptive words included in each key descriptive sentence, obtain the first position of each target object name in the corresponding key descriptive sentence and the second position of each key descriptive word in the corresponding key descriptive sentence.
[0009] S4, obtaining the second priority corresponding to the current key descriptor according to the second position corresponding to each key descriptor, the number of first words corresponding to the key description sentence corresponding to each key descriptor, and the first position and first priority corresponding to each target object name included in the key description sentence corresponding to each key descriptor.
[0010] S5, according to the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and the preset priority threshold, the target element object corresponding to the initial poster image is obtained, wherein the target element object is used to generate the target poster image together with the initial poster image.
[0011] The present invention also provides a website poster generation device based on multiple elements, and the website poster generation device based on multiple elements includes:
[0012] The data acquisition module is used to acquire the initial poster image, target description text, several preset target object names, the first priority corresponding to each target object name and the preset element database input by the user.
[0013] A data screening module is used to obtain several key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and the reference element object corresponding to each key description word in the preset element database based on several target object names and a preset element database, wherein each key description sentence includes at least one target object name.
[0014] The position acquisition module is used to obtain the first position of each target object name in the corresponding key description sentence and the second position of each key description word in the corresponding key description sentence based on all target object names and corresponding key description words included in each key description sentence.
[0015] A priority acquisition module is used to acquire the second priority corresponding to the current key descriptor based on the second position corresponding to each key descriptor, the number of first words corresponding to the key description sentence corresponding to each key descriptor, and the first position and first priority corresponding to each target object name included in the key description sentence corresponding to each key descriptor.
[0016] The target element object acquisition module is used to acquire the target element object corresponding to the initial poster image according to the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and the preset priority threshold, wherein the target element object is used to generate the target poster image together with the initial poster image.
[0017] The present invention also provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned multi-element-based website poster generation method.
[0018] The present invention also provides an electronic device, comprising a processor and the above-mentioned non-transitory computer-readable storage medium.
[0019] The present invention has at least the following beneficial effects: according to several target object names and a preset element database, several key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and the reference element object corresponding to each key description word in the preset element database are obtained; according to all target object names included in each key description sentence and all corresponding key description words, the first position of each target object name in the corresponding key description sentence and the second position of each key description word in the corresponding key description sentence are obtained; according to the second position corresponding to each key description word, the number of first words corresponding to the key description sentence corresponding to each key description word, and each target object name included in the key description sentence corresponding to each key description word, the reference element object corresponding to each key description word in the preset element database is obtained; Corresponding to the first position and the first priority, the second priority corresponding to the current key descriptor is obtained, and according to the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and the preset priority threshold, the target element object corresponding to the initial poster image is obtained to generate the target poster image together with the initial poster image. It can be seen that this embodiment reduces the interference of redundant sentences and invalid sentences in the target description text, focuses on the key needs of generating posters through key description sentences, and comprehensively represents the priority of each key descriptor in generating the target poster through the second priority, thereby improving the matching of the generated poster with the target description text, thereby improving the generation efficiency and quality of the poster, and then improving the visual appeal and communication effect of the target poster image to meet user needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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.
[0021] Figure 1 A flowchart of a method for generating a website poster based on multiple elements provided in the first embodiment of the present invention;
[0022] Figure 2 A flowchart of a method for automatically sorting and arranging website content when rendering provided by Embodiment 2 of the present invention;
[0023] Figure 3 This is a schematic diagram of the structure of a multi-element website poster generation device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", 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 is understood that, where appropriate, the above-mentioned terms used to distinguish similar objects can be interchanged so that the present invention can also implement other embodiments other than the above-mentioned illustrated embodiments or described embodiments. In addition, the terms "including" and "having" and any variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Embodiment 1
[0027] This embodiment 1 provides a method for generating a website poster based on multiple elements. The method for generating a website poster based on multiple elements includes the following steps: Figure 1 As shown:
[0028] S1, obtaining an initial poster image, a target description text, a plurality of preset target object names, a first priority corresponding to each target object name, and a preset element database input by a user.
[0029] The initial poster image may refer to a semi-finished poster image that already includes some poster elements. For example, the initial poster image may include some poster elements such as the poster theme and the poster name.
[0030] The preset target object name may refer to the theme, name, product, interest group, etc. of the poster, which is used to characterize the purpose, source, audience, etc. of the corresponding poster, and serves as the data basis for influencing the content of the poster to generate a target poster that meets the requirements.
[0031] According to the importance of each target object name in generating a target poster that meets the requirements, the first priority corresponding to each target object name is obtained. Specifically, the specific value of the first priority corresponding to each target object name can be set by the implementer according to actual conditions.
[0032] The target description text may refer to a description text of the desired finished poster product, and may be provided by implementers such as users or designers. The target description text may represent the implementer's settings and expectations regarding the theme, name, product, interest groups, etc. of the poster. The preset element database includes several initial element objects, so that the target element objects required for the target poster are filtered out from the preset element database based on the target description text and the target object name, and are used to fill in the initial poster image to generate a target poster that meets the requirements.
[0033] The initial element object may refer to poster elements of the type of graphics, illustrations, photos, texts, colors, etc.
[0034] S2, based on several target object names and a preset element database, obtain several key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and the reference element object corresponding to each key description word in the preset element database, wherein each key description sentence includes at least one target object name.
[0035] Among them, the target description text includes several initial description sentences. Based on the target object name, several key description sentences are screened out from the target description text, which can reduce the interference of redundant sentences and invalid sentences, focus on the key needs of generating posters, and improve the generation efficiency and quality of target posters.
[0036] Key descriptive words may refer to the keywords in the key description statement that characterize the implementer's settings and expectations for the target poster. Among the massive element objects in the preset element database, we focus on the key needs of generating the poster, screen out the reference element objects corresponding to the key descriptive words in the target description text, and use them as the element basis for generating the target poster, which can improve the generation efficiency and quality of the target poster.
[0037] In the above, several key description sentences are screened out from the target description text based on the target object name, which reduces the interference of redundant sentences and invalid sentences, focuses on the key needs of generating posters, and obtains the key description words corresponding to each key description sentence and the reference element objects corresponding to each key description word as the basis for generating target posters, thereby improving the generation efficiency and quality of target posters.
[0038] In a specific implementation, S2 includes the following steps:
[0039] S21, obtaining a number of initial description sentences from the target description text.
[0040] S22, matching each target object name with each initial description sentence, and obtaining the first number of target object names included in each initial description sentence.
[0041] S23: determining the initial description sentences corresponding to the first name quantity greater than the first preset quantity threshold as key description sentences.
[0042] S24, performing keyword extraction on each key description sentence, obtaining all key description words corresponding to each key description sentence, and the number of first words corresponding to all key description words corresponding to each key description sentence.
[0043] S25, matching each key descriptor with the preset element database, and obtaining a reference element object corresponding to each key descriptor in the preset element database.
[0044] Among them, different initial description sentences can be divided according to punctuation marks in the target description text.
[0045] Each target object name and each initial description statement are traversed, retrieved, and matched to obtain all target object names and the corresponding number of first names included in each initial description statement. The larger the number of first names, that is, the more target object names are included in the initial description statement, the richer the description information of the target poster in the initial description statement, and therefore, the initial description statement corresponding to the number of first names greater than the first preset number threshold is determined as a key description statement.
[0046] Keywords are extracted from each key description sentence according to a keyword extraction algorithm, wherein those skilled in the art are aware that any keyword extraction algorithm in the prior art falls within the protection scope of the present invention, and will not be described in detail herein.
[0047] In the above, based on the first preset quantity threshold and the number of first names corresponding to each initial description sentence, key description sentences with richer description information are screened out for keyword extraction and element screening, so as to obtain all key description words corresponding to each key description sentence and the reference element objects corresponding to each key description word, thereby improving the generation efficiency and quality of the target poster.
[0048] In a specific implementation, the preset element database includes a plurality of initial element objects and an element tag corresponding to each initial element object, and S25 includes the following steps:
[0049] S251, for any key description word, calculating the semantic similarity between the current key description word and the element label corresponding to each initial element object.
[0050] S252: Determine the initial element object corresponding to the maximum semantic similarity corresponding to the current key descriptor as the reference element object corresponding to the current key descriptor.
[0051] Among them, those skilled in the art know that any method for calculating semantic similarity in the prior art falls within the protection scope of the present invention, and will not be described in detail here.
[0052] As described above, based on the semantic similarity between the key descriptive words and the element labels, the reference element objects corresponding to each key descriptive word are screened out from the preset element database as the basis for generating the target poster, thereby improving the matching degree between the reference element objects and the key requirements of the generated poster and improving the generation quality of the target poster.
[0053] S3, according to all target object names and corresponding key descriptive words included in each key descriptive sentence, obtain the first position of each target object name in the corresponding key descriptive sentence and the second position of each key descriptive word in the corresponding key descriptive sentence.
[0054] In a specific implementation, S3 includes the following steps:
[0055] S31, determining the character position serial number of the first character in each target object name in the corresponding key description sentence as the first position of each target object name in the corresponding key description sentence.
[0056] S32, determining the character position serial number of the first character in each key description word in the corresponding key description sentence as the second position of each key description word in the corresponding key description sentence.
[0057] In the above, the first position is used to represent the position information of the target object name in the corresponding key description sentence, and the second position is used to represent the position information of the key descriptive word in the corresponding key description sentence. The correlation between the key descriptive word and the target object name can be measured by the distance between the first position and the second position, which provides a data basis for analyzing the matching between the key descriptive word and the requirements for generating posters.
[0058] S4, obtaining the second priority corresponding to the current key descriptor according to the second position corresponding to each key descriptor, the number of first words corresponding to the key description sentence corresponding to each key descriptor, and the first position and first priority corresponding to each target object name included in the key description sentence corresponding to each key descriptor.
[0059] In a specific implementation, S4 includes the following steps:
[0060] S41, for any key descriptor, any key descriptive sentence corresponding to the current key descriptor, and any target object name corresponding to the current key descriptive sentence, obtain the degree of association of the current key descriptor with respect to the current target object name included in the current key descriptive sentence based on the first position of the current target object name in the current key descriptive sentence and the second position of the current key descriptor in the current key descriptive sentence.
[0061] S42, determining the proportion of the number of first words corresponding to the current key description sentence to the sum of the numbers of first words corresponding to all key description sentences as the criticality corresponding to the current key description sentence.
[0062] S43: Determine the average value of the first priorities corresponding to all target object names included in the current key description sentence as the third priority corresponding to the current key description sentence.
[0063] S44, acquiring a fourth priority level corresponding to the current key description sentence according to the criticality level and the third priority level corresponding to the current key description sentence.
[0064] S45, obtaining the first importance of the current key descriptor relative to the current key descriptor sentence according to the first priority corresponding to each target object name and the association degree of the current key descriptor relative to all target object names included in the current key descriptor sentence.
[0065] S46, according to the fourth priority level corresponding to the current key description sentence and the first importance level of the current key description word relative to all key description sentences, obtain the second priority level corresponding to the current key description word.
[0066] The closer the first position is to the second position, the higher the degree of association between the corresponding key descriptor and the corresponding target object name is.
[0067] The more first words corresponding to the key description sentence, that is, the more key description words included in the key description sentence, the richer the description information of the target poster of the key description sentence, and correspondingly, the greater the criticality of the key description sentence. The larger the first priority corresponding to the target object name, the more important the target object name is in generating a target poster that meets the requirements, and correspondingly, the larger the third priority, the more important the key description sentence is in generating a target poster that meets the requirements. Furthermore, the fourth priority corresponding to the key description sentence is obtained by combining the criticality and the third priority corresponding to the key description sentence, which comprehensively represents the priority of the key description sentence in generating the target poster.
[0068] Correspondingly, the first importance is positively correlated with the corresponding first priority and the association degree, and the second priority is positively correlated with the corresponding fourth priority and the first importance.
[0069] In the above, based on the second position corresponding to each key descriptive word, the number of first words corresponding to the key descriptive sentence corresponding to each key descriptive word, and the first position and first priority corresponding to each target object name included in the key descriptive sentence corresponding to each key descriptive word, the second priority corresponding to the current key descriptive word is obtained, which comprehensively represents the priority of each key descriptive word when generating the target poster. As the basis for generating the poster, the matching between the generated poster and the target description text is improved, thereby improving the efficiency and quality of poster generation and meeting the needs of users.
[0070] S5, according to the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and the preset priority threshold, the target element object corresponding to the initial poster image is obtained, wherein the target element object is used to generate the target poster image together with the initial poster image.
[0071] Among them, according to the preset priority threshold and the second priority corresponding to each key descriptive word, the reference element objects corresponding to the key descriptive words are screened to obtain the target element objects. The target element objects can be added to the appropriate position in the initial poster image, adjusted in size, changed in color, etc., so that the finally generated target poster image can better reflect the key information of the target description text and have higher visual appeal and communication effect.
[0072] In a specific implementation, the preset element database includes a plurality of initial element objects and a preset area range corresponding to each initial element object, the preset area range includes a minimum preset area and a maximum preset area, and S5 further includes the following steps:
[0073] S51, acquiring the to-be-filled region in the initial poster image and the to-be-filled area corresponding to the to-be-filled region according to the pixel value of each pixel point in the initial poster image.
[0074] S52: Determine a reference element object whose corresponding second priority is greater than a preset priority threshold as a target element object.
[0075] S53: Acquire the preset area range corresponding to each target element object according to the preset area range corresponding to each initial element object.
[0076] S54, acquiring the required area corresponding to each target element object according to the second priority corresponding to the key descriptor corresponding to each target element object and the preset area range corresponding to each target element object.
[0077] S55, selecting the to-be-filled element objects from all the target elements according to the to-be-filled area and the required area corresponding to each target element object.
[0078] S56, filling all the element objects to be filled into the to-be-filled area of the initial poster image to obtain a target poster image.
[0079] Among them, the minimum preset area may refer to the minimum area that makes the corresponding initial element object have a better visual effect in the target poster image, and the maximum preset area may refer to the maximum area that makes the corresponding initial element object have a better visual effect in the target poster image.
[0080] When the pixel value of a pixel point in the initial poster image is within a preset pixel value range, the corresponding pixel point is divided into the area to be filled. The preset pixel value range may refer to the pixel value range corresponding to all background pixel points in the initial poster image.
[0081] The higher the second priority, the higher the importance and priority of the corresponding target element object in generating the target poster. Therefore, if the second priority corresponding to the same target element object is different, the size of the target element object presented on the target poster image will be different, thereby achieving different visual appeal and communication effects. Therefore, the required area corresponding to each target element object is positively correlated with the corresponding second priority.
[0082] In order to ensure that there are gaps in the target poster image and improve the visual communication effect, this embodiment further screens the target element objects according to the area to be filled and the required area corresponding to each target element object, and fills the screened element objects to be filled into the area to be filled in the initial poster image to obtain the target poster image.
[0083] In a specific implementation, S54 includes the following steps:
[0084] S541: Determine an average value of a maximum preset area and a minimum preset area corresponding to each target element object as a first intermediate area corresponding to each target element object.
[0085] S542: Determine half of the difference between the maximum preset area and the minimum preset area corresponding to each target element object as the second intermediate area corresponding to each target element object.
[0086] S543, acquiring the required area corresponding to each target element object according to the second priority corresponding to the key descriptor corresponding to each target element object, the first middle area and the second middle area corresponding to each target element object, and a preset required area calculation model.
[0087] In a specific implementation, the preset required area calculation model is:
[0088] A=S 1 +((1 / (1+e^(-k×B)))-1)×S 2 , where A refers to the required area corresponding to the target element object, B refers to the second priority corresponding to the key descriptor corresponding to the target element object, k refers to the preset coefficient corresponding to the second priority, S 1 Refers to the first middle area corresponding to the target element object, S 1 =(C 1 +C 2 ) / 2,S 2 Refers to the first middle area corresponding to the target element object, S 1 =(C 2 -C 1 ) / 2,C 1 Refers to the minimum preset area corresponding to the target element object, C 2 Refers to the maximum preset area corresponding to the target element object.
[0089] Among them, the value range of ((1 / (1+e^(-k×B)))-1) is (-1, 1), and the value range of A is (C 1 , C 2 ), and A and B are positively correlated. As B increases, A increases from C 1 Gradually increase to C2 , thereby improving the visual appeal and communication effect of the corresponding target element object in the target poster image.
[0090] In a specific implementation, S55 includes the following steps:
[0091] S551, if the area to be filled is greater than the sum of the required areas corresponding to the first M target element objects of the second priority, and is less than or equal to the sum of the required areas corresponding to the first M+1 target element objects of the second priority, then the target element objects corresponding to the first M second priorities are determined as the element objects to be filled, where M=1, 2,..., N, and N refers to the total number of target element objects.
[0092] The sum of the required areas of all the element objects to be filled is smaller than the area to be filled, which ensures that there are gaps in the target poster image and improves the visual communication effect of the target poster image.
[0093] In the above, according to the names of several target objects and the preset element database, several key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and the reference element object corresponding to each key description word in the preset element database are obtained. According to all target object names and all corresponding key description words included in each key description sentence, the first position of each target object name in the corresponding key description sentence and the second position of each key description word in the corresponding key description sentence are obtained. According to the second position corresponding to each key description word, the number of first words corresponding to the key description sentence corresponding to each key description word, and the first position corresponding to each target object name included in the key description sentence corresponding to each key description word, the first position corresponding to each target object name included in the key description sentence corresponding to each key description word, the first position corresponding to each target object name included in the key description sentence Position and the first priority, obtain the second priority corresponding to the current key descriptor, and according to the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and the preset priority threshold, obtain the target element object corresponding to the initial poster image to generate the target poster image together with the initial poster image. It can be seen that this embodiment reduces the interference of redundant sentences and invalid sentences in the target description text, focuses on the key needs of generating posters through key description sentences, and comprehensively represents the priority of each key descriptor in generating the target poster through the second priority, thereby improving the matching of the generated poster with the target description text, thereby improving the generation efficiency and quality of the poster, and then improving the visual appeal and communication effect of the target poster image to meet user needs.
[0094] Embodiment 2
[0095] The second embodiment provides a method for automatically sorting and arranging website content when rendering. The method for automatically sorting and arranging website content when rendering includes: Figure 2 As shown:
[0096] S10, obtaining M target poster images, the poster theme corresponding to each target poster image, color element information, graphic element information and text element information, wherein M is an integer greater than 1.
[0097] Among them, static posters can easily cause visual fatigue to the audience, while the switching presentation of posters can constantly bring new visual stimulation, break the monotony, and quickly attract the audience's attention. Different posters can convey information from different angles, and the switching presentation of posters can make the conveyed information richer and more comprehensive.
[0098] The current poster display method is generally to switch and display in the order set by the user. With the rapid spread of information and people's continuous pursuit of visual experience, the traditional poster display method lacks objective analysis of the order of poster presentation, which may lead to display problems such as confusion and disorder, making it difficult to meet the audience's diverse needs such as aesthetics and information acquisition, thereby reducing the attention of the target poster image and the information communication effect.
[0099] Therefore, this embodiment obtains the poster theme, color element information, graphic element information and text element information corresponding to each target poster image, and integrates poster features of multiple dimensions to sort the M target poster images that need to be presented, so as to reasonably arrange the switching order of the target poster images to improve the attention and information communication effect of the target poster images.
[0100] In a specific implementation, S10 includes the following steps:
[0101] S101, input each target poster image into a preset theme recognition model to obtain the poster theme corresponding to each target poster image.
[0102] S102, acquiring color element information corresponding to each target poster image according to the hue corresponding to each pixel in each target poster image, wherein the color element information includes the number of hue types, the proportion of warm tones, and the proportion of cool tones.
[0103] S103, inputting each target poster image into a preset semantic segmentation model to obtain a plurality of graphic elements and a plurality of text elements corresponding to each target poster image.
[0104] S104, performing bounding box detection on each graphic element and each text element, and obtaining a first frame and a first frame area corresponding to each graphic element, and a second frame and a second frame area corresponding to each text element.
[0105] S105, obtaining graphic element information corresponding to each target poster image according to a number of graphic elements corresponding to each target poster image and a first frame area corresponding to each graphic element, wherein the graphic element information includes a first number of graphic elements and a first frame area corresponding to each graphic element.
[0106] S106, acquiring text element information corresponding to each target poster image according to a number of text elements corresponding to each target poster image and a second frame area corresponding to each text element, wherein the text element information includes a second number of text elements and a second frame area corresponding to each text element.
[0107] The preset theme recognition model is used to extract features and predict themes of the input target poster image, thereby characterizing the poster features of the target poster image in the theme dimension. The specific types of poster themes can be pre-set by the implementer according to actual conditions. For example, the specific types of poster themes can include product promotion, art exhibitions, environmental protection, charity activities, and other types.
[0108] By counting the hue of all pixels in the target poster image, the color element information of the target poster image can be obtained to characterize the poster features of each target poster image in the color dimension. The color element information includes the number of hue types, that is, how many different colors appear in the target poster image. The warm tone ratio is the ratio of warm-toned pixels (such as red, orange, yellow, etc.) to the total pixel points in the target poster image. The cool tone ratio is the ratio of cool-toned pixels (such as blue, green, purple, etc.) to the total pixel points in the target poster image.
[0109] The preset semantic segmentation model is used to perform operations such as feature extraction, upsampling, deconvolution and pixel-level classification on the input target poster image, and assign corresponding category labels to each pixel, such as image element labels and text element labels, so as to obtain a number of graphic elements and text elements corresponding to each target poster image. Each text element may include a number of characters.
[0110] According to the bounding box detection algorithm, each graphic element and each text element is subjected to bounding box detection, and the first frame and the first frame area corresponding to each graphic element, as well as the second frame and the second frame area corresponding to each text element are obtained, and then the graphic element information and the text element information corresponding to each target poster image are obtained, so as to characterize the poster features of each target poster image in the graphic dimension and the text dimension. Among them, those skilled in the art know that any bounding box detection algorithm in the prior art falls within the protection scope of the present invention, and will not be described in detail here.
[0111] In the above, the poster theme, color element information, graphic element information and text element information corresponding to each target poster image are obtained, and the poster features of multiple dimensions are integrated as the basis for sorting the M target poster images that need to be presented, so as to reasonably arrange the switching order of the target poster images to improve the attention and information communication effect of the target poster images.
[0112] S20 , acquiring a first layout priority corresponding to each target poster image according to the color element information, graphic element information and text element information corresponding to each target poster image.
[0113] The first layout priority is the priority of the corresponding target poster image in displaying in the poster switching display process.
[0114] In a specific implementation, S20 includes the following steps:
[0115] S201, obtaining the color complexity corresponding to each target poster image according to the number of hue types, the proportion of warm tones, and the proportion of cold tones corresponding to each target poster image.
[0116] S202, acquiring the graphic complexity corresponding to each target poster image according to the first quantity corresponding to each target poster image and the first frame area corresponding to each graphic element.
[0117] S203, acquiring the text complexity corresponding to each target poster image according to the second quantity corresponding to each target poster image and the second frame area corresponding to each text element.
[0118] S204, obtaining a first layout priority corresponding to each target poster image according to the color complexity, graphic complexity and text complexity corresponding to each target poster image, wherein the first layout priority is negatively correlated with the color complexity, graphic complexity and text complexity.
[0119] Among them, in the process of switching the target poster image, the transition from simple colors to complex colors, from simple graphics to complex images, and from simple text to complex text can reduce display problems such as chaos and disorder, provide the audience with an adaptation process, and constantly bring new visual stimulation and surprises to the audience, thereby increasing the attention and information communication effect of the target poster image.
[0120] Therefore, in this embodiment, the first layout priority is negatively correlated with the color complexity, graphic complexity and text complexity. The first layout priority corresponding to each target poster image can be obtained according to the color complexity, graphic complexity and text complexity corresponding to each target poster image, which serves as the data basis for reasonably arranging the switching order of the target poster images.
[0121] In a specific implementation, S201 includes the following steps:
[0122] S2011, acquiring a first difference degree corresponding to each target poster image according to a warm tone ratio and a cool tone ratio corresponding to each target poster image.
[0123] S2012, obtaining the color complexity corresponding to each target poster image according to the number of hue types and the first degree of difference corresponding to each target poster image, wherein the color complexity is positively correlated with the number of hue types, and negatively correlated with the first degree of difference.
[0124] Among them, the greater the first difference between the proportion of warm tones and the proportion of cool tones corresponding to the target poster image, that is, the greater the proportion of warm tones corresponding to the target poster image, or the greater the proportion of cool tones corresponding to the target poster image, it means that the tone of the target poster image is more uniform and the corresponding color complexity is lower.
[0125] The greater the number of hue types corresponding to the target poster image, the more complex the hue information of the target poster image is, and the higher the corresponding color complexity is.
[0126] Therefore, color complexity is positively correlated with the number of hue types, and negatively correlated with the first degree of difference. The color complexity corresponding to each target poster image can be obtained based on the number of hue types and the first degree of difference corresponding to each target poster image, which serves as the data basis for reasonably arranging the switching order of the target poster images.
[0127] In a specific implementation, S202 includes the following steps:
[0128] S2021, acquiring a second degree of difference between all graphic elements corresponding to each target poster image according to a first frame area corresponding to each graphic element corresponding to each target poster image.
[0129] S2022, acquiring the graphic complexity corresponding to each target poster image according to the first quantity and the second difference degree corresponding to each target poster image, wherein the graphic complexity is negatively correlated with the first quantity and the second difference degree.
[0130] Among them, the greater the difference between the first frame areas corresponding to different graphic elements in the target poster image and the larger the first number corresponding to the target poster image, the more complicated the graphic information of the target poster image is and the higher the corresponding graphic complexity is.
[0131] Therefore, the graphic complexity is positively correlated with the first quantity and the second degree of difference. The graphic complexity corresponding to each target poster image can be obtained based on the first quantity and the second degree of difference corresponding to each target poster image, which serves as the data basis for reasonably arranging the switching order of the target poster images.
[0132] In a specific implementation, S203 includes the following steps:
[0133] S2031 , obtaining a third difference degree between all text elements corresponding to each target poster image according to a second frame area corresponding to each text element corresponding to each target poster image.
[0134] S2032, acquiring the text complexity corresponding to each target poster image according to the second quantity and the third difference degree corresponding to each target poster image, wherein the text complexity is positively correlated with the second quantity and the third difference degree.
[0135] Among them, the greater the difference between the second frame areas corresponding to different text elements in the target poster image and the larger the second number corresponding to the target poster image, the more complicated the text information of the target poster image and the higher the corresponding text complexity.
[0136] Therefore, the text complexity is positively correlated with the second quantity and the third degree of difference. The text complexity corresponding to each target poster image can be obtained based on the second quantity and the third degree of difference corresponding to each target poster image, which serves as the data basis for reasonably arranging the switching order of the target poster images.
[0137] As mentioned above, setting the first layout priority is negatively correlated with the color complexity, graphic complexity and text complexity. According to the color complexity, graphic complexity and text complexity corresponding to each target poster image, the first layout priority corresponding to each target poster image is obtained as the data basis for reasonably arranging the switching order of the target poster images, thereby reducing display problems such as chaos and disorder, constantly bringing new visual stimulation and surprise to the audience, and improving the attention and information communication effect of the target poster image.
[0138] S30 , obtaining first sorting results corresponding to the M target poster images according to the first layout priority corresponding to each target poster image.
[0139] The M target poster images are sorted in descending order of the first layout priority, and a first sorting result corresponding to the M target poster images is obtained as a basis for arranging the switching order of the target poster images.
[0140] S40, initializing t=1, and determining the first target poster image in the first sorting result as the first presentation object, and determining other target poster images other than the first presentation object as objects to be presented.
[0141] Among them, the first target poster image in the first sorting result, that is, the target poster image corresponding to the largest first layout priority, is determined as the first presentation object, and other target poster images other than the first presentation object are determined as objects to be presented. On the basis of determining the first presentation object, the priorities of the objects to be presented are analyzed, so as to gradually determine the presentation order of the target poster images.
[0142] S50, obtaining the second layout priority corresponding to each object to be presented according to the first layout priority corresponding to each object to be presented, the tth presented object and the poster theme corresponding to each object to be presented, the color element information, the graphic element information and the text element information.
[0143] In a specific implementation, S50 includes the following steps:
[0144] S501, according to the poster theme corresponding to each object to be presented and the poster theme corresponding to the t-th presented object, obtain the theme difference degree between each object to be presented and the t-th presented object.
[0145] S502, according to the number of hue types, the proportion of warm tones and the proportion of cool tones corresponding to each object to be presented, and the number of hue types, the proportion of warm tones and the proportion of cool tones corresponding to the tth presented object, the degree of color difference between each object to be presented and the tth presented object is obtained.
[0146] S503, obtaining the degree of graphic difference between each object to be presented and the tth presented object based on the first quantity corresponding to each object to be presented and the first frame area corresponding to each graphic element, as well as the first quantity corresponding to the tth presented object and the first frame area corresponding to each graphic element.
[0147] S504, based on the second quantity corresponding to each object to be presented and the second frame area corresponding to each text element, as well as the second quantity corresponding to the tth presented object and the second frame area corresponding to each text element, obtain the degree of text difference between each object to be presented and the tth presented object.
[0148] S505, based on the degree of subject difference, color difference, graphic difference, text difference between each object to be presented and the tth presented object, and the first layout priority corresponding to each object to be presented, obtain the second layout priority corresponding to each object to be presented, wherein the second layout priority is negatively correlated with the degree of subject difference, color difference, graphic difference, and text difference, and the second layout priority is positively correlated with the first layout priority.
[0149] In a specific implementation, S501 includes the following steps:
[0150] S5011, calculating the semantic similarity between the poster theme corresponding to each object to be presented and the poster theme corresponding to the tth presented object.
[0151] S5012, based on the degree of semantic similarity between the poster theme corresponding to each object to be presented and the poster theme corresponding to the tth presented object, obtain the degree of theme difference between the poster theme corresponding to each object to be presented and the poster theme corresponding to the tth presented object, wherein the degree of theme difference is negatively correlated with the degree of semantic similarity.
[0152] Among them, when the semantic similarity between the object to be presented and the tth presented object is high, that is, the degree of theme difference is small, it means that the core content or main idea conveyed by the object to be presented and the tth presented object is relatively similar. When arranging the presentation order, placing the target poster images with similar themes in a relatively close position can allow the audience to better focus on the specific theme, think deeply about related issues, and form a coherent cognitive experience. Therefore, the second layout priority is negatively correlated with the degree of theme difference.
[0153] Among them, those skilled in the art are aware that any method for calculating the degree of semantic similarity between texts in the prior art falls within the protection scope of the present invention and will not be described in detail here.
[0154] In a specific implementation, S502 includes the following steps:
[0155] S5021: Determine the difference between the number of hue types corresponding to each object to be presented and the number of hue types corresponding to the t-th presented object as a first color difference value between each object to be presented and the t-th presented object.
[0156] S5022: Determine the difference between the warm color ratio corresponding to each object to be presented and the warm color ratio corresponding to the t-th presented object as a second color difference value between each object to be presented and the t-th presented object.
[0157] S5023: Determine the difference between the cold color ratio corresponding to each object to be presented and the cold color ratio corresponding to the t-th presented object as a third color difference value between each object to be presented and the t-th presented object.
[0158] S5024, obtaining a degree of color difference between each object to be presented and the tth presented object according to the first color difference value, the second color difference value, and the third color difference value between each object to be presented and the tth presented object, wherein the degree of color difference is positively correlated with the first color difference value, the second color difference value, and the third color difference value.
[0159] Among them, when the color difference between the object to be presented and the tth presented object is small, it means that the color matching of the object to be presented and the tth presented object is relatively similar, that is, the visual atmosphere is relatively harmonious and unified. For example, a group of posters are all blue as the main color, and different shades of blue may be used to express different emotions or information. When arranging the presentation order, placing target poster images with similar colors in a relatively close position will not give the audience a strong sense of visual jump, making the entire presentation process smoother. Therefore, the second layout priority is negatively correlated with the degree of color difference.
[0160] In a specific implementation, S503 includes the following steps:
[0161] S5031: Acquire a first quantity difference value between each object to be presented and the tth presented object according to the first quantity corresponding to each object to be presented and the first quantity corresponding to the tth presented object.
[0162] S5032: Determine an average value of first frame areas corresponding to all graphic elements corresponding to each object to be presented as a first average frame area corresponding to each object to be presented.
[0163] S5033: Determine an average value of first frame areas corresponding to all graphic elements corresponding to the t-th presentation object as a first average frame area corresponding to the t-th presentation object.
[0164] S5034: Obtain a first frame area difference value between each object to be presented and the tth presented object according to the first average frame area corresponding to each object to be presented and the first average frame area corresponding to the tth presented object.
[0165] S5035, according to the first quantity difference value and the first frame area difference value between each object to be presented and the tth presented object, obtain the degree of graphic difference between each object to be presented and the tth presented object, wherein the degree of graphic difference is positively correlated with the first quantity difference value and the first frame area difference value.
[0166] Among them, when the degree of difference between the graphics of the object to be presented and the t-th presented object is small, it means that the object to be presented and the t-th presented object are similar in shape, style or expression of the graphics. For example, a group of posters all use simple line graphics to express the theme, and they may only differ in the specific graphic content. In this case, presenting posters with similar graphics in sequence can make it easier for the audience to recognize and understand the information conveyed by the graphics, while also enhancing the relevance between posters. In addition, the audience can quickly adapt to similar graphic styles during the viewing process and better appreciate and interpret the uniqueness of each poster.
[0167] In a specific implementation, S504 includes the following steps:
[0168] S5041: Acquire a second quantity difference value between each object to be presented and the tth presented object according to the second quantity corresponding to each object to be presented and the second quantity corresponding to the tth presented object.
[0169] S5042: Determine the average value of the second frame areas corresponding to all text elements corresponding to each object to be presented as the second average frame area corresponding to each object to be presented.
[0170] S5043: Determine the average value of the second frame areas corresponding to all text elements corresponding to the t-th presentation object as the second average frame area corresponding to the t-th presentation object.
[0171] S5044: Obtain a second frame area difference value between each object to be presented and the tth presented object according to the second average frame area corresponding to each object to be presented and the second average frame area corresponding to the tth presented object.
[0172] S5045, according to the second quantity difference value and the second frame area difference value between each object to be presented and the tth presented object, obtain the text difference degree between each object to be presented and the tth presented object, wherein the text difference degree is positively correlated with the second quantity difference value and the second frame area difference value.
[0173] Among them, when the text difference between the object to be presented and the tth presented object is small, it indicates that the object to be presented and the tth presented object are relatively close in text content, font style or expression. For example, a group of posters all use concise and clear slogan-like text to convey information, and may only differ slightly in the specific words. Presenting posters in the order of the smallest text difference can make it easier for the audience to remember and understand the main information of the posters, and avoid confusion caused by frequent changes in text style. At the same time, similar text expressions can also strengthen the overall style and theme of the poster, allowing the audience to form a unified impression during the viewing process.
[0174] Therefore, the second layout priority is negatively correlated with the theme difference degree, color difference degree, graphic difference degree and text difference degree, and the second layout priority is positively correlated with the first layout priority.
[0175] In the above, according to the poster theme, color element information, graphic element information and text element information corresponding to the tth presented object and each object to be presented, the theme difference degree, color difference degree, graphic difference degree and text difference degree between the tth presented object and each object to be presented are measured to characterize the difference between the tth presented object and each object to be presented in multiple dimensions of theme, color, graphic and text, and the second layout priority corresponding to each object to be presented is obtained in combination with the first layout priority of the object to be presented itself, so that when switching to present the target poster image, the target poster images with similar themes, colors, graphics and texts are placed in a closer position, which will not bring a strong sense of visual jump to the audience, allowing the audience to better focus on the specific theme, and more easily identify and understand the information conveyed by the graphics and text, thereby improving the attention of the target poster image and the information communication effect.
[0176] S60: Determine the to-be-presented object corresponding to the largest second layout priority as the t+1th presentation object.
[0177] S70, update t=t+1, and delete the tth presentation object and the t+1th presentation object from the first sorting result, repeat step S50 until t=M-1, and obtain the 1st presentation object to the Mth presentation object.
[0178] Among them, according to the differences between the object to be presented and the previous presented object in multiple dimensions such as theme, color, graphic and text, combined with the first layout priority of the object to be presented itself, the next presented object is determined, and so on, until the presentation order of M target poster images is determined, thereby improving the overall attention and overall information communication effect of the M target poster images.
[0179] S80, when rendering the website content, switching the M target poster images according to the order from the first presentation object to the Mth presentation object.
[0180] In the above, according to the color element information, graphic element information and text element information corresponding to each target poster image, the first layout priority corresponding to each target poster image is obtained, according to the first layout priority corresponding to each target poster image, the first sorting result corresponding to the M target poster images is obtained, t=1 is initialized, and the first target poster image in the first sorting result is determined as the first presentation object, and the other target poster images other than the first presentation object are determined as objects to be presented, and according to the first layout priority corresponding to each object to be presented, the tth presentation object and the poster theme, color element information, graphic element information and text element information corresponding to each object to be presented, the second layout priority corresponding to each object to be presented is obtained, the object to be presented corresponding to the largest second layout priority is determined as the t+1th presentation object, t=t+1 is updated, and the tth presentation object and the t+1th presentation object are moved from the first layout priority to the second layout priority. The first sorting result is deleted, and the step of obtaining the second layout priority is repeated until t=M-1, and the 1st presentation object to the Mth presentation object are obtained, and the M target poster images are switched according to the order of the 1st presentation object to the Mth presentation object. It can be seen that by characterizing the differences between the tth presentation object and each object to be presented in multiple dimensions of theme, color, graphic and text, combined with the first layout priority of the object to be presented itself, the second layout priority corresponding to each object to be presented is obtained, and the presentation order of the target poster images is determined one by one, so that when switching to present the M target poster images, the target poster images with similar themes, colors, graphics and texts are placed in a closer position, which will not bring a strong sense of visual jump to the audience, allowing the audience to better focus on specific topics, and more easily identify and understand the information conveyed by graphics and text, thereby improving the attention of the target poster image and the information communication effect when rendering website content.
[0181] Embodiment 3
[0182] The third embodiment provides a website poster generation device based on multiple elements, and the website poster generation device based on multiple elements includes: Figure 3 As shown:
[0183] The data acquisition module 31 is used to acquire the initial poster image, target description text, a plurality of preset target object names, the first priority corresponding to each target object name and a preset element database input by the user.
[0184] The data screening module 32 is used to obtain several key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and the reference element object corresponding to each key description word in the preset element database according to several target object names and a preset element database, wherein each key description sentence includes at least one target object name.
[0185] The position acquisition module 33 is used to acquire the first position of each target object name in the corresponding key description sentence and the second position of each key description word in the corresponding key description sentence based on all target object names and corresponding key description words included in each key description sentence.
[0186] The priority acquisition module 34 is used to obtain the second priority corresponding to the current key descriptor based on the second position corresponding to each key descriptor, the number of first words corresponding to the key description sentence corresponding to each key descriptor, and the first position and first priority corresponding to each target object name included in the key description sentence corresponding to each key descriptor.
[0187] The target element object acquisition module 35 is used to acquire the target element object corresponding to the initial poster image according to the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and the preset priority threshold, wherein the target element object is used to generate the target poster image together with the initial poster image.
[0188] In a specific implementation, the location acquisition module 33 includes:
[0189] The first position acquisition submodule is used to determine the character position sequence number of the first character in each target object name in the corresponding key description sentence as the first position of each target object name in the corresponding key description sentence.
[0190] The second position acquisition submodule is used to determine the character position sequence number of the first character in each key description word in the corresponding key description sentence as the second position of each key description word in the corresponding key description sentence.
[0191] In a specific implementation, the priority acquisition module 34 includes:
[0192] The association degree acquisition submodule is used to obtain the association degree of the current key descriptor with respect to the current target object name included in the current key description sentence based on the first position of the current target object name in the current key description sentence and the second position of the current key descriptor in the current key description sentence for any key descriptor, any key descriptive sentence corresponding to the current key descriptor, and any target object name corresponding to the current key description sentence.
[0193] The criticality acquisition submodule is used to determine the criticality corresponding to the current key description sentence by taking the proportion of the number of first words corresponding to the current key description sentence to the sum of the numbers of first words corresponding to all key description sentences.
[0194] The third priority obtaining submodule is used to determine the average value of the first priorities corresponding to all target object names included in the current key description sentence as the third priority corresponding to the current key description sentence.
[0195] The fourth priority obtaining submodule is used to obtain the fourth priority corresponding to the current key description sentence according to the criticality corresponding to the current key description sentence and the third priority.
[0196] The first importance acquisition submodule is used to acquire the first importance of the current key descriptor relative to the current key description sentence based on the first priority corresponding to each target object name and the degree of association of the current key descriptor relative to all target object names included in the current key description sentence.
[0197] The second priority acquisition submodule is used to acquire the second priority corresponding to the current key description word according to the fourth priority corresponding to the current key description sentence and the first importance of the current key description word relative to all key description sentences.
[0198] In a specific embodiment, the data screening module 32 includes:
[0199] The initial description sentence acquisition submodule is used to acquire several initial description sentences from the target description text.
[0200] The first name quantity acquisition submodule is used to match each target object name with each initial description sentence, and acquire the first name quantity of the target object names included in each initial description sentence.
[0201] The key description sentence determination submodule is used to determine the initial description sentences corresponding to the first name quantity greater than the first preset quantity threshold as key description sentences.
[0202] The first word quantity acquisition submodule is used to extract keywords from each key description sentence, obtain all key description words corresponding to each key description sentence, and the first word quantity corresponding to all key description words corresponding to each key description sentence.
[0203] The reference element object acquisition submodule is used to match each key descriptor with the preset element database to obtain the reference element object corresponding to each key descriptor in the preset element database.
[0204] In a specific implementation, the preset element database includes a plurality of initial element objects and a preset area range corresponding to each initial element object, the preset area range includes a minimum preset area and a maximum preset area, and the target element object acquisition module 35 further includes:
[0205] The to-be-filled area acquisition submodule is used to acquire the to-be-filled area in the initial poster image and the to-be-filled area corresponding to the to-be-filled area according to the pixel value of each pixel point in the initial poster image.
[0206] The target element object determination submodule is used to determine the reference element object whose corresponding second priority is greater than a preset priority threshold as the target element object.
[0207] The preset area range acquisition submodule is used to acquire the preset area range corresponding to each target element object according to the preset area range corresponding to each initial element object.
[0208] The required area acquisition submodule is used to acquire the required area corresponding to each target element object according to the second priority corresponding to the key descriptor corresponding to each target element object and the preset area range corresponding to each target element object.
[0209] The to-be-filled element object acquisition submodule is used for the screening submodule, which is used to screen out the to-be-filled element objects from all the target element objects according to the to-be-filled area and the required area corresponding to each target element object.
[0210] The target poster image acquisition submodule is used to fill all the element objects to be filled into the to-be-filled area of the initial poster image to obtain the target poster image.
[0211] In a specific implementation, the required area acquisition submodule includes the following steps:
[0212] The first intermediate area acquisition unit is used to determine the average value of the maximum preset area and the minimum preset area corresponding to each target element object as the first intermediate area corresponding to each target element object.
[0213] The second intermediate area acquisition unit is used to determine half of the difference between the maximum preset area and the minimum preset area corresponding to each target element object as the second intermediate area corresponding to each target element object.
[0214] The required area acquisition unit is used to acquire the required area corresponding to each target element object according to the second priority corresponding to the key descriptor corresponding to each target element object, the first intermediate area and the second intermediate area corresponding to each target element object and a preset required area calculation model.
[0215] In a specific implementation, the submodule for obtaining the element object to be filled includes the following steps:
[0216] The to-be-filled element object acquisition unit is used to determine the target element objects corresponding to the first M second priorities as the to-be-filled element objects if the to-be-filled area is greater than the sum of the required areas corresponding to the first M target element objects corresponding to the second priority, and is less than or equal to the sum of the required areas corresponding to the first M+1 target element objects corresponding to the second priority, wherein M=1, 2,..., N, and N refers to the total number of target element objects.
[0217] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0218] Embodiment 4
[0219] Embodiment 4 of the present invention provides a non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, and the at least one instruction or at least one program is loaded and executed by a processor to implement the steps:
[0220] S1, obtaining an initial poster image, a target description text, a plurality of preset target object names, a first priority corresponding to each target object name, and a preset element database input by a user.
[0221] S2, based on several target object names and a preset element database, obtain several key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and the reference element object corresponding to each key description word in the preset element database, wherein each key description sentence includes at least one target object name.
[0222] S3, according to all target object names and corresponding key descriptive words included in each key descriptive sentence, obtain the first position of each target object name in the corresponding key descriptive sentence and the second position of each key descriptive word in the corresponding key descriptive sentence.
[0223] S4, obtaining the second priority corresponding to the current key descriptor according to the second position corresponding to each key descriptor, the number of first words corresponding to the key description sentence corresponding to each key descriptor, and the first position and first priority corresponding to each target object name included in the key description sentence corresponding to each key descriptor.
[0224] S5, according to the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and the preset priority threshold, the target element object corresponding to the initial poster image is obtained, wherein the target element object is used to generate the target poster image together with the initial poster image.
[0225] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0226] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0227] Embodiment 5
[0228] A fifth embodiment of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium in the fourth embodiment of the present invention.
[0229] The above are only preferred embodiments of the present invention, and are not intended to limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with the profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A method for generating website posters based on multiple elements, characterized in that: The method for generating a website poster based on multiple elements comprises the following steps: S1, obtaining an initial poster image, a target description text, a plurality of preset target object names, a first priority corresponding to each target object name, and a preset element database input by a user; S2, according to the target object names and the preset element database, obtaining a plurality of key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and a reference element object corresponding to each key description word in the preset element database, wherein each key description sentence includes at least one target object name; S3, according to all target object names and all corresponding key descriptive words included in each key descriptive sentence, obtaining the first position of each target object name in the corresponding key descriptive sentence and the second position of each key descriptive word in the corresponding key descriptive sentence; S4, acquiring the second priority corresponding to the current key descriptor according to the second position corresponding to each key descriptor, the number of first words corresponding to the key descriptive sentence corresponding to each key descriptor, and the first position and first priority corresponding to each target object name included in the key descriptive sentence corresponding to each key descriptor; S5, according to the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and the preset priority threshold, the target element object corresponding to the initial poster image is obtained, wherein the target element object is used to generate the target poster image together with the initial poster image.
2. The method for generating a website poster based on multiple elements according to claim 1, characterized in that: S3 includes the following steps: S31, determining the character position sequence number of the first character in each target object name in the corresponding key description sentence as the first position of each target object name in the corresponding key description sentence; S32, determining the character position serial number of the first character in each key description word in the corresponding key description sentence as the second position of each key description word in the corresponding key description sentence.
3. The method for generating a website poster based on multiple elements according to claim 1, characterized in that: S4 includes the following steps: S41, for any key descriptor, any key descriptive sentence corresponding to the current key descriptor, and any target object name corresponding to the current key descriptive sentence, according to the first position of the current target object name in the current key descriptive sentence and the second position of the current key descriptor in the current key descriptive sentence, obtaining the degree of association of the current key descriptor with respect to the current target object name included in the current key descriptive sentence; S42, determining the proportion of the number of first words corresponding to the current key description sentence in the sum of the numbers of first words corresponding to all key description sentences as the criticality corresponding to the current key description sentence; S43, determining an average value of the first priorities corresponding to all target object names included in the current key description sentence as a third priority corresponding to the current key description sentence; S44, acquiring a fourth priority corresponding to the current key description sentence according to the criticality and the third priority corresponding to the current key description sentence; S45, obtaining a first importance of the current key descriptor relative to the current key descriptor sentence according to the first priority corresponding to each target object name and the relevance of the current key descriptor relative to all target object names included in the current key descriptor sentence; S46, according to the fourth priority level corresponding to the current key description sentence and the first importance level of the current key description word relative to all key description sentences, obtain the second priority level corresponding to the current key description word.
4. The method for generating a website poster based on multiple elements according to claim 1, characterized in that: S2 includes the following steps: S21, obtaining a plurality of initial description sentences from the target description text; S22, matching each target object name with each initial description sentence, and obtaining the first number of target object names included in each initial description sentence; S23, determining the initial description sentences corresponding to the first name quantity greater than the first preset quantity threshold as key description sentences; S24, performing keyword extraction on each key description sentence, obtaining all key description words corresponding to each key description sentence, and the number of first words corresponding to all key description words corresponding to each key description sentence; S25, matching each key descriptor with the preset element database, and acquiring a reference element object corresponding to each key descriptor in the preset element database.
5. The method for generating a website poster based on multiple elements according to claim 4, characterized in that: The preset element database includes a plurality of initial element objects and a preset area range corresponding to each initial element object, wherein the preset area range includes a minimum preset area and a maximum preset area. S5 further includes the following steps: S51, acquiring a to-be-filled region in the initial poster image and an to-be-filled area corresponding to the to-be-filled region according to a pixel value of each pixel point in the initial poster image; S52, determining a reference element object whose corresponding second priority is greater than the preset priority threshold as a target element object; S53, acquiring a preset area range corresponding to each target element object according to the preset area range corresponding to each initial element object; S54, acquiring the required area corresponding to each target element object according to the second priority corresponding to the key descriptor corresponding to each target element object and the preset area range corresponding to each target element object; S55, screening out to-be-filled element objects from all target element objects according to the to-be-filled area and the required area corresponding to each target element object; S56, filling all the element objects to be filled into the to-be-filled area of the initial poster image to obtain a target poster image.
6. The method for generating a website poster based on multiple elements according to claim 5, characterized in that: S54 includes the following steps: S541, determining an average value of a maximum preset area and a minimum preset area corresponding to each target element object as a first intermediate area corresponding to each target element object; S542, determining half of the difference between the maximum preset area and the minimum preset area corresponding to each target element object as the second intermediate area corresponding to each target element object; S543, acquiring the required area corresponding to each target element object according to the second priority corresponding to the key descriptor corresponding to each target element object, the first middle area and the second middle area corresponding to each target element object, and a preset required area calculation model.
7. The method for generating a website poster based on multiple elements according to claim 5, characterized in that: S55 includes the following steps: S551, if the area to be filled is greater than the sum of the required areas corresponding to the first M target element objects of the second priority, and is less than or equal to the sum of the required areas corresponding to the first M+1 target element objects of the second priority, then the target element objects corresponding to the first M second priorities are determined as the element objects to be filled, where M=1, 2,..., N, and N refers to the total number of target element objects.
8. A website poster generation device based on multiple elements, characterized in that: The website poster generation device based on multiple elements includes: A data acquisition module, used to acquire an initial poster image, a target description text, a plurality of preset target object names, a first priority corresponding to each target object name, and a preset element database input by a user; A data screening module, for obtaining, according to the target object names and the preset element database, a plurality of key description sentences in the target description text, all key description words and the number of first words corresponding to each key description sentence, and a reference element object corresponding to each key description word in the preset element database, wherein each key description sentence includes at least one target object name; A position acquisition module, used to acquire the first position of each target object name in the corresponding key description sentence and the second position of each key description word in the corresponding key description sentence according to all target object names and all corresponding key description words included in each key description sentence; A priority acquisition module, configured to acquire a second priority corresponding to the current key descriptor according to the second position corresponding to each key descriptor, the number of first words corresponding to the key descriptive sentence corresponding to each key descriptor, and the first position and first priority corresponding to each target object name included in the key descriptive sentence corresponding to each key descriptor; A target element object acquisition module is used to acquire the target element object corresponding to the initial poster image based on the reference element object corresponding to each key descriptor, the second priority corresponding to each key descriptor and a preset priority threshold, wherein the target element object is used to generate a target poster image together with the initial poster image.
9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the multi-element based website poster generation method as described in any one of claims 1-7.
10. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.
Citation Information
Patent Citations
Poster generation method and system, electronic equipment and storage medium
CN114820883A
Method and device for generating poster of financial training activity
CN116644201A
Poster generation method and device and computer equipment
CN116740208A
Activity poster generation method and device, storage medium and electronic device
CN117576262A
Method and system for displaying a video poster based on artificial intelligence
US20220230274A1