Image generation system and method
The image generation system converts text and image information into feature sequences to generate high-quality and efficient images, solving the problems of low design efficiency and insufficient image generation capabilities in clothing design, and realizing automation, large-scale batch design and high-resolution rate image generation.
Patent Information
- Application Number
- CN202111165351.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Existing technology relies on manual design in the field of clothing design, resulting in low design efficiency, high cost, and inability to achieve large-scale batch design. Moreover, existing image generation methods cannot effectively utilize multi-modal data, resulting in a limited number of generated images and control. Inadequate power, slow generation and insufficient resolution.
Provide an image generation system and method that obtains text control information, image control information and original image information through an information acquisition component, uses the image generation component to convert these information into feature sequences, and generates high-quality and efficient images, including image control The information is converted into a first feature sequence, and the original image information is converted into a second feature sequence, part of which is a mask sequence, and images are generated based on these feature sequences to realize automatic generation of images.
It improves the quality and efficiency of image generation, reduces costs, supports large-scale batch design, enhances the practicality of the image generation system, and can automatically generate high-resolution images to meet personalized needs.
Smart Images

Figure CN113989420B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image generation system and method. Background Art
[0002] In product manufacturing scenarios, the products being manufactured often correspond to design drawings, and design images are generally obtained through manual design operations by designers. For example, in the field of clothing design, in the process of clothing design, designers often need to refer to existing manufacturing styles to design new manufacturing styles. Since it relies entirely on manpower, the design efficiency of related products in manufacturing scenarios is not high, the design cost is also high, and large-scale batch design cannot be achieved. Summary of the invention
[0003] Multiple aspects of the present application provide an image generation system and method that can automatically generate images based on multimodal data, improve the quality and efficiency of image generation, and reduce the cost of image generation, which is conducive to large-scale batch production and design.
[0004] In a first aspect, an embodiment of the present application provides an image generation system, comprising:
[0005] An information acquisition component, used to acquire text control information, image control information and original image information;
[0006] An image generation component, configured to convert the image control information into a first feature sequence, and convert the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region requiring an image generation operation;
[0007] The image generation component is also used to generate at least one first image based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0008] In a second aspect, an embodiment of the present application provides an image generation method, including:
[0009] Obtain text control information, image control information and original image information;
[0010] Converting the image control information into a first feature sequence, and converting the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region that requires an image generation operation;
[0011] At least one first image is generated based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0012] In a third aspect, an embodiment of the present application provides an image generating device, including:
[0013] A first acquisition module, used to acquire text control information, image control information and original image information;
[0014] A first determination module, configured to convert the image control information into a first feature sequence, and convert the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region that requires an image generation operation;
[0015] The first processing module is used to generate at least one first image based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0016] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the image generation method in the above-mentioned second aspect.
[0017] In a fifth aspect, an embodiment of the present invention provides a computer storage medium for storing a computer program, wherein the computer program enables a computer to implement the image generation method in the second aspect when executed.
[0018] In a sixth aspect, an embodiment of the present invention provides a computer program product, comprising: a computer program, which, when executed by a processor of an electronic device, causes the processor to execute the steps in the address allocation method shown in the second aspect above.
[0019] In an embodiment of the present application, text control information, image control information and original image information are acquired through an information acquisition component, and then the image control information is converted into a first feature sequence and the original image information is converted into a second feature sequence using an image generation component, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region where an image generation operation is required, and based on the text control information, the first feature sequence and the second feature sequence, at least one first image is generated, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information, and effectively realizes the automatic generation of images based on multimodal data such as text control information and image control information, thereby ensuring the quality and efficiency of image generation, reducing the cost of image generation, and facilitating large-scale batch production and design, further improving the practicality of the image generation system.
[0020] In a seventh aspect, an embodiment of the present application provides an image generation method, comprising:
[0021] In response to invoking the image generation request, a processing resource corresponding to the image generation service is determined.
[0022] The processing resources are used to perform the following steps: obtaining text control information, image control information and original image information; converting the image control information into a first feature sequence, and converting the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region where an image generation operation is required; and generating at least one first image based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0023] In an eighth aspect, an embodiment of the present application provides an image generating device, including:
[0024] The second determining module is used to determine the processing resources corresponding to the image generation service in response to the image generation request.
[0025] The second processing module is used to use the processing resources to perform the following steps: obtain text control information, image control information and original image information; convert the image control information into a first feature sequence, and convert the original image information into a second feature sequence, at least part of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize the image area where an image generation operation is required; based on the text control information, the first feature sequence and the second feature sequence, generate at least one first image, the first image including an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0026] In the ninth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the image generation method in the above-mentioned seventh aspect.
[0027] In a tenth aspect, an embodiment of the present invention provides a computer storage medium for storing a computer program, wherein the computer program enables a computer to implement the image generation method in the seventh aspect when executed.
[0028] In the eleventh aspect, an embodiment of the present invention provides a computer program product, comprising: a computer program, when the computer instructions are executed by one or more processors, causing the one or more processors to execute the steps in the image generation method shown in the seventh aspect above.
[0029] In a twelfth aspect, an embodiment of the present invention provides an image generation method, including:
[0030] Acquire text control information, clothing image control information and original image information;
[0031] Based on the clothing image control information, determining at least one clothing focus area;
[0032] At least one target clothing image is generated based on the text control information, the at least one clothing focus area and the original image information, wherein the target clothing image includes an image obtained by fusion processing of the text control information, the at least one clothing focus area and the original image information.
[0033] In a thirteenth aspect, an embodiment of the present invention provides an image generating device, including:
[0034] The third acquisition module is used to acquire text control information, clothing image control information and original image information;
[0035] A third determination module, configured to determine at least one clothing focus area based on the clothing image control information;
[0036] The third processing module is used to generate at least one target clothing image based on the text control information, the at least one clothing focus area and the original image information, wherein the target clothing image includes an image obtained by fusion processing of the text control information, the at least one clothing focus area and the original image information.
[0037] In the fourteenth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the image generation method in the above-mentioned twelfth aspect.
[0038] In a fifteenth aspect, an embodiment of the present invention provides a computer storage medium for storing a computer program, wherein the computer program enables a computer to implement the image generation method in the twelfth aspect when executed.
[0039] In the sixteenth aspect, an embodiment of the present invention provides a computer program product, comprising: a computer program, when the computer instructions are executed by one or more processors, causing the one or more processors to execute the steps in the image generation method shown in the above-mentioned twelfth aspect.
[0040] In this embodiment, by acquiring text control information, clothing image control information and original image information, at least one clothing focus area is determined based on the clothing image control information, and at least one target clothing image is generated based on the text control information, at least one clothing focus area and the original image information, thereby effectively realizing the ability to automatically generate the same clothing image based on multimodal data such as text control information and clothing image control information, improving the design quality and efficiency of the same clothing image, reducing the image generation cost, and being conducive to the large-scale batch production and design of clothing, further improving the practicability of the image generation method, and being conducive to market promotion and application. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0042] Figure 1 A schematic diagram of a scene of an image generation system according to an exemplary embodiment of the present application;
[0043] Figure 2 A schematic diagram of the principle of an image generation system according to an exemplary embodiment of the present application;
[0044] Figure 3 A schematic flow chart of an image generating method according to an exemplary embodiment of the present application;
[0045] Figure 4 A schematic flow chart of an image generating method according to another exemplary embodiment of the present application;
[0046] Figure 5A flowchart of an image generating method according to another exemplary embodiment of the present application is shown;
[0047] Figure 6 A flowchart of an image generating method according to another exemplary embodiment of the present application is shown;
[0048] Figure 7 A schematic flow chart of an image generating method according to another exemplary embodiment of the present application;
[0049] Figure 8 A flowchart of an image generating method according to another exemplary embodiment of the present application is shown;
[0050] Fig. 9 A schematic flow chart of an image generating method according to another exemplary embodiment of the present application;
[0051] Fig.10 A schematic structural diagram of an image generating device according to an exemplary embodiment of the present application;
[0052] Fig.11 For Fig.10 A schematic diagram of the structure of an electronic device corresponding to the image generating device provided in the illustrated embodiment;
[0053] Fig.12 A schematic structural diagram of an image generating device according to another exemplary embodiment of the present application;
[0054] Fig.13 For Fig.12 A schematic diagram of the structure of an electronic device corresponding to the image generating device provided in the illustrated embodiment;
[0055] Fig.14 A schematic structural diagram of an image generating device according to another exemplary embodiment of the present application;
[0056] Fig.15 For Fig.14 A schematic structural diagram of an electronic device corresponding to the image generating device provided in the illustrated embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "an", "the" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the inclusion of at least one.
[0059] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0060] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0061] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.
[0062] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0063] In order to facilitate those skilled in the art to understand the technical solutions provided by the embodiments of the present application, the relevant technologies are described below:
[0064] In product manufacturing scenarios, the products produced often correspond to design drawings, and the design drawings are generally obtained through manual design operations by designers. For example, in the field of clothing design, in the process of clothing design, designers often need to refer to existing manufacturing styles to design new manufacturing styles. Since it relies entirely on manpower, the design efficiency of related products in manufacturing scenarios is not high, the design cost is also high, and large-scale batch design is not possible.
[0065] Since the field of clothing design has a strong demand for automated and efficient design, the relevant technology provides a clothing generation method based on a deep learning algorithm. This method can generate an image generation model based on the deep learning algorithm and training data in advance. The image generation model can generate an image based on a single control signal such as text or image material.
[0066] For example, when a user wants to generate a jeans image, the user can input a "jeans" text control signal in the image generation model, and the image generation model can generate multiple corresponding images based on the text control signal, that is, it can generate a variety of multiple jeans images, such as: jeans images of various colors, jeans images of various materials, jeans images of various features, etc.
[0067] However, the above method cannot use multimodal data as a control signal, so that the number of jeans images generated by the above image generation method is large. This often requires manual image screening operations in multiple jeans images to select target images that meet the conditions. In addition, in the clothing design scenario, every clothing merchant hopes to have automated clothing design capabilities so that they can perform large-scale selection and trial and error operations, which is conducive to speeding up the design of new products; and the image categories generated in the above implementation method are limited, and the same style cannot be expanded, so that the free control of the generated images cannot be satisfied. There is often a large gap between the generated images and the target images that the designer wants. Therefore, it is urgent to improve the control ability of the generated images. In addition, since the control signal used to generate the image is a single signal, the control ability of the image generation is insufficient, the image generation speed is too slow, and the resolution is insufficient, thereby reducing the practicality of the image generation method.
[0068] In addition, the related art provides a two-stage image generation method, which can generate a corresponding image using text information as a control signal. However, the above image generation method has the following defects: (1) It is impossible to generate an image based on a multimodal control signal. (2) Because the autoregressive method is used in the two stages, the generation speed is slow and the consistency of the generated image is poor. (3) Only 256*256 resolution images can be generated, and high-definition images cannot be generated; if a high-resolution image is to be generated, the quality of the generated image cannot be guaranteed. For example, if an image with a resolution of 800*800 is to be generated, the length of the image to be processed can reach several thousand, which greatly reduces the quality and efficiency of image generation.
[0069] In order to solve the above technical problems, refer to the attached Figure 1As shown, this embodiment provides an image generation system and method, wherein the image generation system can be implemented as software, or a combination of software and hardware, and the image generation system can be communicated with a client / requester to implement image generation operations.
[0070] Among them, the client / requester can be any computing device with a certain data transmission capability. In addition, the basic structure of the client may include: at least one processor. The number of processors depends on the configuration and type of the client. The client may also include a memory, which may be volatile, such as RAM, or non-volatile, such as read-only memory (ROM), flash memory, etc., or may include both types at the same time. The memory usually stores an operating system (OS), one or more application programs, and may also store program data, etc. In addition to the processing unit and the memory, the client also includes some basic configurations, such as a network card chip, an IO bus, a display component, and some peripheral devices, etc. Optionally, some peripheral devices may include, for example, a keyboard, a mouse, an input pen, a printer, etc. Other peripheral devices are well known in the art and will not be described in detail here. Optionally, the client may be a PC (personal computer) terminal, a handheld terminal (e.g., a smart phone, a tablet computer), etc.
[0071] An image generation system refers to a device that can provide image generation services in a network virtual environment, usually a device that uses the network to perform information planning and image generation operations. In physical implementation, an image generation system can be any device that can provide computing services, respond to service requests, and perform processing. In this case, the image generation system can be implemented as a cluster server, conventional server, cloud server, cloud host, virtual center, etc. The composition of the image generation system mainly includes processors, hard disks, memory, system buses, etc., which are similar to general computer architectures.
[0072] In the above embodiment, the client can establish a network connection with the image generation system, and the network connection can be a wireless or wired network connection. If the client and the image generation device are connected by communication, the network standard of the mobile network can be any one of 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G+ (LTE+), WiMax, 5G, etc.
[0073] In an embodiment of the present application, the client may generate / obtain an image generation request, which may include text control information, image control information and original image information. The text control information and image control information are used as control signals for image generation, and the original image information may refer to image information that can characterize the size characteristics of the image to be generated. Specifically, this embodiment does not limit the specific implementation method for the client to generate / obtain an image generation request. For example, an interactive interface is provided on the client, and an execution operation input by the user is obtained through the interactive interface, and an image generation request is generated by executing the operation; or, a specific interface may be provided on the client, and the image generation request may be obtained through the specific interface. After obtaining the image generation request, the image generation request may be sent to the image generation device through a setting interface (including: mobile gateway, cloud gateway, etc.), so that the image generation device can analyze and process the uploaded image generation request.
[0074] For details, please refer to the attached Figure 2 As shown, the image generation system may include: an information acquisition component 101 and an image generation component 102 that is communicatively connected to the information acquisition component 101. In this embodiment, the deployment implementation of the information acquisition component 101 and the image generation component 102 is not limited. Optionally, these components are implemented as distributed deployment, and the overall system function is realized with the help of a cloud computing system. For example, the information acquisition component 101 and the image generation component 102 can both be deployed in the cloud, such as in a data center or a central cloud system. Alternatively, the image generation component 102 is deployed in the cloud, such as in a data center or a central cloud system, and is implemented as a cloud server, so as to take advantage of the resources on the cloud to run various neural network models that generate object images; relative to cloud deployment, the information acquisition component 101 can be deployed on various e-commerce platforms and user-side terminals to facilitate the collection of user behavior data and object description information. Regardless of where it is deployed, the information acquisition component 101 can be deployed on terminal devices such as desktop computers, laptops or smart phones, or on server-side devices such as conventional servers, cloud servers or server arrays.
[0075] The image generation system provided in the embodiment of the present application can be applied to various manufacturing industries. The manufacturing industry generally refers to the industry that uses certain resources (materials, energy, equipment, tools, funds, technology, information and manpower, etc.) in the mechanical industrial era, according to market requirements, through the manufacturing process, to transform into large-scale tools, industrial products and consumer products that can be used and utilized by people, such as but not limited to: food, clothing, tobacco, furniture, papermaking, printing, sports and entertainment products, medicine or chemical industry and other manufacturing industries. For the convenience of description and distinction, in the embodiment of the present application, the image generation system is used to generate the required object image for the first manufacturing industry as an example to start the description. Among them, the first manufacturing industry can be any industry that relies on object images for production and manufacturing, such as but not limited to: clothing industry, printing industry, daily necessities industry, home furnishing industry, electrical appliance industry or passenger car industry, etc. In particular, the first manufacturing industry can be a manufacturing industry that supports customer-to-manufacturer (C2M). The image generation system provided in the embodiment of the present application can meet the personalized customization needs of users, and can quickly, efficiently and high-quality generate object images that meet their customized needs for users.
[0076] For example, when the image generation system provided in the embodiment of the present application is applied to the food manufacturing industry, it can quickly and efficiently generate food sample images for the food manufacturing industry, and the food sample images include the shape style of the food, such as bear-shaped biscuits, or pig-shaped cakes, etc. For another example, when the image generation system provided in the embodiment of the present application is applied to the clothing manufacturing industry, it can quickly and efficiently generate clothing style images for the clothing manufacturing industry, and the service style images include the shape style of the clothing, such as a sweater with a drawstring and a hat, or a short blouse with puff sleeves, etc.
[0077] Regardless of what kind of manufacturing industry the first manufacturing industry is, the objects produced by the first manufacturing industry are usually diverse. In order to facilitate the reasonable management and distinction of the objects, these objects are classified into categories. There are obvious differences between objects under different object categories, and these differences are mainly reflected in some attributes of the objects. Among them, the objects produced by the first manufacturing industry can be finished products or semi-finished products in the manufacturing industry. After the finished products are put into use, they can also be called commodities, such as clothing, vehicles, home appliances, etc. In the embodiment of the present application, there is no focus on the classification of objects, nor is the dimension based on which the categories are divided. In this embodiment, the image generation system can generate the object images required for each object category with the object category in the first manufacturing industry as the granularity, which is conducive to reducing the processing burden of the image generation system and can ensure the generation of object images with higher precision.
[0078] Specifically, the information acquisition component 101 and the image generation component 102 in the image generation system can be used to perform the following steps respectively:
[0079] The information acquisition component 101 is used to receive an image processing request uploaded by a client, and then determine the text control information, image control information and original image information corresponding to the image processing request; or, the information acquisition component 101 can directly acquire the text control information, image control information and original image information. The text control information can refer to a word sequence of any length; the original image information is used to limit the size characteristics of the generated image, which can specifically be the image to be generated, the text control information is used as a text control signal for image generation, and the image control information is used as a visual control signal for image generation. In some instances, the image control information can include image material, and the image material can include one or more material dimensions.
[0080] The image generation component 102 is used to convert the image control information into a first feature sequence, wherein the number of the first feature sequences is one or more; and can convert the original image information into a second feature sequence, wherein at least part of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize the image area that needs to perform the image generation operation; based on the text control information, the first feature sequence and the second feature sequence, generate at least one first image, wherein the generated first image includes an image that is fused with the text control information, the image control information and the original image information.
[0081] Since the image control information is a visual control signal and belongs to a different modality from the text control signal, after acquiring the image control information and the original image information, the image control information and the original image information can be analyzed and processed respectively. Specifically, the image control information can be converted into at least one first feature sequence, and the original image information can be converted into a second feature sequence, wherein at least part of the second feature sequence is a mask sequence, and the mask sequence is used to characterize the image area that needs to be subjected to the image generation operation, that is, at least part of the second feature sequence needs to be subjected to the image generation operation. After generating the text control information, at least one first feature sequence and the second feature sequence, at least one first image can be generated based on the text control information, at least one first feature sequence and the second feature sequence, thereby effectively realizing that the image can be generated based on multi-modal control data, ensuring the quality and efficiency of the generated image, and meeting the personalized needs of different users.
[0082] For specific implementation, refer to the attached Figure 2As shown, the image generation system can implement a network model for analyzing and processing images, and the network model can use a two-stage image generation paradigm to implement the image generation operation. After the network model obtains the text control information, image control information and original image information used to generate the image, the image control information and the original image information can be encoded, so as to obtain at least one first feature sequence corresponding to the image control information and a second feature sequence corresponding to the original image information, wherein the dimensions corresponding to any two feature sequences in at least one first feature sequence are different.
[0083] In some instances, the network model includes: a first stage model for implementing encoding and decoding operations on an image and a second stage model for analyzing and processing the image. After the image control information is obtained, the image control information can be encoded by the first stage model, so that at least one image feature corresponding to the image control information can be obtained. Then, at least one image feature can be quantized using a preset mapping rule (codebook), wherein the preset mapping rule is composed of a series of learnable feature vectors, and the quantization process is to find the reference feature closest to the image feature from the preset mapping rule, and then use the encoding information corresponding to the reference feature as the first feature sequence corresponding to the image feature. It should be noted that different first feature sequences correspond to different dimensions of the image control information. For example: when the image control information includes material information such as texture, pattern, style, etc., then the generated first feature sequence can include: a first feature sequence corresponding to texture, a first feature sequence corresponding to pattern, and a first feature sequence corresponding to style, etc.
[0084] In some instances, in order to support image generation operations in multiple visual dimensions, encoding the image control information through the first stage model to obtain at least one image feature corresponding to the image control information may include: encoding the image control information through the encoder in the first stage model to obtain a control information encoding sequence corresponding to the image control information, and then using a preset segmentation identifier to divide the control information encoding sequence into at least one image feature corresponding to the image control information. It can be understood that the number of image features corresponding to the image control information can be configured according to specific application scenarios or application requirements, thereby realizing that image generation operations can be performed based on any number of multimodal control data.
[0085] For example, when the image control information is a clothing image input by the user, the clothing image includes: clothing color, clothing style, clothing texture, clothing pattern, etc. When the clothing image is analyzed and processed using the first-stage model, a control information coding sequence corresponding to the clothing image can be obtained, and the control information coding sequence includes: a color coding sequence corresponding to the clothing color, a style coding sequence corresponding to the clothing style, a texture coding sequence corresponding to the clothing texture, and a pattern coding sequence corresponding to the clothing pattern. In order to accurately obtain at least one image feature corresponding to the image control information, a segmentation mark (for example: [SEP]) can be added between the color coding sequence and the style coding sequence. Similarly, a segmentation mark (for example: [SEP]) is added between the style coding sequence and the texture coding sequence, and a segmentation mark (for example: [SEP]) is added between the texture coding sequence and the pattern coding sequence. Then, based on at least one image feature corresponding to the image control information, visual control signals of different dimensions corresponding to the image control information can be obtained.
[0086] Similarly, after acquiring the original image information, the original image information can be encoded to obtain a second feature sequence corresponding to the original image information, at least part of which is a mask sequence, that is, part or all of the encoding sequence in the second feature sequence is replaced by a preset mask [MASK]. Specifically, when the generated image is a complete image, all of the second feature sequence is a mask sequence; when the generated image is a part of an image, part of the second feature sequence is a mask sequence.
[0087] After obtaining the text control information, the first feature sequence and the second feature sequence, the text control information, the first feature sequence and the second feature sequence can be input into the second stage model. Among them, the second stage model can be implemented by a 24-layer encoder (BidirectionalEncoder Representation from Transformers, referred to as BERT) based on a bidirectional translation model (Transformer model) of a self-attention mechanism. It can be understood that the number of network layers implemented by the second stage model is not limited to the number of network layers described above. Specifically, the corresponding network configuration operation can be performed according to data processing resources and data processing requirements. In general, the more network layers, the better the image processing quality and efficiency, and more data processing resources will be consumed. After the second stage model obtains the text control information, the first feature sequence and the second feature sequence, the text features, the first feature sequence and the second feature sequence corresponding to the text control information can be analyzed and processed, so as to obtain at least one target image encoding for generating at least one first image. After obtaining at least one target image encoding, the target image encoding can be transmitted to the first stage model.
[0088] After the first-stage model obtains the target image code, the target image code can be restored to a target image feature sequence through a preset mapping rule, and then the target image feature sequence is decoded by the decoder in the first-stage model, thereby realizing a series of target image feature sequences being restored to at least one corresponding first image. It can be understood that the number of generated first images can be one or more. As can be seen from the above, the first-stage model can not only quantize the image into a corresponding feature sequence, but also restore a given feature sequence to an image.
[0089] In some instances, in order to improve the quality and efficiency of image generation, the text control information, the first feature sequence and the second feature sequence can be continuously analyzed and processed in a loop iteration manner so as to continuously obtain at least one target image code for generating at least one first image. Specifically, for the original image information, at least part of the second feature sequence corresponding to the original image information is a mask sequence, and the mask sequence is the data that needs to be predicted. Specifically, in some instances, the image generation component 102 generates at least one first image based on the text control information, the first feature sequence and the second feature sequence, which may include: determining a first mask to be predicted in the second feature sequence, the first mask to be predicted being part of the mask sequence; predicting the first mask to be predicted based on the text control information and the first feature sequence to obtain at least one first image feature sequence; and then decoding the at least one first image feature sequence to generate at least one first image, wherein the mask sequence ratio corresponding to the first image is less than the mask sequence ratio corresponding to the original image information.
[0090] In order to improve the quality and efficiency of image generation, the mask sequence in the original image information is gradually and iteratively predicted. In some instances, the image generation component 102 determines the first mask to be predicted in the second feature sequence, which may include: obtaining proportion information for limiting the first mask to be predicted; and randomly sampling the mask sequence in the second feature sequence to obtain the first mask to be predicted corresponding to the proportion information.
[0091] Among them, the proportion information for limiting the first mask to be predicted is pre-configured, and the proportion information can be configured according to the specific application scenario or application requirements, for example, the proportion information can be 10%, 15% or 5%, etc. After obtaining the proportion information for limiting the first mask to be predicted, the mask sequence in the second feature sequence can be randomly sampled based on the proportion information, so as to obtain the first mask to be predicted corresponding to the proportion information.
[0092] Specifically, the image generation component 102 randomly samples the mask sequence in the second feature sequence, which may include: performing random point sampling on the mask sequence in the second feature sequence, that is, determining the number of codes of the collected mask sequence based on the proportion information of the first mask to be predicted, and then randomly sampling the mask position that needs to be predicted, thereby realizing the point mask random sampling operation in the iterative process.
[0093] And / or, the image generation component 102 randomly samples the mask sequence in the second feature sequence, which may include: sampling all the mask sequences in the second feature sequence to implement an image completion operation for a whole image. For example, all the second feature sequences corresponding to the original image information are mask sequences. When the mask sequence is 256 masks, after sampling and predicting all the mask sequences, encoding values corresponding to the 256 masks can be generated, thereby implementing a prediction operation on the mask sequence.
[0094] And / or; The image generation component 102 randomly samples the mask sequence in the second feature sequence, which may include: performing random block sampling on the mask sequence in the second feature sequence, that is, randomly selecting a mask area of any size in the image, and then performing a prediction operation on the mask sequence in the above mask area. This sampling method is used to achieve the task of completing a partial image.
[0095] And / or, the image generation component 102 randomly sampling the mask sequence in the second feature sequence may include: sampling the area outside the random block in the mask sequence in the second feature sequence, that is, randomly selecting a mask area of any size in the image, and then performing a mask sequence prediction operation on the part outside the mask area. It is understandable that in different application scenarios / design requirements, different methods can be used to perform random sampling operations on the mask sequence in the second feature sequence.
[0096] After determining the first mask to be predicted, a prediction operation can be performed on the first mask to be predicted based on the text control information and the first feature sequence to obtain at least one first image feature sequence after the prediction, in which the mask sequence ratio in the first image feature sequence is less than the mask sequence ratio in the second feature image. After generating at least one first image feature sequence, at least one first image can be generated based on the at least one first image feature sequence.
[0097] In some instances, after generating at least one first image, in order to further improve the quality and efficiency of image generation, an iterative generation operation of the image can be performed based on a progressive non-autoregressive generation algorithm (PNAG). Specifically, the information acquisition component 101 in this embodiment can also be used to: obtain the image quality corresponding to each of the at least one first image; the image generation component 102 is used to determine a target image in the at least one first image based on the image quality corresponding to each of the at least one first image; iteratively predict the mask sequence corresponding to the target image based on the text control information and the first feature sequence to generate at least one second image, and the mask sequence ratio corresponding to the second image is less than the mask sequence ratio corresponding to the first image.
[0098] Among them, the information acquisition component 101 acquires the image quality corresponding to each of the at least one first image, which may include: acquiring the correlation between the text control information and the image control information and each of the first images; determining the authenticity corresponding to each of the at least one first image; and determining the image quality corresponding to each of the at least one first image based on the correlation and the authenticity.
[0099] After acquiring at least one first image, the text control information, the image control information and each first image can be analyzed and processed to obtain the correlation between the text control information and the image control information and each first image. Specifically, a first network model for analyzing and processing the text control information and the image control information and each first image is pre-trained. It can be understood that the first network model is a linear classifier for binary classification, which is used to determine the correlation between the control signal and the currently generated image. When training the first network model, negative samples can be obtained by exchanging the control signals of any two training instances.
[0100] After obtaining the text control information, the image control information and each first image, the text control information, the image control information and each first image can be input into the first network model to obtain the correlation between the text control information and the image control information and each first image. Specifically, the correlation can be identified by token [REL], which can be represented by a numerical value between 0 and 1. The closer the numerical value is to 1, the higher the correlation between the text control information and the image control information and the first image; the closer the numerical value is to 0, the lower the correlation between the text control information and the image control information and the first image.
[0101] Similarly, a second network model is pre-trained for analyzing and processing the authenticity of each first image. When training and generating the second network model, a real data set can be used as a positive sample. As for negative samples, since there are no "unreal" negative samples, the method in this embodiment can use a synthesized image as a negative sample to perform a model training operation. At this time, after obtaining each first image (including: the first image after the first image generation operation, the first image after multiple iterations), the first image can be input into the second network model to obtain the authenticity of the first image. The authenticity is used to identify abnormal conditions such as the degree of distortion of the image and the degree of abnormality of the object in the image. The authenticity can be identified by [FDL]. It can be understood that the higher the degree of distortion of the image, the lower the authenticity of the image; the lower the degree of distortion of the image, the higher the authenticity of the image.
[0102] After obtaining the correlation degree and the authenticity, the correlation degree and the authenticity can be analyzed and processed to determine the image quality corresponding to each of the at least one first image. In some instances, based on the correlation degree and the authenticity, determining the image quality corresponding to each of the at least one first image can include: taking a weighted sum of the correlation degree and the authenticity, thereby obtaining the image quality of the first image.
[0103] In some instances, the image generation component 102 iteratively predicts a mask sequence corresponding to the target image based on the text control information and the first feature sequence, and generating at least one second image may include: obtaining a second mask to be predicted corresponding to the target image, the second mask to be predicted is different from the first mask to be predicted; predicting the second mask to be predicted based on the text control information and the first feature sequence to obtain a second image feature sequence; and generating at least one second image based on the second image feature sequence.
[0104] After obtaining the image quality corresponding to each of the at least one first image, a target image can be determined in the at least one first image based on the image quality corresponding to each of the at least one first image; in some instances, the first image with the highest image quality can be determined as the target image in all the first images. After obtaining the target image, the mask sequence corresponding to the target image can be iteratively predicted based on the text control information and the first feature sequence (the number can be at least one). Specifically, in the process of predicting the mask sequence of the original image information using the progressive non-autoregressive generation algorithm (PNAG algorithm), the mask value of each position can correspond to multiple prediction values, each prediction value can correspond to a different confidence, and then multiple different prediction values can be collected for each mask position based on the confidence as input samples, for example: 5, 10 or 15 multiple prediction values with different confidence distributions can be used as input samples for iterative prediction operations, so as to generate at least one second image, and the mask sequence ratio corresponding to the second image is less than the mask sequence ratio corresponding to the first image. This effectively achieves the goal of selecting a higher-quality image mask sequence and superimposing it on the original image information during the continuous image processing process, thereby ensuring that the proportion of the mask sequence in the image generated by continuous iterative prediction will become smaller and smaller, further improving the quality and efficiency of image generation.
[0105] It should be noted that in the process of continuously iteratively generating images, when the number of iterations is less than a preset threshold, the proportion of mask sequences in the image generated by the iterative prediction operation will become smaller and smaller, and the quality of the generated image will gradually increase; when the number of iterations is higher than the preset threshold, the quality of the generated image will not increase significantly. Therefore, in order to obtain a high-quality image, the iterative operation of the image can be effectively controlled. Specifically, the image generation component 102 is used to obtain multiple image sets obtained after multiple iterative predictions after generating at least one second image, each image set including at least one second image; determine the image quality change trend corresponding to the multiple image sets; and control the iterative prediction operation of the target image based on the image quality change trend.
[0106] In some instances, the image generation component 102 controls the iterative prediction operation of the target image based on the image quality change trend, which may include: stopping the iterative prediction operation on the target image when the image quality change trend is not on an upward trend; or continuing the iterative prediction operation on the target image when the image quality change trend is on an upward trend.
[0107] For example, after performing the first iteration operation, a first image set can be obtained, after performing the second iteration operation based on the first image set, a second image set can be obtained, and after performing the third iteration operation based on the second image set, a third image set can be obtained. It can be understood that each of the above different image sets can include at least one second image.
[0108] After acquiring the first image set, the second image set and the third image set, the image quality representative 1 (which may be the average quality corresponding to all second images, the maximum quality corresponding to all second images, or the quality variance corresponding to all second images, etc.) of at least one second image included in the first image set, the image quality representative 2 of at least one second image included in the second image set, and the image quality representative 3 of at least one second image included in the third image set may be acquired respectively.
[0109] After obtaining the image quality representative 1, image quality representative 2 and image quality representative 3 to obtain the image quality change trend, when image quality representative 1 < image quality representative 2 < image quality representative 3, it means that the image quality change trend is in an upward trend. At this time, in order to obtain a higher quality image, the iterative prediction operation of the image can be continued. When image quality representative 1 < image quality representative 2 > image quality representative 3, image quality representative 1 > image quality representative 2 < image quality representative 3, or image quality representative 1 > image quality representative 2 > image quality representative 3, it means that the image quality change trend is not in an upward trend. At this time, the iterative prediction operation of the image can be stopped.
[0110] In the above implementation process, the PNAG algorithm can determine the correlation between the text control information, the image control information and the generated image, and the authenticity of the generated image to guide the non-autoregressive iteration generation direction of the image, rather than unconsciously performing the image iterative processing operation, which effectively ensures the quality and efficiency of the image iterative operation. At the same time, since the image quality of the generated image can be obtained in each iterative operation, if the image quality does not increase within multiple iterative operations, the iterative prediction operation of the image can be stopped, thereby effectively realizing that it does not need to iterate a fixed number of steps, and can perform different degrees of iterative operations based on different application scenarios, thereby improving the flexibility and reliability of the method.
[0111] In some other examples, in order to meet the need of quickly generating high-definition pictures, after acquiring the second image, the image generation component 102 can be used to: acquire the image resolution of the second image, and when the image resolution is less than the set resolution, adjust the resolution of the second image to obtain a third image, and the image resolution of the third image is the set resolution. For example, after acquiring the second image with an image resolution of 256*256, the second image can be processed using a pre-established image generation model for adjusting the resolution, for example: adjusting the image resolution from 256*256 to 512*512, or adjusting the image resolution from 256*256 to 800*800, thereby effectively achieving the generation of high-resolution or ultra-high-resolution high-definition images (i.e., images with an image resolution exceeding 512*512). It should be noted that the above-mentioned image generation model only needs to focus on the adjustment operation of the image resolution, which not only improves the quality and efficiency of image processing, but also the training speed of the image generation model is faster.
[0112] In other examples, when the generated second image is adjusted to a third image with a higher resolution, some pixels in the third image may be distorted. In this case, a self-correcting iterative algorithm can be used to improve the image quality of the third image. Optionally, after obtaining the third image, the image generation component 102 can be used to: obtain the confidence corresponding to the third image; determine the image area in the third image whose confidence is less than a preset threshold; predict the image area to obtain the predicted area; and generate a fourth image corresponding to the third image based on the predicted area and the third image.
[0113] Specifically, after acquiring the third image, the confidence corresponding to each pixel in the third image can be acquired. Since the unreal area is often in pieces, if the third image is randomly sampled, it is difficult to produce the self-correction effect of the image. Therefore, after acquiring the confidence corresponding to each pixel in the third image, the image area with a confidence less than a preset threshold can be determined based on the confidence corresponding to each pixel. After acquiring the image area, the image area can be predicted, thereby obtaining the predicted area by randomly sampling the third image. After acquiring the predicted area and the third image, a fourth image corresponding to the third image can be generated based on the predicted area and the third image. In short, after iteratively generating the third image, the mask value can be used to replace the part with a lower confidence in the third image, and then the image area can be predicted to achieve the regeneration operation of the third image, thereby ensuring the quality and efficiency of high-definition image acquisition.
[0114] In some other instances, the image generation component 102 in this embodiment can be used to: obtain multiple area information corresponding to image control information; determine the generation difficulty corresponding to each of the multiple area information, wherein the generation difficulty is used to reflect the style novelty of the area information; based on the generation difficulty, determine the target area included in the image control information; and generate at least one first image corresponding to the target area.
[0115] Specifically, the above-mentioned image generation system in this embodiment can be applied to various application scenarios to implement different image processing operations. For example, when the image generation method is applied to the field of clothing, the generation operation of the same clothing can be implemented. Specifically, for clothing, if a certain area of clothing is difficult to generate, the area often has at least one of the following characteristics: (1) relatively complex, such as some textures, patterns, etc.; (2) relatively novel, such as asymmetrical design, then it means that the area is "special" relative to other areas, and the same clothing is often generated based on the above-mentioned special areas. Therefore, the difficulty of area generation can be used as a novelty score, and the novelty score can be used to select one or more areas in the entire clothing area to automatically generate the same clothing. Specifically, the information acquisition component 101 and the image generation component 102 in the image generation system can be used to perform the following steps:
[0116] Step 1: Use the information acquisition component 101 to acquire text control information, reference clothing images, and size information of clothing images to be generated.
[0117] Step 2: Utilize the image generation component 102 to obtain a plurality of region information corresponding to the reference clothing image.
[0118] Step 3: Utilize the image generation component 102 to encode the reference clothing image and the clothing image to be generated, respectively, so as to obtain at least one first feature sequence corresponding to the reference clothing image and a second feature sequence corresponding to the clothing image to be generated.
[0119] Step 4: The image generation component 102 determines the generation difficulty corresponding to each of the plurality of region information based on the feature sequence corresponding to each region information.
[0120] Wherein, determining the generation difficulty corresponding to each of the plurality of regional information may include: obtaining a network model for analyzing and processing the regional information; processing the plurality of regional information using the network model to obtain the generation difficulty corresponding to each of the plurality of regional information, the generation difficulty being used to reflect the novelty of the style of the regional information. Specifically, the feature sequence corresponding to the regional information may be analyzed and processed using a preset model to obtain the average production score corresponding to the regional information, and the generation difficulty corresponding to the regional information may be determined based on the average production score. It can be understood that the average production score is negatively correlated with the generation difficulty, that is, the lower the average production score, the more novel the style of the regional information is, that is, the more difficult the regional information is to generate.
[0121] Step 5: The image generation component 102 determines the target area included in the reference clothing image based on the generation difficulty.
[0122] After obtaining the generation difficulty, the generation difficulty can be analyzed and compared with the preset threshold. When the generation difficulty is greater than or equal to the preset threshold, it means that the pattern and style of the regional information corresponding to the generation difficulty are relatively novel, and then the regional information corresponding to the above-mentioned generation difficulty can be determined as the target area included in the reference clothing image, and the target area is the area included in the same clothing to be generated, wherein the number of the obtained target areas can be one or more, specifically, one or more areas with higher novelty can be selected as the target area (i.e., image control information), so that a variety of clothing images of the same style can be automatically generated.
[0123] Step 6: After determining the target area included in the reference clothing image, the image generation component 102 can generate at least one target clothing image based on the text control information and at least one first feature sequence and second feature sequence corresponding to the target area. The target clothing image includes the target area, that is, the target clothing image includes the same style, pattern or pattern as the reference clothing image.
[0124] The image generation system provided in this embodiment obtains text control information, image control information and original image information through the information acquisition component 101, and then flexibly generates images for analysis and processing of multimodal control signals such as text control information and image control information through the image generation component 102, so as to realize unified processing operation of multimodal data to generate images. Specifically, the image generation system adopts a two-stage paradigm to realize image processing operation, and introduces a non-autoregressive generation algorithm based on BERT in the second stage of the two-stage paradigm, so that it can not only realize the generation of images based on multimodal data such as text control information and image control information as control signals, but also can be based on the correlation between the text control information and the image control information and the generated image and the image quality of the generated image as the input signal of the image loop iteration prediction operation, thereby ensuring the quality and efficiency of image generation. In addition, the image generation system uses non-autoregressive generation to generate all feature sequences at one time, and the generation time of the feature sequence is only related to the number of iterations and has nothing to do with the sequence length. The image processing speed is fast, and any two feature sequences can interact with each other, which is conducive to improving the consistency of image generation. In addition, the image generation system can also generate high-resolution or ultra-high-resolution images in combination with a network model for generating super-resolution images. When the image generation system is applied to the field of clothing, it can automatically discover trend elements or areas of interest in clothing, and can generate images of the same clothing based on trend elements or areas of interest. The above implementation process effectively realizes the automatic generation operation of the image, further improving the flexibility and reliability of the use of the image generation system.
[0125] The following describes in detail the application scenarios and processing procedures of the image generation method in conjunction with the method embodiments.
[0126] Figure 3 This is a flow chart of an image generation method according to an exemplary embodiment of the present application; Figure 3 As shown, this embodiment provides an image generation method. The execution subject of the image generation method may be an image generation device. The image generation device may be implemented as software or a combination of software and hardware. Specifically, the image generation method may include:
[0127] Step S301: Acquire text control information, image control information and original image information.
[0128] Step S302: converting the image control information into a first feature sequence, and converting the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region that requires an image generation operation.
[0129] Step S303: generating at least one first image based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0130] The following is a detailed description of the above steps:
[0131] Step S301: Acquire text control information, image control information and original image information.
[0132] Among them, the text control information, image control information and original image information are used as control signals for image generation operations. The above-mentioned text control information can refer to a keyword sequence of any length, which is used as a text control signal for image generation; the original image information is used to limit the size characteristics of the generated image. In some instances, the original image information can be an image to be generated; the image control information is used as a visual control signal for image generation. The image control information can be an image material, and the image material can include one or more material dimensions. Specifically, this embodiment does not limit the specific implementation method for obtaining text control information, image control information and original image information. For example, an interactive interface is set on the client, and the execution operation input by the user is obtained through the interactive interface, and the text control information, image control information and original image information are obtained through the execution operation; or a specific interface can be set on the client, and the text control information, image control information and original image information can be obtained through the specific interface. After obtaining the text control information, image control information and original image information, the text control information, image control information and original image information are sent to the image generation device through the setting interface, so that the image generation device obtains the text control information, image control information and original image information.
[0133] Step S302: converting the image control information into a first feature sequence, and converting the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region that requires an image generation operation.
[0134] Since both the image control information and the original image information are visual control signals, and the text control information and the above-mentioned image control information belong to data of different modalities, in order to be able to perform fusion processing on multimodal data, after obtaining the image control information and the original image information, the image control information and the original image information can be respectively converted to determine at least one first feature sequence corresponding to the image control information and a second feature sequence corresponding to the original image information, at least part of the second feature sequence is a mask sequence, and the mask sequence is used to characterize the image area where the image generation operation needs to be performed. Specifically, when a complete image needs to be generated, all of the second feature sequence is a mask sequence; when a part of the image needs to be completed, part of the second feature sequence is a mask sequence.
[0135] In some instances, converting the image control information into a first feature sequence may include: encoding the image control information to obtain at least one image feature corresponding to the image control information; and quantizing the at least one image feature using a preset mapping rule to obtain a first feature sequence corresponding to each of the at least one image features.
[0136] After acquiring the image control information, the image control information can be encoded using the trained network model to obtain at least one image feature corresponding to the image control information, and the image feature can include: color feature, texture feature, pattern feature, material feature, style feature, etc. After acquiring at least one image feature, at least one image feature can be quantized using a preset mapping rule to obtain a first feature sequence corresponding to each of the at least one image feature. Specifically, when there are multiple first feature sequences, in order to facilitate the application of any number of image features, a segmentation operation can be performed between the first feature sequences corresponding to any two image features using a segmentation identifier "SEP".
[0137] Step S303: generating at least one first image based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0138] After acquiring the text control information, the first feature sequence, and the second feature sequence, the text control information, the first feature sequence, and the second feature sequence may be analyzed and processed to generate at least one first image. In some examples, generating at least one first image based on the text control information, the first feature sequence, and the second feature sequence may include: determining at least one first image feature sequence based on the text control information, the first feature sequence, and the second feature sequence; decoding the at least one first image feature sequence to generate at least one first image, wherein the mask sequence ratio corresponding to the first image is less than the mask sequence ratio corresponding to the original image information.
[0139] After obtaining the text control information, the first feature sequence, and the second feature sequence, the text control information, the first feature sequence, and the second feature sequence can be input into a trained network model, and the network model can output at least one first image feature sequence based on the multimodal control signal. In some examples, determining at least one first image feature sequence based on the text control information, the first feature sequence, and the second feature sequence includes: determining a first mask to be predicted in the second feature sequence, the first mask to be predicted being a part of the mask sequence; predicting the first mask to be predicted based on the text control information and the at least one first feature sequence to obtain at least one first image feature sequence.
[0140] Specifically, after obtaining the second feature sequence, a first mask to be predicted can be determined in the second feature sequence, and the first mask to be predicted is a part of the mask sequence. In some examples, determining the first mask to be predicted in the second feature sequence can include: obtaining the proportion information used to limit the first mask to be predicted; randomly sampling the mask sequence in the second feature sequence to obtain the first mask to be predicted corresponding to the proportion information. Among them, randomly sampling the mask sequence in the second feature sequence can include: randomly sampling the mask sequence in the second feature sequence; and / or, sampling all the mask sequences in the second feature sequence; and / or; randomly sampling the mask sequence in the second feature sequence; and / or, sampling the area outside the random block in the mask sequence in the second feature sequence.
[0141] After obtaining the first mask to be predicted, the first mask to be predicted can be predicted based on the text control information and the first feature sequence to obtain at least one first image feature sequence. Then, the at least one first image feature sequence can be decoded to generate at least one first image, and the mask sequence ratio corresponding to the generated first image is smaller than the mask sequence ratio corresponding to the original image information, thereby effectively realizing the prediction operation of at least part of the mask sequence corresponding to the original image information.
[0142] The image generation method provided in the present embodiment obtains text control information, image control information and original image information, converts the image control information into a first feature sequence, converts the original image information into a second feature sequence, at least a part of the second feature sequence is a mask sequence, and generates at least one first image based on the text control information, the first feature sequence and the second feature sequence. The first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information, and effectively realizes automatic generation of images based on multimodal data such as text control information and image control information as control signals, and ensures the quality and efficiency of image generation, reduces the cost of image generation, is suitable for large-scale batch design, further improves the practicability of the image generation method, and is conducive to market promotion and application.
[0143] Figure 4 FIG. 1 is a flow chart of an image generation method of another exemplary embodiment of the present application; based on the above embodiment, refer to FIG. Figure 4 As shown, after generating at least one first image, the method in this embodiment further includes:
[0144] Step S401: Obtain image quality corresponding to at least one first image.
[0145] After generating at least one first image, the at least one first image may be analyzed and processed to obtain the image quality corresponding to each of the at least one first image. In some examples, obtaining the image quality corresponding to each of the at least one first image may include: obtaining the degree of association between the text control information and the image control information and each of the first images; determining the degree of authenticity corresponding to each of the at least one first image; and determining the image quality corresponding to each of the at least one first image based on the degree of association and the degree of authenticity.
[0146] Specifically, a first network model for analyzing and processing text control information, image control information and each first image is pre-trained. It can be understood that the first network model is a binary classification linear classifier, which is used to determine the correlation and association between the control signal and the generated image. When training the first network model, negative samples can be obtained by exchanging the control signals of any two training instances. After obtaining the text control information, image control information and each first image, the text control information, image control information and each first image can be input into the first network model, so that the association between the text control information and image control information and each first image can be obtained. The association can be represented by the identifier token [REL], and the association can be a value between 0 and 1. The closer the value is to 1, the higher the association between the text control information and image control information and the first image; the closer the value is to 0, the lower the association between the text control information and image control information and the first image.
[0147] Similarly, a second network model is pre-trained for analyzing and processing the authenticity of the first image. When training and generating the second network model, a real data set can be used as a positive sample. As for negative samples, since there are no "unreal" negative samples in the data set, the method in this embodiment can use synthetic images as negative samples to perform model training operations. At this time, after obtaining each first image, the first image can be input into the second network model to obtain the authenticity corresponding to at least one first image. The authenticity is used to identify abnormal conditions such as the degree of distortion of the image and the degree of abnormality of the object in the image. Specifically, it can be represented by the identifier [FDL]. It can be understood that the higher the degree of distortion of the image, the lower the authenticity of the image; and the lower the degree of distortion of the image, the higher the authenticity of the image.
[0148] After obtaining the correlation degree and the authenticity, the correlation degree and the authenticity can be analyzed and processed to determine the image quality corresponding to each of the at least one first image. In some instances, based on the correlation degree and the authenticity, determining the image quality corresponding to each of the at least one first image can include: taking a weighted sum of the correlation degree and the authenticity, thereby obtaining the image quality of the first image.
[0149] Step S402: determining a target image in at least one first image based on the image quality corresponding to each of the at least one first images.
[0150] After obtaining the image quality corresponding to each of the at least one first image, the image quality corresponding to all the first images may be analyzed and compared to determine a target image in the at least one first image based on the analysis and comparison results. In some examples, based on the image quality of each of the at least one first image, determining a target image in the at least one first image may include: determining the first image with the highest image quality among all the first images as the target image, thereby effectively ensuring the accuracy and reliability of determining the target image.
[0151] Step S403: iteratively predicting the mask sequence corresponding to the target image based on the text control information and the first feature sequence to generate at least one second image, wherein the ratio of the mask sequence corresponding to the second image is smaller than the ratio of the mask sequence corresponding to the first image.
[0152] After acquiring the text control information and the first feature sequence, the mask sequence corresponding to the target image can be iteratively predicted based on the text control information and the first feature sequence, so as to generate at least one second image, the mask sequence ratio corresponding to the second image is smaller than the mask sequence ratio corresponding to the first image. In some instances, iteratively predicting the mask sequence corresponding to the target image based on the text control information and the first feature sequence to generate at least one second image includes: acquiring a second mask to be predicted corresponding to the target image, the second mask to be predicted being different from the first mask to be predicted; predicting the second mask to be predicted based on the text control information and the first feature sequence to obtain a second image feature sequence; and generating at least one second image based on the second image feature sequence.
[0153] Specifically, the progressive non-autoregressive generation algorithm (PNAG algorithm) can be used to predict the mask sequence of the original image information. In the prediction process, multiple prediction values can correspond to the mask value of each position, and each prediction value can correspond to its own confidence. Then, based on the confidence, multiple different prediction values can be collected for each mask position as input samples. For example, 5, 10 or 15 multiple prediction values with different confidence distributions can be used as input samples for iterative prediction operations, thereby generating at least one second image, and the proportion of the mask sequence corresponding to the second image is less than the proportion of the mask sequence corresponding to the first image. In this way, it is effectively realized that in the process of continuously performing iterative image prediction, a high-quality image mask sequence can be selected to be superimposed on the original image information, thereby ensuring that the proportion of the mask sequence in the generated image will become smaller and smaller through continuous iterative prediction operations, further improving the quality and efficiency of the generated image.
[0154] In this embodiment, by acquiring the image quality corresponding to each of the at least one first image, a target image is determined in the at least one first image based on the image quality corresponding to each of the at least one first image, and an iterative prediction is performed on the mask sequence corresponding to the target image based on the text control information and the at least one first feature sequence to generate at least one second image, thereby achieving continuous image iterative prediction operations based on the image quality of the generated image, further improving the quality and efficiency of image generation.
[0155] Figure 5 This is a flowchart of an image generation method according to another exemplary embodiment of the present application; based on the above embodiment, refer to the attached Figure 5 As shown, after generating at least one second image, the method in this embodiment further includes:
[0156] Step S501: Acquire multiple image sets obtained after multiple iterations of prediction, each image set including at least one second image.
[0157] Step S502: Determine image quality change trends corresponding to multiple image sets.
[0158] Step S503: Based on the image quality change trend, the iterative prediction operation of the target image is controlled.
[0159] Generally speaking, in the process of iteratively generating an image, when the number of iterations is less than a preset threshold, the proportion of mask sequences in the image generated by the iterative prediction operation will become smaller and smaller, and the quality of the generated image will gradually increase; when the number of iterations is higher than the preset threshold, the quality of the generated image will not increase significantly. Therefore, in order to obtain a high-quality image, the number of iterations can be effectively controlled. Specifically, multiple image sets obtained after multiple iterative predictions can be obtained, each image set including at least one second image; the image quality change trend corresponding to the multiple image sets is determined; based on the image quality change trend, the iterative prediction operation of the target image is controlled.
[0160] In some instances, controlling the iterative prediction operation of the target image based on the image quality change trend may include: stopping the iterative prediction operation on the target image when the image quality change trend is not on an upward trend; or continuing the iterative prediction operation on the target image when the image quality change trend is on an upward trend.
[0161] For example, after performing the first iteration operation, a first image set may be obtained, and then a second iteration operation may be performed based on a certain image in the first image set, and then a second image set may be obtained after performing the second iteration operation based on a certain image in the first image set, and then a third iteration operation may be performed based on a certain image in the second image set, and then a third image set may be obtained after performing the third iteration operation based on the second image set. It is understandable that each of the above different image sets may include at least one second image.
[0162] After acquiring the first image set, the second image set and the third image set, the image quality representative 1 corresponding to the first image set (which may be the average quality corresponding to all second images, the maximum quality corresponding to all second images, or the quality variance corresponding to all second images, etc.), the image quality representative 2 corresponding to the second image set, and the image quality representative 3 corresponding to the third image set can be acquired respectively.
[0163] After obtaining the image quality representative 1, image quality representative 2 and image quality representative 3, the image quality change trend can be obtained. When image quality representative 1 < image quality representative 2 < image quality representative 3, it means that the image quality change trend is in an upward trend. At this time, in order to obtain a higher quality image, the iterative prediction operation can be continued for the target image. When image quality representative 1 < image quality representative 2 > image quality representative 3, image quality representative 1 > image quality representative 2 < image quality representative 3, or image quality representative 1 > image quality representative 2 > image quality representative 3, it means that the image quality change trend is not in an upward trend. At this time, the iterative prediction operation for the target image can be stopped.
[0164] In other instances, after stopping the iterative prediction operation on the target image, the method may further include: determining a target image set from multiple image sets based on the image quality change trend corresponding to the multiple image sets, the image quality corresponding to the target image set being greater than the image quality corresponding to other image sets; and outputting the second image included in the target image set, thereby effectively achieving the ability to obtain a second image with higher quality.
[0165] In this embodiment, the PNAG algorithm is used to generate the image in a non-autoregressive iterative direction guided by the correlation between the control signal and the generated image and the authenticity of the generated image. In this way, the image generation operation is not an unconscious image iterative processing operation. At the same time, since the image quality of the generated image can be obtained in each iterative operation, if the image quality no longer increases within multiple iterative operations, the iterative prediction operation of the image can be stopped, thereby effectively achieving the need for a fixed number of iterations. Specifically, different degrees of iterative operations can be performed based on different application scenarios, thereby improving the flexibility and reliability of the method. Moreover, after stopping the iterative operation, a second image with higher image quality can be output, thereby further improving the quality and efficiency of image generation, which is conducive to meeting the personalized needs of users.
[0166] Figure 6 This is a flowchart of an image generation method of another exemplary embodiment of the present application; based on the above embodiment, refer to the attached Figure 6 As shown, after generating at least one second image, the method in this embodiment further includes:
[0167] Step S601: obtaining the image resolution of the second image;
[0168] Step S602: when the image resolution is less than the set resolution, the resolution of the second image is adjusted to obtain a third image, and the image resolution of the third image is the set resolution.
[0169] After generating at least one second image, the image resolution of the second image can be obtained, and then the image resolution is analyzed and compared with the set resolution. When the image resolution is greater than or equal to the set resolution, it means that the image resolution of the generated second image is relatively high, and generally can meet the user's usage requirements. When the image resolution is less than the set resolution, it means that the image resolution of the generated second image is relatively low and cannot meet the user's usage requirements. Therefore, the resolution of the second image can be adjusted. Specifically, the resolution of the second image can be adjusted from the current image resolution to the set resolution, which effectively realizes that a high-resolution image can be directly generated from a low-resolution image.
[0170] In some other instances, after obtaining the third image, the method in this embodiment may further include: obtaining a confidence level corresponding to the third image; determining an image area in the third image whose confidence level is less than a preset threshold; predicting the image area to obtain a predicted area; and generating a fourth image corresponding to the third image based on the predicted area and the third image.
[0171] When the generated second image is adjusted to a third image with a higher resolution, some pixels in the third image may be distorted. In this case, the self-correction iterative algorithm can be used to improve the image quality of the generated third image. Specifically, after the third image is obtained, the confidence corresponding to each pixel in the third image can be obtained. Since the unreal area is often in pieces, if random point sampling is performed at this time, and the self-correction operation is performed based on the data after the point sampling, it is difficult to produce the self-correction effect. Therefore, the image area in the third image with a confidence less than a preset threshold can be determined based on the confidence corresponding to each pixel in the third image. After the image area is obtained, the image area can be predicted to obtain the predicted area. After the predicted area and the third image are obtained, a fourth image corresponding to the third image can be generated based on the predicted area and the third image. In short, after the third image is iteratively generated, the mask value can be used to replace the part with a lower confidence in the third image, and then the image area can be predicted to achieve the regeneration operation of the third image, thereby ensuring the quality and efficiency of high-definition image acquisition.
[0172] In this embodiment, by obtaining the image resolution of the second image, when the image resolution is less than the set resolution, the resolution of the second image is adjusted to obtain a third image, and the image resolution of the third image is the set resolution, thereby effectively achieving the ability to adjust a low-resolution image to a high-resolution image, which is conducive to meeting the personalized needs of each user.
[0173] Figure 7FIG. 1 is a flow chart of an image generating method of another exemplary embodiment of the present application; based on any of the above embodiments, refer to FIG. Figure 7 As shown, the method in this embodiment may further include:
[0174] Step S701: Acquire multiple area information corresponding to the image control information.
[0175] Step S702: determining the generation difficulty corresponding to each of the plurality of region information, where the generation difficulty is used to reflect the novelty of the style of the region information.
[0176] Step S703: Based on the generation difficulty, determine the target area included in the image control information.
[0177] Step S704: Generate at least one first image corresponding to the target area.
[0178] After the image control information is acquired, the image control information may be analyzed and processed to acquire a plurality of area information corresponding to the image control information. After the plurality of area information corresponding to the image control information is acquired, each area information may be analyzed and processed to determine the generation difficulty corresponding to each area information. Specifically, determining the generation difficulty corresponding to each of the plurality of area information may include: acquiring a network model for analyzing and processing the area information; and processing the plurality of area information using the network model to acquire the generation difficulty corresponding to each of the plurality of area information.
[0179] After determining the generation difficulty corresponding to each of the multiple area information, the generation difficulty corresponding to each of the multiple area information can be analyzed and processed to determine the target area included in the image control information. Specifically, based on the generation difficulty, determining the target area included in the image control information can include: determining the area information whose generation difficulty is greater than or equal to a preset threshold as the target area included in the image control information.
[0180] After obtaining the generation difficulty, the generation difficulty can be analyzed and compared with the preset threshold. When the generation difficulty is greater than or equal to the preset threshold, it means that the pattern and style of the regional information corresponding to the generation difficulty are relatively novel, and then the regional information corresponding to the image generation difficulty can be determined as the target area included in the image control information, and the target area is the area included in the same clothing to be generated. Specifically, the preset model can be used to analyze and process the feature sequence corresponding to the regional information to obtain the production average score corresponding to the regional information, and the generation difficulty corresponding to the regional information is determined based on the production average score. It can be understood that the production average score is negatively correlated with the generation difficulty, that is, the lower the production average score, the more novel the regional information is, that is, the more difficult the regional information is to generate. Then, one or more regions with higher novelty can be selected as the target area (material) to automatically generate at least one first image corresponding to the target area, thereby effectively realizing the generation operation of the same image.
[0181] In this embodiment, by acquiring multiple area information corresponding to the image control information, the generation difficulty corresponding to each of the multiple area information is determined, and then based on the generation difficulty, the target area included in the image control information is determined, and at least one first image corresponding to the target area is generated. When the above method is applied to the clothing field, it is possible to automatically discover trend elements or areas of interest in clothing images, and generate the same clothing images based on the trend elements or areas of interest. The above implementation process effectively realizes the automatic generation operation of the image, and the implementation method is simple and reliable, with low production cost, which is conducive to batch generation of images, further improving the practicality of the method.
[0182] Figure 8 A flowchart of an image generation method according to another exemplary embodiment of the present application is shown in FIG. Figure 8 As shown, this embodiment provides another image generation method. The execution subject of the image generation method may be an image generation device. The image generation device may be implemented as software or a combination of software and hardware. Specifically, the image generation method includes:
[0183] Step S801: In response to a request to call image generation, determine processing resources corresponding to an image generation service.
[0184] Step S802: Utilize processing resources to perform the following steps: obtain text control information, image control information, and original image information; convert the image control information into a first feature sequence, and convert the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region where an image generation operation is required; generate at least one first image based on the text control information, the first feature sequence, and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information, and the original image information.
[0185] Specifically, the image generation method provided by the present invention can be executed in the cloud, and a number of computing nodes can be deployed in the cloud, each of which has computing, storage and other processing resources. In the cloud, multiple computing nodes can be organized to provide a certain service, and of course, a computing node can also provide one or more services.
[0186] For the scheme provided by the present invention, the cloud can provide a service for completing the image generation method, which is called an image generation service. When a user needs to use the image generation service, the image generation service is called to trigger a request to the cloud to call the image generation service, and the request may carry text control information, image control information, and original image information. The cloud determines the computing node that responds to the request, and uses the processing resources in the computing node to perform the following steps: obtaining text control information, image control information, and original image information; converting the image control information into a first feature sequence, and converting the original image information into a second feature sequence, wherein at least part of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize the image area that needs to be subjected to the image generation operation; based on the text control information, the first feature sequence, and the second feature sequence, at least one first image is generated, and the first image includes an image after the text control information, the image control information, and the original image information are fused.
[0187] Specifically, the implementation process, implementation principle and implementation effect of the above method steps in this embodiment are the same as those in the above Figure 1-Figure 7 The implementation process, implementation principle and implementation effect of the method steps in the embodiment shown are similar. For the parts not described in detail in this embodiment, please refer to Figure 1-Figure 7 Description of the illustrated embodiment.
[0188] Fig. 9 FIG. 1 is a flow chart of an image generation method according to another exemplary embodiment of the present invention; Fig. 9As shown, this embodiment provides another image generation method, which can generate the same clothing image based on the provided reference clothing image. In addition, the execution subject of the image generation method can be an image generation device, which can be implemented as software or a combination of software and hardware. Specifically, the image generation method may include:
[0189] Step S901: Acquire text control information, clothing image control information and original image information.
[0190] Among them, text control information, clothing image control information and original image information are used as control signals for image generation operations. The above-mentioned text control information can refer to a keyword sequence of any length, which is used as a text control signal for image generation; the original image information is used to limit the size characteristics of the generated image, and the clothing image control information is used as a visual control signal for image generation. Specifically, the clothing image control information may include at least one of the following: clothing texture image, clothing color image, clothing pattern image, clothing style image, clothing style image, etc.
[0191] Specifically, the implementation method and implementation effect of the above steps in this embodiment are similar to the implementation method and implementation effect of step S301 in the above embodiment. For details, please refer to the above statements and will not be repeated here.
[0192] Step S902: determining at least one clothing focus area based on the clothing image control information.
[0193] After acquiring the clothing image control information, the clothing image control information may be analyzed and processed to obtain at least one clothing focus area corresponding to the clothing image control information. In some examples, based on the clothing image control information, determining at least one clothing focus area may include: dividing the clothing image control information into a plurality of clothing areas, determining a generation difficulty corresponding to each clothing area; and determining at least one clothing focus area based on the generation difficulty.
[0194] After obtaining the clothing image control information, the clothing image control information can be divided into a plurality of clothing areas, and then a network model for analyzing and processing the clothing areas is obtained; the plurality of clothing areas are processed using the network model to obtain the generation difficulty corresponding to each of the plurality of clothing areas. After determining the generation difficulty corresponding to each of the plurality of clothing areas, the clothing area whose generation difficulty is greater than or equal to a preset threshold can be determined as at least one clothing focus area included in the clothing image control information. Specifically, after obtaining the generation difficulty, the generation difficulty can be analyzed and compared with the preset threshold. When the generation difficulty is greater than or equal to the preset threshold, it means that the pattern and style of the clothing area corresponding to the generation difficulty are relatively novel, and then the clothing area corresponding to the image generation difficulty can be determined as the clothing focus area included in the clothing image control information, and the clothing focus area is the area included in the same clothing to be generated, so as to facilitate the generation operation of the same clothing image.
[0195] Step S903: generating at least one target clothing image based on the text control information, at least one clothing focus area and the original image information, wherein the target clothing image includes an image obtained by fusion processing of the text control information, at least one clothing focus area and the original image information.
[0196] After acquiring at least one clothing focus area, the text control information, at least one clothing focus area and the original image information can be analyzed and processed to generate at least one target clothing image that can include at least one clothing focus area, thereby effectively realizing the generation operation of the same clothing image.
[0197] The image generation method provided in this embodiment obtains text control information, clothing image control information and original image information, determines at least one clothing focus area based on the clothing image control information, and generates at least one target clothing image based on the text control information, the at least one clothing focus area and the original image information, wherein the target clothing image includes at least one clothing focus area, and effectively realizes the automatic generation of the same clothing image based on multimodal data, which not only improves the design quality and efficiency of the same clothing image, reduces the image generation cost, and is suitable for large-scale batch design, further improves the practicability of the image generation method, and is conducive to market promotion and application.
[0198] Fig.10 FIG. 1 is a schematic diagram of a structure of an image generating device according to an exemplary embodiment of the present application; Fig.10 As shown, this embodiment provides an image generating device, which can perform the above Figure 3 The image generating method shown, specifically, the image generating device may include:
[0199] A first acquisition module 11 is used to acquire text control information, image control information and original image information;
[0200] A first determination module 12 is used to convert the image control information into a first feature sequence, and convert the original image information into a second feature sequence, wherein at least a part of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region that needs to be subjected to an image generation operation;
[0201] The first processing module 13 is used to generate at least one first image based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0202] In some instances, when the first determination module 12 converts the image control information into a first feature sequence, the first determination module 12 is used to: encode the image control information to obtain at least one image feature corresponding to the image control information; and quantize the at least one image feature using a preset mapping rule to obtain a first feature sequence corresponding to each of the at least one image features.
[0203] In some instances, when the first processing module 13 generates at least one first image based on text control information, the first feature sequence, and the second feature sequence, the first processing module 13 is used to execute: determining at least one first image feature sequence based on the text control information, the first feature sequence, and the second feature sequence; decoding the at least one first image feature sequence to generate at least one first image, and the mask sequence ratio corresponding to the first image is smaller than the mask sequence ratio corresponding to the original image information.
[0204] In some instances, when the first processing module 13 determines at least one first image feature sequence based on text control information, the first feature sequence, and the second feature sequence, the first processing module 13 is used to perform: determining a first mask to be predicted in the second feature sequence, where the first mask to be predicted is a part of the mask sequence; and obtaining at least one first image feature sequence based on the text control information and predicting the first mask to be predicted.
[0205] In some instances, when the first processing module 13 determines the first mask to be predicted in the second feature sequence, the first processing module 13 is used to execute: obtaining proportion information used to limit the first mask to be predicted; and randomly sampling the mask sequence in the second feature sequence to obtain the first mask to be predicted corresponding to the proportion information.
[0206] In some instances, when the first processing module 13 randomly samples the mask sequence in the second feature sequence, the first processing module 13 is used to execute: random point sampling of the mask sequence in the second feature sequence; and / or, sampling the entire mask sequence in the second feature sequence; and / or; random block sampling of the mask sequence in the second feature sequence; and / or, sampling the area outside the random block in the mask sequence in the second feature sequence.
[0207] In some examples, after generating at least one first image, the first acquisition module 11, the first determination module 12 and the first processing module 13 in this embodiment are respectively used to perform:
[0208] A first acquisition module 11 is used to acquire image quality corresponding to at least one first image;
[0209] A first determination module 12, configured to determine a target image in at least one first image based on image quality corresponding to each of the at least one first images;
[0210] The first processing module 13 is used to iteratively predict the mask sequence corresponding to the target image based on the text control information and the first feature sequence to generate at least one second image, wherein the mask sequence ratio corresponding to the second image is smaller than the mask sequence ratio corresponding to the first image.
[0211] In some instances, when the first acquisition module 11 acquires the image quality corresponding to each of at least one first image, the first acquisition module 11 is used to perform: acquiring the correlation between the text control information and the image control information and each of the first images; determining the authenticity corresponding to each of the at least one first image; and determining the image quality corresponding to each of the at least one first image based on the correlation and the authenticity.
[0212] In some instances, when the first determination module 12 determines a target image in at least one first image based on the image quality of each of the at least one first image, the first determination module 12 is used to execute: among all the first images, determine the first image with the highest image quality as the target image.
[0213] In some instances, when the first processing module 13 iteratively predicts the mask sequence corresponding to the target image based on the text control information and the first feature sequence to generate at least one second image, the first processing module 13 is used to execute: obtaining a second mask to be predicted corresponding to the target image, the second mask to be predicted is different from the first mask to be predicted; predicting the second mask to be predicted based on the text control information and the first feature sequence to obtain a second image feature sequence; and generating at least one second image based on the second image feature sequence.
[0214] In some examples, after generating at least one second image, the first acquisition module 11, the first determination module 12 and the first processing module 13 in this embodiment are respectively used to perform:
[0215] A first acquisition module 11 is used to acquire multiple image sets obtained after multiple iterations of prediction, each image set including at least one second image;
[0216] A first determination module 12, used to determine the image quality change trend corresponding to the plurality of image sets;
[0217] The first processing module 13 is used to control the iterative prediction operation of the target image based on the image quality change trend.
[0218] In some instances, when the first processing module 13 controls the iterative prediction operation of the target image based on the image quality change trend, the first processing module 13 is used to execute: when the image quality change trend is not in an upward trend, stop the iterative prediction operation on the target image; or, when the image quality change trend is in an upward trend, continue the iterative prediction operation on the target image.
[0219] In some examples, after stopping the iterative prediction operation on the target image, the first determination module 12 and the first processing module 13 in this embodiment are respectively used to perform:
[0220] A first determination module 12 is used to determine a target image set from the multiple image sets based on the image quality change trend corresponding to the multiple image sets, wherein the image quality corresponding to the target image set is greater than the image quality corresponding to the other image sets;
[0221] The first processing module 13 is used to output the second image included in the target image set.
[0222] In some examples, after generating at least one second image, the first acquisition module 11 and the first processing module 13 in this embodiment are respectively used to perform:
[0223] A first acquisition module 11, used to acquire the image resolution of the second image;
[0224] The first processing module 13 is used to adjust the resolution of the second image to obtain a third image when the image resolution is less than the set resolution. The image resolution of the third image is the set resolution.
[0225] In some examples, after obtaining the third image, the first acquisition module 11, the first determination module 12 and the first processing module 13 in this embodiment are respectively used to perform:
[0226] A first acquisition module 11, used to acquire the confidence level corresponding to the third image;
[0227] A first determination module 12, configured to determine an image region in the third image whose confidence level is less than a preset threshold;
[0228] The first processing module 13 is used to predict the image area and obtain the predicted area;
[0229] The first processing module 13 is further configured to generate a fourth image corresponding to the third image based on the predicted area and the third image.
[0230] In some examples, the first acquisition module 11, the first determination module 12 and the first processing module 13 in this embodiment are respectively used to execute:
[0231] A first acquisition module 11 is used to acquire a plurality of area information corresponding to the image control information;
[0232] A first determination module 12 is used to determine the generation difficulty corresponding to each of the plurality of regional information, where the generation difficulty is used to reflect the novelty of the style of the regional information;
[0233] The first determination module 12 is further used to determine the target area included in the image control information based on the generation difficulty;
[0234] The first processing module 13 is used to generate at least one first image corresponding to the target area.
[0235] In some instances, when the first determination module 12 determines the generation difficulty corresponding to each of the multiple area information, the first determination module 12 is used to: obtain a network model for analyzing and processing the area information; and use the network model to process the multiple area information to obtain the generation difficulty corresponding to each of the multiple area information.
[0236] In some examples, when the first determination module 12 determines the target area included in the image control information based on the generation difficulty, the first determination module 12 is used to: determine the area information whose generation difficulty is greater than or equal to a preset threshold as the target area included in the image control information.
[0237] Fig.10 The device shown can perform Figure 1-Figure 7 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 1-Figure 7 The implementation process and technical effects of this technical solution refer to Figure 1-Figure 7 The description in the illustrated embodiment will not be repeated here.
[0238] In one possible design, Fig.10The structure of the image generating device shown in the figure can be realized as an electronic device, which can be an image processing device, a server or other devices. Fig.11 As shown, the electronic device may include: a first processor 21 and a first memory 22. The first memory 22 is used to store the corresponding electronic device to execute the above Figure 1-Figure 7 The program of the image generating method provided in the illustrated embodiment, the first processor 21 is configured to execute the program stored in the first memory 22 .
[0239] The program includes one or more computer instructions, wherein the one or more computer instructions can implement the following steps when executed by the first processor 21: obtaining text control information, image control information and original image information; converting the image control information into a first feature sequence, converting the original image information into a second feature sequence, at least part of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize the image area where the image generation operation needs to be performed; based on the text control information, the first feature sequence and the second feature sequence, generating at least one first image, the first image including an image after fusion processing of the text control information, the image control information and the original image information.
[0240] Furthermore, the first processor 21 is also used to execute the aforementioned Figure 1-Figure 7 All or part of the steps in the illustrated embodiments.
[0241] The structure of the electronic device may further include a first communication interface 23 for the electronic device to communicate with other devices or a communication network.
[0242] In addition, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, which is used to store computer software instructions used by electronic devices, including instructions for executing the above-mentioned Figure 1-Figure 7 The procedures involved in the image generation method in the method embodiment shown.
[0243] In addition, an embodiment of the present invention provides a computer program product, including: a computer-readable storage medium storing computer instructions, when the computer instructions are executed by one or more processors, causing the one or more processors to execute the above Figure 1-Figure 7 The steps in the image generation method in the method embodiment are shown.
[0244] Fig.12 FIG. 1 is a structural diagram of an image generating device according to another exemplary embodiment of the present invention; Fig.12 As shown, this embodiment provides an image generating device, which can perform the above Figure 8 The image generating method shown, specifically, the image generating device may include:
[0245] A second determination module 31 is used to determine the processing resources corresponding to the image generation service in response to the image generation request;
[0246] The second processing module 32 is used to use processing resources to perform the following steps: obtain text control information, image control information and original image information; convert the image control information into a first feature sequence, and convert the original image information into a second feature sequence, at least part of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize the image area that requires image generation operation; based on the text control information, the first feature sequence and the second feature sequence, generate at least one first image, the first image including an image obtained by fusion processing of the text control information, the image control information and the original image information.
[0247] Fig.11 The device shown can perform Figure 8 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 8 The implementation process and technical effects of this technical solution refer to Figure 8 The description in the illustrated embodiment will not be repeated here.
[0248] In one possible design, Fig.11 The structure of the image generating device shown in the figure can be realized as an electronic device, which can be an image processing device, a server or other devices. Fig.12 As shown, the electronic device may include: a second processor 41 and a second memory 42. The second memory 42 is used to store the corresponding electronic device executing the above Figure 8 The program of the image generating method provided in the illustrated embodiment, the second processor 41 is configured to execute the program stored in the second memory 42 .
[0249] The program includes one or more computer instructions, wherein the one or more computer instructions can implement the following steps when executed by the second processor 41: in response to calling an image generation request, determine the processing resources corresponding to the image generation service; use the processing resources to perform the following steps: obtain text control information, image control information and original image information; convert the image control information into a first feature sequence, and convert the original image information into a second feature sequence, at least part of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize the image area that needs to perform an image generation operation; based on the text control information, the first feature sequence and the second feature sequence, generate at least one first image, the first image including an image after fusion processing of the text control information, the image control information and the original image information.
[0250] Furthermore, the second processor 41 is also used to execute the aforementioned Figure 8All or part of the steps in the illustrated embodiments.
[0251] The structure of the electronic device may further include a second communication interface 43 for the electronic device to communicate with other devices or a communication network.
[0252] In addition, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, which is used to store computer software instructions used by electronic devices, including instructions for executing the above-mentioned Figure 8 The procedures involved in the image generation method in the method embodiment shown.
[0253] In addition, an embodiment of the present invention provides a computer program product, including: a computer-readable storage medium storing computer instructions, when the computer instructions are executed by one or more processors, causing the one or more processors to execute the above Figure 8 The steps in the image generation method in the method embodiment are shown.
[0254] Fig.14 FIG. 1 is a structural diagram of an image generating device according to another exemplary embodiment of the present application; Fig.14 As shown, this embodiment provides an image generating device, which can perform the above Fig. 9 The image generating method shown, specifically, the image generating device may include:
[0255] The third acquisition module 51 is used to acquire text control information, clothing image control information and original image information;
[0256] A third determination module 52, configured to determine at least one clothing focus area based on the clothing image control information;
[0257] The third processing module 53 is used to generate at least one target clothing image based on the text control information, at least one clothing focus area and the original image information, wherein the target clothing image includes an image obtained by fusion processing of the text control information, at least one clothing focus area and the original image information.
[0258] Fig.14 The device shown can perform Fig. 9 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Fig. 9 The implementation process and technical effects of this technical solution refer to Fig. 9 The description in the illustrated embodiment will not be repeated here.
[0259] In one possible design, Fig.14 The structure of the image generating device shown in the figure can be realized as an electronic device, which can be an image processing device, a server or other devices. Fig.15 As shown, the electronic device may include: a third processor 61 and a third memory 62. The third memory 62 is used to store the corresponding electronic device executing the above Fig. 9 The program of the image generating method provided in the illustrated embodiment, the third processor 61 is configured to execute the program stored in the third memory 62 .
[0260] The program includes one or more computer instructions, wherein when the one or more computer instructions are executed by the third processor 61, the following steps can be implemented: obtaining text control information, clothing image control information and original image information; determining at least one clothing focus area based on the clothing image control information; generating at least one target clothing image based on the text control information, at least one clothing focus area and the original image information, wherein the target clothing image includes an image obtained by fusion processing of the text control information, at least one clothing focus area and the original image information.
[0261] Furthermore, the third processor 61 is also used to execute the aforementioned Fig. 9 All or part of the steps in the illustrated embodiments.
[0262] The structure of the electronic device may further include a third communication interface 63 for the electronic device to communicate with other devices or a communication network.
[0263] In addition, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, which is used to store computer software instructions used by electronic devices, including instructions for executing the above-mentioned Fig. 9 The procedures involved in the image generation method in the method embodiment shown.
[0264] In addition, an embodiment of the present invention provides a computer program product, including: a computer-readable storage medium storing computer instructions, when the computer instructions are executed by one or more processors, causing the one or more processors to execute the above Fig. 9 The steps in the image generation method in the method embodiment are shown.
[0265] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as 601, 602, 603, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0266] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0267] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0268] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable multimedia data computing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable multimedia data computing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0269] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable multimedia data computing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0270] These computer program instructions can also be loaded onto a computer or other programmable multimedia data computing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0271] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0272] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0273] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0274] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image generation system, It is characterized in that include: An information acquisition component, used to acquire text control information, image control information and original image information, wherein the image control information is used as a visual control signal for image generation, and the original image information is used to define the size characteristics of the generated image; An image generation component, configured to convert the image control information into a first feature sequence, and convert the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region requiring an image generation operation; The image generation component is also used to generate at least one first image based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
2. The system according to claim 1, It is characterized in that The image generation component generates at least one first image based on the text control information, the first feature sequence and the second feature sequence, including: Determine a first mask to be predicted in the second feature sequence, where the first mask to be predicted is a part of the mask sequence; Predicting the first mask to be predicted based on the text control information and the first feature sequence to obtain at least one first image feature sequence; The at least one first image feature sequence is decoded to generate at least one first image, wherein the ratio of the mask sequence corresponding to the first image is smaller than the ratio of the mask sequence corresponding to the original image information.
3. The system according to claim 2, It is characterized in that The image generation component determines a first mask to be predicted in the second feature sequence, including: Acquire proportion information for limiting the first mask to be predicted; The mask sequence in the second feature sequence is randomly sampled to obtain a first mask to be predicted corresponding to the proportion information.
4. The system according to claim 2, It is characterized in that The information acquisition component is used to acquire the image quality corresponding to each of the at least one first image after generating the at least one first image; An image generation component, configured to determine a target image in the at least one first image based on image qualities corresponding to each of the at least one first image; The mask sequence corresponding to the target image is iteratively predicted based on the text control information and the first feature sequence to generate at least one second image, wherein the ratio of the mask sequence corresponding to the second image is smaller than the ratio of the mask sequence corresponding to the first image.
5. The system according to claim 4, It is characterized in that The information acquisition component acquires the image quality corresponding to each of the at least one first image, including: Acquire the correlation between the text control information and the image control information and each first image; Determining a degree of authenticity corresponding to each of the at least one first image; Based on the association degree and the authenticity degree, image quality corresponding to each of the at least one first image is determined.
6. The system according to claim 4, It is characterized in that The image generation component iteratively predicts the mask sequence corresponding to the target image based on the text control information and the first feature sequence to generate at least one second image, including: Acquire a second mask to be predicted corresponding to the target image, where the second mask to be predicted is different from the first mask to be predicted; Predicting the second mask to be predicted based on the text control information and the first feature sequence to obtain the second image feature sequence; At least one second image is generated based on the second image feature sequence.
7. The system according to claim 4, It is characterized in that The image generation component is used to obtain a plurality of image sets obtained after performing multiple iterative predictions after generating at least one second image, each image set including at least one second image; Determine the image quality change trend corresponding to the multiple image sets; and control the iterative prediction operation of the target image based on the image quality change trend.
8. The system according to claim 4, It is characterized in that After generating at least one second image, the image generation component is configured to: acquiring an image resolution of the second image; When the image resolution is less than the set resolution, the resolution of the second image is adjusted to obtain a third image, and the image resolution of the third image is the set resolution.
9. The system according to claim 8, It is characterized in that After obtaining the third image, the image generating component is used to: Obtaining a confidence level corresponding to the third image; Determining an image region in the third image whose confidence level is less than a preset threshold; Predicting the image region to obtain a predicted region; Based on the predicted region and the third image, a fourth image corresponding to the third image is generated.
10. A method for generating an image, It is characterized in that include: Acquire text control information, image control information and original image information, wherein the image control information is used as a visual control signal for image generation, and the original image information is used to limit the size characteristics of the generated image; Converting the image control information into a first feature sequence, and converting the original image information into a second feature sequence, wherein at least a portion of the second feature sequence is a mask sequence, wherein the mask sequence is used to characterize an image region that requires an image generation operation; At least one first image is generated based on the text control information, the first feature sequence and the second feature sequence, wherein the first image includes an image obtained by fusion processing of the text control information, the image control information and the original image information.
11. The method according to claim 10, It is characterized in that Generating at least one first image based on the text control information, the first feature sequence, and the second feature sequence, comprising: Determine a first mask to be predicted in the second feature sequence, where the first mask to be predicted is a part of the mask sequence; Predicting the first mask to be predicted based on the text control information and the first feature sequence to obtain at least one first image feature sequence; The at least one first image feature sequence is decoded to generate at least one first image, wherein the ratio of the mask sequence corresponding to the first image is smaller than the ratio of the mask sequence corresponding to the original image information.
12. The method according to claim 11, It is characterized in that Determining a first mask to be predicted in the second feature sequence includes: Acquire proportion information for limiting the first mask to be predicted; The mask sequence in the second feature sequence is randomly sampled to obtain a first mask to be predicted corresponding to the proportion information.
13. The method according to claim 11, It is characterized in that After generating at least one first image, the method further comprises: Acquire image quality corresponding to each of the at least one first image; Determining a target image in the at least one first image based on the image quality corresponding to each of the at least one first image; The mask sequence corresponding to the target image is iteratively predicted based on the text control information and the first feature sequence to generate at least one second image, wherein the ratio of the mask sequence corresponding to the second image is smaller than the ratio of the mask sequence corresponding to the first image.
14. The method according to claim 13, It is characterized in that Acquiring the image quality corresponding to each of the at least one first image includes: Acquire the correlation between the text control information and the image control information and each first image; Determining a degree of authenticity corresponding to each of the at least one first image; Based on the association degree and the authenticity degree, image quality corresponding to each of the at least one first image is determined.
15. The method according to claim 13, It is characterized in that Iteratively predicting a mask sequence corresponding to the target image based on the text control information and the first feature sequence to generate at least one second image includes: Acquire a second mask to be predicted corresponding to the target image, where the second mask to be predicted is different from the first mask to be predicted; Predicting the second mask to be predicted based on the text control information and the first feature sequence to obtain the second image feature sequence; At least one second image is generated based on the second image feature sequence.
16. The method according to claim 13, It is characterized in that After generating at least one second image, the method further comprises: Acquire multiple image sets obtained after performing multiple iterations of prediction, each image set including at least one second image; Determining image quality change trends corresponding to the multiple image sets; Based on the image quality change trend, an iterative prediction operation of the target image is controlled.
17. The method according to claim 13, It is characterized in that After generating at least one second image, the method further comprises: acquiring an image resolution of the second image; When the image resolution is less than the set resolution, the resolution of the second image is adjusted to obtain a third image, and the image resolution of the third image is the set resolution.
18. The method according to claim 17, It is characterized in that After obtaining the third image, the method further includes: Obtaining a confidence level corresponding to the third image; Determining an image region in the third image whose confidence level is less than a preset threshold; Predicting the image region to obtain a predicted region; Based on the predicted region and the third image, a fourth image corresponding to the third image is generated.
19. The method according to any one of claims 10 to 18, It is characterized in that The method further comprises: Acquire multiple area information corresponding to the image control information; Determine the generation difficulty corresponding to each of the plurality of area information, wherein the generation difficulty is used to reflect the novelty of the style of the area information; Based on the generation difficulty, determining a target area included in the image control information; At least one first image corresponding to the target area is generated.
