Image generation method and apparatus, device, and medium
By acquiring the parameter and arrangement information of the source images, the target image is generated using an image parameter generation model. This solves the problems of high cost and inconsistent visual features in deep learning, achieves diverse and aesthetically pleasing image generation, and improves the user experience.
Patent Information
- Application Number
- CN202210365249.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-04-07
AI Technical Summary
In existing technologies, deep learning-based image generation methods are costly and difficult to retain the visual features of the source material when generating diverse images, which cannot meet the needs of practical application scenarios, especially the problem of inconsistent visual features of different products in order systems.
By acquiring parameter information from multiple source images, an image parameter generation model is used to obtain the arrangement information of the source images, and a target image is generated based on this. By combining generative adversarial learning and lookup table methods, the model performance is optimized to generate diverse images that conform to human aesthetics.
While ensuring that the visual characteristics of the materials are not distorted, more diverse images are generated, improving the user experience and meeting the needs of application scenarios such as order systems.
Smart Images

Figure CN114723855B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence, and more particularly to the field of image processing technology, specifically to an image generation method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] In practical applications, information is often displayed visually in the form of images, such as product posters and restaurant menus. Aesthetically pleasing and diverse images can effectively enhance the user experience in commercial settings.
[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0004] This disclosure provides an image generation method, apparatus, electronic device, computer-readable storage medium, and computer program product.
[0005] According to one aspect of this disclosure, an image generation method is provided, comprising: acquiring a plurality of source images; acquiring arrangement information of the plurality of source images based on parameter information of the plurality of source images, wherein the parameter information includes content information of each of the plurality of source images; and generating a target image based on the plurality of source images and the arrangement information of the plurality of source images.
[0006] According to another aspect of this disclosure, a page display method is provided for an order system, the method comprising: obtaining user order information, the order information including multiple materials; generating a target image corresponding to the order information using the image generation method described above; and displaying the target image on an order display page.
[0007] According to another aspect of this disclosure, an image generation apparatus is provided, comprising: a first acquisition unit configured to acquire a plurality of source images; a second acquisition unit configured to acquire arrangement information of the plurality of source images based on parameter information of the plurality of source images, the parameter information including content information of each of the plurality of source images; and a generation unit configured to generate a target image based on the plurality of source images and the arrangement information of the plurality of source images.
[0008] According to another aspect of this disclosure, a page display apparatus is provided, configured for use in an order system, comprising: an acquisition unit configured to acquire user order information, the order information including multiple materials; an image generation apparatus as described above, configured to generate a target image corresponding to the order information; and a display unit configured to display the target image on an order display page.
[0009] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in any of the preceding claims.
[0010] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method described in any of the preceding claims.
[0011] According to another aspect of this disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the method described in any of the preceding claims.
[0012] According to one or more embodiments of this disclosure, more diverse and aesthetically pleasing images can be generated.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0014] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0015] Figure 1 A flowchart of an image generation method according to an exemplary embodiment of the present disclosure is shown;
[0016] Figure 2 A flowchart of an image generation method according to an exemplary embodiment of the present disclosure is shown;
[0017] Figure 3 A flowchart illustrating the training process of an image parameter generation model according to an exemplary embodiment of the present disclosure is shown;
[0018] Figure 4 A schematic diagram of the structure of an image parameter generation model according to an exemplary embodiment of the present disclosure is shown;
[0019] Figure 5 A flowchart illustrating a page display method according to an exemplary embodiment of the present disclosure is shown;
[0020] Figure 6 A flowchart illustrating a page display method according to an exemplary embodiment of the present disclosure is shown;
[0021] Figure 7 A reference diagram showing the page display effect according to an exemplary embodiment of the present disclosure is shown;
[0022] Figure 8 A structural block diagram of an image generation apparatus according to an exemplary embodiment of the present disclosure is shown;
[0023] Figure 9 A structural block diagram of a training apparatus for an image parameter generation model according to an exemplary embodiment of the present disclosure is shown;
[0024] Figure 10 A structural block diagram of a page display apparatus according to an exemplary embodiment of the present disclosure is shown;
[0025] Figure 11 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0026] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0027] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0028] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0029] In related technologies, deep learning-based image generation methods are commonly used to obtain diverse images. However, improving the performance of deep learning models usually requires training with large amounts of data, resulting in excessively high training costs. Furthermore, due to the complexity of image features, deep learning models struggle to achieve satisfactory fitting results. Relying entirely on the output of deep learning models leads to excessive randomness, making it difficult to reproduce the visual features of objects in the real world, which may not meet the needs of practical applications. For example, in an order system that needs to use images to display the products included in an order, different images of the same product should have identical visual features. However, because the output of deep learning models has a certain degree of randomness, the same product may display different visual effects, failing to meet the aforementioned requirements.
[0030] Based on this, this disclosure provides an image generation method that obtains more diverse material image arrangement information and generates a target image based on the material images and their arrangement information. While generating more diverse images, it can retain the visual features of the material images, making the generated images more in line with human aesthetics, thereby improving user experience and meeting the needs of specific application scenarios.
[0031] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0032] Figure 1 A flowchart of an image generation method according to an exemplary embodiment of the present disclosure is shown. Figure 1 As shown, the method includes: step S101, acquiring multiple source images; step S102, acquiring arrangement information of the multiple source images based on parameter information of the multiple source images, wherein the parameter information includes content information of each of the multiple source images; and step S103, generating a target image based on the multiple source images and the arrangement information of the multiple source images. The content information of each of the multiple source images may, for example, indicate the corresponding type of the source image. Therefore, by acquiring more diverse arrangement information of source images, a corresponding target image can be generated, preserving the visual characteristics of the source images while changing their arrangement, thereby increasing the diversity of the target image without distorting the source images.
[0033] For example, the source image can be a two-dimensional image, and the target image is generated by superimposing or collaging the two-dimensional source images. According to some embodiments, the source image can also be a three-dimensional image, thereby enabling the generation of a three-dimensional target image to meet the needs of more application scenarios.
[0034] Furthermore, in some examples, multiple target images can be generated using source images and their arrangement information, and then these multiple target images can be stitched together to form a video or GIF, thereby obtaining a more diverse range of videos or GIFs.
[0035] For example, the source image can be an image corresponding to a specific element included in the target image. For instance, the image generation method can be applied to an order system to display multiple items included in an order to the user using the generated target image. In this case, the source image can be an image of a specific item. For example, if a user's order includes three items A, B, and C, then the source images corresponding to each of the three items can be obtained. Based on this, the arrangement information of the source images can be obtained, and then the target image can be generated and displayed to the user. This allows for a more intuitive display of the information about the items included in the order, improving the user experience.
[0036] For example, the content information of each of the plurality of materials included in the parameter information can be used to indicate the corresponding content category of the material. For instance, in the image generation method applied to an order system described above, if the material image is an image of a specific product, then the corresponding content information of the material can be the name of the product. Further, in another example, the content information of each of the plurality of materials included in the parameter information can also contain richer content features corresponding to the material, such as color information. Based on the plurality of corresponding content feature information, arrangement information that better matches the material content can be obtained, making the generated target image more aesthetically pleasing to humans.
[0037] It should be understood that the above application method is only an example of the image generation method described in this disclosure. The image generation method can be applied to other practical scenarios, such as poster collage based on source images, and is not limited thereto.
[0038] According to some embodiments, obtaining the arrangement information of the plurality of source images in step S102 includes: inputting the parameter information of the plurality of source images into an image parameter generation model to obtain the arrangement information of the plurality of source images output by the image parameter generation model. Therefore, the image parameter generation model can be used to easily and quickly obtain more diverse arrangement information of source images, thereby improving the diversity of the target image.
[0039] For example, the image parameter generation model can be a neural network model based on various structures, such as a feedforward neural network. The image parameter generation model can output the arrangement information of the material images based on the number of input materials and their respective content information, thereby generating a target image based on the material images and their arrangement information.
[0040] According to some embodiments, the image parameter generation model includes a generative model trained using a discriminative model. The step of obtaining the arrangement information of the plurality of source images includes inputting the parameter information of the plurality of source images into the generative model to obtain the arrangement information of the plurality of source images output by the generative model. Therefore, generative adversarial learning can be used to train the image parameter generation model, improving model performance.
[0041] For example, the arrangement information of the multiple source images can also be obtained through other means. For instance, the parameter information of the source images and the corresponding manually configured arrangement information can be stored in a database as key-value pairs, allowing the arrangement information of multiple source images to be obtained using a lookup table. Furthermore, each set of parameter information can correspond to multiple sets of arrangement information, allowing one set of arrangement information to be randomly obtained based on a lookup table, thereby increasing the diversity of the arrangement information used to generate the target image.
[0042] According to some embodiments, the arrangement information may include, but is not limited to, at least one of the following: layer order information of the plurality of source images, relative position information of the plurality of source images, and relative size information of the plurality of source images. Therefore, source images can be overlaid or collaged based on the source image arrangement information, thereby enabling the simple and rapid generation of a target image.
[0043] According to some embodiments, when the arrangement information includes layer order information, relative position information, and relative size information of the multiple source images, step S103, which generates a target image based on the multiple source images and their arrangement information, includes: adjusting the size of the multiple source images based on their relative size information; and sequentially superimposing the resized source images based on their layer order information and relative position information to generate the target image. Therefore, source images can be adjusted and pieced together based on their layer order information, relative position information, and relative size information, allowing for a simple and quick way to obtain the corresponding target image and improving image generation efficiency.
[0044] For example, before step S103, the multiple source images can be preprocessed, and a target image can be generated based on the preprocessed source images, so that the generated target image can better meet the needs of the actual application scenario.
[0045] In some examples, the preprocessing may include instance segmentation of the multiple source images to further extract the desired portions from the source images. For example, the source images may include backgrounds unrelated to the desired object; instance segmentation can be used to separate the desired object from the background to avoid any potential influence of the background on the target image. The instance segmentation process can be implemented using various techniques, such as transparency transformation, grayscale transformation, edge detection, Hough transform, deep learning instance segmentation algorithms, etc., and is not limited thereto.
[0046] In some examples, the preprocessing may also include adding shadows to the multiple source images to suit the needs of actual application scenarios. The process of adding shadows can be implemented using various techniques, such as grayscale processing and overlaying of layers, and is not limited thereto.
[0047] It should be understood that the above method is only an example of a preprocessing method. Various preprocessing methods can be applied to the material according to actual needs, such as color adjustment, sharpness adjustment, etc., to improve the quality of the generated target image.
[0048] Figure 2 A flowchart of an image generation method according to an exemplary embodiment of the present disclosure is shown. Figure 2 As shown, the method includes: step S201, acquiring multiple source images; step S202, inputting the parameter information of the multiple source images into an image parameter generation model to obtain the arrangement information of the multiple source images output by the image parameter generation model, wherein the arrangement information includes the layer order information, relative position information, and relative size information of the multiple source images; step S203, adjusting the size of each source image based on the relative size information of the multiple source images; and step S204, sequentially superimposing the multiple adjusted source images based on the layer order information and relative position information of the multiple source images to generate the target image. This method can utilize an image parameter generation model to obtain diverse source image arrangement information, and then adjust and collage the source images based on this information, enabling a simple and quick way to obtain the corresponding target image, improving the diversity and efficiency of image generation.
[0049] Figure 3 A flowchart illustrating the training process of an image parameter generation model according to an exemplary embodiment of this disclosure is shown. Figure 3As shown, the method includes: step S301, acquiring the actual layout information of multiple sample material images and the parameter information of the multiple sample material images, wherein the parameter information includes the content information of each of the multiple sample material images; step S302, inputting the parameter information of the multiple sample material images into an image parameter generation model, and acquiring the predicted layout information of the multiple sample material images output by the image parameter generation model; and step S303, tuning the parameters of the image parameter generation model based on the actual layout information and the predicted layout information. Therefore, the image parameter generation model can be trained using the actual layout information of the sample material images, enabling the image parameter generation model to output material image layout information that better conforms to aesthetic characteristics based on the parameter information of the material images, thereby achieving high-efficiency and diversified image generation using this image parameter generation model.
[0050] According to some embodiments, when the image parameter generation model includes a generation model and the generation model is trained using a discriminative model, the parameter information of the multiple sample materials is respectively input into the discriminative model and the generation model. The predicted arrangement information is the output of the generation model, and the true arrangement information and the predicted arrangement information are also input into the discriminative model. Furthermore, step S303, which involves tuning the image parameter generation model based on the true arrangement information and the predicted arrangement information, includes tuning the discriminative model and the generation model based on the similarity between the true arrangement information and the predicted arrangement information. Therefore, generative adversarial learning can be used to train the image parameter generation model, improving training efficiency and effectiveness.
[0051] Figure 4 A schematic diagram of the structure of an image parameter generation model 400 according to an exemplary embodiment of the present disclosure is shown. Figure 4 The arrows in the diagram indicate the direction of signal flow, with solid arrows showing the forward propagation and dashed arrows showing the backward propagation. For example... Figure 4 As shown, the parameter information of the multiple sample materials is input into the generation model 401, and the predicted layout information output by the generation model 401 is input into the discrimination model 402. The discrimination model 402 also acquires the parameter information and the actual layout information of the multiple sample materials, and outputs a discrimination result to indicate the similarity between the actual layout information and the predicted layout information, and propagates it back to the generation model 401 and the discrimination model 402.
[0052] For example, tuning the discriminant model and the generative model based on the similarity between the real and predicted layout information may include: obtaining the discrimination result output by the discriminant model for the real and predicted layout information. The discrimination result can, for example, represent the probability that a certain layout information belongs to the real layout information in the form of a prediction probability, thus indicating the similarity between the real and predicted layout information. For instance, if the discriminant model predicts an 80% probability for the real layout information and a 20% probability for the predicted layout information, it indicates a low similarity between the real and predicted layout information, and a significant gap exists between the predicted and real layout information. In this case, the discriminant model and the generative model can be tuned based on the similarity. As another example, if the discriminant model predicts a 50% probability for both the real and predicted layout information, it indicates a high similarity between the real and predicted layout information, and training can be terminated accordingly.
[0053] It should be understood that the above content is merely an example of the model parameter tuning and optimization process. The discriminative model may also output other forms of discrimination results to indicate the similarity between the true arrangement information and the predicted arrangement information. Correspondingly, other forms of optimization objectives may also be set as conditions for the end of model training.
[0054] According to some embodiments, the training process of the discriminative model includes: inputting the parameter information of the plurality of sample materials into the generative model, and obtaining the initial predicted layout information output by the generative model; inputting the parameter information of the plurality of sample materials, the initial predicted layout information, and the actual layout information into the discriminative model, and obtaining a first similarity between the initial predicted layout information and the actual layout information output by the discriminative model; and tuning the parameters of the discriminative model based on the first similarity. The training process of the generative model includes: after the discriminative model is trained, inputting the parameter information of the plurality of sample materials into the generative model; inputting the predicted layout information output by the generative model, the parameter information of the plurality of sample materials, and the actual layout information into the discriminative model, and obtaining a second similarity between the initial predicted layout information and the actual layout information output by the discriminative model; and tuning the parameters of the generative model based on the second similarity. Therefore, it is possible to first train a discriminative model, and then use the output of the trained discriminative model to train a generative model, thereby obtaining a performance-optimized generative model more easily, and using the generative model to obtain the required material arrangement information.
[0055] For example, the discriminative model and the generative model can also be trained using other methods. For instance, this can be achieved through the following process: inputting the parameter information of the multiple sample materials into the generative model and obtaining the predicted arrangement information output by the generative model; inputting the parameter information of the multiple sample materials, the predicted arrangement information, and the actual arrangement information into the discriminative model and obtaining the third similarity between the predicted arrangement information and the actual arrangement information output by the discriminative model; and based on the third similarity, tuning the generative model and the discriminative model using different parameter tuning optimization objectives, wherein maximizing the third similarity is the optimization objective for the discriminative model, and minimizing the third similarity is the optimization objective for the generative model. In this process, the generative model and the discriminative model adjust their respective parameters to maximize or minimize the third similarity, reaching an equilibrium point in a dynamic game, which serves as the condition for ending training, thereby obtaining relatively optimal parameter values. Alternatively, other training termination conditions can be set according to actual needs, as long as the generative and discriminative models with performance meeting the actual requirements can be obtained, without any restrictions.
[0056] According to some embodiments, the training process of the image parameter generation model further includes: generating a target image based on the plurality of sample material images and their predicted arrangement information; determining the corresponding evaluation score of the target image; and adjusting the arrangement of the plurality of sample material images in the target image according to preset rules in response to the target image's evaluation score not meeting preset conditions, so that the target image's evaluation score meets preset conditions; and training the image parameter generation model using the adjusted target image and its predicted arrangement information. This allows for quality control of the generated images, adjustment of the images based on the quality control results, and return of the adjusted images for model training, thereby expanding the training dataset and improving the model's training effect and performance.
[0057] For example, the evaluation score of the target image can be determined manually, and the target image can be adjusted. This allows for manual quality control and adjustment to obtain images that meet the corresponding conditions, which can then be used to expand the training dataset and improve the model training effect.
[0058] Figure 5 A flowchart illustrating a page display method according to an exemplary embodiment of this disclosure is shown. Figure 5As shown, the method includes: step S501, obtaining the user's order information, which includes multiple materials; step S502, generating a target image corresponding to the order information using the image generation method described above; and step S503, displaying the target image on the order display page. Therefore, the image generation method can be applied to the order system, generating corresponding images based on the user's order information and displaying them to the user. The images visually display the user's order information, allowing the user to intuitively obtain the corresponding order information and thus more conveniently and quickly confirm the order information, effectively improving the user experience.
[0059] For example, the multiple materials included in the order information can be multiple products included in the user's order. The target image generated based on this can visualize the products included in the user's order to improve the user experience.
[0060] According to some embodiments, the page display method further includes: obtaining recommendation information for the user based on the user's order information; obtaining recommended materials based on the recommendation information; adding the recommended materials to the target image; and wherein the target image with the added recommended materials is displayed on the order display page. Therefore, it is possible to add corresponding recommended materials to the target image according to the display needs of recommendation information in the order system, fully meeting the needs of practical application scenarios.
[0061] For example, the recommendation information may be promotional information for the user or for the order, and the recommended material may be text, images, animations, or other content corresponding to the recommendation information.
[0062] According to some embodiments, the page display method further includes: obtaining the user's preference information related to the plurality of materials based on the user's historical order information; adjusting the arrangement of the plurality of material images in the target image based on the user's preference information, wherein the adjusted target image is displayed on the order display page. Thus, the arrangement of material images in the target image can be adjusted in a targeted manner according to the user's personalized preference information to further improve the user experience.
[0063] According to some embodiments, the page display method further includes: obtaining a target background image for the user based on the user's relevant information; adding the target image to the target background image, wherein the target image with the target background image as its background is displayed on the order display page. The user's relevant information may include, for example, the user's preference information regarding background images, thereby enabling the acquisition and display of the target background image according to the user's personalized needs, further enhancing the user experience.
[0064] According to some embodiments, the page display method further includes: obtaining order interaction information based on the user's order information; obtaining order interaction materials based on the order interaction information; and adding the order interaction materials to the target image in response to the user's input interaction operation. Thus, corresponding order interaction materials can be added to the target image according to the needs of the human-computer interaction process in the order system, fully meeting the needs of practical application scenarios.
[0065] For example, the order interaction material can be a panel, button, pop-up, or other component on a graphical user interface that can be interacted with by the user through clicks or touches. The interaction material can be used to guide the user's operation or to display the information the user needs, thereby further improving the user experience.
[0066] For example, after generating the target image based on any of the above methods, the target image can be post-processed to further improve its quality, making the method more in line with the needs of actual application scenarios.
[0067] In some examples, the post-processing may include adding predefined materials to the target image, such as text, images, tables, etc. For example, predefined text prompts may be added to the target image to prompt the user. As another example, predefined poster images or product images used to recommend items to the user may also be added to the target image to recommend relevant information.
[0068] In some examples, the post-processing may also include adjusting the display position of the target image. For example, when the size of the target image does not match the page size, causing the target image to not be fully displayed, the display position of the target image can be adjusted, for example, to center it, so that the main information of the target image can be displayed on the page.
[0069] It should be understood that the above method is only an example of a post-processing method. Various post-processing can be performed on the target image according to actual needs, such as sharpness adjustment, so that the target image can be better adapted to the page to be displayed and improve the quality of page display.
[0070] Figure 6 A flowchart illustrating a page display method according to an exemplary embodiment of this disclosure is shown. Figure 6As shown, the method includes: step S601, obtaining user order information, the order information including multiple materials; step S602, generating a target image corresponding to the order information using the image generation method described above; step S603, obtaining recommendation information for the user based on the user's order information; step S604, obtaining materials to be recommended based on the recommendation information; step S605, adding the materials to be recommended to the target image; step S606, obtaining a target background image for the user based on the user's relevant information; step S607, adding the target image with the added recommendation materials to the target background image; and step S608, displaying the target image with the target background image as the background on the order display page. Therefore, the image generation method can be applied to the order system, and corresponding display materials can be added based on the display needs of other information in the order system, allowing for page display according to the user's personalized needs, effectively improving the user experience.
[0071] Figure 7 A reference diagram showing the page display effect according to an exemplary embodiment of the present disclosure is provided. Figure 7 As shown, the corresponding order system page can display order information to users simultaneously in the form of text and images. Specifically, it can display all the products included in the order, with the visual information shown in the images corresponding to the text information, allowing users to intuitively obtain the relevant order information and conveniently and quickly confirm the order information, thereby improving the user experience.
[0072] Figure 8 A structural block diagram of an image generation apparatus 800 according to an exemplary embodiment of the present disclosure is shown. Figure 8 As shown, the image generation apparatus 800 includes: a first acquisition unit 801 configured to acquire multiple source images; a second acquisition unit 802 configured to acquire arrangement information of the multiple source images based on parameter information of the multiple source images, wherein the parameter information includes content information of each of the multiple source images; and a generation unit 803 configured to generate a target image based on the multiple source images and the arrangement information of the multiple source images. The operation of units 801-803 of the image generation apparatus 800 is similar to the operation of steps S101-S103 described above, and will not be repeated here.
[0073] Figure 9 A structural block diagram of a training apparatus 900 for generating an image parameter model according to an exemplary embodiment of the present disclosure is shown. Figure 7As shown, the training device 900 for the image parameter generation model includes: a first acquisition unit 901, configured to acquire the actual layout information of multiple sample material images and the parameter information of the multiple sample material images, wherein the parameter information includes the content information of each of the multiple sample material images; a second acquisition unit 902, configured to input the parameter information of the multiple sample material images into the image parameter generation model and acquire the predicted layout information of the multiple sample material images output by the image parameter generation model; and a parameter tuning unit 903, configured to tune the image parameter generation model based on the actual layout information and the predicted layout information. The operations of units 901-903 of the training device 900 for the image parameter generation model are similar to the operations of steps S301-S303 described above, and will not be repeated here.
[0074] Figure 10 A structural block diagram of a page display device 1000 according to an exemplary embodiment of the present disclosure is shown, the device being used in an order system. Figure 10 As shown, the page display device 1000 includes: an acquisition unit 1001 configured to acquire user order information, the order information including multiple materials; an image generation device 800 as described above, configured to generate a target image corresponding to the order information; and a display unit 1002 configured to display the target image on the order display page. The operation of units 1001, 800, and 1002 of the page display device 1000 is similar to the operation of steps S501-S503 described above, and will not be repeated here.
[0075] According to another aspect of this disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform at least one of the above-described image generation method and page display method.
[0076] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to cause the computer to perform at least one of the above-described image generation method and page display method.
[0077] According to another aspect of this disclosure, a computer program product is also provided, comprising a computer program, wherein the computer program, when executed by a processor, implements at least one of the above-described image generation method and page display method.
[0078] See Figure 11The following description serves as a structural block diagram of the electronic device 1100 of this disclosure, which is an example of a hardware device applicable to various aspects of this disclosure. The electronic device can be different types of computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the disclosure described and / or claimed herein.
[0079] Figure 11 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. (As follows) Figure 11 As shown, the electronic device 1100 may include at least one processor 1101, working memory 1102, I / O device 1104, display device 1105, storage device 1106 and communication interface 1107 that are capable of communicating with each other via system bus 1103.
[0080] Processor 1101 may be a single processing unit or multiple processing units, and all processing units may include single or multiple computing units or multiple cores. Processor 1101 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuits, and / or any device that manipulates signals based on operating instructions. Processor 1101 may be configured to acquire and execute computer-readable instructions stored in working memory 1102, storage device 1106, or other computer-readable media, such as program code of operating system 1102a, program code of application program 1102b, etc.
[0081] Working memory 1102 and storage device 1106 are examples of computer-readable storage media for storing instructions executed by processor 1101 to perform the various functions described above. Working memory 1102 may include both volatile and non-volatile memory (e.g., RAM, ROM, etc.). Furthermore, storage device 1106 may include hard disk drives, solid-state drives, removable media including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CDs, DVDs), storage arrays, network-attached storage, storage area networks, etc. Working memory 1102 and storage device 1106 may be collectively referred to herein as memory or computer-readable storage media, and may be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code, which may be executed by processor 1101 as a specific machine configured to perform the operations and functions described in the examples herein.
[0082] I / O device 1104 may include input devices and / or output devices. Input devices may be any type of device capable of inputting information to electronic device 1100, and may include, but are not limited to, a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. Output devices may be any type of device capable of presenting information, and may include, but are not limited to, video / audio output terminals, vibrators, and / or printers.
[0083] The communication interface 1107 allows the electronic device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and / or chipsets, such as Bluetooth™ devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices and / or the like.
[0084] The application program 1102b in working register 1102 can be loaded to execute the various methods and processes described above, for example... Figure 1 Steps S101-S104 in the above description. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 1100 via the storage device 1106 and / or the communication interface 1107. When the computer program is loaded and executed by the processor 1101, one or more steps included in at least one of the above-described image generation method and page display method may be performed.
[0085] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0086] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0087] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0088] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0089] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0090] A computing system may include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other.
[0091] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0092] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. An image generation method, comprising: Get multiple source images corresponding to multiple source materials; Based on the parameter information of the multiple materials, the arrangement information of the multiple material images is obtained. The parameter information includes the content information of each of the multiple materials. The content information of each material is used to indicate the corresponding content category of the material. The arrangement information includes the layer order information of the multiple material images, the relative position information of the multiple material images, and the relative size information of the multiple material images. as well as The target image is generated by overlaying or collaging the multiple source images based on their arrangement information.
2. The method according to claim 1, wherein, The process of obtaining the arrangement information of the multiple source images includes: The parameter information of the multiple materials is input into the image parameter generation model to obtain the arrangement information of the multiple material images output by the image parameter generation model.
3. The method according to claim 2, wherein, The image parameter generation model includes a generation model, which is trained using a discriminative model, and wherein obtaining the arrangement information of the multiple source images includes: The parameter information of the multiple materials is input into the generation model to obtain the arrangement information of the multiple material images output by the generation model.
4. The method according to claim 1, wherein, The step of generating a target image by overlaying or collaging the multiple source images based on their arrangement information includes: Based on the relative size information of the multiple source images, adjust the size of the multiple source images; and Based on the layer order and relative position information of the multiple source images, the resized source images are sequentially superimposed to generate the target image.
5. The method according to claim 1, wherein, The source image is a two-dimensional image or a three-dimensional image.
6. The method according to claim 2 or 3, wherein, The image parameter generation model was trained through the following process: Obtain the actual arrangement information of multiple sample material images and the parameter information of the multiple sample material images, wherein the parameter information includes the content information of each of the multiple sample material images; The parameter information of the multiple sample materials is input into the image parameter generation model, and the predicted arrangement information of the multiple sample material images output by the image parameter generation model is obtained. as well as Based on the actual layout information and the predicted layout information, the parameters of the image parameter generation model are adjusted.
7. The method according to claim 6, wherein, When the image parameter generation model includes a generation model and the generation model is trained using a discriminative model... The parameter information of the multiple sample materials is respectively input into the discrimination model and the generation model, the predicted layout information is the output of the generation model, and the actual layout information and the predicted layout information are also input into the discrimination model. Furthermore, the step of tuning the image parameter generation model based on the actual layout information and the predicted layout information includes: The parameters of the discrimination model and the generation model are tuned based on the similarity between the actual layout information and the predicted layout information.
8. The method according to claim 7, wherein, The training process of the discriminative model includes: Input the parameter information of the multiple sample materials into the generation model, and obtain the initial predicted layout information output by the generation model; The parameter information of the multiple sample materials, the initial predicted layout information, and the actual layout information are input into the discrimination model, and the first similarity between the initial predicted layout information and the actual layout information output by the discrimination model is obtained; and The discrimination model is tuned based on the first similarity score. The training process of the generative model includes: After the discrimination model is trained, the parameter information of the multiple sample materials is input into the generation model; The predicted layout information output by the generative model, the parameter information of the multiple sample materials, and the actual layout information are input into the discriminative model, and a second similarity is obtained between the initial predicted layout information output by the discriminative model and the actual layout information; and The generative model is tuned based on the second similarity.
9. The method according to claim 6, wherein the training process further comprises: A target image is generated based on the multiple sample material images and the predicted arrangement information of the multiple sample material images; Determine the corresponding evaluation score for the target image; as well as In response to the target image's corresponding evaluation score not meeting the preset conditions, the arrangement of multiple sample material images in the target image is adjusted using preset rules so that the target image's corresponding evaluation score meets the preset conditions. The image parameter generation model is trained using multiple sample images corresponding to the adjusted target image and the predicted arrangement information of the multiple sample images.
10. A page display method for an order system, the method comprising: Obtain the user's order information, which includes multiple materials; The target image corresponding to the order information is generated using the method described in any one of claims 1-9; as well as The target image is displayed on the order display page.
11. The method of claim 10, further comprising: Based on the user's order information, obtain recommendation information for that user; Based on the recommendation information, obtain the materials to be recommended; Add the material to be recommended to the target image. Furthermore, the target image is displayed on the order display page after the added recommended material is shown.
12. The method of claim 10, further comprising: Based on the user's historical order information, obtain the user's preference information related to the multiple materials; Based on the user's preference information, the arrangement of multiple source images in the target image is adjusted. The target image, after its adjusted layout, is displayed on the order display page.
13. The method of claim 10, further comprising: Based on the user's relevant information, obtain the target background image for the user; Add the target image to the target background image. Furthermore, the target image, with the target background image as its background, is displayed on the order display page.
14. The method of claim 10, further comprising: Based on the user's order information, obtain order interaction information; Based on the order interaction information, obtain order interaction materials; In response to the user's input interaction, the order interactive material is added to the target image.
15. An image generation apparatus, comprising: The first acquisition unit is configured to acquire multiple material images corresponding to multiple materials; The second acquisition unit is configured to acquire the arrangement information of the multiple materials based on the parameter information of the multiple materials. The parameter information includes the content information of each of the multiple materials. The content information of each material is used to indicate the corresponding content category of the material. The arrangement information includes the layer order information of the multiple material images, the relative position information of the multiple material images, and the relative size information of the multiple material images. as well as The generation unit is configured to generate a target image by superimposing or collaging the multiple source images based on their arrangement information.
16. A page display device for an order system, the device comprising: The acquisition unit is configured to acquire the user's order information, which includes multiple materials. The image generation apparatus as described in claim 15 is configured to generate a target image corresponding to the order information; as well as The display unit is configured to display the target image on the order display page.
17. An electronic device comprising: At least one processor; as well as A memory that is communicatively connected to the at least one processor; in The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-14.
18. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-14.
19. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the method of any one of claims 1-14.
Citation Information
Patent Citations
Picture generation method and system, electronic equipment and storage medium
CN110750666A
Method and device for generating commodity object dynamic image and electronic equipment
CN112652038A