Image generation method, electronic device, storage medium and program product
Through feature extraction and fusion of images of target objects and target items in virtual fitting technology, the problem of low fidelity of fitting results in virtual fitting is solved, achieving a clothing fitting effect that is more in line with the real scene, and enhancing In order to ensure the realism and diversity of the try-on results.
Patent Information
- Application Number
- CN202411052538.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing virtual fitting technology, the fidelity of the fitting results generated by the diffusion model is not high, resulting in the simulated fitting results being inconsistent with the real scene, and the style of the fitting results is single and cannot accurately reflect the user. The effect of wearing the target outfit.
By obtaining images of target objects and target items, segment the images and extract features respectively to obtain style, texture and structural features, use these features to control the image generation model, fuse the characteristics of target items and target objects, and generate images that are more consistent with real-life scenes. Target images to ensure the realism and diversity of clothing in virtual try-on.
It improves the fidelity of virtual fitting and the realism of clothing fitting results, ensures that the generated target image is more in line with the real scene, can accurately reflect the effect of the user wearing or wearing the target item, and enhances the diversity of fitting results.
Smart Images

Figure CN118570342A
Abstract
Description
Technical Field
[0001] The present application relates to large model technology and image generation fields, and in particular, to an image generation method, electronic device, storage medium and program product. Background Art
[0002] Currently, users can use virtual fitting technology to provide an image containing the user's body and an image containing the target clothing, deform the target clothing through a diffusion model, and then fuse the deformed image with the image of the user's body to generate an image of the user wearing the target clothing, so that they can naturally try on different types of clothing in a specified area. However, when clothing is deformed, the original texture structure of the clothing may be destroyed, resulting in the generated image not reflecting the effect of the user actually wearing the target clothing. When synthesizing images, the generated synthesized image may be distorted due to occlusion, morphological differences between clothing and the user's body, etc., which in turn causes the simulated clothing fitting results to be inconsistent with the real scene, the fitting style is single, and the fidelity of the clothing fitting results is not high.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide an image generation method, an electronic device, a storage medium, and a program product to at least solve the technical problem in the related art that the fidelity of fitting results generated by the virtual fitting solution using a diffusion model is not high.
[0005] According to one aspect of an embodiment of the present application, there is provided an image generation method, comprising: acquiring a first image of a target object, and a second image of a target object, wherein the target object is to be added to the target object; performing feature extraction on a segmented image of the first image and the second image, respectively, to obtain a plurality of features of the target object, wherein different features are used to characterize a description of the target object from different dimensions, the segmented image comprising posture information of the target object, and position information of the target object in the first image; utilizing the plurality of features, controlling an image generation model to generate a target image based on the first image and the second image, wherein the target object in the target image has the target object added thereto.
[0006] According to one aspect of an embodiment of the present application, there is also provided an image generation method, comprising: obtaining an object image of a target object and a clothing image of a target clothing; performing feature extraction on a segmented image and a clothing image corresponding to the object image, respectively, to obtain a plurality of features of the target clothing, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains posture information of the target object and position information of the target object in a first image; utilizing the plurality of features, controlling an image generation model to generate a target image based on the object image and the clothing image, wherein the target clothing is worn on the target object in the target image.
[0007] According to one aspect of an embodiment of the present application, an image generation method is also provided, including: obtaining a first image of a target object and a second image of a target object by calling a first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the first image and the second image, and the target object is to be added to the target object; performing feature extraction on the segmented image and the second image of the first image respectively to obtain multiple features of the target object, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains posture information of the target object and position information of the target object in the first image; using multiple features, controlling an image generation model to generate a target image based on the first image and the second image, wherein the target object in the target image is added with the target object; outputting the target image by calling a second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target image.
[0008] According to one aspect of an embodiment of the present application, an image generating device is also provided, including: an image acquisition module, used to acquire a first image of a target object, and a second image of a target object, wherein the target object is to be added to the target object; a feature extraction module, used to perform feature extraction on a segmented image and a second image of the first image, respectively, to obtain multiple features of the target object, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains posture information of the target object, as well as position information of the target object in the first image; an image generation module, used to use multiple features to control an image generation model to generate a target image based on the first image and the second image, wherein the target object in the target image is added with the target object.
[0009] According to one aspect of an embodiment of the present application, there is also provided an image generating device, including: a first acquisition module, used to acquire an object image of a target object, and a clothing image of a target clothing; a first extraction module, used to perform feature extraction on a segmented image and a clothing image corresponding to the object image, respectively, to obtain a plurality of features of the target clothing, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains posture information of the target object, and position information of the target object in the first image; a first generation module, used to use a plurality of features to control an image generation model to generate a target image based on the object image and the clothing image, wherein the target object in the target image wears the target clothing.
[0010] According to one aspect of an embodiment of the present application, an image generating device is also provided, including: a second acquisition module, used to acquire a first image of a target object and a second image of a target object by calling a first interface, wherein the first interface includes a first parameter, and the parameter value of the first parameter includes the first image and the second image, and the target object is to be added to the target object; a second extraction module, used to perform feature extraction on the segmented image and the second image of the first image respectively to obtain multiple features of the target object, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains posture information of the target object and position information of the target object in the first image; a second generation module, used to use multiple features to control an image generation model to generate a target image based on the first image and the second image, wherein the target object in the target image is added with the target object; an image output module, used to output the target image by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target image.
[0011] According to another aspect of the embodiments of the present application, an electronic device is further provided, including: a memory storing an executable program; and a processor for running the program, wherein the method of each embodiment of the present application is executed when the program is running.
[0012] According to another aspect of an embodiment of the present application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in each embodiment of the present application.
[0013] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present application is implemented.
[0014] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present application is implemented.
[0015] According to another aspect of the embodiments of the present application, a computer program is also provided, and when the computer program is executed by a processor, the methods in the various embodiments of the present application are implemented.
[0016] In an embodiment of the present application, a first image of a target object and a second image of a target object are acquired; feature extraction is performed on a segmented image of the first image and the second image respectively to obtain a plurality of features of the target object; and a manner in which an image generation model generates a target image based on the first image and the second image is controlled by using the plurality of features. By using a diffusion model, the item features of the target object in the second image in a real scene and the object features of the target object in the first image are fused. The target object and the target object can be fused according to the posture information presented by the target object while retaining information of the target object such as its own style and texture, so as to reduce the structural error when the target object and the target object are fused, and at the same time, improve the flexibility of the simulated target object wearing or wearing the target object, thereby making the generated target image more in line with the real scene and more diversified, thereby solving the technical problem of low fidelity of fitting results generated by the virtual fitting solution using a diffusion model in the related art.
[0017] It is easy to notice that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present application, and do not constitute a limitation of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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:
[0019] Figure 1 is a schematic diagram of an application scenario for generating a target image according to Embodiment 1 of the present application;
[0020] Figure 2 is a flowchart of an image generating method according to Embodiment 1 of the present application;
[0021] Figure 3 is a schematic diagram of an image generation process according to Embodiment 1 of the present application;
[0022] Figure 4 is a schematic diagram of a color feature determination process according to Embodiment 1 of the present application;
[0023] Figure 5 is a schematic diagram of an adapter operation process according to Embodiment 1 of the present application;
[0024] Figure 6 is a flowchart of an image generation method according to Embodiment 2 of the present application;
[0025] Figure 7 is a flowchart of an image generation method according to Embodiment 3 of the present application;
[0026] Figure 8 is a structural block diagram of an image generating device according to Embodiment 4 of the present application;
[0027] Fig. 9 is a structural block diagram of an image generating device according to Embodiment 5 of the present application;
[0028] Fig.10 is a structural block diagram of an image generating device according to Embodiment 6 of the present application;
[0029] Fig.11 It is a structural block diagram of an electronic device shown in Example 7 of the present application. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the solution of the present application, 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 only 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 should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] The technical solution provided in this application is mainly implemented using large-scale model technology. The large model here refers to a deep learning model with large-scale model parameters, which can usually contain hundreds of millions, tens of billions, hundreds of billions, trillions or even more than 10 trillion model parameters. The large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as large-scale language model (LLM), multi-modal pre-training model, etc.
[0033] It should be noted that when the large model is actually applied, the pre-trained model can be fine-tuned through a small number of samples, so that the large model can be applied to different tasks. For example, the large model can be widely used in natural language processing (NLP), computer vision, speech processing and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image caption (IC), image generation, etc. It can also be widely used in natural language processing tasks such as text-based sentiment classification, text summary generation, machine translation, etc. Therefore, the main application scenarios of the large model include but are not limited to digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc. In the embodiment of the present application, the first entity image of the biological object and the second entity image of the target object are processed by using diffusion modules, multimodal modules, deformation modules and other models in a virtual clothing display scenario as an example for explanation.
[0034] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0035] CLIP: Contrastive Language-Image Pre-Training, a model for image-text correlation matching.
[0036] VAE: Variational Autoencoder, a deep learning model used for unsupervised learning tasks, especially data generation and feature extraction.
[0037] Diffusion Model: Diffusion model, a generative model, has attracted much attention in the field of machine learning, especially because of its ability to generate high-quality, diverse samples that are similar to the given data distribution.
[0038] GAN: Generative Adversarial Network, a generative adversarial network, is one of the commonly used deep learning models.
[0039] Example 1
[0040] According to an embodiment of the present application, an image generation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0041] Considering the huge number of model parameters of the large model and the limited computing resources of the mobile terminal, the above-mentioned image generation method provided in the embodiment of the present application can be applied to Figure 1 The application scenarios shown are not limited to these. Figure 1 is a schematic diagram of an application scenario for generating a target image according to Embodiment 1 of the present application. Figure 1 In the application scenario shown, the large model is deployed in the server 10, and the server 10 can be connected to one or more client devices 20 through a local area network connection, a wide area network connection, an Internet connection, or other types of data networks. The client device 20 here may include but is not limited to: a smart phone, a tablet computer, a laptop computer, a PDA, a personal computer, a smart home device, a vehicle-mounted device, etc. The client device 20 can interact with the user through a graphical user interface to implement the call of the large model, thereby implementing the method provided in the embodiment of the present application.
[0042] In an embodiment of the present application, a system composed of a client device and a server can perform the following steps: the client device can capture a first entity image of a generated object and a second entity image of a target object in a physical environment, and display the first entity image, the second entity image, and the generated virtual object to the user; the server can perform feature extraction and image segmentation on the first entity image and the second entity image to obtain style features, texture features, and structural features, and use a diffusion model to generate a virtual object based on these features, the first entity image, and the second entity image. It should be noted that the embodiment of the present application can be performed in the client device when the operating resources of the client device can meet the deployment and operating conditions of the large model.
[0043] Under the above operating environment, this application provides Figure 2The image generation method shown. Figure 2 FIG. 1 is a flow chart of an image generation method according to Embodiment 1 of the present application. Figure 2 As shown, the method may include the following steps:
[0044] Step S202, acquiring a first image of the target object and a second image of the target object.
[0045] Among them, the target item is to be added to the target object.
[0046] The target object may refer to an object that can wear or wear the target object, such as a biological object such as a person, a cat, a dog, or a non-biological object such as a plastic mannequin, a decorative model, or a stone statue. The target object may refer to an object that can change the visual effect presented by the target object after being worn or worn on the target object, such as clothing, jewelry, eyeglass accessories, decorations, etc., and may be an object that currently needs to be added to the target object.
[0047] In an optional scheme of the present embodiment, in order to quickly and conveniently display the effect presented when the above-mentioned target object wears or wears the target item, a target image corresponding to the target object wearing or wearing the target item can be generated in a virtual scene. In order to improve the realism of the generated target image, the image generation system (referred to as the generation system) can first shoot the physical appearance of the above-mentioned target object and target item through an image acquisition device in a physical environment to obtain a first image of the target object and a second image of the target item, thereby ensuring the authenticity of the first image and the second image obtained for generating the target image, and further ensuring the realism of the target image generated according to the target object and the target item in the virtual environment. For example, if a user wants to see how a piece of clothing looks when worn, the generation system can generate a target image corresponding to the user wearing the clothing in a virtual environment. The corresponding user can use an image acquisition device such as a camera to take an image of his or her body appearance. The generation system can use the image taken by the user as the first image mentioned above, and select an image including the overall appearance of the clothing from the images taken in advance of the clothing as the second image mentioned above. Then, based on these two physical objects, a target image of the user wearing the clothing is generated in a virtual environment to facilitate the user to view the effect of the clothing when worn.
[0048] Step S204 , performing feature extraction on the segmented image of the first image and the second image respectively to obtain a plurality of features of the target object.
[0049] Among them, different features are used to characterize the description of the target object from different dimensions, and the segmented image contains the posture information of the target object and the position information of the target object in the first image.
[0050] The above-mentioned segmented image may refer to an area segmented from the first image, which is used to highlight the effect presented when the target object wears or wears the target item. The segmented image may at least include the posture information of the target object. For example, if the above-mentioned target object is user A and the target item is a short-sleeved shirt, then the above-mentioned segmented image may correspond to the upper body image of user A in the first image, and the above-mentioned posture information may be the posture of the upper body of user A in the first image, such as hands on hips, crossed arms, body leaning to the left, etc.
[0051] In the above embodiments of the present application, the above multiple features include at least two of the following: style features, texture features and structural features.
[0052] The above-mentioned style features may refer to features that can represent common application scenarios of the target object. Taking clothes as an example, users usually choose clothes of different styles when attending different occasions and performing different tasks. The colors, styles, textures, elements included and other features of these clothes may be different, and what can be intuitively obtained from the perspective of other people are the features such as the color and category of these clothes. This means that the color and category of the clothes can be regarded as features that can intuitively reflect the style of the clothes. Therefore, the above-mentioned style features may at least include the color features and category features of the target object.
[0053] The above structural features may refer to the structural features of the target object when the target object wears or wears the target object in the posture presented in the first image. For example, if the user's posture in the first image is with his hands on his hips, the corresponding structural features may refer to the structural features of the shirt when the user has his hands on his hips. Different features can be used to describe the target object in different dimensions. For example, the above structural features can be used to describe the structure, posture and other information that the target object needs to present. Style features can be used to describe the scenes and item styles that the target object usually appears. Texture features can be used to express the texture information of the target object itself. Based on this, the generation system can use multiple features of the first image and the second image to ensure the realism of the generated target image.
[0054] In an optional scheme of the present embodiment, in order to accurately display the effect presented by the target object when wearing or wearing the target object, and to ensure that the generated target image is more in line with the real scene, after acquiring the first image and the second image, the generation system can use computer vision technology to extract representative image features, that is, multiple features of the target object, from the segmented image of the first image and the second image, to ensure the accuracy of analysis, identification and processing of the second image. Based on this, in order to improve the degree of fit between the target object and the target article in the generated target image, avoid the mismatch between the target object and the target article, resulting in a large degree of inconsistency and low realism in the generated target image, after acquiring the first image and the second image, the generation system can first segment from the first image an area that can highlight the effect presented when the generated object wears or wears the target article, so as to obtain the above-mentioned segmented image, and then perform feature extraction on the segmented image to determine the posture information related to the target article currently presented by the target object in the segmented image, such as the current action of the target object, the proportion and size between different parts of the target object, and other information, and identify the posture information to determine the structure that the target article needs to present when the target object wears or wears the target article, thereby obtaining the structural features that the target article needs to satisfy. In addition, in order to avoid misalignment between the target article and the target object in the target image, the extracted structural features can also include the position information of the target object in the first image.
[0055] Furthermore, the generation system can also extract features from the second image to obtain the above-mentioned style features that can reflect the overall style of the target object. Considering the factors that affect whether the target object wears or puts on the target object, the texture features of the target object are also one of the important factors. For example, when a user chooses clothes, in addition to checking the style of the clothes, he will also consider whether the texture on the clothes meets the user's preferences. Therefore, the generation system can also extract the texture features of the target object from the second image, so that the generated target image can fully and accurately reflect the appearance of the target object when wearing or putting on the target object.
[0056] In an optional scheme of the present embodiment, in order to ensure that the generated target image can meet the user's expectations, the above-extracted style features and texture features can also be adjusted according to user needs. For example, the user can input a text instruction for feature adjustment to the generation system, and the generation system can adjust the above-mentioned style features or texture features accordingly according to the instruction, such as keeping the current category and texture unchanged and changing the color of the target object, or keeping the current color and category of the target object unchanged and changing the texture of the target object, etc.
[0057] It should be noted that in order to ensure the realism of the generated target object, the above-mentioned extracted features may include at least two features among style features, texture features and structural features to avoid the situation where the generated target image does not match the target object and the target item.
[0058] Step S206: using the plurality of features, controlling the image generation model to generate a target image based on the first image and the second image.
[0059] Wherein, a target item is added to the target object in the target image.
[0060] In an optional solution of this embodiment, after determining multiple features of the target object in the second image, such as style features, texture features, and structural features, the generation system can further use the above-mentioned image generation model to fuse the first image and the second image based on these features to generate a target image that can reflect the effect of adding the target object to the target object. For example, the generation system can first generate an image based on the determined structural features, and then fill the image with the style features and texture features of the target object to generate skin information corresponding to the target object that can reasonably cover the skin surface of the target object in the first image, so as to simulate the effect presented by the target object when the above-mentioned structural features are met. It should be noted that the structure of the skin information generated here is the same as the structure of the above-mentioned second skin information. After generating the new skin information, the generation system can reuse the above-mentioned image generation model to fuse the generated skin information into the target object in the first image to simulate the effect presented when the target object wears or wears the target object, thereby obtaining a target image covering the above-mentioned target object on the biological surface, avoiding the mismatch between the structure of the target object and the posture of the target object, resulting in abnormalities when the simulated generated object wears or wears the target object, such as the user's arm does not overlap with the sleeve of the shirt, thereby improving the accuracy of the generated target image.
[0061] In an optional scheme of the present embodiment, considering that the GAN generative adversarial network is currently mostly used to generate the target image, and the generative adversarial network may be unstable and the modal collapse of the output distribution may occur, resulting in loss of details in the generated result. Therefore, a diffusion model can be used instead of GAN to generate the above-mentioned target image, that is, the above-mentioned image generation model can be a diffusion model, but it should be noted that the above-mentioned diffusion model is only an exemplary display. In addition, common GAN, deep learning and other models can also be used to generate the target image, which will not be elaborated or limited here.
[0062] In an embodiment of the present application, a first image of a target object and a second image of a target object are acquired; feature extraction is performed on a segmented image of the first image and the second image respectively to obtain a plurality of features of the target object; and a manner in which an image generation model generates a target image based on the first image and the second image is controlled by using the plurality of features. By using a diffusion model, the item features of the target object in the second image in a real scene and the object features of the target object in the first image are fused. The target object and the target object can be fused according to the posture information presented by the target object while retaining information of the target object such as its own style and texture, so as to reduce the structural error when the target object and the target object are fused, and at the same time, improve the flexibility of the simulated target object wearing or wearing the target object, thereby making the generated target image more in line with the real scene and more diversified, thereby solving the technical problem of low fidelity of fitting results generated by the virtual fitting solution using a diffusion model in the related art.
[0063] In the above-mentioned embodiment of the present application, when multiple features include style features, feature extraction is performed on the segmented image of the first image and the second image respectively to obtain multiple features of the target object, including: using a visual encoder to extract features from the second image to obtain category unit features and image block features, wherein the category unit features are used to characterize the category information of the target object, and the image block features are used to characterize the color information of the second image; using a decoder to decode the category unit features to obtain category features; using a variational autoencoder to extract features from the second image to obtain image features; using a style adapter to fuse the image block features with the image features to obtain color features; wherein the style features include category features and color features.
[0064] The style adapter may refer to a controller for determining the overall style of the target object, and may enhance the perception effect of the image block on the overall color of the target object.
[0065] In an optional scheme of this embodiment, as shown above, if the user has additional requirements for information such as style features and texture features of the target object, the generation system can adjust these style features and texture features based on the instructions input by the user according to his own needs. Considering that the instructions input by the user may be instructions of different modes such as text, audio, and image, a multimodal model can be configured in the generation system, and the multimodal model can be used to extract different image features of the target object from the second image, and the extracted image features can be adjusted according to the instructions input by the user, thereby improving the efficiency of generating the target image. Based on this, when extracting features from the second image to obtain the style features of the target object, the second image can be first divided into multiple image blocks, and then the visual encoder in the multimodal model can be used to extract features from the second image to obtain features that can reflect the category to which the target object belongs, that is, the above-mentioned category unit features, and features that can reflect the color information of the second image, that is, the above-mentioned image block features, thereby improving the efficiency of determining these two features. After obtaining the category unit features and image block features, the generation system can use the decoder to decode the category unit features to obtain the category features of the target object. Considering that the category unit features mainly reflect the category of the target object, and the image block features mainly reflect the regional information of the local area of the target object, these two features cannot obviously reflect the overall color features of the target object, such as the overall color distribution and color change trend of the target object. Therefore, a variational autoencoder can also be set up, and the encoder in the variational autoencoder can be used to further extract features from the second image to obtain the above-mentioned image features, and then the style adapter configured in the multimodal model can be used to fuse the above-mentioned image block features and image features to obtain the color features of the target object.
[0066] In the above embodiment of the present application, the style adapter includes: a multi-head attention module and a feedforward network module, and the style adapter is used to fuse the image block features with the image features to obtain color features, including: flattening and mapping the image features to obtain processed image features; using the multi-head attention module to perform attention processing on the processed image features and image block features to obtain attention features; superimposing the attention features with the image block features to obtain superimposed features; using the feedforward network module to process the superimposed features to obtain feedforward features; superimposing the superimposed features with the feedforward features to obtain color features.
[0067] In an optional solution of the present embodiment, in order to accurately determine the color features of the target object, at least a multi-head attention module and a feedforward network module may be configured in the style adapter. When fusing the image block features and the image features, in order to improve the fusion efficiency, the image features may be flattened first to obtain a one-dimensional image feature vector, and then the one-dimensional image feature vector may be mapped, for example, by linear mapping, or after feature learning using a neural network, the feature vector may be mapped using a neural network to obtain the above-processed image features. After flattening and mapping, the above-mentioned multi-head attention module may be used to perform attention processing on the processed image features and image block features to obtain the above-mentioned attention features, and then the attention features and the image block features may be superimposed to obtain the above-mentioned superimposed features, and finally the above-mentioned feedforward network module may be used to process the superimposed features to obtain the corresponding feedforward features, and after superimposing the above-mentioned superimposed features and the feedforward features, the above-mentioned color features may be obtained.
[0068] For ease of understanding, the formula for fusing the above image block features and image features using the style adapter can be:
[0069] ;
[0070] .
[0071] in, It represents the image features obtained by extracting features from the second image using the pre-trained Stable Diffusion VAE encoder (stable diffusion variational autoencoder), i.e., the variational autoencoder. It can be obtained by flattening and mapping the image features. represents the multi-head attention module, represents the feedforward network module, can refer to feedforward features, Can refer to superimposed features, It can refer to color features. By superimposing the feedforward features and the superposition features, the color features of the target object can be determined. It can refer to a compensation value and can be set by the user.
[0072] In the above-mentioned embodiment of the present application, when multiple features include texture features, feature extraction is performed on the segmented image of the first image and the second image respectively to obtain multiple features of the target object, including: based on the posture information of the target object, the target object in the second image is deformed by using a deformation model to obtain a deformed image, wherein the deformed image contains the deformed target object; feature extraction is performed on the deformed image and the mask image of the deformed image by using a high-pass filter to obtain initial texture features, wherein the mask image is used to characterize the position of the deformed target object in the deformed image; and multi-scale feature extraction is performed on the initial texture features by using a texture adapter to obtain texture features.
[0073] In an optional solution of this embodiment, when extracting the texture features of the target object from the second image, in order to avoid distortion when deforming the target object in the second image, the target object in the second image can be deformed using the above-mentioned deformation model according to the posture information of the target object in the first image, such as the posture shown by the user in the first image, to obtain the above-mentioned deformed image, thereby realizing the operation of non-rigid deformation. The deformed image can include the deformed target object and the deformed background image in the second image. After obtaining the deformed image, in order to facilitate the determination of the texture of the target object, the generation system can identify the deformed image, determine the position of the target object in the deformed image, and construct a corresponding mask image, and then use a high-pass filter to filter the deformed image based on the mask image of the deformed image to obtain the initial texture features of the target object. Corresponding to the style adapter, in order to improve the accuracy of the determined texture features, a texture adapter can also be configured in the multimodal model, and the texture adapter can be used to further extract multi-scale features from the above-mentioned initial texture features to obtain the above-mentioned texture features, thereby improving the robustness of the extracted texture features.
[0074] The texture features determined by the texture adapter can be expressed as:
[0075] .
[0076] in, It can refer to texture features, It can be a texture feature at the first scale, It can refer to the texture features at the second scale, It may refer to texture features at the third scale. The specific scale may be set by the user and is not limited here.
[0077] In the above embodiment of the present application, the high-pass filter includes: a Sobel operator and an erosion operator, and the high-pass filter is used to extract features of the deformed image and the mask image of the deformed image to obtain initial texture features, including: using the Sobel operator to perform a convolution operation on the deformed image to obtain a convolution result; using the erosion operator to perform an erosion operation on the mask image to obtain an erosion result; performing a Hadamard product operation on the convolution result and the erosion result to obtain the initial texture features.
[0078] In an optional scheme of the present embodiment, in order to ensure the accuracy of the initial texture features obtained by filtering, the above-mentioned Sobel operator and erosion operator can be configured in a high-pass filter, and then the Sobel operator is used to perform a convolution operation on the deformed image to extract the high-frequency image of the deformed image, that is, the above-mentioned convolution result, so as to highlight the texture of the target object, such as logos, text and other information, and then the erosion operator is used to perform an erosion operation on the mask image to adaptively refine the blur error caused by the edge information of the image to obtain the above-mentioned erosion result, and finally the convolution result and the erosion result are subjected to a Hadamard product operation to obtain the initial texture features of the target object.
[0079] For ease of understanding, the above formula for determining the initial texture features can be:
[0080] ;
[0081] in, represents the initial texture features, , and Represents the horizontal and vertical sobel kernels and erosion kernels. , and They refer to convolution operation, Hadamard product operation and erosion operation respectively. represents the deformed image, Represents the mask image.
[0082] In the above embodiment of the present application, the texture adapter includes: a first pixel rearrangement module, multiple first residual blocks, and a first downsampling module connected between any two first residual blocks. The texture adapter is used to perform multi-scale feature extraction on the initial texture features to obtain texture features, including: using the first pixel rearrangement module to rearrange the initial texture features to obtain first rearranged features; using multiple first residual blocks to perform residual processing on the first input features to obtain texture features, wherein the first input feature of the first first residual block among the multiple first residual blocks is the first rearrangement feature, the first input features of the other first residual blocks are the features output by the connected first downsampling modules, and the other first residual blocks are used to characterize the first residual blocks other than the first first residual block among the multiple first residual blocks; using the first downsampling module to downsample the features output by the connected first residual blocks to obtain the features output by the first downsampling module.
[0083] In an optional scheme of the present embodiment, in order to ensure the accuracy of the determined texture features, the above-mentioned first pixel rearrangement module, multiple first residual blocks, and a first downsampling module connected between any two first residual blocks can be configured in the texture adapter. When using the texture adapter to determine the texture features, the above-mentioned first pixel rearrangement module can be used to rearrange the initial texture features. For example, the initial texture features with high similarity can be arranged together, or different initial texture features can be rearranged according to parameters such as texture intensity and texture direction, or the size, direction, contrast and other parameters of the initial texture features can be adjusted to obtain the first rearranged features, and then the above-mentioned multiple first residual blocks are used to perform residual processing on the first input features to determine the above-mentioned texture features. Correspondingly, among these multiple first residual blocks, the input feature of the first first residual block is the first rearrangement feature obtained by processing the first pixel rearrangement module, and the input features of other first residual blocks can be the features output by the first downsampling module that is adjacent to and connected to the first residual block before the first residual block. The output features of different first residual blocks can be regarded as texture features at the corresponding scale of the first residual block. Correspondingly, the input of the first downsampling module connected between different first residual blocks can be the features output by the previous first residual block that is adjacent to the first downsampling module. The features output by the connected first residual block can be downsampled in the first downsampling module to obtain the features output by the first downsampling module, and the features can be used as the input features of the next first residual block that is adjacent to the first downsampling module.
[0084] In the above embodiments of the present application, when multiple features include texture features, feature extraction is performed on the segmented image of the first image and the second image respectively to obtain multiple features of the target object, including: using a segmentation adapter to perform multi-scale feature extraction on the segmented image to obtain structural features.
[0085] In an optional scheme of the present embodiment, similar to the aforementioned extraction of style features and texture features, in order to ensure the accuracy of the extracted structural features, a segmentation adapter may be configured, and the generation system may use the segmentation adapter to perform multi-scale feature extraction on the segmented image segmented from the first image to obtain the structural features of the target object.
[0086] The structural features extracted by the segmentation adapter can be expressed as:
[0087] .
[0088] in, It can refer to structural features, It can be a scale feature at the first scale, It can refer to the scale characteristics at the second scale, It can refer to the scale feature at a third scale, where the scale of the segmentation adapter corresponds to the scale of the texture adapter.
[0089] In the above embodiment of the present application, the segmentation adapter includes: a second pixel rearrangement module, multiple second residual blocks, and a second downsampling module connected between any two second residual blocks. The segmentation adapter is used to perform multi-scale feature extraction on the segmented image to obtain structural features, including: using the second pixel rearrangement module to rearrange the segmented image to obtain second rearrangement features; using multiple second residual blocks to perform residual processing on the second input features to obtain structural features, wherein the second input feature of the first second residual block among the multiple second residual blocks is the second rearrangement feature, the second input features of the other second residual blocks are the features output by the connected second downsampling modules, and the other second residual blocks are used to characterize the second residual blocks other than the first second residual block among the multiple second residual blocks; using the second downsampling module to downsample the features output by the connected second residual blocks to obtain the features output by the second downsampling module.
[0090] In an optional solution of the present embodiment, similar to the aforementioned texture adapter, the segmentation adapter may at least include: a second pixel rearrangement module, a plurality of second residual blocks, and a second downsampling module connected between any two second residual blocks. To ensure the accuracy of the extracted structural features, when the segmentation adapter is used to extract multi-scale features from the segmented image, the segmented image may be rearranged using the second pixel rearrangement module, for example, the initial texture features with high similarity may be arranged together, or different initial texture features may be rearranged according to parameters such as texture intensity and texture direction, or the size, direction, contrast and other parameters of the initial texture features may be adjusted to obtain the corresponding second rearranged features, and then the second rearranged features may be subjected to residual processing through the plurality of second residual blocks to determine the structural features of the target object. Among these, the input feature of the first second residual block in the plurality of second residual blocks is the second rearranged feature, and the input features of the other second residual blocks are the features output by the second downsampling module connected adjacent to the second residual block, and the features output by different second residual blocks may be regarded as the structural features at the corresponding scale of the second residual block. Correspondingly, the input of the second downsampling module connected between different second residual blocks can be the feature output by the previous second residual block connected adjacent to the second downsampling module. The feature output by the connected second residual block can be downsampled in the second downsampling module to obtain the feature output by the second downsampling module, and the feature can be used as the input feature of the next first residual block connected adjacent to the second downsampling module.
[0091] In the above-mentioned embodiment of the present application, multiple features are used to control the image generation model to generate a target image based on the first image and the second image, including: based on the posture information of the target object, using the deformation model to deform the target object in the second image to obtain a deformed image, wherein the deformed image contains the deformed target object; removing the current object added to the target object from the first image to obtain a third image; adding the deformed image and the third image pixel by pixel to obtain a summed image; performing noise processing on the first image to obtain a noise image; and using multiple features to control the image generation model to generate a target image based on the summed image and the noise image.
[0092] In an optional solution of this embodiment, in order to ensure the realism of the generated target image, when generating the target image according to the acquired multiple features, the target object can be first deformed according to the aforementioned process of deforming the target object, the posture information of the target object in the first image can be determined, and the target object in the second image can be deformed using the deformation model to obtain a deformed image that matches the posture information displayed by the target object in the first image and contains the deformed target object, and then the current object currently added to the target object is removed from the first image to obtain an image that does not contain the current object, i.e., the third image. After obtaining the third image, the generation system can add the deformed image and the third image pixel by pixel to implement the operation of adding the target object to the target object in the virtual environment, such as simulating the operation of the user wearing clothes according to the posture in the first image. However, considering that simply adding the two images element by element may not be able to simulate the realism of the target object wearing or donning the target item in the real scene, the generated summed image will look rather abrupt as a whole. For example, when clothes are added to the user in a virtual environment, the clothes are too flat and cannot reflect the effect of the user actually wearing the clothes. Therefore, after obtaining the summed image, the generation system can further perform noise processing on the acquired first image to obtain a noise image that can simulate the effect of the target object wearing or donning the target item in the real scene, and then use the acquired style features, texture features and structural features to synthesize the summed image and the noise image using a diffusion model to simulate the actual effect of the target object wearing or donning the target item in the real scene in the virtual environment, thereby obtaining a target image with higher realism, wherein the diffusion model used here can be a steady-state diffusion model.
[0093] In the above embodiment of the present application, the image generation model includes: a generation encoder, a plurality of down-sampling modules connected in sequence, and a plurality of up-sampling modules connected in sequence; when the plurality of features include style features, texture features, and structural features, the plurality of features are used to control the image generation model to generate a target image based on the sum image and the noise image, including: using the generation encoder to perform feature extraction on the sum image to obtain the sum feature, and using the generation encoder to perform feature extraction on the noise image to obtain the noise feature; inputting the sum feature and the noise feature into the first down-sampling module among the plurality of down-sampling modules, and obtaining the down-sampling result output by the last down-sampling module among the plurality of down-sampling modules, wherein the plurality of The down-sampling modules correspond one-to-one to the multi-scale features in the texture features and the multi-scale features in the structural features. The down-sampling result output by any down-sampling module is the result obtained by weighted summing the initial result of any down-sampling module, the texture features of the corresponding scale and the structural features. The initial result of any sampling module is the result obtained by down-sampling the input features of any sampling module by any sampling module; the down-sampling result output by the last down-sampling module is respectively input to the first up-sampling module among the multiple up-sampling modules, and the style features are input to any up-sampling module, and the target image output by the last up-sampling module among the multiple up-sampling modules is obtained.
[0094] In an optional scheme of the present embodiment, in order to make high use of the target image generated by the image generation model, a generation encoder, a plurality of downsampling modules connected in sequence, and a plurality of upsampling modules connected in sequence may be set in the image generation model, wherein the plurality of downsampling modules correspond one-to-one to the plurality of scales of the above-mentioned texture features and the plurality of scales of the structural features, and the plurality of downsampling modules correspond one-to-one to the plurality of upsampling modules. When the image generation model is used to process the sum image and the noise image according to the plurality of features acquired, such as style features, texture features, and structural features to generate the target image, the generation system may first use the above-mentioned generation encoder to perform feature extraction on the sum image to obtain the image features of the sum image, i.e., the above-mentioned sum features, and at the same time use the generation encoder to perform feature extraction on the noise image to obtain the image features of the noise image, i.e., the above-mentioned noise features.
[0095] For ease of understanding, the formula for determining noise characteristics can be:
[0096] .
[0097] in, represents the noise characteristics, represents a noisy image, represents Gaussian noise, , It may refer to features obtained by processing the first image using the above-mentioned variational encoder.
[0098] After determining the summed features and noise, the generation system can input the summed features and noise features into the above-mentioned multiple downsampling modules for processing to obtain different initial results output by different downsampling modules, and then perform weighted processing on the initial results output by different downsampling modules, the texture features and structural features of the corresponding scales of different downsampling modules to obtain different downsampling results corresponding to different downsampling modules. Finally, the downsampling result output by the last downsampling module in the multiple downsampling modules can be input into the first upsampling module in the above-mentioned multiple upsampling modules to perform an upsampling operation on the downsampling result to construct a target image, and when using these multiple upsampling modules to perform upsampling operations, style features that can reflect the style of the target object are introduced multiple times, thereby ensuring that the target object can retain its own style in the generated target image, further improving the effect of the target object generated in the virtual environment wearing or wearing the target object, and further improving the realism of the target image generated in the virtual environment.
[0099] For ease of understanding, the formula for weighting the initial results, texture features of the corresponding scale, and structural features can be:
[0100] .
[0101] in, Represents the weight value, which can be a hyperparameter. Represents the weighted downsampling result.
[0102] The formula for processing the downsampling result and style features through the upsampling module can be:
[0103] E z,t, h c , F HF , F seg ,ϵ [||ϵ - ϵ θ ( z t ' , t , h c , F HF , F seg )| | 2 2 ] .
[0104] in, May refer to learnable parameters.
[0105] In the above embodiments of the present application, any upsampling module includes: a self-attention layer, a gated self-attention layer and a cross-attention layer. The self-attention layer is used to perform self-attention processing on the input features of any upsampling module to obtain self-attention features. The gated self-attention layer is used to perform gated self-attention processing on the self-attention features and the color features in the style features to obtain the gated self-attention features. The cross-attention layer is used to perform cross-attention processing on the gated self-attention features and the category features in the style features to obtain the output features of any upsampling module.
[0106] It should be noted that in order to improve the effect of the upsampling module on processing the received downsampling results and style features, at least: a self-attention layer, a gated self-attention layer and a cross-attention layer can be configured in the upsampling module. The corresponding upsampling module can perform self-attention processing on the input features of any upsampling module through the self-attention layer to determine the self-attention features corresponding to the downsampling results, and then perform gated self-attention processing on the self-attention features and the color features in the style features through the gated self-attention layer to obtain the corresponding gated self-attention features. Finally, the cross-attention layer is used to perform cross-attention processing on the obtained gated self-attention features and the category features in the style features, so as to obtain image features close to those presented when the target object is wearing or wearing the target object in a real scene, that is, the output features of any of the above-mentioned upsampling modules, and the generation system can generate a target image with higher realism based on the output features.
[0107] For ease of understanding, the formulas for the above three attention layers can be expressed in turn as follows:
[0108] ;
[0109] ;
[0110] .
[0111] in, May refer to a learnable scalar whose initial value is 0.
[0112] In an embodiment of the present application, after performing feature extraction on the segmented image of the first image and the second image respectively to obtain multiple features of the target object, the above method also includes: using the multiple features to control the image generation model to generate multiple images based on the first image and the second image; combining the multiple images to obtain the target video.
[0113] In a hard scheme of the present embodiment, in order to facilitate user viewing, after extracting multiple features of the target object, the generation system can also use the image generation model to perform image generation operations on the above-mentioned first image and second image based on these multiple features, so as to obtain multiple images that are a fusion of the first image and the second image, and then combine these multiple images to generate the above-mentioned target video. The user can intuitively view the effect of adding the target object to the target object through the target video.
[0114] In the above embodiment of the present application, after using multiple features to control the image generation model to generate a target image based on the first image and the second image, the above method also includes: outputting the first image, the second image and the target image; upon receiving a first feedback result of the target image, adjusting the model parameters of the style adapter, the model parameters of the encoder, the model parameters of the texture adapter, the model parameters of the segmentation adapter, and the model parameters of the image generation model based on the first image, the second image and the target image, wherein the first feedback result is a result obtained by modifying the target image when the target image does not match the first image and the second image.
[0115] In an optional scheme of the present embodiment, the generation system may further output the target image, and the corresponding first image and second image in a preset operation interface after constructing the target image, and the user may evaluate and modify the target image. The controller may determine the user's modification of the target image based on the evaluation and modification results output by the user when the target image does not match the first image and the second image, that is, the first feedback result obtained by modifying the target image, and then adjust the style adapter, encoder, texture adapter, segmentation adapter, image generation model and other modules used in the process of generating the target image based on the first image, the second image and the target image according to the first feedback result, so that the target image generated using these modules can better meet user needs, for example, be more in line with real scenes.
[0116] In the above embodiment of the present application, after deforming the target object in the second image using a deformation model based on the posture information of the target object to obtain a deformed image, the above method also includes: outputting the posture information of the target object and the deformed image; upon receiving a second feedback result of the deformed image, updating the deformed image to the second feedback result, wherein the second feedback result is a result obtained by modifying the deformed image when the deformed image does not match the posture information of the target object.
[0117] In an optional scheme of the present embodiment, in addition to directly outputting the target image, after generating the deformed image, the generation system may also output the deformed image obtained by deforming the target object in a preset operation interface, and the user may evaluate and modify the deformed image to eliminate unreasonable places in the deformed image as much as possible, such as abnormal proportions of various parts of the deformed target object, bending degrees that do not conform to the actual scene, etc., so as to improve the rationality of the deformed image. The controller may directly modify the deformed image to the above-mentioned second feedback result based on the result obtained by the user when the deformed image does not match the posture information of the target object, that is, the above-mentioned second feedback result, to ensure that the target image generated using the deformed image can meet the user's expectations.
[0118] In the above embodiment of the present application, after removing the current item added to the target object from the first image to obtain the third image, the above method also includes: outputting the third image; when receiving a third feedback result of the third image, adding the deformed entity image and the third feedback result pixel by pixel to obtain a summed image, wherein the third feedback result is a result obtained by modifying the third image when there is an error in the third image.
[0119] In an optional scheme of the present embodiment, the generation system can also output a third image after removing the second skin information from the first image in a preset operation interface, and then the user evaluates and modifies the third image to improve the accuracy of removing the second skin information from the first image. The generation system can add the result obtained by the user modifying the third image when there is an error in the third image, that is, the third feedback result, with the deformed image pixel by pixel to improve the effect of fusing the target object in the first image and the target object in the second image, thereby obtaining a more accurate summed image.
[0120] In the above embodiment of the present application, after adding the deformed image and the third image pixel by pixel to obtain the summed image, the method also includes: outputting the deformed image, the third image and the summed image; upon receiving a fourth feedback result of the summed image, using multiple features to control the image generation model to generate a target image based on the fourth feedback result and the noise image, wherein the fourth feedback result is a result obtained by modifying the summed image when the summed image does not match the deformed image and the third image.
[0121] In an optional solution of this embodiment, the generation system can also output the above-mentioned sum image in a preset operation interface, and the user can continue to evaluate and modify the sum image to reduce unreasonable places in the fused sum image, such as reducing the pixels not covered by the deformed image and the third image, and improving the fit between the deformed image and the third image. The generation system can use the acquired style features, texture features, and structural features to control the image generation model to fuse the noise image obtained by noise processing the first image based on the fourth feedback result, that is, the result obtained by the user modifying the sum image when the sum image does not match the deformed image and the third image, so as to obtain a target image that is more in line with the real scene and has better visual effects.
[0122] For ease of understanding, Figure 3 is a schematic diagram of an image generation process according to Embodiment 1 of the present application, such as Figure 3 As shown, the entire target image generation process can be divided into three parts. The first part is the overall style preservation module, the second part is the texture detail and fitting structure preservation module, and the third part is the target image generation part, where 301 represents a third image that is independent of clothing, 302 represents a deformed image, 303 represents a mask image, 304 represents a summed image, 305 represents a noise image, 306 represents an initial texture feature, 307 represents a segmentation image, 308 represents a texture adapter, 309 represents a segmentation adapter, and 310 represents a Diffusion. Model image generation model, 311 represents the second image, 312 represents the encoder in the multimodal model, 313 represents the encoder in the variational autoencoder, 314 represents the extracted image block features, 315 represents the extracted category unit features, 316 represents the style adapter, 317 represents the decoder, 318 represents the cross attention layer, 319 represents the gated sub-attention layer, 320 represents the self-attention module layer, 321 represents the scale, 322 represents the denoised target image, 323 represents the element-by-element sum, and 324 represents the high-pass filter.
[0123] like Figure 3As shown, in the first part, the generation system can use the encoder in the multimodal model to extract the image block features and category unit features of the second image, and use the decoder to decode the category unit features to determine the category features of the target image, and then use the encoder of the variational autoencoder to extract the image features of the second image, and use the style adapter to fuse the image features and image block features to determine the color features of the target object. In the second part, the generation system can obtain the segmented image determined from the first image, use the segmentation adapter to perform multi-scale feature extraction on the segmented image to obtain the structural features of the target object, and then use the structural features to determine the deformed image obtained by deforming the target object and the mask image corresponding to the deformed image. The generation system can use a high-pass filter to extract features from the deformed image and the mask image to determine the initial texture features of the target object, and then use the texture adapter to perform multi-scale feature extraction on the initial texture features to obtain the texture features of the target object. In the third part, the generation system can obtain a third image in the first image that is independent of clothing, and then add the third image and the above-mentioned deformed image pixel by pixel to obtain a corresponding sum image, and input the sum image and the noise image corresponding to the first image into the image generation model, and combine the style features, texture features and structural features of different scales to generate the final target image. When introducing the style image, the style image determined in the first part can be processed through a self-attention layer, a gated self-attention layer and a cross-attention layer to improve the realism of the generated target image.
[0124] Figure 4 401 represents a Flatten flattening process, 402 represents a Linear linear processing, 403 represents a Relu activation processing, 404, 405 and 406 represent different weights, 407 represents a Muli-head Attention attention processing, 408 represents a feedforward network FNN, 409 represents an image feature, and 410 represents an image block feature, such as Figure 4 As shown, when determining the color features of the target object, the image features of the second image can be flattened, linearly processed, and activated to obtain processed image features, and then the processed image features and image block features are subjected to attention processing according to different weights to obtain attention features, and then the attention features and image block features are superimposed to obtain superimposed features, and at the same time, the superimposed features are processed using a feedforward network to obtain feedforward features, and finally, the feedforward features and superimposed features are further superimposed to obtain the color features of the target object.
[0125] Figure 5is a schematic diagram of an adapter operation process according to Example 1 of the present application, such as Figure 5 As shown, the generation system can input the parameters 501 that need to be processed, such as image block features and image features, segmented images, initial texture features and other parameters, into the pixel rearrangement module 502 to obtain rearranged features, and then input the rearranged features into the residual blocks, such as 5031, 5032, and 5033, and output the scale features corresponding to the residual blocks, i.e., features such as 5041, 5042, and 5043. In addition, downsampling modules, such as 5051 and 5052, are connected between different residual blocks to downsample the features output by the previous residual block and input them into the next residual block.
[0126] In the above embodiment of the present application, the image generation model is a pre-trained model including an attention layer. The parameters of the attention layer, the model parameters of the style adapter, the model parameters of the encoder, the model parameters of the texture adapter and the model parameters of the segmentation adapter in the image generation model are obtained by training using training data, and the model parameters of the image generation model except the parameters of the attention layer remain unchanged during the training process, so as to minimize the adjustable parameters used in the model training process, thereby greatly improving the efficiency of training the image generation model and reducing the image calculation cost. At the same time, the pre-trained weights pre-set in the image generation model will not be easily changed and destroyed, and the style characteristics of the target object can be effectively introduced into the process of generating the target image, which can greatly improve the matching degree between the generated target image and the target object and ensure the realism of the target image.
[0127] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0128] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0130] Example 2
[0131] According to an embodiment of the present application, an image generating method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0132] Figure 6 is a flow chart of an image generation method according to Embodiment 2 of the present application, such as Figure 6 As shown, the method may include the following steps:
[0133] Step S602, acquiring an object image of a target object and an apparel image of a target apparel.
[0134] The target item is the first skin information to be covered on the surface of the target object.
[0135] The target object may refer to an object that can wear or wear the target clothing.
[0136] In an optional scheme of the present embodiment, in order to quickly and conveniently display the effect presented when the above-mentioned target object wears or wears the target clothing, a target image corresponding to the target object wearing or wearing the target clothing can be generated in a virtual scene. In order to improve the realism of the generated target image, the image generation system (referred to as the generation system) can first shoot the physical appearance of the above-mentioned target object and target clothing through an image acquisition device in a physical environment to obtain an object image of the target object and a clothing image of the target clothing, thereby ensuring the authenticity of the object image and clothing image obtained for generating the target image, and further ensuring the realism of the target image generated in the virtual environment based on the target object and the target clothing.
[0137] Step S604 , performing feature extraction on the segmented image and the clothing image corresponding to the object image, respectively, to obtain a plurality of features of the target clothing.
[0138] Among them, different features are used to characterize the description of the target clothing from different dimensions, and the segmented image contains the posture information of the target object and the position information of the target object in the object image.
[0139] In the above embodiments of the present application, the above multiple features include at least two of the following: style features, texture features and structural features.
[0140] In an optional scheme of the present embodiment, in order to accurately display the effect presented by the target object when wearing or wearing the target clothing and to ensure that the generated target image is more in line with the real scene, after acquiring the object image and the clothing image, the generation system can use computer vision technology to extract representative image features from the segmented image of the above-mentioned object image and the clothing image, that is, multiple features of the above-mentioned target clothing, so as to ensure the accuracy of analysis, identification and processing of the clothing image. Based on this, in order to improve the fit between the target object and the target clothing in the generated target image, avoid the mismatch between the target object and the target clothing, resulting in a large degree of non-match and low realism in the generated target image, after obtaining the object image and the clothing image, the generation system can first segment from the object image an area that can highlight the effect of the generated object wearing or wearing the target clothing to obtain the above-mentioned segmented image, and then perform feature extraction on the segmented image to determine the posture information related to the target clothing currently presented by the target object in the segmented image, such as the current action of the target object, the proportions and sizes between different parts of the target object, and identify the posture information to determine the structure that the target clothing needs to present when the target object wears or wears the target clothing, thereby obtaining the structural features that the target clothing needs to satisfy. In addition, in order to avoid misalignment of the target clothing and the target object in the target image, the extracted structural features can also include the position information of the target object in the object image.
[0141] Furthermore, the generation system can also extract features from the clothing image to obtain the above-mentioned style features that can reflect the overall style of the target clothing. Considering the factors that affect whether the target object wears or wears the target clothing, the texture features of the target clothing are also one of the important factors. For example, when users choose clothes, in addition to checking the style of the clothes, they will also consider whether the texture on the clothes meets the user's preferences. Therefore, the generation system can also extract the texture features of the target clothing from the clothing image, so that the generated target image can fully and accurately reflect the appearance of the target object when wearing or wearing the target clothing.
[0142] Step S606, using multiple features, controlling the image generation model to generate a target image based on the object image and the clothing image.
[0143] The target object in the target image wears target clothing.
[0144] In an optional solution of this embodiment, after determining multiple features of the target clothing in the clothing image, such as style features, texture features, and structural features, the generation system can further use the above-mentioned image generation model to fuse the object image and the clothing image based on these features to generate a target image that can reflect the effect of adding the target clothing to the target object. For example, the generation system can first generate an image based on the determined structural features, and then fill the image with the style features and texture features of the target clothing to generate skin information corresponding to the target clothing that can reasonably cover the target object's skin surface in the object image to simulate the effect presented by the target clothing when the above-mentioned structural features are met. It should be noted that the structure of the skin information generated here is the same as the structure of the second skin information mentioned above. After generating the new skin information, the generation system can reuse the above-mentioned image generation model to fuse the generated skin information into the target object in the object image to simulate the effect presented when the target object wears or wears the target clothing, thereby obtaining a target image covering the above-mentioned target clothing on the biological surface, avoiding the mismatch between the structure of the target clothing and the posture of the target object, resulting in abnormalities in the simulated generated object when wearing or wearing the target clothing, such as the user's arm and the sleeve of the top do not overlap, thereby improving the accuracy of the generated target image.
[0145] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0146] Example 3
[0147] According to an embodiment of the present application, an image generating method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0148] Figure 7 is a flow chart of an image generation method according to Embodiment 3 of the present application, such as Figure 7 As shown, the method may include the following steps:
[0149] Step S702: Acquire a first image of the target object and a second image of the target object by calling a first interface.
[0150] The first interface includes a first parameter, a parameter value of the first parameter includes a first image and a second image, and a target item is to be added to the target object.
[0151] In an optional scheme of the present embodiment, in order to quickly and conveniently display the effect presented when the above-mentioned target object wears or wears the target item, a target image corresponding to the target object wearing or wearing the target item can be generated in a virtual scene, and in order to improve the realism of the generated target image, the image generation system (referred to as the generation system) can first shoot the physical appearance of the above-mentioned target object and target item through an image acquisition device in a physical environment to obtain a first image of the target object and a second image of the target item, and call the parameter value of the first parameter through the above-mentioned first interface, that is, call the captured first image and second image, so as to ensure the authenticity of the first image and second image obtained for generating the target image, and then ensure the realism of the target image generated in the virtual environment according to the target object and target item.
[0152] Step S704: extract features from the segmented image of the first image and the second image respectively to obtain multiple features of the target object.
[0153] Among them, different features are used to characterize the description of the target object from different dimensions, and the segmented image contains the posture information of the target object and the position information of the target object in the first image.
[0154] In the above embodiments of the present application, the above multiple features include at least two of the following: style features, texture features and structural features.
[0155] In an optional scheme of the present embodiment, in order to accurately display the effect presented by the target object when wearing or wearing the target object, and to ensure that the generated target image is more in line with the real scene, after acquiring the first image and the second image, the generation system can use computer vision technology to extract representative image features, that is, multiple features of the target object, from the segmented image of the first image and the second image, to ensure the accuracy of analysis, identification and processing of the second image. Based on this, in order to improve the degree of fit between the target object and the target article in the generated target image, avoid the mismatch between the target object and the target article, resulting in a large degree of inconsistency and low realism in the generated target image, after acquiring the first image and the second image, the generation system can first segment from the first image an area that can highlight the effect presented when the generated object wears or wears the target article, so as to obtain the above-mentioned segmented image, and then perform feature extraction on the segmented image to determine the posture information related to the target article currently presented by the target object in the segmented image, such as the current action of the target object, the proportion and size between different parts of the target object, and other information, and identify the posture information to determine the structure that the target article needs to present when the target object wears or wears the target article, thereby obtaining the structural features that the target article needs to satisfy. In addition, in order to avoid misalignment between the target article and the target object in the target image, the extracted structural features can also include the position information of the target object in the first image.
[0156] Furthermore, the generation system can also extract features from the second image to obtain the above-mentioned style features that can reflect the overall style of the target object. Considering the factors that affect whether the target object wears or puts on the target object, the texture features of the target object are also one of the important factors. For example, when a user chooses clothes, in addition to checking the style of the clothes, he will also consider whether the texture on the clothes meets the user's preferences. Therefore, the generation system can also extract the texture features of the target object from the second image, so that the generated target image can fully and accurately reflect the appearance of the target object when wearing or putting on the target object.
[0157] In an optional scheme of the present embodiment, in order to ensure that the generated target image can meet the user's expectations, the above-extracted style features and texture features can also be adjusted according to user needs. For example, the user can input a text instruction for feature adjustment to the generation system, and the generation system can adjust the above-mentioned style features or texture features accordingly according to the instruction, such as keeping the current category and texture unchanged and changing the color of the target object, or keeping the current color and category of the target object unchanged and changing the texture of the target object, etc.
[0158] It should be noted that in order to ensure the realism of the generated target object, the above-mentioned extracted features may include at least two features among style features, texture features and structural features to avoid the situation where the generated target image does not match the target object and target item.
[0159] Step S706: using the plurality of features, controlling the image generation model to generate a target image based on the first image and the second image.
[0160] Wherein, a target item is added to the target object in the target image.
[0161] In an optional solution of this embodiment, after determining multiple features of the target object in the second image, such as style features, texture features, and structural features, the generation system can further use the above-mentioned image generation model to fuse the first image and the second image based on these features to generate a target image that can reflect the effect of adding the target object to the target object. For example, the generation system can first generate an image based on the determined structural features, and then fill the image with the style features and texture features of the target object to generate skin information corresponding to the target object that can reasonably cover the skin surface of the target object in the first image, so as to simulate the effect presented by the target object when the above-mentioned structural features are met. It should be noted that the structure of the skin information generated here is the same as the structure of the above-mentioned second skin information. After generating the new skin information, the generation system can reuse the above-mentioned image generation model to fuse the generated skin information into the target object in the first image to simulate the effect presented when the target object wears or wears the target object, thereby obtaining a target image covering the above-mentioned target object on the biological surface, avoiding the mismatch between the structure of the target object and the posture of the target object, resulting in abnormalities when the simulated generated object wears or wears the target object, such as the user's arm does not overlap with the sleeve of the shirt, thereby improving the accuracy of the generated target image.
[0162] Step S708: output the target image by calling the second interface.
[0163] The second interface includes a second parameter, and a parameter value of the second parameter includes a target image.
[0164] In an optional scheme of this embodiment, after generating the target image, the processing system can obtain the parameter value of the second parameter by calling the second interface, that is, obtain the generated target image, and then display the target image in a preset operation interface for user viewing.
[0165] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0166] Example 4
[0167] According to an embodiment of the present application, an image generating device for implementing the above-mentioned image generating method is also provided. Figure 8 is a structural block diagram of an image generating device according to Embodiment 4 of the present application, such as Figure 8 The device shown includes: an image acquisition module 802 , a feature extraction module 804 and an image generation module 806 .
[0168] Among them, the image acquisition module 802 is used to acquire a first image of the target object and a second image of the target object, wherein the target object is to be added to the target object; the feature extraction module 804 is used to extract features from the segmented image and the second image of the first image respectively to obtain multiple features of the target object, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains the posture information of the target object and the position information of the target object in the first image; the image generation module 806 is used to use multiple features to control the image generation model to generate a target image based on the first image and the second image, wherein the target object in the target image is added with the target object.
[0169] In the above embodiments of the present application, the multiple features include at least two of the following: style features, texture features, and structural features.
[0170] In the above embodiment of the present application, the feature extraction module 804 includes: a first extraction unit, used to use a visual encoder to extract features from the second image to obtain category unit features and image block features, wherein the category unit features are used to characterize the category information of the target object, and the image block features are used to characterize the color information of the second image; a feature decoding unit, used to use a decoder to decode the category unit features to obtain category features; use a variational autoencoder to extract features from the second image to obtain image features; a first fusion unit, used to use a style adapter to fuse the image block features with the image features to obtain color features; wherein the style features include category features and color features.
[0171] In the above embodiment of the present application, the style adapter includes: a multi-head attention module and a feedforward network module, and the first fusion unit is also used to: flatten and map the image features to obtain processed image features; use the multi-head attention module to perform attention processing on the processed image features and image block features to obtain attention features; superimpose the attention features with the image block features to obtain superimposed features; use the feedforward network module to process the superimposed features to obtain feedforward features; superimpose the superimposed features with the feedforward features to obtain color features.
[0172] In the above embodiment of the present application, the feature extraction module 804 also includes: a first deformation unit, which is used to deform the target object in the second image using a deformation model based on the posture information of the target object to obtain a deformed image, wherein the deformed image contains the deformed target object; a second extraction unit, which is used to extract features from the deformed image and the mask image of the deformed image using a high-pass filter to obtain initial texture features, wherein the mask image is used to characterize the position of the deformed target object in the deformed image; and a third extraction unit, which is used to perform multi-scale feature extraction on the initial texture features using a texture adapter to obtain texture features.
[0173] In the above embodiment of the present application, the high-pass filter includes: a Sobel operator and an erosion operator, and the second extraction unit is also used to: perform a convolution operation on the deformed image using the Sobel operator to obtain a convolution result; perform an erosion operation on the mask image using the erosion operator to obtain an erosion result; perform a Hadamard product operation on the convolution result and the erosion result to obtain an initial texture feature.
[0174] In the above embodiment of the present application, the texture adapter includes: a first pixel rearrangement module, multiple first residual blocks, and a first downsampling module connected between any two first residual blocks, and the third extraction unit is also used to: use the first pixel rearrangement module to rearrange the initial texture feature to obtain a first rearrangement feature; use multiple first residual blocks to perform residual processing on the first input feature to obtain a texture feature, wherein the first input feature of the first first residual block among the multiple first residual blocks is the first rearrangement feature, the first input features of the other first residual blocks are the features output by the connected first downsampling module, and the other first residual blocks are used to characterize the first residual blocks other than the first first residual block among the multiple first residual blocks; use the first downsampling module to downsample the features output by the connected first residual blocks to obtain the features output by the first downsampling module.
[0175] In the above embodiment of the present application, the feature extraction module 804 includes: a fourth extraction unit, which is used to perform multi-scale feature extraction on the segmented image by using a segmentation adapter to obtain structural features.
[0176] In the above embodiment of the present application, the segmentation adapter includes: a second pixel rearrangement module, multiple second residual blocks, and a second downsampling module connected between any two second residual blocks, and the fourth extraction unit is also used to: use the second pixel rearrangement module to rearrange the segmented image to obtain a second rearrangement feature; use multiple second residual blocks to perform residual processing on the second input feature to obtain a structural feature, wherein the second input feature of the first second residual block among the multiple second residual blocks is the second rearrangement feature, and the second input features of the other second residual blocks are the features output by the connected second downsampling module, and the other second residual blocks are used to characterize the second residual blocks other than the first second residual block among the multiple second residual blocks; use the second downsampling module to downsample the features output by the connected second residual blocks to obtain the features output by the second downsampling module.
[0177] In the above embodiment of the present application, the image generation module 806 includes: a second deformation unit, which is used to deform the target object in the second image based on the posture information of the target object using a deformation model to obtain a deformed image, wherein the deformed image contains the deformed target object; an image removal unit, which is used to remove the current object added to the target object from the first image to obtain a third image; a first addition unit, which is used to add the deformed image and the third image pixel by pixel to obtain a summed image; a noise processing unit, which is used to perform noise processing on the first image to obtain a noise image; and an image generation unit, which is used to control the image generation model using multiple features to generate a target image based on the summed image and the noise image.
[0178] In the above embodiment of the present application, the image generation model includes: a generation encoder, a plurality of downsampling modules connected in sequence, and a plurality of upsampling modules connected in sequence; the image generation unit is also used for: using the generation encoder to extract features from the sum image to obtain the sum feature, and using the generation encoder to extract features from the noise image to obtain the noise feature; inputting the sum feature and the noise feature into the first downsampling module among the plurality of downsampling modules, and obtaining the downsampling result output by the last downsampling module among the plurality of downsampling modules, wherein the plurality of downsampling modules correspond one-to-one to the multi-scale features in the texture feature and the multi-scale features in the structure feature, and the downsampling result output by any downsampling module is the result obtained by weighted summing the initial result of any downsampling module, the texture feature of the corresponding scale, and the structure feature, and the initial result of any sampling module is the result obtained by any sampling module downsampling the input feature of any sampling module; respectively inputting the downsampling result output by the last downsampling module into the first upsampling module among the plurality of upsampling modules, and inputting the style feature into any upsampling module, and obtaining the target image output by the last upsampling module among the plurality of upsampling modules.
[0179] In the above embodiments of the present application, any upsampling module includes: a self-attention layer, a gated self-attention layer and a cross-attention layer. The self-attention layer is used to perform self-attention processing on the input features of any upsampling module to obtain self-attention features. The gated self-attention layer is used to perform gated self-attention processing on the self-attention features and the color features in the style features to obtain the gated self-attention features. The cross-attention layer is used to perform cross-attention processing on the gated self-attention features and the category features in the style features to obtain the output features of any upsampling module.
[0180] In the above embodiment of the present application, the above device also includes: a first generation unit, used to use multiple features to control the image generation model to generate multiple images based on the first image and the second image; an image combination unit, used to combine multiple images to obtain a target video.
[0181] In the above embodiment of the present application, the above device also includes: a first output unit, which is used to output the first image, the second image and the target image; a first adjustment unit, which is used to adjust the model parameters of the style adapter, the model parameters of the encoder, the model parameters of the texture adapter, the model parameters of the segmentation adapter, and the model parameters of the image generation model based on the first image, the second image and the target image when receiving a first feedback result of the target image, wherein the first feedback result is a result obtained by modifying the target image when the target image does not match the first image and the second image.
[0182] In the above embodiment of the present application, the above device also includes: a second output unit, used to output the posture information and the deformed image of the target object; an image update unit, used to update the deformed image to the second feedback result when receiving the second feedback result of the deformed image, wherein the second feedback result is a result obtained by modifying the deformed image when the deformed image does not match the posture information of the target object.
[0183] In the above embodiment of the present application, the above device also includes: a third output unit, used to output a third image; a second addition unit, used to, when receiving a third feedback result of the third image, perform pixel-by-pixel addition of the deformed entity image and the third feedback result to obtain a summed image, wherein the third feedback result is a result obtained by modifying the third image when there is an error in the third image.
[0184] In the above-mentioned embodiment of the present application, the above-mentioned device also includes: a fourth output unit, which is used to output the deformed image, the third image and the summed image; a second generation unit, which is used to control the image generation model using multiple features to generate a target image based on the fourth feedback result and the noise image when receiving the fourth feedback result of the summed image, wherein the fourth feedback result is the result obtained by modifying the summed image when the summed image does not match the deformed image and the third image.
[0185] In the above embodiments of the present application, the image generation model is a pre-trained model including an attention layer, and the parameters of the attention layer, the model parameters of the style adapter, the model parameters of the encoder, the model parameters of the texture adapter, and the model parameters of the segmentation adapter in the image generation model are obtained by training using training data, and the model parameters of the image generation model except the parameters of the attention layer remain unchanged during the training process.
[0186] It should be noted that the above-mentioned image acquisition module 802, feature extraction module 804 and image generation module 806 correspond to steps S202 to S206 in Example 1, and the three modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may be run in the server 10 provided in Example 1.
[0187] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0188] Example 5
[0189] According to an embodiment of the present application, an image generating device for implementing the above-mentioned image generating method is also provided. Fig. 9 is a structural block diagram of an image generating device according to Embodiment 5 of the present application, such as Fig. 9 The device shown includes: a first acquisition module 902 , a first extraction module 904 and a first generation module 906 .
[0190] Among them, the first acquisition module 902 is used to obtain the object image of the target object and the clothing image of the target clothing; the first extraction module 904 is used to perform feature extraction on the segmented image and clothing image corresponding to the object image respectively, and obtain multiple features of the target clothing, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains the posture information of the target object and the position information of the target object in the first image; the first generation module 906 is used to use multiple features to control the image generation model to generate a target image based on the object image and the clothing image, wherein the target object in the target image wears the target clothing.
[0191] It should be noted that the first acquisition module 902, the first extraction module 904 and the first generation module 906 correspond to steps S602 to S606 in Example 2, and the three modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may run in the server 10 provided in Example 1.
[0192] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0193] Example 6
[0194] According to an embodiment of the present application, an image generating device for implementing the above-mentioned image generating method is also provided. Fig.10 is a structural block diagram of an image generating device according to Embodiment 6 of the present application, such as Fig.10 The device shown includes: a second acquisition module 1002 , a second extraction module 1004 , a second generation module 1006 and an image output module 1008 .
[0195] Among them, the second acquisition module 1002 is used to obtain a first image of the target object and a second image of the target object by calling the first interface, wherein the first interface includes a first parameter, the parameter value of the first parameter includes the first image and the second image, and the target object is to be added to the target object; the second extraction module 1004 is used to perform feature extraction on the segmented image and the second image of the first image respectively to obtain multiple features of the target object, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains the posture information of the target object and the position information of the target object in the first image; the second generation module 1006 is used to use multiple features to control the image generation model to generate a target image based on the first image and the second image, wherein the target object in the target image is added with the target object; the image output module 1008 is used to output the target image by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target image.
[0196] It should be noted that the second acquisition module 1002, the second extraction module 1004, the second generation module 1006 and the image output module 1008 correspond to steps S702 to S708 in Example 3, and the four modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may be run in the server 10 provided in Example 1.
[0197] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0198] Example 7
[0199] The embodiment of the present application may provide an electronic device, which may be any electronic device in a group of electronic devices. Optionally, in this embodiment, the electronic device may also be replaced by a terminal device such as a mobile terminal.
[0200] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0201] In this embodiment, the electronic device can execute the program code in the method.
[0202] Optionally, Fig.11 is a structural block diagram of an electronic device according to Embodiment 7 of the present application. Fig.11As shown, the electronic device A may include: one or more (only one is shown in the figure) processors 1102, a memory 1104, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.
[0203] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing the methods in the above embodiments. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0204] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain a first image of the target object and a second image of the target item, wherein the target item is to be added to the target object; perform feature extraction on the segmented image of the first image and the second image respectively to obtain multiple features of the target item, wherein different features are used to characterize the description of the target item from different dimensions, and the segmented image contains posture information of the target object and position information of the target object in the first image; use multiple features to control the image generation model to generate a target image based on the first image and the second image, wherein the target item is added to the target object in the target image.
[0205] In an embodiment of the present application, a first image of a target object and a second image of a target object are acquired; feature extraction is performed on a segmented image of the first image and the second image respectively to obtain a plurality of features of the target object; and a manner in which an image generation model generates a target image based on the first image and the second image is controlled by using the plurality of features. By using a diffusion model, the item features of the target object in the second image in a real scene and the object features of the target object in the first image are fused. The target object and the target object can be fused according to the posture information presented by the target object while retaining information of the target object such as its own style and texture, so as to reduce the structural error when the target object and the target object are fused, and at the same time, improve the flexibility of the simulated target object wearing or wearing the target object, thereby making the generated target image more in line with the real scene and more diversified, thereby solving the technical problem of low fidelity of fitting results generated by the virtual fitting solution using a diffusion model in the related art.
[0206] It will be understood by those skilled in the art that the structure shown in the figure is only for illustration, and the electronic device may also be a smart phone (such as , tablet computers, PDAs, and mobile Internet devices (MID), PADs, and other terminal devices. This figure does not limit the structure of the above electronic devices. For example, electronic device A may also include more or fewer components (such as network interfaces, display devices, etc.) than those shown in the figure, or have a different configuration from that shown in the figure.
[0207] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0208] Example 10
[0209] The embodiment of the present application further provides a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the method provided in the above embodiment.
[0210] Optionally, in this embodiment, the storage medium may be located in any electronic device in a group of electronic devices in a computer network, or in any mobile terminal in a group of mobile terminals.
[0211] Optionally, in this embodiment, a computer-readable storage medium is configured to store program codes for executing the following steps: capturing a first image of a target object in a physical environment, and a second image of a target object, wherein the target object is first skin information to be covered on the surface of the target object; performing feature extraction on the second image to obtain style features and texture features of the target object, wherein the style features include: color features and category features; performing feature extraction on a segmented image corresponding to the first image to obtain structural features of the target object, wherein the segmented image is used to characterize a first area on the target object covered with the second skin information, and a second area on the target object not covered with the second skin information; using the style features, texture features and structural features, a controlled diffusion model generates a target image in a virtual environment based on the first image and the second image, wherein the target image is used to characterize an object with the target object covered on the surface of the target object.
[0212] Embodiment 11
[0213] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, and the computer program implements the method provided in the embodiment when executed by a processor.
[0214] Example 12
[0215] The embodiments of the present application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which may be used to store a computer program, and when the computer program is executed by a processor, the method provided in the embodiments is implemented.
[0216] Embodiment 13
[0217] The embodiment of the present application further provides a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the method provided in the above embodiment is implemented.
[0218] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0219] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0220] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0221] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0222] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0223] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0224] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An image generation method, characterized in that: include: Acquire a first image of a target object and a second image of a target item, wherein the target item is to be added to the target object; Performing feature extraction on the segmented image and the second image of the first image respectively to obtain a plurality of features of the target object, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains posture information of the target object and position information of the target object in the first image; By using the multiple features, the image generation model is controlled to generate a target image based on the first image and the second image, wherein the target item is added to the target object in the target image.
2. The method according to claim 1, characterized in that The multiple features include at least two of the following: style features, texture features, and structure features.
3. The method according to claim 2, characterized in that In the case where the multiple features include the style feature, the extracting features from the segmented image of the first image and the second image to obtain the multiple features of the target object includes: Using a visual encoder to extract features from the second image to obtain category unit features and image block features, wherein the category unit features are used to represent category information of the target object, and the image block features are used to represent color information of the second image; Decoding the category unit feature using a decoder to obtain a category feature; Extracting features from the second image using a variational autoencoder to obtain image features; Using a style adapter to fuse the image block feature with the image feature to obtain a color feature; The style feature includes the category feature and the color feature.
4. The method according to claim 2, characterized in that: In the case where the multiple features include the texture feature, the extracting features from the segmented image of the first image and the second image to obtain the multiple features of the target object includes: Based on the posture information of the target object, deform the target object in the second image using a deformation model to obtain a deformed image, wherein the deformed image contains the deformed target object; Using a high-pass filter to extract features from the deformed image and a mask image of the deformed image to obtain initial texture features, wherein the mask image is used to represent the position of the deformed target object in the deformed image; A texture adapter is used to perform multi-scale feature extraction on the initial texture feature to obtain the texture feature.
5. The method according to claim 2, characterized in that: In the case where the multiple features include the texture feature, the extracting features from the segmented image of the first image and the second image to obtain the multiple features of the target object includes: A segmentation adapter is used to perform multi-scale feature extraction on the segmented image to obtain the structural features.
6. The method according to claim 1, characterized in that The using the multiple features to control the image generation model to generate a target image based on the first image and the second image comprises: Based on the posture information of the target object, deform the target object in the second image using a deformation model to obtain a deformed image, wherein the deformed image contains the deformed target object; removing the current item added to the target object from the first image to obtain a third image; Adding the deformed image and the third image pixel by pixel to obtain a summed image; Performing noise processing on the first image to obtain a noise image; The image generation model is controlled by using the multiple features to generate the target image based on the sum image and the noise image.
7. The method according to any one of claims 1 to 6, characterized in that: After extracting features from the segmented image of the first image and the second image respectively to obtain a plurality of features of the target object, the method further includes: Using the multiple features, controlling the image generation model to generate multiple images based on the first image and the second image; The multiple images are combined to obtain a target video.
8. The method according to any one of claims 1 to 6, characterized in that After using the multiple features to control the image generation model to generate a target image based on the first image and the second image, the method further includes: outputting the first image, the second image and the target image; Upon receiving a first feedback result of the target image, model parameters of the style adapter, model parameters of the encoder, model parameters of the texture adapter, model parameters of the segmentation adapter, and model parameters of the image generation model are adjusted based on the first image, the second image, and the target image, wherein the first feedback result is a result obtained by modifying the target image when the target image does not match the first image and the second image.
9. The method according to claim 4 or 6, characterized in that: After deforming the target object in the second image using a deformation model based on the posture information of the target object to obtain a deformed image, the method further includes: Outputting the posture information of the target object and the deformed image; When a second feedback result of the deformed image is received, the deformed image is updated to the second feedback result, wherein the second feedback result is a result obtained by modifying the deformed image when the deformed image does not match the posture information of the target object.
10. The method according to claim 6, characterized in that After removing the current item added to the target object from the first image to obtain a third image, the method further includes: outputting the third image; When the third feedback result of the third image is received, the sum image is obtained by performing pixel-by-pixel addition on the deformed entity image and the third feedback result, wherein the third feedback result is a result obtained by modifying the third image when there is an error in the third image.
11. The method according to claim 6, characterized in that After adding the deformed image and the third image pixel by pixel to obtain the added image, the method further includes: outputting the deformed image, the third image and the added image; Upon receiving the fourth feedback result of the sum image, the multiple features are used to control the image generation model to generate the target image based on the fourth feedback result and the noise image, wherein the fourth feedback result is a result obtained by modifying the sum image when the sum image does not match the deformed image and the third image.
12. The method according to any one of claims 1 to 6, characterized in that: The image generation model is a pre-trained model that includes an attention layer. The parameters of the attention layer, the model parameters of the style adapter, the model parameters of the encoder, the model parameters of the texture adapter, and the model parameters of the segmentation adapter in the image generation model are obtained by training using training data, and the model parameters of the image generation model except the parameters of the attention layer remain unchanged during the training process.
13. An image generation method, characterized in that: include: Acquire an object image of a target object and a clothing image of a target clothing; Performing feature extraction on the segmented image corresponding to the object image and the clothing image respectively to obtain a plurality of features of the target clothing, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains posture information of the target object and position information of the target object in the first image; By using the multiple features, the image generation model is controlled to generate a target image based on the object image and the clothing image, wherein the target object in the target image is wearing the target clothing.
14. An image generation method, characterized in that: include: Acquire a first image of a target object and a second image of a target item by calling a first interface, wherein the first interface includes a first parameter, a parameter value of the first parameter includes the first image and the second image, and the target item is to be added to the target object; Performing feature extraction on the segmented image and the second image of the first image respectively to obtain a plurality of features of the target object, wherein different features are used to characterize the description of the target object from different dimensions, and the segmented image contains posture information of the target object and position information of the target object in the first image; Using the multiple features, controlling the image generation model to generate a target image based on the first image and the second image, wherein the target object in the target image is added with the target item; The target image is output by calling a second interface, wherein the second interface includes a second parameter, and a parameter value of the second parameter includes the target image.
15. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 14 when running.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 14.
17. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Virtual fitting method based on diffusion model
CN117011207A
Virtual fitting method and device, electronic equipment and readable storage medium
CN118172134A
Virtual fitting method and device, electronic equipment and readable storage medium
CN118212028A
Virtual dressing method and apparatus, and device, storage medium and program product
WO2023088277A1
Cited By
Image processing system
CN121685570A
