CN116934908B - Automatic poster generation method, device, computer equipment and storage medium - Google Patents

Automatic poster generation method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116934908B
CN116934908B CN202311170287.8A CN202311170287A CN116934908B CN 116934908 B CN116934908 B CN 116934908B CN 202311170287 A CN202311170287 A CN 202311170287A CN 116934908 B CN116934908 B CN 116934908B
Authority
CN
China
Prior art keywords
text
image
product
layout
poster
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311170287.8A
Other languages
Chinese (zh)
Other versions
CN116934908A (en
Inventor
周星
何理达
董少灵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Rabbit Exhibition Intelligent Technology Co ltd
Original Assignee
Shenzhen Rabbit Exhibition Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Rabbit Exhibition Intelligent Technology Co ltd filed Critical Shenzhen Rabbit Exhibition Intelligent Technology Co ltd
Priority to CN202311170287.8A priority Critical patent/CN116934908B/en
Publication of CN116934908A publication Critical patent/CN116934908A/en
Application granted granted Critical
Publication of CN116934908B publication Critical patent/CN116934908B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a poster automatic generation method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a background image, a product image and a popularization text input by a user; calling a target layout model to carry out image and text layout in a background image based on the product image and the popularization text, so as to obtain a poster information layout area comprising a product image layout area and a text layout area; converting the popularization text into a target text style to obtain a target popularization text; and fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain the product poster. The target layout model is adopted to automatically perform text and image layout, and fusion work is performed after text patterns are automatically converted, so that the product poster is rapidly and intelligently generated, the product poster with higher quality can be obtained, the product poster generation efficiency is effectively improved, and the information transmission efficiency through the poster image is further improved.

Description

Automatic poster generation method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of image data processing, and in particular, to a method and apparatus for automatically generating a poster, a computer device, and a storage medium.
Background
In internet business service, poster influence is an important means of network influence, and the poster can be used as an intuitive information carrier for propaganda and propagation of relevant information of enterprise products, thereby achieving the purpose of improving product attraction.
The existing poster generation mode is generally formed by typesetting processed product images and information by professional designers, and the specific process of generating the poster comprises the steps of manually selecting a background image of the poster, carrying out product image and text layout in the poster, modifying the text style of the poster and the like. However, the manner of manually designing the poster requires long-term manual investment, which results in lower generation efficiency of the poster, and the design of the poster depends on experience of a designer, so that the rapidly-increased high-quality poster demand on the market is difficult to meet, and the information transmission efficiency is reduced.
Disclosure of Invention
The invention provides an automatic generation method, an automatic generation device, computer equipment and a storage medium for a poster, which are used for solving the problems that the existing manual generation method for the poster is low in poster generation efficiency and reduces information transmission efficiency.
In view of the above problems, an automatic poster generation method is provided, including:
Acquiring poster description information input by a user, wherein the poster description information comprises a background image, a product image and a popularization text;
calling a target layout model obtained through pre-training to carry out image and text layout in a background image based on a product image and a popularization text to obtain a poster information layout area, wherein the poster information layout area comprises a product image layout area and a text layout area;
converting the popularization text into a target text style to obtain a target popularization text;
and fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain the product poster.
Optionally, the poster description information further includes an enterprise identification map; based on the product image and the popularization text, invoking a target layout model obtained by pre-training to carry out image and text layout in the background image to obtain a poster information layout area, comprising:
inputting a background image, a product image, an enterprise identification image and a popularization text into a first model of a target layout model to layout the product image, the enterprise identification image and the popularization text in the background image, so as to obtain a target layout image;
inputting the target layout image into a second model of the target layout model, and respectively carrying out layout area identification on the product image, the enterprise identification graph and the popularization text to obtain a product graph layout area, an identification graph layout area of the enterprise identification graph and a text layout area;
And marking the product map layout area, the identification map layout area and the text layout area as poster information layout areas.
Optionally, based on the product image and the popularization text, before invoking the target layout model obtained by pre-training to perform image and text layout in the background image, the method further comprises:
carrying out size recognition on the product image to determine the display type of the product image according to a size recognition result, wherein the display type comprises transverse display and vertical display;
and scaling the product image according to the display type and the size information of the background image to obtain a processed product image, and taking the processed product image as the input of a target layout model to obtain poster description information through layout.
Optionally, the poster information layout area further includes an identification map layout area, and based on the product map layout area and the text layout area, the product image, the target popularization text and the background image are fused to obtain the product poster, including:
fusing the scaled product image to a product image layout area of the background image, and fusing the enterprise identification image to the identification image layout area to obtain an initial product image corresponding to each area of the background image;
And filling the target popularization text into a text layout area of the initial product graph, setting the text layout area to be in an editable state, obtaining an editable product graph, and taking the editable product graph as a product poster.
Optionally, the product poster is an editable product poster, and based on the product map layout area and the text layout area, the product image, the target popularization text and the background image are fused, and after the product poster is obtained, the method further comprises:
sending the editable product poster to a user so that the user can adjust and confirm the text information of the product poster according to the requirement;
and after receiving the confirmation instruction of the user, solidifying the current product poster into a target product poster and feeding back the target product poster to the user.
Optionally, the target text style includes a text font and a text color, and before converting the promotion text into the target text style to obtain the target promotion text, the method further includes:
determining popularization products according to the popularization texts and the product images;
determining the industry type corresponding to the promotion product and determining the promotion style corresponding to the promotion text;
determining fonts conforming to industry types and popularization styles as text fonts based on pre-established mapping relation data of the fonts, the industry types and the popularization styles;
Text color is determined based on the promotional style and/or the color of the background map.
Optionally, the target layout model is trained by:
obtaining a plurality of layout samples, wherein each layout sample comprises a sample background image, a sample product image and a sample text, and each layout sample corresponds to one standard poster;
inputting a layout sample into a pre-training network comprising a first network and a second network, so as to layout a sample product graph and a sample text in a sample background graph through the first network to obtain a predicted layout image, and carrying out layout area identification on the predicted layout image through the second network to obtain a predicted product graph area and a predicted text area;
determining a total loss value according to the predicted layout image, the standard poster, the predicted product image area and the predicted text area;
and when the total loss value does not meet the convergence condition, continuing to iterate parameters of the pre-training network according to the plurality of layout samples until the total loss value meets the convergence condition, determining that the pre-training network converges, and outputting the converged pre-training network as a target layout model.
Provided is an automatic poster generating apparatus including:
the acquisition module is used for acquiring poster description information input by a user, wherein the poster description information comprises a background image, a product image and a popularization text;
The layout module is used for calling a target layout model obtained through pre-training to carry out image and text layout in a background image based on the product image and the popularization text to obtain a poster information layout area, wherein the poster information layout area comprises a product image layout area and a text layout area;
the conversion module is used for converting the popularization text into a target text style to obtain a target popularization text;
and the fusion module is used for fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain the product poster.
There is provided a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above-described method for automatically generating a poster when the computer program is executed.
There is provided a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above-described poster automatic generation method.
In one scheme provided by the automatic poster generation method, the automatic poster generation device, the computer equipment and the storage medium, the poster description information input by a user is obtained, the poster description information comprises a background image, a product image and a promotion text, then a target layout model obtained through pre-training is called to carry out image and text layout in the background image based on the product image and the promotion text, a poster information layout area comprising a product image layout area and a text layout area is obtained, the promotion text is converted into a target text style, a target promotion text is obtained, and finally the product image, the target promotion text and the background image are fused based on the product image layout area and the text layout area, so that the product poster is obtained; in this embodiment, information such as a background image, a product image, a popularization text and the like input by a user is directly obtained, then a deep learning target layout model is adopted to automatically perform text and image layout, and fusion work of the image and the text is performed after text style is automatically converted, so that a product poster is quickly and intelligently generated, a designer is not required to be relied on, a product poster with higher quality can be obtained, the generation efficiency of the product poster is effectively improved, and the information transmission efficiency through the poster image is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of an application environment of a method for automatically generating a poster according to an embodiment of the invention;
FIG. 2 is a flow chart of an automatic poster generation method according to an embodiment of the invention;
FIG. 3 is a flowchart illustrating an implementation of step S20 in FIG. 2;
FIG. 4 is a flowchart illustrating an implementation of step S40 in FIG. 2;
FIG. 5 is a schematic flow chart of a method for automatically generating a poster according to an embodiment of the invention;
FIG. 6 is a schematic diagram of an automatic poster generating apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the invention. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
It should be understood that the sequence numbers of the steps in the following embodiments do not mean the order of execution, and the execution order of the processes should be determined by the functions and the internal logic, and should not be construed as limiting the implementation process of the embodiments of the present invention.
In order to illustrate the technical scheme of the invention, the following description is made by specific examples.
The automatic poster generation method provided by the embodiment of the invention can be applied to an application environment as shown in fig. 1, wherein terminal equipment communicates with a server through a network. When a user needs to generate a product poster image, poster description information is input through the terminal equipment, the poster description information comprises background images, product images, popularization texts and the like, and after receiving the poster description information input by the user through the terminal equipment, the server executes a poster automatic generation task. Firstly, a server needs to call a target layout model obtained through pre-training to carry out image and text layout in a background image to obtain a poster information layout area comprising a product image layout area and a text layout area, then converts a popularization text into a target text style to obtain a target popularization text, and finally fuses the product image, the target popularization text and the background image based on the product image layout area and the text layout area to obtain the product poster. In this embodiment, information such as a background image, a product image, a popularization text and the like input by a user is directly obtained, then a deep learning target layout model is adopted to automatically perform text and image layout, and fusion work of the image and the text is performed after text style is automatically converted, so that a product poster is quickly and intelligently generated, a designer is not required to be relied on, a product poster with higher quality can be obtained, the generation efficiency of the product poster is effectively improved, and the information transmission efficiency through the poster image is further improved.
In this embodiment, the terminal device may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, an automatic poster generating method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
s10: and acquiring poster description information input by a user, wherein the poster description information comprises a background image, a product image and a popularization text.
When a user needs to generate a product poster, the poster description information is input through the terminal equipment, and the server receives the poster description information sent by the terminal equipment, so that the poster automatic generation task is completed according to the poster description information. The poster description information at least comprises information such as background images, product images, popularization texts and the like. In other embodiments, the poster description information also includes information such as the identity (i.e., logo), the address of the business, and the contact details.
In this embodiment, when a user uses a certain internet editing platform, the poster description information may be input through a poster design interface provided by the internet editing platform, where the poster design interface has a plurality of information input points, including a background image input point, a product image input point and a promotion text input point, and through the corresponding information input points, the user may directly input the corresponding poster description information, so that the poster description information input by the user carries a corresponding identifier, and thus the server receives the classified poster description information. For example, the image input by the user at the background image input point carries the background image identifier, and the server marks the input image as the background image after receiving the input image carrying the background image identifier, so that the method is simple and convenient, and does not need the server to additionally carry out information identification processing.
S20: and calling a target layout model obtained through pre-training to carry out image and text layout in the background image based on the product image and the popularization text, and obtaining a poster information layout area comprising a product image layout area and a text layout area.
After the poster description information input by a user is acquired, a server acquires a target layout model which is obtained by training in advance, wherein the target layout model is a network model obtained by performing deep learning training based on a plurality of layout samples; and then, the server inputs the background image, the product image and the popularization text into the target layout model so as to carry out image and text layout in the background image, thereby obtaining a product image layout area of the product image and a text layout area of the popularization text, and obtaining a poster information layout area comprising the product image layout area and the text layout area.
Specifically, the target layout model comprises a first model and a second model, wherein the first model is a random layout image generation model, and the second model is an image structure identification model; step S20 includes: inputting a background image, a product image and a popularization text into a first model to lay out the product image and the popularization text in the background image, fusing the image and the text to obtain a target layout image comprising the product image and the popularization text, inputting the target layout image into a second model to respectively identify the layout areas of the product image and the popularization text to obtain a product image layout area and a text layout area, recording the product image layout area and the text layout area as a poster information layout area, randomly laying out the background image, the product image and the popularization text through the first model and generating a target layout image with higher quality and layout effect, and extracting layout positions of the product image and the popularization text through the second model to obtain a product image layout area and a text layout area.
S30: and converting the popularization text into a target text style to obtain a target popularization text.
Meanwhile, the server also needs to convert the popularization text into a target text style to obtain a target popularization text. Wherein the target text style includes one of style information such as color, font size, texture, etc. The method and the device can convert the style information such as the color, the font, the word size, the texture and the like of the popularization text according to the user demands, thereby obtaining the target popularization text, further improving the individuation and the quality of the product poster and meeting the individuation poster design demands of the user.
S40: and fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain the product poster.
After the information such as the target popularization text, the product graph layout area, the text layout area and the like is obtained, the product image, the target popularization text and the background image are fused based on the product graph layout area and the text layout area, and the product poster is obtained. For example, the product image is directly fused to the product image layout area of the background image, so as to obtain an initial product image corresponding to each area of the background image, namely, the initial product image also comprises the text layout area corresponding to the background image, and then the target popularization text is filled into the text layout area of the initial product image, so that the product poster is obtained. And then, feeding the product poster back to the terminal equipment of the user, so that the high-quality product poster can be quickly obtained without manual design, and the problems that the time consumption is long when the poster is manually generated, the poster generation efficiency is low and the information transmission efficiency is reduced are solved.
In other embodiments, the poster description information may further include other information, such as images of enterprise identification diagrams, two-dimensional codes, and text information of contact ways, addresses, and the like, and correspondingly, the poster information layout area further includes an identification diagram layout area, a two-dimensional code layout area, a contact way layout area, and an address layout area. When the product poster is generated, fusing a product image to a product image layout area of a background image, fusing an enterprise identification image to an identification image layout area, and fusing a two-dimensional code to the identification image layout area to obtain an initial product image corresponding to each area of the background image, wherein the initial product image comprises a text layout area, a contact way layout area and an address layout area; and then, the target popularization text, the contact information and the address are respectively and correspondingly filled into the text layout area, the contact information layout area and the address layout area of the initial product diagram to obtain the product poster, so that the display information of the product poster is richer, the enterprise propaganda effect can be improved, and the information spreading efficiency of the product poster is improved.
In the embodiment, the poster description information input by a user is obtained, the poster description information comprises a background image, a product image and a promotion text, then a target layout model obtained through training in advance is called to carry out image and text layout in the background image based on the product image and the promotion text, a poster information layout area comprising a product image layout area and a text layout area is obtained, the promotion text is converted into a target text style, a target promotion text is obtained, and finally the product image, the target promotion text and the background image are fused based on the product image layout area and the text layout area, so that the product poster is obtained; in this embodiment, information such as a background image, a product image, a popularization text and the like input by a user is directly obtained, then a deep learning target layout model is adopted to automatically perform text and image layout, and fusion work of the image and the text is performed after text style is automatically converted, so that a product poster is quickly and intelligently generated, a designer is not required to be relied on, a product poster with higher quality can be obtained, the generation efficiency of the product poster is effectively improved, and the information transmission efficiency through the poster image is further improved.
In one embodiment, before step S20, that is, before invoking the pre-trained target layout model, the pre-trained network needs to be deep-learned based on a plurality of layout samples, so as to obtain the target layout model for invoking the target layout model for image and text layout. Specifically, the target layout model is trained as follows:
s01: and obtaining a plurality of layout samples, wherein each layout sample comprises a sample background image, a sample product image and a sample text, and each layout sample corresponds to one standard poster.
In this embodiment, the poster description information input by the user history needs to be collected as layout samples, and in order to ensure the model accuracy, a plurality of layout samples need to be obtained as model training data to perform model training. Each layout sample comprises a sample background image, a sample product image and a sample text, and each layout sample corresponds to one standard poster which is a poster image designed by a experienced deep designer according to the layout sample.
When the number of the layout samples does not meet the model training requirement, the data augmentation algorithm can be adopted to augment the existing plurality of layout samples, so that a plurality of layout samples with enough number are obtained for model training.
S02: and inputting the layout sample into a pre-training network comprising a first network and a second network, so as to layout the sample product graph and the sample text in the sample background graph through the first network to obtain a predicted layout image, and carrying out layout area identification on the predicted layout image through the second network to obtain a predicted product graph area and a predicted text area.
Meanwhile, a pre-training network is required to be acquired, wherein the pre-training network comprises a first network and a second network, the first network is a random layout image generation network, and the second network is an image structure identification network.
After a plurality of layout samples are acquired, inputting a certain layout sample into a pre-training network, so as to layout a sample product graph and a sample text in a sample background graph through a first network to obtain a predicted layout image, and carrying out layout area identification on the predicted layout image through a second network to obtain a predicted product graph area and a predicted text area.
S03: and determining the total loss value according to the predicted layout image, the standard poster, the predicted product graph area and the predicted text area.
After the predicted layout image is obtained, a total loss value is determined from the predicted layout image, the standard poster, the predicted product map area, and the predicted text area.
The calculation method of the total loss value may include the following steps:
s031: inputting the standard poster into a second network for layout area identification to obtain a standard product graph area and a standard text area;
s032: calculating the position similarity of the standard product graph area and the predicted product graph area to obtain first area similarity, and calculating the position similarity of the standard text area and the predicted text area to obtain second area similarity;
s033: calculating the image similarity of the predicted layout image and the standard poster;
s034: and calculating to obtain a total loss value based on the first region similarity, the second region similarity and the image similarity.
After the predicted product image area and the predicted text area are obtained, the standard poster is required to be input into a second network for layout area recognition to obtain the standard product image area and the standard text area, then the position similarity of the standard product image area and the predicted product image area is calculated to obtain the first area similarity, the position similarity of the standard text area and the predicted text area is calculated to obtain the second area similarity, meanwhile, the image similarity of a predicted layout image and the standard poster is calculated, finally, the total loss value is calculated based on the first area similarity, the second area similarity and the image similarity, so that the accuracy of the total loss value is ensured, and the accuracy of a model is ensured from the image quality (reflected by the image similarity) and the layout position accuracy (reflected by the area similarity), so that the accuracy of model output data and the image layout effect are improved.
S04: and when the total loss value does not meet the convergence condition, continuing to iterate parameters of the pre-training network according to the plurality of layout samples until the total loss value meets the convergence condition, determining that the pre-training network converges, and outputting the converged pre-training network as a target layout model.
After the total loss value is obtained, determining whether the total loss value meets the convergence condition, if the total loss value does not meet the convergence condition, continuing to iterate parameters of the pre-training network according to the plurality of layout samples, namely repeatedly executing the steps S032-S034 until the total loss value meets the convergence condition, determining that the pre-training network converges, and outputting the converged pre-training network as a target layout model. When the total loss value is required to meet the convergence condition, outputting a first network as a first model, and outputting a second network as a second model, thereby obtaining a target layout model comprising the first model and the second model, and conveniently calling the target layout model to execute the poster automatic generation task.
In this embodiment, a plurality of layout samples are obtained, each layout sample includes a sample background image, a sample product image and a sample text, and one standard poster corresponding to each layout sample is input into a pre-training network including a first network and a second network, so that the sample product image and the sample text are laid out in the sample background image through the first network to obtain a predicted layout image, and layout area identification is performed on the predicted layout image through the second network to obtain a predicted product image area and a predicted text area, then a total loss value is determined according to the predicted layout image, the standard poster, the predicted product image area and the predicted text area, when the total loss value does not meet a convergence condition, iteration of parameters of the pre-training network is continued according to the plurality of layout samples until the total loss value meets the convergence condition, convergence of the pre-training network is determined, and the converged pre-training network is output as a target layout model. The process defines a specific training process of the target layout model, deep learning is carried out on the pre-training network based on a plurality of layout samples and corresponding standard posters, and the target layout model with higher precision can be obtained, so that the target layout model carries out image and text layout with better effect, and a solid foundation is provided for the subsequent execution of the automatic poster generation task.
In an embodiment, in step S033, the calculating the total loss value based on the first region similarity, the second region similarity, and the image similarity may include: and respectively determining weight values corresponding to the first region similarity, the second region similarity and the image similarity, and then carrying out weighted calculation on the first region similarity, the second region similarity and the image similarity based on the corresponding weight values to obtain a total loss value, wherein the weight value of the image similarity is smaller than that of the first region similarity and the second region similarity, so that the method is simple and convenient, emphasizes the similarity of the layout region more, and enhances the layout effect. When the total loss value is larger than a preset loss value, the convergence condition is met, and the model converges; when the total loss value is smaller than or equal to the preset loss value, the model does not converge, and the parameters of the pre-training network are required to be iterated according to a plurality of layout samples until the total loss value meets the convergence condition.
In other embodiments, the total loss value calculated based on the first region similarity, the second region similarity, and the image similarity may be: and determining whether the image similarity is smaller than a first preset value, if the image similarity is larger than or equal to the first preset value, indicating that the predicted layout image is relatively close to the standard poster in quality and layout position, and taking the average value of the first area similarity and the second area similarity as a total loss value, wherein the judgment is simple and the calculated amount is small. If the difference between the quality and the layout position of the predicted layout image and the standard poster is larger, the first region similarity, the second region similarity and the image similarity are weighted based on the corresponding weight values, so that a total loss value is obtained, the accuracy of the total loss value is ensured, and the accuracy of the target layout model is ensured.
In one embodiment, the poster description information further includes an enterprise identification map. As shown in fig. 3, in step S20, that is, based on the product image and the popularization text, invoking the target layout model obtained by training in advance to perform image and text layout in the background image, so as to obtain the poster information layout area, which specifically includes the following steps:
s21: inputting a background image, a product image, an enterprise identification image and a popularization text into a first model of a target layout model to layout the product image, the enterprise identification image and the popularization text in the background image, so as to obtain a target layout image;
s22: inputting the target layout image into a second model of the target layout model, and respectively carrying out layout area identification on the product image, the enterprise identification graph and the popularization text to obtain a product graph layout area, an identification graph layout area of the enterprise identification graph and a text layout area;
s23: and marking the product map layout area, the identification map layout area and the text layout area as poster information layout areas.
In this embodiment, the poster description information includes a background image, a product image, an enterprise identification map (i.e., logo), and a promotion text. After the poster description information input by a user is obtained, a server calls a target layout model stored in a database, a background image, a product image, an enterprise identification image and a popularization text are input into a first model of the target layout model, the position layout of the background image is carried out on the product image, the enterprise identification image and the popularization text through the first model, and the image and the text are fused to obtain a target layout image containing the product image, the enterprise identification image and the popularization text; then inputting the obtained target layout image into a second model of the target layout model, and respectively identifying the positions of the product image, the enterprise identification image and the popularization text in the target layout image through the second model, namely, carrying out layout area identification to respectively obtain a product image layout area corresponding to the product image, an identification image layout area corresponding to the enterprise identification image and a text layout area corresponding to the popularization text; and then marking the product map layout area, the identification map layout area and the text layout area as poster information layout areas.
In the embodiment, a background image, a product image, an enterprise identification image and a popularization text are input into a first model of a target layout model to layout the product image, the enterprise identification image and the popularization text in the background image to obtain a target layout image, the target layout image is input into a second model of the target layout model, layout area identification is respectively carried out on the product image, the enterprise identification image and the popularization text to obtain a product image layout area, an identification image layout area and a text layout area of the enterprise identification image, and the product image layout area, the identification image layout area and the text layout area are recorded as poster information layout areas; the method and the device define a specific process of calling a target layout model obtained through training in advance to carry out image and text layout in a background image based on a product image and a popularization text, so as to obtain a poster information layout area, and an enterprise identification chart is also used as a model input to determine the layout area of more poster description information, so that a product poster with richer information is generated later, the enterprise propaganda effect can be improved, and the information propagation efficiency of the product poster is improved.
In other embodiments, the poster description information may also include other information, such as images of two-dimensional codes, contact information, addresses, and other text information. And in the process of carrying out image and text layout on the poster description information, inputting the other images and texts, background images, product images, enterprise identification images and popularization texts into a target layout model together for layout, so as to obtain layout areas corresponding to the images and texts, thereby forming a poster information layout area, facilitating subsequent generation of product posters with more effective information, and further improving the information propagation efficiency of the product posters.
In an embodiment, in step S20 or step S21, that is, in the process of performing image and text layout in a background image through a target layout model to obtain a poster information layout area, the first model will determine a product image layout area of a product image in the background image according to a display type of the product image, further determine a text layout area (and an identification image layout area) according to the product image layout area, and further determine a text layout area (and an identification image layout area) according to a display type of the product image, so that it is possible to ensure that the product image in a subsequent product poster has the highest visual saliency, and improve the visual effect of the product poster, thereby improving the propaganda effect of the product poster on a promoted product.
Specifically, the determination method of the layout area of the product graph is as follows: if the display type of the product image is transverse display, dividing the background image into an upper area, a middle area and a lower area according to the principle from top to bottom based on the longitudinal size of the (processed) product image, and taking the middle area as a layout area of the product image; if the product image display type is vertical display, dividing the background image into a left side area, a middle area and a right side area based on the transverse size of the (processed) product image, and selecting any area as a product image layout area; if the display type of the product image is a uniform image, the four corners of the background image are taken as base points for image overlapping, and the overlapping area of the (processed) product image and the background image is taken as a layout area of the product image. In the embodiment, a specific determining process of the layout area of the product graph is defined, the layout position of the product graph is determined according to the specific display form of the promoted product, and the aesthetic property of the product poster is also considered under the condition that the visual significance of the product image is ensured, so that the quality of the product poster is improved.
In an embodiment, before step S20, that is, before the target layout model obtained by training in advance is invoked to perform image and text layout in the background image based on the product image and the popularization text, the method further specifically includes the following steps:
s201: and carrying out size recognition on the product image so as to determine the display type of the product image according to the size recognition result.
In this embodiment, before invoking the target layout model obtained by training in advance to perform image and text layout in the background image, the size recognition needs to be performed on the product image, so as to determine the display type of the product image according to the size recognition result. The display types of the product images comprise transverse display, vertical display and center display. For example, when the lateral dimension (dimension in the horizontal direction) of the product image is larger than the longitudinal dimension (dimension in the vertical direction), the display type of the product image is a lateral display; when the lateral dimension (dimension in the horizontal direction) of the product image is smaller than the longitudinal dimension (dimension in the vertical direction), the display type of the product image is the longitudinal dimension; when the product image is a quasi-circular image or the transverse dimension is equal to the longitudinal dimension, the product image is a uniform image, and the display type is determined to be a central display.
S202: and scaling the product image according to the display type and the size information of the background image to obtain a processed product image, and taking the processed product image as the input of a target layout model to obtain poster description information through layout.
After determining the display type of the product image, the product image is required to be scaled according to the display type and the size information of the background image, so that the processed product image is obtained, the processed product image is used as the input of the target layout model, and the target layout model obtained through training in advance is called to carry out image and text layout in the background image, so that the poster description information is obtained.
In this embodiment, before invoking a target layout model obtained by training in advance to perform image and text layout in a background image, size recognition is performed on a product image to determine a display type of the product image according to a size recognition result, scaling processing is performed on the product image according to the display type and size information of the background image to obtain a processed product image, the processed product image is used as input of the target layout model, and the layout obtains poster description information, so that the size of the product image can be adaptively processed, and after the subsequent input of the target layout model is reduced, the determined layout area of the product image is inaccurate due to undersize or oversize of the product image, so that the layout effect of the product poster obtained by subsequent fusion is poor, and even a phenomenon that the product image is difficult to fuse occurs.
In an embodiment, in step S201, the size recognition is performed on the product image to determine the display type of the product image according to the size recognition result, which specifically includes the following steps:
s2011: and determining the ratio of the transverse dimension to the longitudinal dimension of the product image to obtain the transverse-longitudinal ratio.
S2012: if the transverse-longitudinal proportion is greater than or equal to a first preset value, determining that the display type of the product image is transverse display;
s2013: if the transverse-longitudinal proportion is smaller than or equal to a second preset value, determining that the display type of the product image is vertical display;
s2014: and if the transverse-longitudinal ratio is larger than the second preset value and smaller than the first preset value, determining the display type of the product image as center display.
In this embodiment, the ratio of the lateral dimension to the longitudinal dimension of the product image needs to be determined first, so as to obtain the lateral-longitudinal ratio.
If the transverse-longitudinal ratio is greater than or equal to a first preset value (such as 1.5), the transverse dimension of the product image is far greater than the longitudinal dimension, and the product image is a transverse image, and the display type of the product image is determined to be transverse display.
If the transverse-longitudinal ratio is smaller than or equal to a second preset value (such as 0.7), the transverse dimension of the product image is far smaller than the longitudinal dimension, and the product image is a vertical image, and the display type of the product image is determined to be vertical display.
If the transverse-longitudinal proportion is larger than the second preset value and smaller than the first preset value, the transverse dimension and the longitudinal dimension of the product image are close, the dimension of the product image is uniform, and the display type of the product image is determined to be central display. The display type of the product image is determined through the transverse and longitudinal proportion of the product image, and the display significance of the product image can be clearly determined from the visual angle, so that the layout area of the product image in the background image is effectively determined, and the accuracy of the layout area of the product image is improved.
In an embodiment, in step S202, the scaling process is performed on the product image according to the display type and the size information of the background image to obtain the target product image, which specifically includes the following steps:
s2021: if the display type is horizontal display, carrying out equal proportion amplification processing on the product image based on the horizontal size of the background image to obtain a target product image;
s2022: if the display type is vertical display, carrying out equal proportion amplification processing on the product image based on the longitudinal size of the background image to obtain a target product image;
s2023: if the display type is center display, carrying out equal proportion amplification processing on the product image based on the transverse size of the background image to obtain a target product image.
The display type is center display, which means that the product image is a uniform image, namely, the product image is a circular-like image or the length and width of the product image are similar, and the aspect ratio (namely, the transverse and longitudinal ratio) is close to 1.
In this embodiment, if the display type is a lateral display, the product image is subjected to equal-proportion amplification processing based on the lateral dimension of the background image, so as to obtain a target product image, where the lateral dimension of the background image is greater than the lateral dimension of the target product image; if the display type is vertical display, carrying out equal proportion amplification processing on the product image based on the longitudinal dimension of the background image to obtain a target product image, wherein the longitudinal dimension of the background image is larger than that of the target product image; if the display type is center display, the product image is subjected to equal proportion amplification processing based on the transverse size of the background image to obtain a target product image, wherein the size of the background image is larger than that of the target product image.
In an embodiment, the target text style includes a text font and a text color. Before step S30, the method further specifically includes the following steps of:
s301: and determining popularization products according to the popularization texts and the product images.
In this embodiment, the target text style includes a text font and a text color. Before converting the promotion text into the target text style to obtain the target promotion text, determining the target text style of the promotion text, namely determining the text font and the text color of the promotion text.
It should be appreciated that the product image may not be or only include an image of the promotional product, for example, the product image is a dance girl, and the promotional product is a dance training service, so to determine the actual promotional product, it is necessary to determine the promotional product based on the promotional text and the product image.
The method comprises the steps of extracting entity mention of a promotion text and identifying intention, obtaining the name of a product mentioned in the promotion text, identifying an image of the product to obtain the name of the product contained in the image of the product, and deducing to obtain a real promotion product by combining the name of the product mentioned in the promotion text and the name of the product contained in the image of the product.
S302: and determining the industry type corresponding to the promotion product and the promotion style corresponding to the promotion text.
After determining the promoted product, determining an industry type corresponding to the promoted product, for example, the promoted product is dance training service, and the corresponding industry type is skill service type; and determining the corresponding promotion styles of the promotion text, including exaggeration, stability, literature, lovely and the like, wherein the promotion styles are determined according to the characters and symbols of the promotion text. For example, the promotion text comprises information such as promotion, X-fold, flail and the like, and the promotion style is exaggerated; the popularization text comprises pigment, heart-shaped symbols and lovely word, and the popularization style is lovely.
S303: and determining fonts conforming to the industry types and the promotion styles as text fonts based on pre-established mapping relation data of the fonts, the industry types and the promotion styles.
After determining the industry type corresponding to the popularization product and determining the popularization style corresponding to the popularization text, determining the fonts conforming to the industry type and the popularization style as text fonts based on the pre-established mapping relation data of the fonts, the industry type and the popularization style.
S304: text color is determined based on the promotional style and/or the color of the background map.
Meanwhile, the text color needs to be determined based on the popularization style or the color of the background map. The text color can be determined according to the promotion style, for example, the promotion style is an exaggerated style, and then some bright and bright colors such as red color system and orange color system can be selected as the text color, so that the text color accords with the promotion style, and the information spreading effect is improved. The text color can also be determined according to the color of the background image, for example, the color which is not weakened to the color development effect and is out of the main color of the background image is selected and used as the text color so as to highlight the popularization text and improve the display effect.
In this embodiment, before the target popularization text is obtained by converting the popularization text into the target text style, a popularization product is determined according to the popularization text and the product image, an industry type corresponding to the popularization product is determined, a popularization style corresponding to the popularization text is determined, fonts conforming to the industry type and the popularization style are determined based on mapping relation data of the pre-established fonts, the industry type and the popularization style, the fonts are used as text fonts, and text colors are determined based on the popularization style and/or the color of the background image. The method and the device define the determining process of the target text style, determine the text font according to the industry type and the popularization style, and determine the text color according to the popularization style and/or the color of the background picture, so that the display effect of the popularization text can be effectively improved, and the quality of the product poster is further improved.
In an embodiment, the poster information layout area further comprises an identification map layout area. As shown in fig. 4, in step S40, that is, based on the layout area of the product map and the layout area of the text, the product image, the target popularization text and the background image are fused to obtain the product poster, which specifically includes the following steps:
s41: and fusing the product image subjected to the scaling treatment to a product image layout area of the background image, and fusing the enterprise identification image to the identification image layout area to obtain an initial product image corresponding to each area of the background image.
In this embodiment, the poster description information further includes image information such as an enterprise identification chart and a two-dimensional code; correspondingly, when the target layout model obtained through pre-training is called to carry out image and text layout in the background image, a poster information layout area comprising a product map layout area, a text layout area and an identification map layout area can be obtained, namely the poster information layout area further comprises the identification map layout area. That is, after converting the promotion text into the target text style to obtain the target promotion text, step S40 is: and fusing the product image, the enterprise identification map, the target popularization text and the background image based on the product map layout area, the identification map layout area and the text layout area to obtain the product poster.
Specifically, in order to ensure the size adaptation of the product image and the background image and achieve a better layout effect, the product image needs to be subjected to size recognition firstly to determine the display type of the product image according to the size recognition result, and then the product image is subjected to scaling treatment according to the display type and the size information of the background image, so that the processed product image is obtained. After the product image is subjected to scaling treatment, the product image subjected to scaling treatment is fused to a product image layout area of the background image, and the enterprise identification image is fused to an identification image layout area of the background image, so that an initial product image corresponding to each area of the background image is obtained, namely the initial product image also comprises a text layout area corresponding to the background image.
S42: and filling the target popularization text into a text layout area of the initial product graph, setting the text layout area to be in an editable state, obtaining an editable product graph, and taking the editable product graph as a product poster.
After the initial product map corresponding to each region of the background image is obtained, the target popularization text is required to be filled into the text layout region of the initial product map, the text layout region is set to be in an editable state, the editable product map is obtained, and the editable product map is used as a product poster. For example. Setting a text box in a text layout area of an initial product diagram directly to enable the text layout area to be in an editable state, filling a target popularization text into the text box, and reserving the editable text box, so that an editable product diagram is obtained, the editable product diagram is used as a product poster, and the product poster is editable, so that a subsequent user can adjust information such as characters, fonts, colors, character arrangement and the like of the target popularization text according to actual needs, and the product poster with better effect is obtained.
In other embodiments, the poster description information may further include other information, such as images of two-dimensional codes, and text information of contact ways, addresses, and the like, and correspondingly, the poster information layout area further includes a two-dimensional code layout area, a contact way layout area, and an address layout area. When the product poster is generated, fusing the product image subjected to scaling treatment to a product image layout area of a background image, fusing an enterprise identification image to the identification image layout area, and fusing a two-dimensional code to the identification image layout area to obtain an initial product image corresponding to each area of the background image, wherein the initial product image comprises a text layout area, a contact way layout area and an address layout area; and then, correspondingly filling the target popularization text, the contact information and the address into a text layout area, a contact information layout area and an address layout area of the initial product map respectively, setting the text layout area, the contact information layout area and the address layout area to be in an editable state to obtain an editable product map, and taking the editable product map as a product poster to realize that the product poster can be edited so as to facilitate the subsequent modification of the product poster.
In this embodiment, a product image after scaling is fused to a product image layout area of a background image, an enterprise identification image is fused to the identification image layout area, an initial product image corresponding to each area of the background image is obtained, then a target promotion text is filled into a text layout area of the initial product image, the text layout area is set to be in an editable state, an editable product image is obtained, the editable product image is taken as a product poster, the specific steps of fusing the product image, the target promotion text and the background image based on the product image layout area and the text layout area are clarified, and the product poster is obtained, so that the editable product poster is realized, and a subsequent user can adjust the product poster according to actual needs, thereby obtaining the product poster with better effect.
In one embodiment, the product poster is an editable product graphic. As shown in fig. 5, after step S40 or S42, that is, after obtaining the product poster, the method further specifically includes the following steps:
s50: and sending the editable product poster to a user so that the user can adjust and confirm the text information of the product poster according to the requirement.
In this embodiment, the product poster is an editable product map, that is, the generated product poster is an editable product poster. After the editable product poster is obtained, the editable product poster needs to be sent to the user, so that the user can adjust and confirm the text information of the product poster according to the requirement. For example, the server sends the editable product poster to the user so that the user can determine whether the text information of the product poster needs to be adjusted; if the user needs to adjust, adjusting the text information of the product poster into an editable state, so that the user can adjust the text information (comprising target popularization text, contact information and address) of the product poster according to the requirement, wherein the information adjustment comprises information adjustment of characters, fonts, colors, character arrangement and the like so as to optimize the text information of the product poster, and sending a confirmation instruction to a server after the user adjustment is completed; if the user does not need to adjust, the confirmation instruction is directly sent to the server.
S60: and after receiving the confirmation instruction of the user, solidifying the current product poster into a target product poster and feeding back the target product poster to the user.
After the editable product poster is sent to the user, determining whether a confirmation instruction of the user is received, solidifying the current product poster into a target product poster and feeding back the target product poster to the user after the confirmation instruction of the user is received, so that the user can keep the target product poster and print and popularize.
In order to ensure the display effect of the product poster and the interaction effect with the user, when the server sends the editable product poster to the user, an adjustment option and a confirmation option are provided on a display page of the product poster, if the user clicks the confirmation option, a confirmation instruction is sent to the server, the current product poster is solidified, namely, the current product poster is converted into a non-editable state, a target product poster is obtained, and the target product poster is fed back to the user, so that the user stores and promotes the product poster. If the user clicks the adjustment option, determining that the user needs to adjust, adjusting the text information of the product poster to be in an editable state, enabling the user to adjust the text style of the text information of the product poster according to the requirement, and updating the text information of the product poster in response to the adjustment operation of the user; after the user finishes adjusting, if the user clicks the confirmation option, a confirmation instruction is sent to the server, the current product poster (namely the adjusted product poster) is solidified, namely the current product poster is converted into a non-editable state, the target product poster is obtained, and the target product poster is fed back to the user, so that the user can store the target product poster for subsequent popularization.
In this embodiment, after obtaining the product poster, the editable product poster is sent to the user, so that the user adjusts and confirms the text information of the product poster according to the requirement, and after receiving the confirmation instruction of the user, the current product poster is solidified into the target product poster and fed back to the user. By generating the editable product poster so that a user can edit information according to actual demands, the target product poster is obtained through solidification, the quality of the target product poster is further improved, the information transmission efficiency through the poster image is further improved, and the satisfaction degree of the user poster design is improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In an embodiment, an automatic poster generating apparatus is provided, which corresponds to the automatic poster generating method in the above embodiment one by one. As shown in fig. 6, the automatic poster generating apparatus includes an acquisition module 601, a layout module 602, a conversion module 603, and a fusion module 604. The functional modules are described in detail as follows:
The acquisition module 601 is configured to acquire poster description information input by a user, where the poster description information includes a background image, a product image and a popularization text;
the layout module 602 is configured to invoke a target layout model obtained by training in advance to perform image and text layout in a background image based on a product image and a popularization text, so as to obtain a poster information layout area, where the poster information layout area includes a product image layout area and a text layout area;
the conversion module 603 is configured to convert the promotion text into a target text style, so as to obtain a target promotion text;
and the fusion module 604 is used for fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain the product poster.
Optionally, the poster description information further includes an enterprise identifier graph, and the layout module 602 is specifically configured to:
inputting a background image, a product image, an enterprise identification image and a popularization text into a first model of a target layout model to layout the product image, the enterprise identification image and the popularization text in the background image, so as to obtain a target layout image;
inputting the target layout image into a second model of the target layout model, and respectively carrying out layout area identification on the product image, the enterprise identification graph and the popularization text to obtain a product graph layout area, an identification graph layout area of the enterprise identification graph and a text layout area;
And marking the product map layout area, the identification map layout area and the text layout area as poster information layout areas.
Optionally, based on the product image and the promotion text, before invoking the target layout model obtained by pre-training to perform image and text layout in the background image, the layout module 602 is further specifically configured to:
carrying out size recognition on the product image to determine the display type of the product image according to a size recognition result, wherein the display type comprises transverse display and vertical display;
and scaling the product image according to the display type and the size information of the background image to obtain a processed product image, and taking the processed product image as the input of a target layout model to obtain poster description information through layout.
Optionally, the poster information layout area further includes an identification map layout area, and the fusion module 604 is specifically configured to:
fusing the scaled product image to a product image layout area of the background image, and fusing the enterprise identification image to the identification image layout area to obtain an initial product image corresponding to each area of the background image;
and filling the target popularization text into a text layout area of the initial product graph, setting the text layout area to be in an editable state, obtaining an editable product graph, and taking the editable product graph as a product poster.
Optionally, the product poster is an editable product poster, and based on the product map layout area and the text layout area, the product image, the target popularization text and the background image are fused, and after the product poster is obtained, the fusion module 604 is specifically further configured to:
sending the editable product poster to a user so that the user can adjust and confirm the text information of the product poster according to the requirement;
and after receiving the confirmation instruction of the user, solidifying the current product poster into a target product poster and feeding back the target product poster to the user.
Optionally, the target text style includes a text font and a text color, and the conversion module 603 is further specifically configured to, before converting the promoted text into the target text style to obtain the target promoted text:
determining popularization products according to the popularization texts and the product images;
determining the industry type corresponding to the promotion product and determining the promotion style corresponding to the promotion text;
determining fonts conforming to industry types and popularization styles as text fonts based on pre-established mapping relation data of the fonts, the industry types and the popularization styles;
text color is determined based on the promotional style and/or the color of the background map.
Optionally, the automatic poster generating apparatus further includes a training module 605, where the training module 605 is specifically configured to train to obtain the target layout model by:
Obtaining a plurality of layout samples, wherein each layout sample comprises a sample background image, a sample product image and a sample text, and each layout sample corresponds to one standard poster;
inputting a layout sample into a pre-training network comprising a first network and a second network, so as to layout a sample product graph and a sample text in a sample background graph through the first network to obtain a predicted layout image, and carrying out layout area identification on the predicted layout image through the second network to obtain a predicted product graph area and a predicted text area;
determining a total loss value according to the predicted layout image, the standard poster, the predicted product image area and the predicted text area;
and when the total loss value does not meet the convergence condition, continuing to iterate parameters of the pre-training network according to the plurality of layout samples until the total loss value meets the convergence condition, determining that the pre-training network converges, and outputting the converged pre-training network as a target layout model.
The specific limitation regarding the automatic poster generating apparatus may be referred to the limitation of the automatic poster generating method hereinabove, and will not be described herein. The respective modules in the above-described poster automatic generation apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing data used and generated by the automatic poster generating method, and the data comprise poster description information, poster information layout areas, target layout models, product posters and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method for automatically generating a poster.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program:
Acquiring poster description information input by a user, wherein the poster description information comprises a background image, a product image and a popularization text;
calling a target layout model obtained through pre-training to carry out image and text layout in a background image based on a product image and a popularization text to obtain a poster information layout area, wherein the poster information layout area comprises a product image layout area and a text layout area;
converting the popularization text into a target text style to obtain a target popularization text;
and fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain the product poster.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring poster description information input by a user, wherein the poster description information comprises a background image, a product image and a popularization text;
calling a target layout model obtained through pre-training to carry out image and text layout in a background image based on a product image and a popularization text to obtain a poster information layout area, wherein the poster information layout area comprises a product image layout area and a text layout area;
Converting the popularization text into a target text style to obtain a target popularization text;
and fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain the product poster.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (10)

1. An automatic poster generation method, comprising:
acquiring poster description information input by a user, wherein the poster description information comprises a background image, a product image and a popularization text;
calling a target layout model obtained through pre-training to carry out image and text layout in the background image based on the product image and the popularization text to obtain a poster information layout area, wherein the poster information layout area comprises a product image layout area and a text layout area; the target layout model comprises a first model and a second model, wherein the first model is a random layout image generation model, and the second model is an image structure identification model; the acquisition mode of the poster information layout area comprises the following steps: inputting the background image, the product image and the popularization text into a first model to lay out the product image and the popularization text in the background image, and fusing the image and the text to obtain a target layout image comprising the product image and the popularization text; inputting the target layout image into the second model, and respectively carrying out layout area identification on the product image and the popularization text to obtain a product image layout area and a text layout area;
Converting the popularization text into a target text style to obtain a target popularization text;
and fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain a product poster.
2. The automatic poster generation method according to claim 1, wherein said poster description information further comprises an enterprise identification map; invoking a target layout model obtained through pre-training to carry out image and text layout in the background image based on the product image and the popularization text to obtain a poster information layout area, wherein the method comprises the following steps of:
inputting the background image, the product image, the enterprise identification image and the popularization text into a first model of the target layout model to layout the product image, the enterprise identification image and the popularization text in the background image so as to obtain a target layout image;
inputting the target layout image into a second model of the target layout model, and respectively carrying out layout area identification on the product image, the enterprise identification graph and the popularization text to obtain a product graph layout area, an identification graph layout area of the enterprise identification graph and the text layout area;
And marking the product map layout area, the identification map layout area and the text layout area as the poster information layout area.
3. The automatic poster generation method according to claim 1, wherein said invoking a pre-trained target layout model based on said product image and said promotional text, prior to image and text layout in said background image, said method further comprises:
performing size recognition on the product image to determine the display type of the product image according to a size recognition result, wherein the display type comprises transverse display and vertical display;
and scaling the product image according to the display type and the size information of the background image to obtain the processed product image, and obtaining the poster description information by using the processed product image as the input of the target layout model.
4. The automatic poster generation method according to claim 1, wherein said poster information layout area further comprises an identification map layout area, said fusing said product image, said target popularization text, and said background image based on said product map layout area, said text layout area, to obtain a product poster, comprising:
Fusing the product image subjected to scaling treatment to a product image layout area of the background image, and fusing an enterprise identification image to the identification image layout area to obtain an initial product image corresponding to each area of the background image;
and filling the target popularization text into the text layout area of the initial product map, setting the text layout area to be in an editable state to obtain an editable product map, and taking the editable product map as the product poster.
5. The automatic generation method of a poster according to claim 1, wherein the product poster is an editable product poster, and the method further comprises, after fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain the product poster:
sending the editable product poster to the user so that the user can adjust and confirm the text information of the product poster according to the requirement;
and after receiving the confirmation instruction of the user, solidifying the current product poster into a target product poster and feeding back the target product poster to the user.
6. The automatic poster generation method according to claim 1, wherein said target text pattern comprises a text font and a text color, said converting said promotional text into a target text pattern, prior to obtaining a target promotional text, said method further comprising:
determining a promotion product according to the promotion text and the product image;
determining the industry type corresponding to the promotion product and determining the promotion style corresponding to the promotion text;
determining fonts conforming to the industry types and the popularization styles as the text fonts based on pre-established mapping relation data of the fonts, the industry types and the popularization styles;
and determining the text color based on the promotion style and/or the color of the background picture.
7. The automatic poster generation method according to any of claims 1-6, wherein said target layout model is trained by:
obtaining a plurality of layout samples, wherein each layout sample comprises a sample background image, a sample product image and a sample text, and each layout sample corresponds to one standard poster;
inputting the layout sample into a pre-training network comprising a first network and a second network, so as to layout the sample product graph and the sample text in the sample background graph through the first network to obtain a predicted layout image, and carrying out layout area identification on the predicted layout image through the second network to obtain a predicted product graph area and a predicted text area;
Determining a total loss value according to the predicted layout image, the standard poster, the predicted product map area and the predicted text area;
and when the total loss value does not meet the convergence condition, continuing to iterate parameters of the pre-training network according to a plurality of layout samples until the total loss value meets the convergence condition, determining that the pre-training network converges, and outputting the converged pre-training network as the target layout model.
8. An automatic poster generation apparatus, comprising:
the acquisition module is used for acquiring poster description information input by a user, wherein the poster description information comprises a background image, a product image and a popularization text;
the layout module is used for calling a target layout model obtained through pre-training to carry out image and text layout in the background image based on the product image and the popularization text to obtain a poster information layout area, and the poster information layout area comprises a product image layout area and a text layout area; the target layout model comprises a first model and a second model, wherein the first model is a random layout image generation model, and the second model is an image structure identification model; the acquisition mode of the poster information layout area comprises the following steps: inputting the background image, the product image and the popularization text into a first model to lay out the product image and the popularization text in the background image, and fusing the image and the text to obtain a target layout image comprising the product image and the popularization text; inputting the target layout image into the second model, and respectively carrying out layout area identification on the product image and the popularization text to obtain a product image layout area and a text layout area;
The conversion module is used for converting the popularization text into a target text style to obtain a target popularization text;
and the fusion module is used for fusing the product image, the target popularization text and the background image based on the product map layout area and the text layout area to obtain a product poster.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the automatic poster generation method according to any of claims 1-7 when the computer program is executed.
10. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the automatic poster generation method according to any of claims 1 to 7.
CN202311170287.8A 2023-09-12 2023-09-12 Automatic poster generation method, device, computer equipment and storage medium Active CN116934908B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311170287.8A CN116934908B (en) 2023-09-12 2023-09-12 Automatic poster generation method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311170287.8A CN116934908B (en) 2023-09-12 2023-09-12 Automatic poster generation method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116934908A CN116934908A (en) 2023-10-24
CN116934908B true CN116934908B (en) 2024-01-26

Family

ID=88375594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311170287.8A Active CN116934908B (en) 2023-09-12 2023-09-12 Automatic poster generation method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116934908B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117241102B (en) * 2023-11-15 2024-03-19 北京京拍档科技股份有限公司 Method for generating commodity poster based on real model business shooting chart
CN117710234B (en) * 2024-02-06 2024-05-24 青岛海尔科技有限公司 Picture generation method, device, equipment and medium based on large model

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114677402A (en) * 2022-04-07 2022-06-28 北京智源人工智能研究院 Poster text layout, poster generation method and related device
CN114972847A (en) * 2022-05-07 2022-08-30 阿里巴巴(中国)有限公司 Image processing method and device
CN116597039A (en) * 2023-05-22 2023-08-15 阿里巴巴(中国)有限公司 Image generation method and server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114677402A (en) * 2022-04-07 2022-06-28 北京智源人工智能研究院 Poster text layout, poster generation method and related device
CN114972847A (en) * 2022-05-07 2022-08-30 阿里巴巴(中国)有限公司 Image processing method and device
CN116597039A (en) * 2023-05-22 2023-08-15 阿里巴巴(中国)有限公司 Image generation method and server

Also Published As

Publication number Publication date
CN116934908A (en) 2023-10-24

Similar Documents

Publication Publication Date Title
CN116934908B (en) Automatic poster generation method, device, computer equipment and storage medium
CN110414519A (en) A kind of recognition methods of picture character and its identification device
US11288499B2 (en) Interactive method for generating strokes with Chinese ink painting style and device thereof
CN107578367B (en) Method and device for generating stylized image
CN110232726B (en) Creative material generation method and device
CN108171650B (en) Chinese flower water-ink painting style stroke generation method with stroke optimization function
CN117058271A (en) Method and computing device for generating commodity main graph background
CN110569379A (en) Method for manufacturing picture data set of automobile parts
CN110211032B (en) Chinese character generating method and device and readable storage medium
CN117058275B (en) Commodity propaganda drawing generation method and device, computer equipment and storage medium
CN109783782B (en) Method, equipment, storage medium and device for generating electronic contract template
CN117036546B (en) Picture generation method and device, storage medium and computing equipment
CN108241861A (en) A kind of data visualization method and equipment
CN106776527A (en) The display methods of electronic book data, device and terminal device
CN112927321B (en) Intelligent image design method, device, equipment and storage medium based on neural network
CN115810215A (en) Face image generation method, device, equipment and storage medium
CN111444452B (en) Webpage conversion method and device and storage medium
US20220019830A1 (en) Systems and methods for generating typographical images or videos
CN113554549A (en) Text image generation method and device, computer equipment and storage medium
CN110428360B (en) Automobile image beautifying method, equipment, storage medium and device
CN106814979A (en) The method for exporting paper matrix immediately using end print equipment
CN116452703B (en) User head portrait generation method, device, computer equipment and storage medium
CN118072127B (en) Training method and related device for image generation model
CN108171767B (en) Image generation method with curve correction function
CN108038819B (en) Interactive stroke generation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant