Virtual fitting method, device and equipment and storage medium
Through the virtual fitting model with dual U-Net structure, combined with deep learning technology for semantic segmentation and mask processing, it solves the problems of low image resolution and high model replacement cost in the existing technology, and realizes high-fidelity virtual fitting. The clothing effect improves user experience and merchant operation efficiency.
Patent Information
- Application Number
- CN202410392719.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2024-10-01
AI Technical Summary
Existing virtual fitting technology generates images with low resolution, cannot produce corresponding wrinkles due to deformation of clothing, has poor light and shadow fusion, and is costly to replace models and cumbersome to operate, making it unable to satisfy users' high-fidelity shopping experience.
A virtual fitting model with a dual U-Net structure is used to generate high-resolution virtual fitting images through image encoders, clothing representation networks and latent diffusion networks, combined with spatial self-attention operations, to achieve the natural integration of clothes and people. It also performs semantic segmentation and masking processing through pre-trained deep learning models to reduce the cost of model generation and replacement.
It improves the realism and texture consistency of virtual fittings, realizes the natural adaptation of clothes in different postures, improves user shopping experience, and reduces merchants’ operating costs.
Smart Images

Figure CN118735767A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, and in particular to a virtual fitting method, device, equipment and storage medium. Background Art
[0002] With the continuous development of Internet technology, e-commerce platforms have gradually become the main way for people to choose and buy clothes. However, compared with trying on clothes in person offline, people can generally only rely on experience to judge whether the clothes are suitable, which has become one of the important reasons for a large number of returns on online clothing purchases. In addition, in order to showcase their own clothes, a large number of e-commerce sellers also have a strong demand for models to try on, and the cost of inviting models to shoot has also become one of the headaches for most small and medium-sized e-commerce sellers. After all, the sales volume of clothing sales is directly proportional to the quality of model shooting.
[0003] With the development of computer vision, image processing and artificial intelligence technology, the research and development of virtual fitting technology has largely alleviated the above two problems. In order to address the pain point of not being able to try on clothes in person when shopping online, virtual fitting allows users to change clothes without actually taking off their clothes. They only need to upload a selfie and select clothes to change clothes with one click, which greatly improves the efficiency of online shopping and the customer's shopping experience. In order to address the cost pain point of model photo shoots, sellers can use the model creation module to generate models by describing the model's skin color, hairstyle, figure and other appearance details in text (models are all generated by AI, and there is no dispute over portrait rights). Using AI-generated models to wear the clothes specified by the seller can greatly reduce the cost of small and medium-sized e-commerce sellers.
[0004] Existing virtual fitting related technologies can be divided into two categories:
[0005] One is to use deep learning technology to estimate the deformation of clothing according to the posture of the person, and then use the generative adversarial network to fit the deformed clothing to the person to achieve the fitting effect. The disadvantage of this method is that the resolution of the final generated image is usually low, the deformation of the clothing cannot produce the corresponding wrinkles, and the light and shadow fusion is poor; in addition, the edge details of the fusion of clothing and the person are generally rough, resulting in a low overall fidelity of the overall fitting effect.
[0006] The second method is for merchants to put clothes on mannequins or real people as the base model task, and use AI generation tools to replace the base model characters with real models or user portraits. The disadvantage of this method is that although it can alleviate the cost of inviting models to shoot to a certain extent, it is not only troublesome for merchants to operate, but can only change the specified poses for merchants to shoot. In addition, the fidelity of replacing the base model with the real user image is still far from the real user image, and it cannot enable users to achieve a more satisfactory shopping experience in terms of image. Summary of the invention
[0007] The present invention provides a virtual fitting method, device, equipment and storage medium, which solve the technical problems.
[0008] According to a first aspect of the present disclosure, a virtual fitting method is provided. The method comprises:
[0009] Acquire a first person image and a clothing image;
[0010] Performing a masking process of the clothing information on the first person image to obtain a second person image;
[0011] The second person image and the clothing image are input into a pre-trained virtual fitting model to obtain a virtual fitting image; the virtual fitting model is a dual U-Net structure, including an image encoder, two U-Nets, and an image decoder, wherein the two U-Nets serve as a clothing representation network and a potential diffusion network respectively; the two U-Net network structures are consistent, including one or more downsampling layers, one or more intermediate layers, and one or more upsampling layers.
[0012] According to the above aspect and any possible implementation manner, an implementation manner is further provided, wherein the inputting the second person image and the clothing image into a pre-trained virtual fitting model to obtain a virtual fitting image comprises:
[0013] Input the clothing image into an image encoder to obtain clothing latent features, and use the clothing latent features as input to a clothing representation network; record the features of the upsampling layer, the middle layer, and the downsampling layer when performing spatial self-attention operations;
[0014] Inputting the second person image into an image encoder to obtain potential features of the person and mask area information, and using the potential features of the person, the mask area information and a random noise obeying a Gaussian distribution as inputs of a potential diffusion network;
[0015] The features of the spatial self-attention operation of the upsampling layer, the middle layer and the downsampling layer recorded by the clothing representation network are concatenated with the features of the spatial self-attention operation of the upsampling layer, the middle layer and the downsampling layer at the corresponding positions in the iterative denoising process of the latent diffusion network, as the features at the corresponding positions of the latent diffusion network;
[0016] The features output by the latent diffusion network are input into the image decoder to output a virtual fitting image.
[0017] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the training process of the virtual fitting model includes:
[0018] Random noise is added to the training samples based on the diffusion step of the Markov chain. Clean samples are recovered from the noisy samples in the reverse process. The loss between the real noise and the estimated noise is calculated. The model parameters of the latent diffusion network are updated by backpropagation until convergence. The model parameters are saved and used as the model parameters of the clothing characterization network.
[0019] According to the above aspect and any possible implementation manner, an implementation manner is further provided, wherein masking the first person image with clothing information to obtain the second person image comprises:
[0020] Inputting the first person image into a pre-trained deep learning image semantic segmentation neural network model for semantic segmentation to obtain a semantically segmented person image, wherein the semantically segmented person image at least includes an image divided into a human body information area and a clothing information area;
[0021] The clothing information region in the semantically segmented person image is masked to obtain a second person image.
[0022] According to the above aspect and any possible implementation manner, an implementation manner is further provided, wherein masking the clothing information area in the semantically segmented person image comprises:
[0023] Acquire the fitting area between the clothing in the clothing image and the person in the semantically segmented person image; and use the union of the fitting area and the clothing information area in the semantically segmented person image as the area in the person image that needs to be masked.
[0024] According to the above aspect and any possible implementation manner, an implementation manner is further provided, wherein obtaining the fitting area between the clothing in the clothing image and the person in the semantically segmented person image comprises:
[0025] Performing posture recognition on the semantically segmented person image to obtain posture information; segmenting the clothing image to segment the area to be masked of the clothing; inputting the area to be masked and the posture information into a pre-trained shallow convolutional neural network to determine the masking area of the clothing in the clothing image and the human body in the semantically segmented person image as the area in the person image that needs to be masked.
[0026] According to a second aspect of the present disclosure, another virtual fitting method is provided. The method comprises:
[0027] A virtual fitting image is obtained by using the method described in the first aspect; the first character image includes a user image, the clothing images are at least two, and the virtual fitting images correspond to the clothing images respectively;
[0028] At least one target virtual fitting image is selected from at least two virtual fitting images for display or recommendation.
[0029] According to a third aspect of the present disclosure, a virtual fitting device is provided. The device comprises:
[0030] An acquisition module, used to acquire a first person image and a clothing image;
[0031] A clothing information masking module, used for performing clothing information masking processing on the first person image to obtain a second person image;
[0032] A virtual fitting image generation module is used to input the second person image and the clothing image into a pre-trained virtual fitting model to obtain a virtual fitting image; the virtual fitting model is a dual U-Net structure, including an image encoder, two U-Nets, and an image decoder, wherein the two U-Nets serve as a clothing representation network and a potential diffusion network respectively; the two U-Net network structures are consistent, including one or more downsampling layers, one or more intermediate layers, and one or more upsampling layers.
[0033] According to a fourth aspect of the present disclosure, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0034] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method according to the first aspect and / or the second aspect of the present disclosure is implemented.
[0035] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:
[0037] Figure 1 A flowchart of a virtual fitting method according to an embodiment of the present disclosure is shown;
[0038] Figure 2 A schematic structural diagram of a virtual fitting model in a virtual fitting method according to an embodiment of the present disclosure is shown;
[0039] Figure 3 A flow chart of feature stitching in a virtual fitting method according to an embodiment of the present disclosure is shown;
[0040] Figure 4 A block diagram of a virtual fitting device according to an embodiment of the present disclosure is shown;
[0041] Figure 5 A block diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0043] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0044] Figure 1 A schematic diagram of a virtual fitting method 100 according to an embodiment of the present disclosure is shown. Figure 1 As shown, the virtual fitting method 100 includes:
[0045] In block 102, a first person image and a clothing image are acquired;
[0046] In block 104, masking of the clothing information is performed on the first person image to obtain a second person image;
[0047] In block 106 , the second person image and the clothing image are input into a pre-trained virtual fitting model to obtain a virtual fitting image.
[0048] In block 102 , the first character image is an image of a user performing a virtual fitting, wherein the user is in an original clothing state.
[0049] In some embodiments, the first person image and clothing image are preprocessed to obtain the first person image and clothing image with a predetermined size, such as a resolution of 512×384.
[0050] In box 104, the first person image is input into a pre-trained deep learning image semantic segmentation neural network model for semantic segmentation to obtain a semantically segmented person image; wherein the semantic segmentation is fine-grained segmentation, and the hair, top, pants, arms, face, etc. are segmented in the semantically segmented person image. The semantically segmented person image at least includes an image divided into a human body information area and a clothing information area, wherein the human body information includes the head, neck, torso, limbs, etc., and the clothing information includes tops, bottoms, skirts, etc. The deep learning image semantic segmentation neural network model can be a neural network model such as FCN, U-Net, PSP net, Mask R-CNN, DeepLab, etc., and the feature map is obtained by extracting the features of the first person image, the feature map is upsampled, and the category of each pixel is output, thereby realizing the semantic segmentation of the first person image.
[0051] In some embodiments, the clothing information area in the semantically segmented character image is masked to obtain a second character image, that is, the clothing (such as a top, pants) in the semantically segmented character image is masked according to the clothing type corresponding to the semantically segmented character image.
[0052] In some embodiments, the fitting area between the clothing in the clothing image and the person in the semantically segmented person image is obtained. Since changes in the person's posture will cause different deformations of clothing, the person image after the semantic segmentation is firstly subjected to posture recognition. For example, a deep learning model such as DensePose and OpenPose is used to estimate the posture of the person image after the semantic segmentation; the clothing area is distorted and the posture is aligned according to the recognized posture. The clothing image is segmented to segment out the area to be masked, i.e., the mask. The mask and the posture information are then input into a pre-trained shallow convolutional neural network to estimate the rough mask area of the clothing in the clothing image on the human body in the first person image as the area in the person image that needs to be masked. In the shallow convolutional neural network, feature fusion is performed through a concat operation.
[0053] In some embodiments, the union of the fitting area and the clothing information area in the semantically segmented character image is used as the area in the character image that needs to be masked.
[0054] Among them, in order to achieve better masking effect and virtual fitting effect; the coverage area of the clothes in the first character image needs to be smaller than the coverage area of the clothes in the clothing image, that is, the fitting position of the new clothes includes the clothing position in the character image after semantic segmentation, avoiding the clothing position in the character image after semantic segmentation being masked but unable to be covered by the new clothes.
[0055] In box 106, the virtual fitting model is a dual U-Net structure, including an image encoder, two U-Nets, and an image decoder, wherein the two U-Nets serve as a clothing representation network and a potential diffusion network, respectively; the two U-Net network structures are consistent, including one or more downsampling layers, one or more intermediate layers, and one or more upsampling layers.
[0056] In some embodiments, Figure 2 As shown in the figure, the network structure of the clothing representation network is consistent with that of the potential diffusion network, and its initial parameters are the parameters obtained after the training of the potential diffusion network is completed. The U-Net includes three downsampling layers, one middle layer and three upsampling layers. Among them, each downsampling layer is a superposition of a convolution module, a spatial self-attention module, and a downsampling module (downsampling twice); the middle layer only has a convolution block and a spatial self-attention block; the upsampling layer includes a convolution block, a spatial self-attention module, and an upsampling layer (upsampling twice).
[0057] In some embodiments, the clothing image (512×384 resolution) is input into an image encoder to obtain clothing latent features (64×48), and the clothing latent features are used as input to the clothing representation network. The spatial dimensions of the operations in the three downsampling layers are (64×48, 32×24, 16×12), the spatial dimensions of the features of the middle layer operations are (8×6), and the spatial dimensions of the operations in the three downsampling layers are (16×12, 32×24, 64×48). After the operation, the clothing representation network will record the features of the upsampling layer, the middle layer, and the downsampling layer when performing spatial self-attention operations.
[0058] In some embodiments, after the clothing representation network records the features of the upsampling layer, the middle layer and the downsampling layer when performing spatial self-attention operations, the character image (512×384 resolution) masked with clothing information is input into the image encoder to obtain the character's potential features (64×48) and the mask area information (64×48), and the character's potential features, the mask area information and a random noise that obeys a Gaussian distribution are used as the input of the latent diffusion network. The features of the upsampling layer, the middle layer and the downsampling layer recorded by the clothing representation network when performing spatial self-attention operations are spliced with the features of the upsampling layer, the middle layer and the downsampling layer at the corresponding positions during the iterative denoising process of the latent diffusion network as the features at the corresponding positions of the latent diffusion network. The spliced features are subjected to spatial self-attention operations, and the clothing potential features are injected into the latent diffusion network at different scales through the spatial self-attention operations to achieve a more natural virtual dressing effect. The features (64×48) output by the latent diffusion network are input into the image decoder to output a virtual fitting image (512×384).
[0059] In some embodiments, Figure 3 As shown, each spatial self-attention module of the potential diffusion network performs feature splicing including the following steps: splicing the feature (width×height) of the potential diffusion network with the feature (width×height) of the clothing representation network to obtain a spliced feature ((width×2)×height), wherein the spliced feature ((width×2)×height) includes Query ((width×2)×height), Key ((width×2)×height) and Value ((width×2)×height); performing matrix multiplication on the transpose of Query ((width×2)×height) and Key ((width×2)×height) to obtain The transposed multiplication result of Query ((width × 2) × height) and Key ((width × 2) × height) ((width × 2) × (width × 2)); the transposed multiplication result of Query ((width × 2) × height) and Key ((width × 2) × height) ((width × 2) × (width × 2)) and Value ((width × 2) × height) are matrix multiplied to obtain the result ((width × 2) × height); the right half of the result ((width × 2) × height) is discarded, and the remaining left half (width × height) is used as the output feature (width × height). Through the above steps, the clothing latent features are injected into the latent diffusion network through the spatial attention operation.
[0060] In some embodiments, in order to maintain consistency in the operation size and not increase the amount of redundant calculations, the features of the splicing position are discarded after the spatial self-attention operation.
[0061] In some embodiments, in the virtual fitting model, the network structure of the clothing characterization network is consistent with the network structure of the potential diffusion network, and its initial parameters are the parameters obtained after the training of the potential diffusion network is completed. Therefore, the potential diffusion network is trained first. The potential diffusion network defines a diffusion step based on a Markov chain, in which random (Gaussian) noise is slowly and sequentially added to the sample, and then learns to recover clean samples from the noise sample in the reverse process. That is, the potential diffusion network is called to estimate, the loss between the real noise and the estimated noise is calculated, and the model parameters of the potential diffusion network are updated by back propagation until convergence, and its model parameters are saved and used as the model parameters of the clothing characterization network, so that the trained virtual fitting model can be obtained.
[0062] In this application, the advantages of the pre-trained latent diffusion network (LDM) are fully utilized to ensure the high authenticity and natural fitting effect of the generated images, and the detailed features of the clothing in the latent space are further learned through the clothing representation network (clothing UNet), and then the clothing fusion process is performed to accurately align the clothing features with the noisy human body in the self-attention layer of the latent diffusion network (denoising UNet). In this way, the clothing features smoothly adapt to various target human body types and postures without causing information loss or feature distortion due to independent deformation processes. In addition, this application also performs a clothing dropout operation, that is, randomly discarding some clothing latent variables during training to achieve guidance of clothing features without classifiers. In this way, the controllability of changing clothes can be further improved.
[0063] Specifically, the virtual fitting model is an extension of Stable Diffusion, which uses a variational autoencoder (VAE) consisting of an encoder E and a decoder D to achieve image representation in the latent space. θ is trained to remove Gaussian noise ∈, while using the CLIP text encoder to condition the input τ θ Given an image x and a text prompt y, the denoising UNet∈ is trained by minimizing the following loss function θ :
[0064]
[0065] Where t∈{1,...,T} represents the time step of the forward diffusion process, z t is the encoded image ε(x) plus Gaussian noise ∈~N(0,1) (i.e., noise latent variable), and the conditional input τ θ (y) Associated with denoising UNet via the cross-attention mechanism.
[0066] The clothing UNet is used to efficiently learn the detailed features of the clothing image g. The essence of clothing UNet is the same as the denoising UNet in stable diffusion. The encoded clothing latent variable ε(g) is input into the clothing UNetω θ′ Then, it is integrated into the denoising UNet∈ via clothing fusion θ In addition to the auxiliary conditional input, the clothing UNet and denoising UNet are jointly trained by minimizing the following loss function:
[0067]
[0068] in, Represents the auxiliary condition input ω of clothing UNet and denoising UNet θ′ and ∈ θ , τg and τ y denote the pre-trained CLIP image encoder and text encoder respectively, Indicates splicing. θ′ and ∈ θ No weights are shared during training. A significant difference of Clothing UNet compared to Denoising UNet is that Clothing UNet only requires one forward pass before multiple denoising steps during inference, which brings minimal additional computational cost to the original stable diffusion.
[0069] Clothing fusion is to integrate the learned clothing features into the denoising UNet and find each pair of feature maps as the input of the corresponding self-attention layer. Given the nth pair of feature maps g n , The feature maps are concatenated in the spatial domain as follows:
[0070]
[0071] x n Replace with the concatenated feature map As the input of the self-attention layer of the denoising UNet, the first half of the feature map is then cropped as the final output of the self-attention layer. During the denoising process, the attention to the human body gradually includes part of the masked area, such as the neck and arms, and the attention to clothing features gradually increases in areas with complex patterns. Through clothing fusion in the self-attention layer, clothing features are implicitly deformed and effectively associated with the target person with almost no loss of information. Therefore, the denoising UNet is able to learn the precise features of the clothing UNet to preserve clothing details and naturally adapt the clothing to the target person in the generated image.
[0072] In order to further improve the reliability of the virtual dressing method, clothing dropout operation can be used in training to achieve the guidance without classifier, thereby adjusting the image generation quality and diversity of clothing features. Specifically, during the training process of clothing UNet, the input clothing latent variables are randomly discarded as refers to a latent variable of all zeros, so that the denoising UNet is trained to perform both conditionally and unconditionally, that is, with and without clothing fusion. At inference time, a guidance ratio s is simply used g ≥1 to adjust for prediction noise The conditional control strength is as follows:
[0073]
[0074] For the sake of brevity, some minor terms compared to formula (2) are omitted. In practice, the clothing dropout ratio in training is set to 10% based on experience, that is, 10% of the clothing latent variables ε(g) are set to Guidance ratios g The optimal value is usually between 1.5 and 2.0.
[0075] According to the embodiments of the present disclosure, the following technical effects are achieved:
[0076] By injecting the latent features of clothing into the latent diffusion network, the preservation of realism and texture consistency is better than the solution based on the generative adversarial network; for example, it achieves a balance between maintaining the texture consistency of the clothing being tried on and photographed, as well as the authenticity of the fitting, retaining the light and shadow of the flat clothing and the details of the folds, so that users can achieve a satisfactory fitting effect; the user who is doing the virtual fitting only needs to provide the user image, and the clothing can be tried on the user, and it has good results for any posture. It can greatly improve the user's shopping experience and facilitate the seller's operation.
[0077] In some embodiments, the above-mentioned virtual fitting method is used to obtain a virtual fitting image; the first character image includes a user image, there are at least two clothing images, and the virtual fitting images correspond to the clothing images respectively; at least one target virtual fitting image is selected from the at least two virtual fitting images for display or recommendation.
[0078] In some embodiments, the application of user virtual fitting can include two application scenarios. The first application scenario is user virtual fitting, such as when a user uploads his or her own user image, and combines the user image with multiple clothing images to generate multiple fitting images for the user to choose from. The second application scenario is merchant promotion, such as when a merchant uses a model image to generate a virtual fitting image for the clothing it sells, and the generated image can be displayed and promoted on a web page or on a large screen in a shopping mall, and the model image can be a photographed model or a generated model.
[0079] In some embodiments, at least one target virtual fitting image may be selected for display or recommendation by a user manually selecting from a plurality of generated fitting images, or the system may sort the generated images according to the generated effects and select the first few with better effects for display.
[0080] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, 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 optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0081] The above is an introduction to the method embodiment. The following is a further explanation of the scheme disclosed in the present invention through an apparatus embodiment.
[0082] Figure 4 A block diagram of a virtual fitting device 400 according to an embodiment of the present disclosure is shown. Figure 4 As shown, the device 400 includes:
[0083] An acquisition module 402 is used to acquire a first person image and a clothing image;
[0084] A clothing information masking module 404 is used to perform clothing information masking processing on the first person image to obtain a second person image;
[0085] The virtual fitting image generation module 406 is used to input the second person image and the clothing image into a pre-trained virtual fitting model to obtain a virtual fitting image; the virtual fitting model is a dual U-Net structure, including an image encoder, two U-Nets, and an image decoder, wherein the two U-Nets serve as a clothing representation network and a potential diffusion network respectively; the two U-Net network structures are consistent, including one or more downsampling layers, one or more intermediate layers, and one or more upsampling layers.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0087] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0088] Figure 5A schematic block diagram of an electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0089] The electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a ROM 502 or a computer program loaded from a storage unit 508 into a RAM 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An I / O interface 505 is also connected to the bus 504.
[0090] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0091] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as method 100. For example, in some embodiments, the method 100 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the method 100 described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the method 100 in any other appropriate manner (e.g., by means of firmware).
[0092] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0093] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0094] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0095] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0096] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0097] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0098] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0099] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A virtual fitting method, include: Acquire a first person image and a clothing image; Performing a masking process on the first person image using clothing information to obtain a second person image; The second person image and the clothing image are input into a pre-trained virtual fitting model to obtain a virtual fitting image; the virtual fitting model is a dual U-Net structure, including an image encoder, two U-Nets, and an image decoder, wherein the two U-Nets serve as a clothing representation network and a potential diffusion network respectively; the two U-Net network structures are consistent, including one or more downsampling layers, one or more intermediate layers, and one or more upsampling layers.
2. The method according to claim 1, in, Inputting the second person image and the clothing image into a pre-trained virtual fitting model to obtain a virtual fitting image comprises: Input the clothing image into an image encoder to obtain clothing latent features, and use the clothing latent features as input to a clothing representation network; record the features of the upsampling layer, the middle layer, and the downsampling layer when performing spatial self-attention operations; Inputting the second person image into an image encoder to obtain potential features of the person and mask area information, and using the potential features of the person, the mask area information and a random noise obeying a Gaussian distribution as inputs of a potential diffusion network; The features of the spatial self-attention operation of the upsampling layer, the middle layer and the downsampling layer recorded by the clothing representation network are concatenated with the features of the spatial self-attention operation of the upsampling layer, the middle layer and the downsampling layer at the corresponding positions in the iterative denoising process of the latent diffusion network, as the features at the corresponding positions of the latent diffusion network; The features output by the latent diffusion network are input into the image decoder to output a virtual fitting image.
3. The method according to claim 2, in, The training process of the virtual fitting model includes: Random noise is added to the training samples based on the diffusion step of the Markov chain. Clean samples are recovered from the noisy samples in the reverse process. The loss between the real noise and the estimated noise is calculated. The model parameters of the latent diffusion network are updated by backpropagation until convergence. The model parameters are saved and used as the model parameters of the clothing characterization network.
4. The method according to claim 1, in, The step of performing a masking process on the first person image for the clothing information to obtain a second person image comprises: Inputting the first person image into a pre-trained deep learning image semantic segmentation neural network model for semantic segmentation to obtain a semantically segmented person image, wherein the semantically segmented person image at least includes an image divided into a human body information area and a clothing information area; The clothing information region in the semantically segmented person image is masked to obtain a second person image.
5. The method according to claim 4, in, The masking of the clothing information area in the semantically segmented person image comprises: Acquire the fitting area between the clothing in the clothing image and the person in the semantically segmented person image; and use the union of the fitting area and the clothing information area in the semantically segmented person image as the area in the person image that needs to be masked.
6. The method according to claim 5, in, Acquiring the fitting area between the clothing in the clothing image and the person in the semantically segmented person image includes: Performing posture recognition on the semantically segmented person image to obtain posture information; segmenting the clothing image to segment the area to be masked of the clothing; inputting the area to be masked and the posture information into a pre-trained shallow convolutional neural network to determine the masking area of the clothing in the clothing image and the human body in the semantically segmented person image as the area in the person image that needs to be masked.
7. A virtual fitting method, include: A virtual fitting image is obtained by using the virtual fitting method according to any one of claims 1 to 6; the first character image includes a user image, the clothing images are at least two, and the virtual fitting images correspond to the clothing images respectively; At least one target virtual fitting image is selected from at least two virtual fitting images for display or recommendation.
8. A virtual fitting device, include: An acquisition module, used to acquire a first person image and a clothing image; A clothing information masking module, used for performing clothing information masking processing on the first person image to obtain a second person image; A virtual fitting image generation module is used to input the second person image and the clothing image into a pre-trained virtual fitting model to obtain a virtual fitting image; the virtual fitting model is a dual U-Net structure, including an image encoder, two U-Nets, and an image decoder, wherein the two U-Nets serve as a clothing representation network and a potential diffusion network respectively; the two U-Net network structures are consistent, including one or more downsampling layers, one or more intermediate layers, and one or more upsampling layers.
9. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6.
10. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.
Citation Information
Cited By
Method and system for generating virtual fitting image display based on AI technology
CN119068153A
A method and system for generating virtual fitting image display based on AI technology
CN119068153B
Diffusion transformer virtual reloading method based on multi-feature low-rank adapter
CN120953748A
