Automatic sorting and layout method and device during website content rendering, medium and equipment
Through the intelligent sorting layout method, the layout priority is calculated using the image element information of the poster image, which solves the problem of lack of flexibility and intelligence in traditional poster layout methods, and improves the attention and information communication effect of the poster.
Patent Information
- Application Number
- CN202411925747.8
- 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 traditional poster layout lacks flexibility and intelligence, which leads to the display of posters on the website pages that may be confusing and disorderly, making it difficult to meet the audience's aesthetic and information acquisition needs, and reducing the attention and information transmission effect of the poster.
By obtaining image element information for each poster image, calculating its layout priorities, and using these priorities to sort the poster, the order of presentation of the poster is determined to maximize the visual effect within a limited page space.
Through the intelligent sorting and layout method, the attention and information communication effect of the poster are improved, and the visual jumping is avoided, making it easier for the audience to focus on specific topics and identify and understand the information conveyed by graphics and text.
Smart Images

Figure CN119782645A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method, device, medium and equipment for automatically sorting and arranging website content when rendering. Background Art
[0002] With the rapid development of the Internet, the forms of information presentation on websites are becoming increasingly diverse. Among them, poster images, as an important visual communication carrier, play a key role in attracting user attention and delivering key information. In a website page containing multiple poster images, how to effectively organize and display these poster images when rendering website content so that they can maximize the visual effect within the limited page space and guide users to browse in an orderly manner has become an important challenge faced by website design and development.
[0003] Traditional layout methods often lack flexibility and intelligence. They may only place poster images based on simple fixed rules such as upload time order or random arrangement, for static display or layout display in the order set by the user. With the rapid spread of information and people's continuous pursuit of visual experience, traditional poster layout methods lack objective analysis of the poster layout order, 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 posters on web pages and the effectiveness of information communication.
[0004] Therefore, how to reasonably arrange the layout order of posters to improve the poster's attention and information communication effect 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 an automatic sorting and layout method when rendering website content, and the automatic sorting and layout method when rendering website content includes the following steps:
[0006] S10, obtaining M target poster images, poster themes and image element information corresponding to each target poster image, where M is an integer greater than 1.
[0007] S20 , acquiring a first layout priority corresponding to each target poster image according to the image element information corresponding to each target poster image.
[0008] S30 , obtaining first sorting results corresponding to the M target poster images according to the first layout priority corresponding to each target poster image.
[0009] S40, initializing t=1, and determining the first target poster image in the first sorting result as the first presentation image, and determining other target poster images except the first presentation image as images to be presented.
[0010] S50 , acquiring a second layout priority corresponding to each image to be presented according to the first layout priority corresponding to each image to be presented, the tth presented image and the image element information corresponding to each image to be presented.
[0011] S60: Determine the image to be presented corresponding to the largest second layout priority as the t+1th presented image.
[0012] S70, updating t=t+1, and deleting the tth presentation image and the t+1th presentation image from the first sorting result, and repeating step S50 until t=M-1, obtaining the 1st presentation image to the Mth presentation image.
[0013] S80 , when rendering the website content, layout the M target poster images according to the order from the first presentation image to the Mth presentation image.
[0014] The present invention also provides an automatic sorting and layout device for website content rendering, the automatic sorting and layout device for website content rendering comprising:
[0015] The data acquisition module is used to acquire M target poster images, the poster theme and image element information corresponding to each target poster image, wherein M is an integer greater than 1.
[0016] The first priority acquisition module is used to acquire the first layout priority corresponding to each target poster image according to the image element information corresponding to each target poster image.
[0017] The first sorting module is used to obtain a first sorting result corresponding to the M target poster images according to a first layout priority corresponding to each target poster image.
[0018] The module for determining images to be presented is used to initialize t=1, and determine the first target poster image in the first sorting result as the first presentation image, and determine other target poster images other than the first presentation image as images to be presented.
[0019] The second priority acquisition module is used to acquire the second layout priority corresponding to each image to be presented according to the first layout priority corresponding to each image to be presented, the image element information corresponding to the tth presented image and each image to be presented.
[0020] The first presentation image determination module is used to determine the to-be-presented image corresponding to the largest second layout priority as the t+1th presentation image.
[0021] The second presentation image determination module is used to update t=t+1, and delete the tth presentation image and the t+1th presentation image from the first sorting result, and repeatedly execute the second priority acquisition module until t=M-1, and obtain the 1st presentation image to the Mth presentation image.
[0022] The poster layout module is used to layout M target poster images according to the order from the first presentation image to the Mth presentation image when rendering website content.
[0023] 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 automatic sorting and layout method when rendering website content.
[0024] The present invention also provides an electronic device, comprising a processor and the above-mentioned non-transitory computer-readable storage medium.
[0025] The present invention has at least the following beneficial effects: according to the image 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 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 image; other target poster images other than the first presentation image are determined as images to be presented; according to the first layout priority corresponding to each image to be presented, the tth presentation image and the image element information corresponding to each image to be presented, the second layout priority corresponding to each image to be presented is obtained; the image to be presented corresponding to the largest second layout priority is determined as the t+1th presentation image; t=t+1 is updated, and the tth presentation image and the t+1th presentation image are deleted from the first sorting result; and the second layout is repeated. The priority acquisition step is performed until t=M-1, and the first to Mth presentation images are acquired. When rendering the website content, the M target poster images are laid out according to the order of the first to Mth presentation images. It can be seen that by characterizing the differences between the tth presentation image and each image to be presented in multiple dimensions such as theme, color, graphics and text, combined with the first layout priority of the image to be presented itself, the second layout priority corresponding to each image to be presented is acquired, and the presentation order of the target poster images is determined one by one, so that when laying out and presenting the M target poster images, the target poster images with similar themes, colors, graphics and texts are placed in a relatively close 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 and information communication effect of the target poster image when rendering the website content. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] 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.
[0027] Figure 1 A flowchart of a method for automatically sorting and arranging website content when rendering provided by Embodiment 1 of the present invention;
[0028] Figure 2 A flowchart of a method for generating a website poster based on multiple elements provided in the second embodiment of the present invention;
[0029] Figure 3 A schematic diagram of the structure of an automatic sorting and layout device for website content rendering provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0030] 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.
[0031] 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.
[0032] Embodiment 1
[0033] This embodiment 1 provides an automatic sorting layout method for website content rendering, such as Figure 1 As shown, the automatic sorting layout method for website content rendering includes the following steps:
[0034] S10, obtaining M target poster images, poster themes and image element information corresponding to each target poster image, where M is an integer greater than 1.
[0035] Among them, static posters can easily cause visual fatigue to the audience, while sorting the layout of posters can ensure that when the website content is rendered, posters with more prominent visual effects, more critical themes or more in line with user browsing expectations are displayed first, reasonably guiding the user's line of sight, making the visual presentation of the entire page more orderly, reasonable and attractive, avoiding the disordered piling up of information and the burying of important content, and effectively improving the overall visual quality of the website page.
[0036] The current poster layout method is generally to display the layout 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.
[0037] Therefore, this embodiment obtains the image element information corresponding to each target poster image, and integrates the poster features of multiple dimensions to sort the M target poster images that need to be presented, so as to reasonably arrange the layout order of the target poster images to improve the attention and information communication effect of the target poster images.
[0038] In a specific implementation, the image element information includes color element information, graphic element information and text element information, and S10 includes the following steps:
[0039] S101, input each target poster image into a preset theme recognition model to obtain the poster theme corresponding to each target poster image.
[0040] 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.
[0041] 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.
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] As described above, the image element information corresponding to each target poster image is obtained, and the poster features of multiple dimensions are integrated as the basis for sorting the M target poster images that need to be laid out and presented, so as to reasonably arrange the layout order of the target poster images to improve the attention and information communication effect of the target poster images.
[0050] S20 , acquiring a first layout priority corresponding to each target poster image according to the image element information corresponding to each target poster image.
[0051] The first layout priority is the priority of the corresponding target poster image in displaying the poster layout.
[0052] In a specific implementation, S20 includes the following steps:
[0053] 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.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] Among them, in the process of target poster image layout, 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 of the target poster image and the information communication effect.
[0058] 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 layout order of the target poster images.
[0059] In a specific implementation, S201 includes the following steps:
[0060] 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.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] 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 layout order of the target poster images.
[0065] In a specific implementation, S202 includes the following steps:
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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 layout order of the target poster images.
[0070] In a specific implementation, S203 includes the following steps:
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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 layout order of the target poster images.
[0075] 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 layout 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.
[0076] S30 , obtaining first sorting results corresponding to the M target poster images according to the first layout priority corresponding to each target poster image.
[0077] The M target poster images are sorted in descending order of the first layout priority, and the first sorting results corresponding to the M target poster images are obtained as a basis for arranging the layout order of the target poster images.
[0078] S40, initializing t=1, and determining the first target poster image in the first sorting result as the first presentation image, and determining other target poster images except the first presentation image as images to be presented.
[0079] 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 image, and other target poster images other than the first presentation image are determined as images to be presented. On the basis of determining the first presentation image, the priority of the images to be presented is analyzed, so as to gradually determine the layout presentation order of the target poster images.
[0080] S50 , acquiring a second layout priority corresponding to each image to be presented according to the first layout priority corresponding to each image to be presented, the tth presented image and the image element information corresponding to each image to be presented.
[0081] In a specific implementation, S50 includes the following steps:
[0082] S501, according to the poster theme corresponding to each image to be presented and the poster theme corresponding to the t-th presented image, obtain the theme difference degree between each image to be presented and the t-th presented image.
[0083] S502, according to the number of hue types, warm color ratio and cool color ratio corresponding to each image to be presented, and the number of hue types, warm color ratio and cool color ratio corresponding to the t-th presented image, obtain the degree of color difference between each image to be presented and the t-th presented image.
[0084] S503, obtaining the degree of graphic difference between each image to be presented and the tth presented image based on the first number corresponding to each image to be presented and the first frame area corresponding to each graphic element, and the first number corresponding to the tth presented image and the first frame area corresponding to each graphic element.
[0085] S504, based on the second number corresponding to each image to be presented and the second frame area corresponding to each text element, as well as the second number corresponding to the tth presented image and the second frame area corresponding to each text element, obtain the degree of text difference between each image to be presented and the tth presented image.
[0086] S505, based on the degree of subject difference, color difference, graphic difference, text difference between each image to be presented and the tth presented image, and the first layout priority corresponding to each image to be presented, obtain the second layout priority corresponding to each image 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.
[0087] In a specific implementation, S501 includes the following steps:
[0088] S5011, calculating the semantic similarity between the poster theme corresponding to each image to be presented and the poster theme corresponding to the tth presented image.
[0089] S5012, based on the degree of semantic similarity between the poster theme corresponding to each image to be presented and the poster theme corresponding to the tth presented image, obtain the degree of theme difference between the poster theme corresponding to each image to be presented and the poster theme corresponding to the tth presented image, wherein the degree of theme difference is negatively correlated with the degree of semantic similarity.
[0090] Among them, when the semantic similarity between the image to be presented and the tth presented image is high, that is, the degree of theme difference is small, it means that the core content or main idea conveyed by the image to be presented and the tth presented image 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.
[0091] 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.
[0092] In a specific implementation, S502 includes the following steps:
[0093] S5021: Determine the difference between the number of hue types corresponding to each image to be presented and the number of hue types corresponding to the t-th presented image as a first color difference value between each image to be presented and the t-th presented image.
[0094] S5022: Determine the difference between the warm color ratio corresponding to each image to be presented and the warm color ratio corresponding to the t-th presented image as a second color difference value between each image to be presented and the t-th presented image.
[0095] S5023: Determine the difference between the cold color ratio corresponding to each image to be presented and the cold color ratio corresponding to the t-th presented image as a third color difference value between each image to be presented and the t-th presented image.
[0096] S5024, obtaining a color difference degree between each image to be presented and the t-th presented image according to the first color difference value, the second color difference value, and the third color difference value between each image to be presented and the t-th presented image, wherein the color difference degree is positively correlated with the first color difference value, the second color difference value, and the third color difference value.
[0097] Among them, when the color difference between the image to be presented and the tth presented image is small, it means that the color matching of the image to be presented and the tth presented image 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.
[0098] In a specific implementation, S503 includes the following steps:
[0099] S5031: Acquire a first quantity difference value between each to-be-presented image and the t-th presented image according to the first quantity corresponding to each to-be-presented image and the first quantity corresponding to the t-th presented image.
[0100] S5032: Determine an average value of first frame areas corresponding to all graphic elements corresponding to each image to be presented as a first average frame area corresponding to each image to be presented.
[0101] S5033: Determine an average value of first frame areas corresponding to all graphic elements corresponding to the t-th presented image as a first average frame area corresponding to the t-th presented image.
[0102] S5034: Obtain a first frame area difference value between each image to be presented and the tth presented image according to the first average frame area corresponding to each image to be presented and the first average frame area corresponding to the tth presented image.
[0103] S5035, according to the first quantity difference value and the first frame area difference value between each image to be presented and the tth presented image, obtain the degree of graphic difference between each image to be presented and the tth presented image, wherein the degree of graphic difference is positively correlated with the first quantity difference value and the first frame area difference value.
[0104] Among them, when the degree of graphic difference between the image to be presented and the t-th presented image is small, it means that the image to be presented and the t-th presented image are similar in shape, style or expression method 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.
[0105] In a specific implementation, S504 includes the following steps:
[0106] S5041: Acquire a second quantity difference value between each to-be-presented image and the t-th presented image according to the second quantity corresponding to each to-be-presented image and the second quantity corresponding to the t-th presented image.
[0107] S5042: Determine an average value of the second frame areas corresponding to all text elements corresponding to each image to be presented as a second average frame area corresponding to each image to be presented.
[0108] S5043: Determine an average value of the second frame areas corresponding to all text elements corresponding to the t-th presented image as a second average frame area corresponding to the t-th presented image.
[0109] S5044: Obtain a second frame area difference value between each image to be presented and the tth presented image according to the second average frame area corresponding to each image to be presented and the second average frame area corresponding to the tth presented image.
[0110] S5045, according to the second quantity difference value and the second frame area difference value between each image to be presented and the tth presented image, obtain the degree of text difference between each image to be presented and the tth presented image, wherein the degree of text difference is positively correlated with the second quantity difference value and the second frame area difference value.
[0111] Among them, when the text difference between the image to be presented and the tth presented image is small, it indicates that the image to be presented and the tth presented image 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.
[0112] 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.
[0113] In the above, according to the image element information corresponding to the tth presented image and each image to be presented, the degree of subject difference, color difference, graphic difference and text difference between the tth presented image and each image to be presented is measured to characterize the difference between the tth presented image and each image to be presented in multiple dimensions of subject, color, graphic and text. The second layout priority corresponding to each image to be presented is obtained in combination with the first layout priority of the image to be presented itself, so that when laying out the target poster image, 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.
[0114] S60: Determine the image to be presented corresponding to the largest second layout priority as the t+1th presented image.
[0115] S70, updating t=t+1, and deleting the tth presentation image and the t+1th presentation image from the first sorting result, and repeating step S50 until t=M-1, obtaining the 1st presentation image to the Mth presentation image.
[0116] Among them, according to the differences between the image to be presented and the previous presented image in multiple dimensions such as theme, color, graphic and text, combined with the first layout priority of the image to be presented itself, the next presentation image is determined, and so on, until the layout 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.
[0117] S80 , when rendering the website content, layout the M target poster images according to the order from the first presentation image to the Mth presentation image.
[0118] In the above, according to the image 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 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 image, and the other target poster images other than the first presentation image are determined as images to be presented, and according to the first layout priority corresponding to each image to be presented, the tth presentation image and the image element information corresponding to each image to be presented, the second layout priority corresponding to each image to be presented is obtained, and the image to be presented corresponding to the largest second layout priority is determined as the t+1th presentation image, t=t+1 is updated, and the tth presentation image and the t+1th presentation image are deleted from the first sorting result, and the second layout priority acquisition is repeated. Take steps until t=M-1, obtain the 1st presentation image to the Mth presentation image, and when rendering the website content, layout the M target poster images according to the order of the 1st presentation image to the Mth presentation image. It can be seen that by characterizing the differences between the tth presentation image and each image to be presented in multiple dimensions of theme, color, graphics and text, combined with the first layout priority of the image to be presented itself, the second layout priority corresponding to each image to be presented is obtained, and the presentation order of the target poster images is determined one by one, so that when laying out and presenting the M target poster images, the target poster images with similar themes, colors, graphics and texts are placed in a relatively close 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 when rendering the website content.
[0119] Embodiment 2
[0120] This embodiment 2 provides a method for generating a website poster based on multiple elements, such as Figure 2 As shown, the method for generating a website poster based on multiple elements includes the following steps:
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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.
[0125] 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.
[0126] The initial element object may refer to poster elements of the type of graphics, illustrations, photos, texts, colors, etc.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] In a specific implementation, S2 includes the following steps:
[0132] S21, obtaining a number of initial description sentences from the target description text.
[0133] 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.
[0134] S23: determining the initial description sentences corresponding to the first name quantity greater than the first preset quantity threshold as key description sentences.
[0135] 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.
[0136] 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.
[0137] Among them, different initial description sentences can be divided according to punctuation marks in the target description text.
[0138] Traverse, retrieve and match each target object name and each initial description statement 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. 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.
[0139] 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.
[0140] 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, thereby obtaining 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.
[0141] 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:
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] In a specific implementation, S3 includes the following steps:
[0148] 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.
[0149] 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.
[0150] 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.
[0151] 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.
[0152] In a specific implementation, S4 includes the following steps:
[0153] 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.
[0154] 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.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] 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.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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.
[0164] 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.
[0165] 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:
[0166] 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.
[0167] S52: Determine a reference element object whose corresponding second priority is greater than a preset priority threshold as a target element object.
[0168] S53: Acquire the preset area range corresponding to each target element object according to the preset area range corresponding to each initial element object.
[0169] 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.
[0170] 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.
[0171] 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.
[0172] 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.
[0173] 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.
[0174] 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.
[0175] 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.
[0176] In a specific implementation, S54 includes the following steps:
[0177] 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.
[0178] 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.
[0179] 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.
[0180] In a specific implementation, the preset required area calculation model is:
[0181] A=S1+((1 / (1+e^(-k×B)))-1)×S2, wherein 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, S1 refers to the first intermediate area corresponding to the target element object, S1=(C1+C2) / 2, S2 refers to the first intermediate area corresponding to the target element object, S1=(C2-C1) / 2, C1 refers to the minimum preset area corresponding to the target element object, and C2 refers to the maximum preset area corresponding to the target element object.
[0182] Among them, the value range of ((1 / (1+e^(-k×B)))-1) is (-1, 1), then the value range of A is (C1, C2), and A is positively correlated with B. As B increases, A gradually increases from C1 to C2, thereby improving the visual appeal and communication effect of the corresponding target element object in the target poster image.
[0183] In a specific implementation, S55 includes the following steps:
[0184] 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.
[0185] 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.
[0186] 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.
[0187] Embodiment 3
[0188] This embodiment 3 provides an automatic sorting layout device for website content rendering, such as Figure 3 As shown, the automatic sorting layout device for website content rendering includes:
[0189] The data acquisition module 31 is used to acquire M target poster images, the poster theme and image element information corresponding to each target poster image, wherein M is an integer greater than 1.
[0190] The first priority acquisition module 32 is used to acquire the first layout priority corresponding to each target poster image according to the image element information corresponding to each target poster image.
[0191] The first sorting module 33 is used to obtain a first sorting result corresponding to the M target poster images according to the first layout priority corresponding to each target poster image.
[0192] The to-be-presented image determination module 34 is used to initialize t=1, and determine the first target poster image in the first sorting result as the first presentation image, and determine other target poster images other than the first presentation image as to-be-presented images.
[0193] The second priority acquisition module 35 is used to acquire the second layout priority corresponding to each image to be presented according to the first layout priority corresponding to each image to be presented, the image element information corresponding to the tth presented image and each image to be presented.
[0194] The first presentation image determination module 36 is configured to determine the to-be-presented image corresponding to the largest second layout priority as the t+1th presentation image.
[0195] The second presentation image determination module 37 is used to update t=t+1 and delete the tth presentation image and the t+1th presentation image from the first sorting result, and repeatedly execute the second priority acquisition module 35 until t=M-1, and obtain the 1st presentation image to the Mth presentation image.
[0196] The poster layout module 38 is used to layout the M target poster images according to the order from the first presentation image to the Mth presentation image when rendering the website content.
[0197] In a specific implementation, the image element information includes color element information, graphic element information and text element information, and the data acquisition module 31 includes:
[0198] The poster theme acquisition submodule is used to input each target poster image into a preset theme recognition model to obtain the poster theme corresponding to each target poster image.
[0199] The color element information acquisition submodule is used to obtain the 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 colors, and the proportion of cool colors.
[0200] The semantic segmentation submodule is used to input each target poster image into a preset semantic segmentation model to obtain a number of graphic elements and a number of text elements corresponding to each target poster image.
[0201] The frame area acquisition submodule is used to perform bounding box detection on each graphic element and each text element, and obtain the first frame and the first frame area corresponding to each graphic element, and the second frame and the second frame area corresponding to each text element.
[0202] The graphic element information acquisition submodule is used to acquire the graphic element information corresponding to each target poster image based on 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.
[0203] The text element information acquisition submodule is used to acquire the text element information corresponding to each target poster image based on 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.
[0204] In a specific implementation, the first priority acquisition module 32 includes:
[0205] The color complexity acquisition submodule is used to obtain the color complexity corresponding to each target poster image according to the number of hue types, warm color ratio and cool color ratio corresponding to each target poster image.
[0206] The graphic complexity acquisition submodule is used to acquire 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.
[0207] The text complexity acquisition submodule is used to acquire 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.
[0208] The first priority acquisition submodule is used to obtain the 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.
[0209] In a specific implementation, the color complexity acquisition submodule includes:
[0210] The first difference degree acquisition unit is used to acquire a first difference degree corresponding to each target poster image according to the warm tone ratio and the cold tone ratio corresponding to each target poster image.
[0211] The color complexity acquisition unit is used to acquire the color complexity corresponding to each target poster image according to the number of hue types and the first difference degree corresponding to each target poster image, wherein the color complexity is positively correlated with the number of hue types, and the color complexity is negatively correlated with the first difference degree.
[0212] In a specific implementation, the graphics complexity acquisition submodule includes:
[0213] The second difference degree acquisition unit is used to acquire the second difference degree between all the graphic elements corresponding to each target poster image according to the first frame area corresponding to each graphic element corresponding to each target poster image.
[0214] The graphic complexity acquisition unit is used to acquire 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 positively correlated with the first quantity and the second difference degree.
[0215] In a specific implementation, the text complexity acquisition submodule includes:
[0216] The third difference degree acquisition unit is used to acquire the third difference degree between all the text elements corresponding to each target poster image according to the second frame area corresponding to each text element corresponding to each target poster image.
[0217] The text complexity acquisition unit is used to acquire 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.
[0218] In a specific implementation, the second priority acquisition module 35 includes:
[0219] The theme difference degree acquisition submodule is used to acquire the theme difference degree between each image to be presented and the tth presented image according to the poster theme corresponding to each image to be presented and the poster theme corresponding to the tth presented image.
[0220] The color difference degree acquisition submodule is used to obtain the color difference degree between each image to be presented and the tth presented image based on the number of hue types, warm tone ratio and cool tone ratio corresponding to each image to be presented, and the number of hue types, warm tone ratio and cool tone ratio corresponding to the tth presented image.
[0221] The graphic difference degree acquisition submodule is used to acquire the graphic difference degree between each image to be presented and the tth presented image based on the first number corresponding to each image to be presented and the first frame area corresponding to each graphic element, and the first number corresponding to the tth presented image and the first frame area corresponding to each graphic element.
[0222] The text difference degree acquisition submodule is used to acquire the text difference degree between each image to be presented and the tth presented image based on the second quantity corresponding to each image to be presented and the second frame area corresponding to each text element, and the second quantity corresponding to the tth presented image and the second frame area corresponding to each text element.
[0223] The second priority acquisition submodule is used to acquire the second layout priority corresponding to each image to be presented based on the degree of subject difference, color difference, graphic difference, text difference between each image to be presented and the tth presented image, and the first layout priority corresponding to each image 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.
[0224] 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.
[0225] Embodiment 4
[0226] 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:
[0227] S10, obtaining M target poster images, poster themes and image element information corresponding to each target poster image, where M is an integer greater than 1.
[0228] S20 , acquiring a first layout priority corresponding to each target poster image according to the image element information corresponding to each target poster image.
[0229] S30 , obtaining first sorting results corresponding to the M target poster images according to the first layout priority corresponding to each target poster image.
[0230] S40, initializing t=1, and determining the first target poster image in the first sorting result as the first presentation image, and determining other target poster images except the first presentation image as images to be presented.
[0231] S50 , acquiring a second layout priority corresponding to each image to be presented according to the first layout priority corresponding to each image to be presented, the tth presented image and the image element information corresponding to each image to be presented.
[0232] S60: Determine the image to be presented corresponding to the largest second layout priority as the t+1th presented image.
[0233] S70, updating t=t+1, and deleting the tth presentation image and the t+1th presentation image from the first sorting result, and repeating step S50 until t=M-1, obtaining the 1st presentation image to the Mth presentation image.
[0234] S80, when rendering the website content, laying out the M target poster images according to the order from the first presentation image to the Mth presentation image.
[0235] 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.
[0236] 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.
[0237] Embodiment 5
[0238] 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.
[0239] 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 automatic sorting and layout when rendering website content, characterized in that: The automatic sorting layout method for website content rendering comprises the following steps: S10, obtaining M target poster images, poster themes and image element information corresponding to each target poster image, where M is an integer greater than 1; S20, acquiring a first layout priority corresponding to each target poster image according to the image element information corresponding to each target poster image; S30, obtaining a first sorting result corresponding to the M target poster images according to the first layout priority corresponding to each target poster image; S40, initializing t=1, and determining the first target poster image in the first sorting result as the first presentation image, and determining other target poster images other than the first presentation image as images to be presented; S50, acquiring a second layout priority corresponding to each image to be presented according to the first layout priority corresponding to each image to be presented, the tth presented image and the image element information corresponding to each image to be presented; S60, determining the to-be-presented image corresponding to the largest second layout priority as the t+1th presentation image; S70, updating t=t+1, and deleting the t-th presentation image and the t+1-th presentation image from the first sorting result, and repeating step S50 until t=M-1, and obtaining the 1st presentation image to the Mth presentation image; S80, when rendering the website content, laying out the M target poster images according to the order from the first presentation image to the Mth presentation image.
2. The automatic sorting and layout method for website content rendering according to claim 1, characterized in that: The image element information includes color element information, graphic element information and text element information, and S10 includes the following steps: S101, inputting each target poster image into a preset theme recognition model to obtain the poster theme corresponding to each target poster image; 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; 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; 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; S105, acquiring 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; 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.
3. The automatic sorting and layout method for website content rendering according to claim 2, characterized in that: S20 includes the following steps: 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; S202, acquiring a graphic complexity corresponding to each target poster image according to a first quantity corresponding to each target poster image and a first frame area corresponding to each graphic element; S203, acquiring the text complexity corresponding to each target poster image according to the second number corresponding to each target poster image and the second frame area corresponding to each text element; 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.
4. The automatic sorting and layout method for website content rendering according to claim 3 is characterized in that: S201 includes the following steps: 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; 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.
5. The automatic sorting and layout method for website content rendering according to claim 3, characterized in that: S202 includes the following steps: S2021, acquiring a second difference degree 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; 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 positively correlated with the first quantity and the second difference degree.
6. The automatic sorting and layout method for website content rendering according to claim 3, characterized in that: S203 includes the following steps: S2031, acquiring 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; 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.
7. The automatic sorting and layout method for website content rendering according to claim 2, characterized in that: S50 includes the following steps: S501, according to the poster theme corresponding to each image to be presented and the poster theme corresponding to the t-th presented image, obtaining the theme difference degree between each image to be presented and the t-th presented image; S502, obtaining the degree of color difference between each image to be presented and the t-th presented image according to the number of hue types, the proportion of warm tones, and the proportion of cool tones corresponding to each image to be presented, and the number of hue types, the proportion of warm tones, and the proportion of cool tones corresponding to the t-th presented image; S503, acquiring a graphic difference degree between each image to be presented and the tth presented image according to the first number corresponding to each image to be presented and the first frame area corresponding to each graphic element, and the first number corresponding to the tth presented image and the first frame area corresponding to each graphic element; S504, acquiring a text difference degree between each image to be presented and the tth presented image according to the second number corresponding to each image to be presented and the second frame area corresponding to each text element, and the second number corresponding to the tth presented image and the second frame area corresponding to each text element; S505, based on the degree of subject difference, color difference, graphic difference, text difference between each image to be presented and the tth presented image, and the first layout priority corresponding to each image to be presented, obtain the second layout priority corresponding to each image 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.
8. An automatic sorting layout device for website content rendering, characterized in that: The automatic sorting layout device for website content rendering includes: A data acquisition module, used to acquire M target poster images, poster themes and image element information corresponding to each target poster image, where M is an integer greater than 1; A first priority acquisition module, used to acquire a first layout priority corresponding to each target poster image according to image element information corresponding to each target poster image; A first sorting module, configured to obtain a first sorting result corresponding to the M target poster images according to a first layout priority corresponding to each target poster image; A module for determining an image to be presented, used for initializing t=1, and determining the first target poster image in the first sorting result as the first presentation image, and determining other target poster images other than the first presentation image as images to be presented; A second priority acquisition module, configured to acquire a second layout priority corresponding to each image to be presented according to the first layout priority corresponding to each image to be presented, the image element information corresponding to the tth presented image and each image to be presented; A first presentation image determination module, configured to determine the image to be presented corresponding to the largest second layout priority as the t+1th presentation image; A second presentation image determination module is used to update t=t+1, delete the t-th presentation image and the t+1-th presentation image from the first sorting result, and repeatedly execute the second priority acquisition module until t=M-1, and acquire the 1st presentation image to the Mth presentation image; The poster layout module is used to layout the M target poster images according to the order from the first presentation image to the Mth presentation image when rendering the website content.
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 automatic sorting and layout method for website content rendering 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
Style information processing method and device
CN110704053A
Image generation method and device, electronic equipment and storage medium
CN115329119A
Image generation method and device, equipment and storage medium
CN118429474A
Display device and homepage interface display method
CN118828095A
Interactively ranking image search results using color layout relevance
US20100158412A1