Virtual reloading method and device based on reloading model

Through the virtual dress-up method based on the dress-up model, clothing and object morphological information are extracted, and clothing images that conform to the target object form are generated, which solves the problem of poor clothing migration effect in the existing technology and achieves a more natural clothing adaptation effect.

CN118747706APending Publication Date: 2024-10-08BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310303955.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing clothing migration technology is difficult to achieve natural adaptation of the clothing form on the target object, resulting in poor migration results.

Method used

A virtual dress-up method based on the dress-up model is adopted. Through the feature extraction module and the deformation generation module, the clothing information is obtained from the first image and the body shape and posture information of the object to be changed is obtained from the second image, and a model that conforms to the target object shape is generated. Morphing clothing images.

Benefits of technology

It achieves a more natural deformation of clothing on the target object, fits the body shape and posture, and improves the clothing migration effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747706A_ABST
    Figure CN118747706A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual reloading method and device based on a reloading model, the reloading model comprises a generation model, and the generation model comprises a feature extraction module and a deformation generation module; the method comprises the following steps: acquiring first feature information containing clothing information of first clothing from a first image, and acquiring second feature information containing body posture information of a to-be-reloaded object from a second image corresponding to the first image; using a feature extraction module to determine a plurality of first feature maps based on the first feature information, and determine a plurality of second feature maps based on the second feature information, the plurality of second feature maps including body posture features of the to-be-reloaded object; and a deformation generation module is utilized to determine a target generation image based on the plurality of first feature maps, the plurality of second feature maps, the initial middle feature and a corresponding initial generation image, the target generation image comprises a to-be-reloaded object wearing the deformed first garment, and the deformed first garment conforms to the body posture feature of the to-be-reloaded object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and more particularly to a virtual dressing method and device based on a dressing model. Background Art

[0002] Clothing transfer (or changing clothes) can refer to transferring the first clothing worn by the first object in the first object image (such as a human body image) to the second object in the second object image to obtain a new object image containing the second object wearing the first clothing (maintaining its posture in the second object image). Clothing transfer can show the effect of the object trying on different clothing in a virtual way. In order to obtain a better clothing transfer effect, it is usually necessary to appropriately deform the clothing to be transferred during the transfer process so that the deformed clothing adapts to the body shape (such as posture, body shape, etc.) of the target object (the object to which the clothing is to be transferred).

[0003] Therefore, how to provide a method for clothing migration that can achieve better clothing migration effect becomes an urgent problem to be solved. Summary of the invention

[0004] One or more embodiments of the present specification provide a virtual dressing method and device based on a dressing model to achieve a better clothing migration (dressing) effect, that is, the deformed clothing worn on an object (such as a person) that needs to be dressed up better fits the body shape of the object.

[0005] According to a first aspect, a virtual dressing method based on a dressing model is provided, wherein the dressing model includes a generation model, and the generation model includes a feature extraction module and a deformation generation module; the method includes:

[0006] Acquire first feature information including clothing information of a first clothing item from the first image, and acquire second feature information including body shape and posture information of an object to be changed from a second image corresponding to the first image;

[0007] Using the feature extraction module, determining a plurality of first feature graphs based on the first feature information, and determining a plurality of second feature graphs based on the second feature information, wherein the plurality of second feature graphs include body shape features and posture features corresponding to the body shape and posture information of the object to be dressed up;

[0008] Using the deformation generation module, a target generation image is determined based on the plurality of first feature maps and the plurality of second feature maps, the randomly generated initial intermediate features and the corresponding randomly generated initial generation image, wherein the target generation image includes the object to be changed wearing the deformed first clothing, and the deformed first clothing conforms to the body shape characteristics and posture characteristics of the object to be changed.

[0009] According to a second aspect, a virtual dressing device based on a dressing model is provided, wherein the dressing model includes a generation model, and the generation model includes a feature extraction module and a deformation generation module; the device includes:

[0010] A first acquisition module is configured to acquire first feature information including clothing information of a first clothing item from the first image, and acquire second feature information including body shape and posture information of an object to be changed from a second image corresponding to the first image;

[0011] A first determination module is configured to use the feature extraction module to determine a plurality of first feature graphs based on the first feature information, and to determine a plurality of second feature graphs based on the second feature information, wherein the plurality of second feature graphs include body shape features and posture features corresponding to the body shape and posture information of the object to be dressed;

[0012] The second determination module is configured to use the deformation generation module to determine a target generation image based on the plurality of first feature maps and the plurality of second feature maps, the randomly generated initial intermediate features and the corresponding randomly generated initial generation image, wherein the target generation image includes the object to be changed wearing the deformed first clothing, and the deformed first clothing conforms to the body shape characteristics and posture characteristics of the object to be changed.

[0013] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect.

[0014] According to a fourth aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in the first aspect is implemented.

[0015] According to the virtual dressing method and device based on the dressing model provided by the embodiments of the present specification, the dressing model includes a generation model, and the generation model includes a feature extraction module and a deformation generation module; the method includes obtaining first feature information including clothing information of a first garment therein from a first image, and obtaining second feature information including body shape and posture information of an object to be dressed up from a second image corresponding to the first image; using the feature extraction module, determining a plurality of first feature graphs based on the first feature information, and determining a plurality of second feature graphs based on the second feature information, wherein the plurality of second feature graphs include body shape features and posture features corresponding to the body shape and posture information of the object to be dressed up; using the deformation generation module, determining a target generation image based on the plurality of first feature graphs and the plurality of second feature graphs as well as randomly generated initial intermediate features and corresponding randomly generated initial generation images, wherein the target generation image includes the object to be dressed up wearing the deformed first garment, and the deformed first garment conforms to the body shape features and posture features of the object to be dressed up. In the above process, the input second feature information includes the body shape and posture information of the object to be changed, so that the dressing model can extract the body shape features and posture features of the object to be changed in the second image, and then the body shape and deformation of the deformed first clothing can be more closely matched to the body shape and posture features of the object to be changed, and the generated target generated image includes an object whose body shape is more closely matched to the body shape and posture features of the object to be changed, thereby achieving a real dressing effect for the object to be changed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1A A flowchart of a virtual dress-changing training method provided in an embodiment;

[0018] Figure 1B A schematic diagram of the structure of the generated model;

[0019] Figure 2A and Figure 2B They are respectively a structural schematic diagram of a feature deformation generator;

[0020] Figure 3 Another schematic flow chart of a virtual dressing method based on a dressing model provided in an embodiment;

[0021] Figure 4 A schematic block diagram of a virtual dressing device based on a dressing model provided in an embodiment;

[0022] Figure 5 A schematic block diagram of a training device for a dress-changing model provided in an embodiment;

[0023] Figure 6 A schematic block diagram of an electronic device provided in an embodiment. DETAILED DESCRIPTION

[0024] The technical solutions of the embodiments of this specification will be described in detail below with reference to the accompanying drawings.

[0025] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0026] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0027] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0028] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0029] The virtual dressing method and device based on the dressing model provided in this specification are described in detail below in conjunction with specific embodiments.

[0030] It can be understood that the virtual dressing based on the dressing model and the dressing model training process provided in the embodiments of this specification include two stages, the first stage of the dressing model (also called clothing transfer model) training process, and the virtual dressing process based on the dressing model. For the sake of clarity, the training process of the dressing model is first introduced below.

[0031] In the first stage (training process of the dress-changing model), such as Figure 1A As shown, a flow chart of a training method for a dress-changing model in one embodiment of the present specification is shown. Figure 1BAs shown, the dressing model may include a generation model, and the generation model includes a feature extraction module and a deformation generation module. The method may be implemented by a target program. The target program may be installed in an electronic device, and the electronic device may be implemented by any device, equipment, platform, device cluster, etc. having computing and processing capabilities. As shown in FIG1 , the method includes the following steps:

[0032] In step S110, first sample feature information including sample clothing information of the sample clothing is obtained from the initial image, and second sample feature information including target body shape and posture information of the target object to be changed is obtained from the target image corresponding to the initial image.

[0033] Among them, the target program can first obtain training data for training the dressing model, and the training data can include several sample image pairs, each sample image pair includes an initial image and a target image. In one implementation, the initial image at least includes sample clothing information of the sample clothing, and the target image includes the object to be changed (referred to as the target object). In another implementation, the initial image may include the object wearing the sample clothing (which may be referred to as the initial object). The trained dressing model can generate a new image, and the new image includes the object wearing the sample clothing (i.e., the target object in the target image) while maintaining the body shape of the target object and the posture presented by the target object in the target image, so as to achieve the effect of migrating the sample clothing to the target object and changing the clothes for the target object. In one implementation, the object can be a person.

[0034] After obtaining the training data, the dressing model can be trained based on each sample image pair in the training data. It can be understood that in the process of training the dressing model, the process of training the dressing model using each sample image pair is similar. Accordingly, the following takes a pair of sample image pairs as an example to introduce the training process of the dressing model.

[0035] Specifically, after the initial image and its corresponding target image are obtained, on the one hand, feature information (referred to as first sample feature information) including sample clothing information of the sample clothing therein is obtained from the initial image.

[0036] In one embodiment, a preset key point extraction algorithm can be used to extract key points from the initial image, and the extracted key points are classified into the first sample feature information. It can be understood that the key points extracted from the initial image may include key points corresponding to the sample clothing, and the key points corresponding to the sample clothing have a corresponding relationship with the key points of the limbs. For example, when the sample clothing includes a top, the left shoulder key point of the top can correspond to the left shoulder key point of the limb, the right shoulder key point of the top can correspond to the right shoulder key point of the limb, and the collar key point of the top can correspond to the neck key point of the limb. The types of the above key points are only for illustration and do not constitute a limitation on the types of key points corresponding to the extracted sample clothing. Any key point type that can describe the corresponding information of the sample clothing can be applied in the embodiments of this specification. For example, the key points corresponding to the sample clothing can also include the outline key points corresponding to the sample clothing, the top hem key points, etc. The sample clothing can also be (or include) bottoms (such as trousers, skirts, etc.), and accordingly, the key points corresponding to the sample clothing can also include the key points corresponding to the bottoms.

[0037] Next, a preset foreground extraction algorithm can be used to extract an image of the area where the sample clothing is located from the initial image and include it in the first sample feature information. A region recognition algorithm can also be used to identify various parts of the sample clothing from the initial image to obtain part segmentation information, wherein the various parts of the sample clothing may include but are not limited to: the left sleeve part, the torso part, and the right sleeve part of a top, the left leg part and the right leg part of a trouser, the waist and abdomen part and the hem part of a skirt, etc.

[0038] In another embodiment, the initial image may include an initial object wearing the sample clothing. Accordingly, based on a limb key point extraction algorithm, limb key points of the initial object may be extracted from the initial image to obtain initial limb key point information, and the initial limb key point information may be included in the first sample feature information. The initial limb key point information may exist in the form of an image, including the extracted limb key points of the initial object.

[0039] In one implementation, the limb key points of the initial object may include limb key points of the trunk, such as trunk contour key points, limb key points of the limbs, such as left and right leg key points, hip key points, knee joint key points, etc. Such key points can characterize the clothing information of the sample clothing, and the limb key points of each trunk can correspond to the key points of the sample clothing. In another implementation, the limb key points of the initial object may also include head key points (including but not limited to limb key points such as ears, eyes, mouth, nose, and facial contour), hand key points (including but not limited to limb key points such as fingers and palms), and foot key points (including but not limited to limb key points such as ankles and insteps), etc. Among them, the extracted limb key points may include any type of limb key points required to be identified in the relevant technology, which is not limited here.

[0040] In order to obtain more abundant clothing information and limb information of the sample clothing, limb area information (called initial limb area information) can also be extracted from the initial image and included in the first sample feature information. The initial limb area information may include an image of the limb area of ​​the initial object, and the initial limb area information includes clothing information and limb information of the sample clothing such as color and texture, wherein the limb information may include information of the limb part wearing the clothing, and may also include information of the limb part not wearing the clothing. The initial limb area information may exist in the form of an image.

[0041] Furthermore, 3D limb posture information of the initial object (referred to as initial limb posture information) can be identified from the initial image and included in the first sample feature information. The initial limb posture information includes limb contour information of the initial object (i.e., sample clothing contour information), which can exist in the form of an image. In one implementation, the initial limb posture information can be a 3D limb image rendered based on the SMPL model, which characterizes the 3D limb posture information and contour information of the initial object in the initial image.

[0042] Next, the limb segmentation information of the initial object (referred to as initial limb segmentation information) can be extracted from the initial image. The initial limb segmentation information includes information representing various parts of the limbs. The limb parts may include but are not limited to the head, limbs, torso, hands, and feet. The initial limb segmentation information may also include segmentation information of various parts of the sample clothing, for example, including but not limited to: tops and bottoms, etc. The initial limb segmentation information may exist in the form of an image, where different parts may be represented by different pixel values. The initial limb segmentation information may include the body shape and posture information of the initial object.

[0043] Correspondingly, the first sample feature information may include: initial limb area information (including sample clothing information such as color, texture, and outline of the sample clothing), initial limb key point information (key points that can characterize the 2D limb posture information of the initial object, as well as information characterizing the posture and deformation of the sample clothing), initial limb posture information (information that can characterize the 3D posture and deformation of the initial object and the sample clothing it wears), and initial limb segmentation information (which can characterize the body shape and posture information of the initial object, and also provide the deformation of the sample clothing).

[0044] On the other hand, feature information (referred to as second sample feature information) including body shape and posture information of the target object to be dressed is obtained from the target image. Specifically, limb segmentation information of the target object is extracted from the target image, referred to as target limb segmentation information, and is included in the second sample feature information. The target limb segmentation information includes information representing various limb parts of the target object, and the limb parts may include but are not limited to the head, limbs, trunk, hands, and feet (as well as the upper body and lower body). The initial limb segmentation information may exist in the form of an image, in which different parts may be represented by different pixel values. The target limb segmentation information includes body shape and posture information of the target object.

[0045] In order to ensure the dressing effect, the limb key points of the target object can also be extracted from the target image to obtain the target limb key point information, which can be included in the second sample feature information, which can exist in the form of an image. The limb key points in the target limb key point information can include any type of limb key points that can be extracted in the relevant technology.

[0046] The 3D limb posture information of the target object (referred to as the target limb posture information) can also be identified from the target image and included in the second sample feature information. The target limb posture information includes the limb contour information of the target object and can exist in the form of an image. In one implementation, the target limb posture information can be a 3D limb image rendered based on the SMPL model (Skinned Multi-Person Linear Model), which characterizes the 3D limb posture information and contour information of the target object in the target image.

[0047] Considering that the color and texture of the clothes worn by the target object in the target image may affect the dressing effect of the dressing model, accordingly, the limb area information of the target task (referred to as the target limb area information) can be extracted from the target image, wherein the target limb area information does not include the clothing wearing area of ​​the target object, but includes the non-clothing wearing area of ​​the target object. On the one hand, considering that the head, hands and feet of the target object generally do not belong to the clothing wearing area, and in the process of changing clothes (i.e., clothing migration), it is hoped that the head, hands and feet of the target object remain unchanged, accordingly, the parts of the limbs that do not belong to the clothing wearing area can be set as preset protection areas (for example, including the head, hands and feet of the aforementioned object), and accordingly, the target limb area information extracted from the target image can include the preset protection area, such as the area where the head, hands and feet of the aforementioned target object are located.

[0048] In one implementation, the initial object in the initial image and the target object in the target image may be the same real object, and in the initial image and the target image, the real object may be a person wearing the same set of clothing (sample clothing) and in different postures. In another implementation, the initial object in the initial image and the target object in the target image may be different real objects, and in the initial image and the target image, the initial object and the target object may be a person wearing the same set of clothing (sample clothing) or different clothing and in different postures.

[0049] After obtaining the first sample feature information of the initial image and the second sample feature information of the target image in the aforementioned manner, in step S120, a feature extraction module is used to determine a plurality of first sample feature graphs based on the first sample feature information, and a plurality of second sample feature graphs based on the second sample feature information, wherein the plurality of second sample feature graphs include body shape features and posture features corresponding to the body shape and posture information of the target object.

[0050] In one implementation, the first sample feature information may be first input into a feature extraction module so that the feature extraction module performs feature extraction on the first sample feature information to obtain a plurality of first sample feature graphs. Next, the second sample feature information may be input into the feature extraction module so that the feature extraction module performs feature extraction on the second sample feature information to obtain a plurality of second sample feature graphs. Among them, the plurality of first sample feature graphs as a whole may at least include clothing features (such as color, texture, contour, etc.) of the sample clothing, and may also include limb features (such as posture and body shape) of the initial object. In fact, for any of the first sample feature graphs, it is output by a certain intermediate layer or a certain intermediate sub-extraction module (such as each first sub-extractor of the first feature extractor mentioned later) in the feature extraction module, and accordingly, any of the first sample feature graphs may include at least one of the aforementioned clothing features (such as color, texture, contour, etc.) and / or limb features (such as posture and body shape). Among them, each of the first sub-extractors may include a sub-extractor of a non-last layer in the first feature extractor.

[0051] The plurality of second sample feature graphs as a whole include the body shape features corresponding to the body shape and posture information of the target object, and may also include posture features that characterize the posture information of the target object. In the case where the second sample feature information also includes target limb key point information and target second limb posture information, the plurality of second sample feature graphs as a whole may also include posture features that can better characterize the posture information of the target object, etc. In fact, for any of the second sample feature graphs, it is output by a certain layer or a certain sub-extraction module in the feature extraction module (such as the various sub-extractors of the second feature extractor mentioned later), and accordingly, any of the second sample feature graphs may include at least one of the aforementioned body shape features and posture features. The target limb area information may include limb features of the target object's non-clothing covered area (such as features of the head, hands, and feet).

[0052] In yet another implementation, Figure 1B As shown, the feature extraction module may include a first feature extractor and a second feature extractor arranged in parallel. Specifically, the first sample feature information is input into the first feature extractor, and the first feature extractor performs feature extraction on the first sample feature information to obtain a plurality of first sample feature maps, wherein the sizes of the plurality of first sample feature maps are different. The second sample feature information is input into the second feature extractor, and the second feature extractor performs feature extraction on the second sample feature information to obtain a plurality of second sample feature maps, wherein the sizes of the plurality of second sample feature maps are different. The first feature extractor and the second feature extractor may be any type of extractors for feature extraction in the relevant technology, and the embodiments of this specification are not limited thereto.

[0053] In one implementation, the image sizes of the first sample feature maps are different, and the image sizes of the second sample feature maps are different. In one case, the image sizes of the first sample feature maps (the second sample feature maps) are increased in sequence. For example, the first sample feature maps (the second sample feature maps) may include image sizes of 2 n *2 n , 2 n+1 *2 n+1 ,……,2 n+m *2 n+m The first sample feature map (second sample feature map) of the present invention. For example, several first sample feature maps include first sample feature maps corresponding to image sizes of 8*8, 16*16, 32*32, 64*64, 128*128, 256*256 and 512*512, respectively. Similarly, several second sample feature maps include second sample feature maps corresponding to image sizes of 8*8, 16*16, 32*32, 64*64, 128*128, 256*256 and 512*512, respectively. It can be considered that the higher the image size, the more detailed the image features are, and the sample feature map with a lower image size includes relatively global image features. In one implementation, the first feature extractor, the several first sample feature maps may be feature maps output by each first sub-extractor. Correspondingly, the second feature extractor may include several second sub-extractors, and the several second sample feature maps may be feature maps output by each second sub-extractor. The second sub-extractors may include sub-extractors other than the last layer in the second feature extractor.

[0054] After obtaining a plurality of first sample feature maps and a plurality of second sample feature maps, in step S130, a deformation generation module is used to determine a target prediction image based on the plurality of first sample feature maps and the plurality of second sample feature maps, randomly generated intermediate features and their corresponding randomly generated prediction images. The target prediction image includes a second object wearing the deformed sample clothing, and the deformed sample clothing conforms to the body shape characteristics and posture characteristics of the second object.

[0055] Among them, Figure 1B As shown, the generation model may also include an initialization module, namely a const module. In one implementation, the const module may randomly generate an intermediate feature F GAN 0 and its corresponding predicted image I 0 , as the input of the deformation generation module. The predicted image I 0 It can be a color image, such as an RGB image. GAN 0 Can exist in image form.

[0056] In this step, a plurality of first sample feature maps, a plurality of second sample feature maps, and a randomly generated intermediate feature F GAN 0 and its corresponding randomly generated prediction image I 0 The deformation generation module is inputted so that the deformation generation module processes the first sample feature maps and the second sample feature maps, the randomly generated intermediate features and the corresponding randomly generated predicted images. Specifically, the first sample feature maps and the second sample feature maps are used to process the randomly generated intermediate features F GAN 0 and its corresponding randomly generated prediction image I 0 , and then use the processed intermediate features and the processed predicted image to obtain a target predicted image, so as to deform the sample clothing (i.e., the limbs of the initial object) based on the body features (and posture features) of the target object, and obtain the deformed sample clothing that conforms to the body features (and posture features) of the target object, and generate a target predicted image of the target object wearing the deformed sample clothing, so as to realize the change of clothes for the target object, that is, to transfer the sample clothing to the target object.

[0057] In one embodiment, in order to better improve the dressing ability of the dressing model and ensure its dressing effect, Figure 1B As shown, the generation model may also include a latent variable extractor, and the second feature extractor in the feature extraction module further determines a sample feature extraction result based on the second sample feature information. Accordingly, the latent variable extractor is used to extract an abstract latent variable vector representing the body shape features and posture features of the target object from the sample feature extraction result. In one implementation, the sample feature extraction result may be a sample result output by the last layer of sub-extractors in the aforementioned second feature extractor (e.g., a result in the form of a feature graph or a result in the form of a vector).

[0058] Accordingly, in step S130, the target prediction image can be determined by using the deformation generation module based on the first sample feature graphs and the second sample feature graphs, the latent variable vector, the randomly generated intermediate features and the corresponding randomly generated prediction images. The target program can use the first sample feature graphs, the second sample feature graphs and the latent variable vector to process the randomly generated intermediate features and the corresponding randomly generated prediction images, and then use the processed intermediate features and the processed prediction images to obtain the target prediction image, so that the posture and body shape of the object in the target prediction image are more consistent with the posture and body shape of the target object in the target image, thereby improving the dressing effect.

[0059] In one implementation, in order to generate a higher definition image, such as Figure 1BAs shown, the deformation generation module includes a plurality of feature deformation generators arranged in series (for example, Figure 1B As shown, it includes feature deformation generator 1, feature deformation generator 2...feature deformation generator N), the output image sizes corresponding to the several feature deformation generators are increased in sequence, each first sample feature map in the several first sample feature maps has a corresponding relationship with each feature deformation generator, and each second sample feature map in the several second sample feature maps has a corresponding relationship with each feature deformation generator. For example: the output image size corresponding to each feature deformation generator in the several feature deformation generators corresponds to 2 n *2 n , 2 n+1 *2 n+1 ,……,2 n+m *2 n+m , where the corresponding output image size is 2 n *2 n The feature deformation generator with image size of 2 n *2 n There is a corresponding relationship between the first sample feature map and the second sample feature map; the corresponding output image size is 2 n+1 *2 n+1 The feature deformation generator with image size of 2 n+1 *2 n+1 There is a corresponding relationship between the first sample feature map and the second sample feature map, and so on.

[0060] It can be understood that the structures of the feature deformation generators among the several feature deformation generators are similar, and the processing process of the input data of each feature deformation generator is similar. The following takes any one of the several feature deformation generators (for example, the target feature deformation generator i) as an example to introduce its processing process of input data. The processing process of other feature deformation generators on their input data can refer to the processing process of the target feature deformation generator i on its input data. Among them, i is an integer from 1 to N, and N represents the number of several feature deformation generators. In one case, the several feature deformation generators can include 7 feature deformation generators, that is, N is 7.

[0061] Accordingly, in one embodiment, step S130 may specifically include: using any target feature deformation generator i among the plurality of feature deformation generators, based on its corresponding first sample feature map F scr i , the second sample feature map F tgt i and latent variable vector w, processing the input intermediate feature F of target feature deformation generator i GAN i-1 , and obtain the processed intermediate feature F of the target feature deformation generatorGAN i Among them, if the target feature deformation generator i is a feature deformation generator other than the first one, the input intermediate feature F of the target feature deformation generator GAN i-1 is the intermediate feature output by the previous feature deformation generator i - 1 of the target feature deformation generator i. If the target feature deformation generator i is the first feature deformation generator, the input intermediate feature F of the target feature deformation generator i GAN i-1 is the intermediate feature F randomly generated by the const module GAN 0 .

[0062] Next, based on the processed intermediate feature F of the target feature deformation generator i GAN i and the input prediction image I of the target feature deformation generator i i-1 , the processed prediction image I of the target feature deformation generator i is obtained i . Among them, if the target feature deformation generator i is a feature deformation generator other than the first one, the input prediction image I of the target feature deformation generator i i -1 is the prediction image output by the previous feature deformation generator i - 1 of the target feature deformation generator i. If the target feature deformation generator i is the first feature deformation generator, the input prediction image I of the target feature deformation generator i i-1 is the prediction image I randomly generated by the const module 0 .

[0063] After that, if i = N, that is, the target feature deformation generator is the Nth feature deformation generator (i.e., the last feature deformation generator of the generation model), based on the processed prediction image I of the target feature deformation generator N N , the target prediction image is determined. In one implementation, the processed prediction image I of the target feature deformation generator N at the end can be directly N , determined as the target prediction image.

[0064] If the target feature deformation generator i is not the feature deformation generator at the end (i.e., i < N), then the processed intermediate feature F of the target feature deformation generator i GAN i and the processed prediction image I i are input into the next feature deformation generator i + 1 of the target feature deformation generator i, so that the feature deformation generator i + 1 is based on its corresponding first sample feature map F scr i+1 , second sample feature map F tgti+1 and latent variable vector w, processing the input intermediate feature F of feature deformation generator i+1 GAN i , and obtain the processed intermediate feature F of feature deformation generator i+1 GAN i+1 ; Then based on the processed intermediate feature F of feature deformation generator i+1 GAN i+1 and the input prediction image I of feature deformation generator i+1 i , get the processed predicted image I of feature deformation generator i+1 i+1 And so on, until the processed prediction image I of the feature deformation generator N at the end is obtained N , based on which the target prediction image is determined.

[0065] It can be understood that the input intermediate feature F of the target feature deformation generator i GAN i-1 and the input prediction image I of the target feature deformation generator i i-1 The size of can be smaller than the output image size corresponding to the target feature deformation generator i. For example, the output image size corresponding to the target feature deformation generator i is 2 n *2 n , whose input intermediate feature F GAN i-1 And the input prediction image I i-1 The size can be 2 n-1 *2 n-1 .

[0066] like Figure 2A As shown, it is a schematic diagram of the internal structure of the target feature deformation generator i. The aforementioned processing target feature deformation generator i input intermediate feature F GAN i-1 The process can be: first use a learnable affine transformation (such as Figure 2A The latent variable vector w is transformed to obtain the specified convolutional network (such as Figure 2A The weight values ​​of each channel in the "conv" shown in FIG2 are then modulated and demodulated by a modulation module ("MOD" as shown in FIG2 ) and a demodulation module ("DEMOD" as shown in FIG2 ) to obtain the weight values ​​after modulation and demodulation.

[0067] The weight value is then applied to the specified convolutional network, that is, the weight value after modulation and demodulation is used as the weight value of the specified convolutional network, and then the upsampling (such as Figure 2A The input intermediate feature F of the target feature deformation generator after the “UP” operation shown in the figure GANi-1 Input the specified convolutional network to obtain the first intermediate feature F inter i , the first intermediate feature F inter i Contains the posture features and body shape features of the target object carried in the latent variable vector w. The first intermediate feature F can be expressed by the following formula (1): inter i process;

[0068]

[0069] Among them, StyleConv represents the aforementioned transformation processing (such as Figure 2A "A" shown), modulation processing (such as Figure 2A "MOD" processing shown), demodulation processing (such as Figure 2A The processing of “DEMOD” shown in the figure) and the convolution processing performed by the specified convolutional network, w represents the aforementioned latent variable vector.

[0070] Afterwards, based on the target feature deformation generator i corresponding to the first sample feature map F scr i , the second sample feature map F tgt i and the first intermediate feature F inter i , determine the intermediate feature F after processing by the target feature deformation generator GAN i In one implementation, the first sample feature map F corresponding to the target feature deformation generator i can be scr i , the second sample feature map F tgt i and the first intermediate feature F inter i Make a connection (such as Figure 2A The “C” operation shown in the figure) obtains the processed intermediate feature F of the target feature deformation generator GAN i Specifically, the preset Concat function can be used to connect the first sample feature map F scr i , the second sample feature map F tgt i and the first intermediate feature F inter i Specifically, the above connection process can be expressed by the following formula (2):

[0071]

[0072] Next, perform processing on the intermediate feature F after the target feature deformation generator i GAN i by performing a convolution operation to obtain the intermediate feature F after the convolution operation (such as Figure 2A the "tRGB" operation shown, representing the convolution operation) of the target feature deformation generator GAN i . Then, fuse the intermediate feature F after the convolution operation of the target feature deformation generator GAN i and the input prediction image I of the target feature deformation generator i after upsampling i-1 (such as Figure 2A the operation shown) to obtain the prediction image I after the processing of the target feature deformation generator i i . After that, if the target feature deformation generator i is the last feature deformation generator (i.e., i = N), then based on the prediction image I after the processing of the target feature deformation generator i N , determine the target prediction image. If the target feature deformation generator i is not the last feature deformation generator (i.e., i < N), then use the intermediate feature F after the processing of the target feature deformation generator i GAN i and the prediction image I after the processing of the target feature deformation generator i i as the input of the next feature deformation generator i + 1 of the target feature deformation generator i

[0073] In another embodiment, in order to improve the clarity of the generated image and improve the authenticity of the generated image, that is, the pose and body shape of the object in the target prediction image are more adapted to the pose and body shape of the target object in the target image. The const module can also randomly initialize the generation of optical flow field information, and then use the randomly generated optical flow field information as the input of the deformation generation module. The deformation generation module continuously optimizes the randomly generated optical flow field information to improve its accuracy. Finally, the dressing model can output the optical flow field information between two frames of images (the corresponding relationship between the corresponding pixel points between two frames of images, such as the corresponding relationship between the pixel points of the sample clothing (or the initial object) in the initial image and the corresponding pixel points of the target object in the target image), so as to deform a number of first sample feature maps through the optical flow field information, making the pose features in the deformed first sample feature maps more conform to the pose features of the target object in the target image. Correspondingly, the dressing model can increase the prediction of the optical flow field information to ensure that the pose of the object in the generated image is more conform to the pose of the target object in the target image

[0074] In another embodiment, for the background area of ​​the target image, in order to ensure that only the target object in the target image is changed, that is, in the image generated based on the change-dress model, only the clothes worn by the target object in the target image are converted into sample clothes in the initial image, and the background area of ​​the target image needs to remain unchanged. In addition, considering that the head, hands and feet of the target object in the target image generally do not belong to the clothing wearing area, in order to ensure the quality of the generated image, for such limb parts, the corresponding limb parts of the object in the generated image (target prediction image) need to remain unchanged relative to the target image, that is, the background area in the image generated based on the change-dress model needs to be the same as the background area of ​​the target image (remain unchanged), and the head, hands and feet of the object in the generated image need to be the same as the head, hands and feet of the target object in the target image (remain unchanged).

[0075] Accordingly, the background area can be extracted from the target image in advance to obtain a background image, and the preset protection area can be extracted from the target image to obtain the preset protection area image (i.e., the image of the area where the head, hands and feet of the target object are located). After that, after obtaining the processed prediction image output by the feature deformation generator at the end, the background image and the preset protection area image can be fused with the processed prediction image output by the feature deformation generator at the end to generate a target prediction image in which the background and the preset protection area remain unchanged from the background and the preset protection area of ​​the target image, wherein the clothes worn by the object are replaced with the sample clothes in the initial image, so that the target prediction image can include the target object after changing clothes (wearing the deformed sample clothes).

[0076] Furthermore, in order to ensure that the target predicted image is not affected by the background area and the preset protection area (the head, hands, feet and other areas of the initial object) in the initial image, the const module can also randomly initialize and generate occlusion information, and use the randomly generated occlusion information as the input of the deformation generation module. The deformation generation module continuously optimizes the randomly generated occlusion information to improve its accuracy. Finally, the dress-up model can output occlusion information that can accurately occlude the background area and the preset protection area in the first sample feature map corresponding to the initial image after deformation, so as to ensure the fusion effect in the process of fusing the background image and the preset protection area image extracted from the target image with the processed predicted image output by the feature deformation generator at the end, avoid the interference of the background area and the preset protection area in the initial image with the background area and the preset protection area in the target image, and protect the background area and the preset protection area of ​​the target image.

[0077] Accordingly, in one embodiment, in step S130, it may include using a deformation generation module to determine a target prediction image based on a number of first sample feature maps and a number of second sample feature maps, randomly generated intermediate features and their corresponding randomly generated prediction images, randomly generated optical flow field information, and randomly generated occlusion information. Wherein, the randomly generated optical flow field information and the randomly generated occlusion information may both exist in the form of an image. The image containing the occlusion information may be a binary image, and the binary image includes pixels with a first value (e.g., 0) and pixels with a second value (e.g., 1).

[0078] The deformation generation module includes a plurality of feature deformation generators arranged in series, and the output image sizes corresponding to the plurality of feature deformation generators are increased in sequence. The feature deformation generator can play a role in shielding the background area and the preset protection area in the image, and accordingly, it can be called a feature deformation masker (or feature deformation masking block (FWMB)).

[0079] Accordingly, in step S130, it may specifically include using any target feature deformation generator i among the plurality of feature deformation generators, based on the input optical flow field information f of the target feature deformation generator i i-1 and the input occlusion information M of the target feature deformation generator i i-1 , and the first sample feature map F corresponding to the target feature deformation generator i is scr i Perform deformation and occlusion processing to obtain the sample feature map after deformation and occlusion corresponding to the target feature deformation generator i

[0080] like Figure 2B As shown in FIG. 1 , a schematic diagram of the internal structure of the feature deformation generator i is shown. Specifically, the input optical flow field information f of the target feature deformation generator i i-1 and the input occlusion information M of the target feature deformation generator i i-1 Upsample them respectively to obtain the upsampled input optical flow field information f of the target feature deformation generator i i-1 and the upsampled input occlusion information M of the target feature deformation generator i i-1 .

[0081] Then the first sample feature map F corresponding to the target feature deformation generator i is scr i , after inputting the target feature deformation generator i, the upsampled input optical flow field information f of the target feature deformation generator i is used i-1 , for the first sample feature map F scr iPerform deformation processing, that is, perform warp operation.

[0082] The first sample feature map F after deformation scr i The upsampled input occlusion information M of the target feature deformation generator i i-1 Multiply them to get the sample feature map after deformation and occlusion Among them, the occlusion information M i-1 It may include the predicted feature map F for the first sample scr i The occlusion information of the background area and the feature map F for the first sample scr i The occlusion information of the preset protection area is transformed into the first sample feature map F scr i The input occlusion information M of the target feature deformation generator i i-1 Multiplication can block the first sample feature map F scr i The background area and the preset protection area in the image are used to avoid interference with the dressing result. The above process can be expressed by the following formula (3):

[0083]

[0084] Afterwards, the sample feature map after deformation and occlusion corresponding to the target feature deformation generator i is The second sample feature map F corresponding to the target feature deformation generator i tgt i and latent variable vector w, processing the input intermediate feature F of target feature deformation generator i GAN i-1 , and obtain the processed intermediate feature F of the target feature deformation generator GAN i If the target feature deformation generator i is a non-first feature deformation generator, the input intermediate feature F of the target feature deformation generator GAN i-1 is the intermediate feature output by the feature deformation generator i-1 before the target feature deformation generator i. If the target feature deformation generator i is the first feature deformation generator, the input intermediate feature F of the target feature deformation generator i is GAN i -1 Randomly generated intermediate feature F for the const module GAN 0 The process can be seen in Figure 2A The intermediate feature F after processing by the target feature deformation generator is shown GAN iThe process is not described here. The above formula (2) can be transformed into the following formula (4):

[0085]

[0086] Next, based on the processed intermediate feature F of the target feature deformation generator i GAN i and the input prediction image I of the target feature deformation generator i-1 , get the processed predicted image I of the target feature deformation generator i i If the target feature deformation generator i is a non-first feature deformation generator, the input prediction image I of the target feature deformation generator i i is the predicted image I output by the previous feature deformation generator i-1 of the target feature deformation generator i i-1 If the target feature deformation generator i is the first feature deformation generator, the input prediction image I of the target feature deformation generator i i The predicted image I is randomly generated by the const module 0 .

[0087] Specifically, Figure 2B As shown, the input prediction image I of the target feature deformation generator after upsampling (the "UP" operation shown in the figure) i-1 The processed intermediate feature F of the target feature deformation generator i after the convolution operation (for example, called the first convolution operation, including the model parameters to be trained) GAN i , to merge, such as Figure 2B shown Operation, get the processed predicted image I of the target feature deformation generator i i .

[0088] The processed predicted image I can be expressed by the following formula (5): i :

[0089]

[0090] Among them, tRGB(.) represents the first convolution operation, and UP(.) represents upsampling.

[0091] And, based on the processed intermediate feature F of the target feature deformation generator i GAN i and the input optical flow information f of the target feature deformation generator i-1 , get the processed optical flow field information f of the target feature deformation generator i i The processed intermediate feature F based on the target feature deformation generator i GANi and the input occlusion information M of the target feature deformation generator i-1 , get the processed occlusion information M of the target feature deformation generator i i .

[0092] Specifically, Figure 2B As shown, the input optical flow field information f of the target feature deformation generator after upsampling (the "UP" operation shown in the figure) i-1 The processed intermediate feature F of the target feature deformation generator i after the convolution operation (called the second convolution operation, including the model parameters to be trained) GAN i , to merge, such as Figure 2B shown Operation, to obtain the processed optical flow field information f of the target feature deformation generator i i The input occlusion information M of the target feature deformation generator after upsampling (the “UP” operation shown in the figure) i The processed intermediate feature F of the target feature deformation generator i after the convolution operation (called the third convolution operation, including the model parameters to be trained) GAN i , to merge, such as Figure 2B shown Operation, to obtain the processed occlusion information M of the target feature deformation generator i i .

[0093] The processed optical flow field information f can be expressed by the following formula (6): i , the processed occlusion information M is expressed by the following formula (7): i :

[0094]

[0095]

[0096] Among them, tXY(.) represents the second convolution operation; tMask(.) represents the third convolution operation.

[0097] Among them, if the target feature deformation generator i is a feature deformation generator that is not in the first place, the input optical flow field information f of the target feature deformation generator i i-1 and the input occlusion information M of the target feature deformation generator i-1 They are respectively the optical flow information f output by the previous feature deformation generator i-1 of the target feature deformation generator i i-1 and occlusion information M i-1 ; If the target feature deformation generator i is the first feature deformation generator, the input optical flow field information f of the target feature deformation generator ii-1 and the input occlusion information M of the target feature deformation generator i-1 Respectively, the optical flow field information f randomly generated by the const module 0 and occlusion information M 0 .

[0098] Afterwards, if the target feature deformation generator i is the feature deformation generator at the end (i.e., i=N, which is the last feature deformation generator of the generation model), the processed predicted image I based on the target feature deformation generator i N , determine the target prediction image.

[0099] If the target feature deformation generator i is not the feature deformation generator at the end, the processed intermediate feature F GAN i , processed predicted image I i , processed optical flow field information f i And the processed occlusion information M i , input the next feature deformation generator i+1 of the target feature deformation generator i, so that the feature deformation generator i+1 processes its input intermediate feature F based on its corresponding first sample feature map and second sample feature map and latent variable vector w GAN i , input prediction image I i , input optical flow field information f i And input occlusion information M i , that is, the intermediate feature F after processing by the aforementioned target feature deformation generator i GAN i , processed predicted image I i , processed optical flow field information f i And the processed occlusion information M i , to update the input intermediate feature F GAN i , input prediction image I i , input optical flow field information f i And input occlusion information M i , so that the updated input intermediate feature F GAN i , input prediction image I i , input optical flow field information f i And input occlusion information M iThe posture features and body shape features of the target object in the second sample feature map and the clothing information of the sample clothing in the first sample feature map can be better and more comprehensively integrated to obtain a deformed sample clothing that is more consistent with the posture features and body shape features of the target object, that is, to obtain an image of the object (target object) wearing the sample clothing while maintaining the posture and body shape of the target object. This is repeated until the processed predicted image I of the feature deformation generator N at the end is obtained. N , based on which the target prediction image I is determined N .

[0100] In one embodiment, in order to ensure that the images of the background area and the preset protection area in the target image are not changed, accordingly, Figure 1B As shown, the generation model may also include a fusion device, based on the processed prediction image I of the feature deformation generator N at the end N , get the target prediction image I N The process may be to use the fuser to process the predicted image I based on the processed feature deformation generator N at the end. N , a background image containing the background area of ​​the target image (referred to as the target background image I tgt BG ) and a protection area image containing a preset protection area of ​​a target image (referred to as a target protection area image I tgt PT ) and the occlusion information M output by the feature deformation generator at the end N , and fused to obtain the target prediction image.

[0101] Specifically, the occlusion information M output by the feature deformation generator at the end N Including occlusion information M for the background area BG and the occlusion information M for the preset protection area PT The process of obtaining the target prediction image by fusion may be: based on the occlusion information M for the preset protection area PT , the target protection area image I tgt PT and the processed predicted image I of the feature deformation generator N at the end N , fused to obtain the intermediate prediction image I inter ; Based on the target background image I tgt BG , occlusion information M for the background area BG and the intermediate prediction image I inter , fused to get the target prediction image

[0102] Specifically, the intermediate prediction image I can be obtained by fusion using the following formula (8): interThe process is expressed by the following formula (9) to obtain the target prediction image

[0103]

[0104]

[0105] The target prediction image is obtained by the above method Then, in step S140, the current prediction loss is determined based on the target prediction image and the target image. In this step, the target image is used as the label image, and accordingly, the reconstruction loss between the target prediction image and the target image can be determined based on the preset loss function according to the target prediction image and the target image, wherein the preset loss function can be an L1 loss function.

[0106] Specifically, the reconstruction loss can be expressed by the following formula (10):

[0107] Among them, L rec represents the reconstruction loss, I tgt represents the target image, Indicates the calculation of the L1 loss value between the target prediction image and the target image.

[0108] In one implementation, the reconstruction loss can be directly determined as the current prediction loss. In another implementation, the refitting model can also include a discriminant model. Accordingly, in order to ensure the refitting capability of the model, an adversarial loss can also be constructed to determine the current prediction loss based on the reconstruction loss and adversarial loss of the previous life. For example, the sum of the reconstruction loss and the adversarial loss can be determined as the current prediction loss.

[0109] The process of constructing the adversarial loss may be: inputting the target predicted image into a discriminant model for determining whether the input image is a real image, obtaining the predicted probability that the target preset image determined by the discriminant model is a real image, and constructing the adversarial loss based on the predicted probability. Specifically, the adversarial loss may be expressed by the following formula (11):

[0110]

[0111] Among them, L adv Represents resistance to loss, It represents the predicted probability that the target preset image judged by the discriminant model is a real image.

[0112] After determining the current prediction loss, then, in step S150, the model parameters of the dressing model are adjusted based on the current prediction loss. In this step, the model parameters of the dressing model (i.e., the generation model) are adjusted with the goal of minimizing the current prediction loss, i.e., with the goal of minimizing the reconstruction loss, and with the goal of maximizing the predicted probability that the target preset image identified by the discriminant model is a real image (i.e., so that the discriminant model identifies the target preset image as a real image), the model parameters of the generation model of the dressing model are adjusted.

[0113] In one implementation, when the dressing model also includes a discriminant model, the model parameters of the discriminant model and the model parameters of the generative model can be updated respectively by alternatingly updating the model parameters of the discriminant model and the model parameters of the generative model. Specifically, when updating the model parameters of the generative model, the model parameters of the discriminant model are fixed, and when updating the model parameters of the discriminant model, the model parameters of the generative model are fixed. When updating the model parameters of the generative model, the model parameters of the discriminant model of the dressing model can be adjusted with the goal of minimizing the reconstruction loss and minimizing the predicted probability that the target preset image judged by the discriminant model is a real image (i.e., so that the discriminant model judges that the target preset image is not a real image). In this way, the model parameters of the discriminant model of the dressing model are confronted with the generative model to improve the authenticity of the image generated by the generative model, that is, to improve its dressing effect.

[0114] Let's review the execution process of steps S110 to S150. The above embodiment is explained by taking a pair of sample image pairs (i.e., a pair of initial images and target images) as one sample. In another embodiment, the above steps S110 to S140 can also be performed for a batch of samples, i.e., multiple pairs of sample image pairs (multiple pairs of initial images and target images), to obtain the target prediction images corresponding to each pair of sample image pairs, and then in step S150, the current prediction loss is determined based on the target prediction images corresponding to each pair of sample image pairs and the target images in each pair of sample image pairs, and the generation model is trained with the goal of minimizing the current prediction loss. In this embodiment, the current prediction loss is determined for a batch of samples, and then the model parameters of the generation model are adjusted. This can reduce the number of adjustments to the model parameters of the generation model and make it easier to implement the training process.

[0115] The dressing model is trained in the aforementioned manner until the dressing model reaches a preset convergence condition, thereby obtaining a trained dressing model, which is used to provide dressing services. The preset convergence condition may include but is not limited to: the current prediction loss of the dressing model is lower than a preset threshold, or the number of iterative adjustments of the model parameters of the generated model reaches a preset number of thresholds, or the generated model and the discriminant model reach a preset balance condition, etc.

[0116] In one implementation, after the dressing model is trained, the dressing model can also be tested. Each test image pair used in the testing process can include a pair of test initial images and test target images. The pair of test initial images and test target images can include different objects wearing different clothes and in different postures.

[0117] In the above process, adding limb segmentation information containing body shape and posture information as the input of the dressing model can enable the dressing model to learn the ability to extract the body shape and posture information of the object in the image, and make the posture and body shape of the object (clothing) in the generated image more closely match the posture and body shape of the object to be dressed up. And using multiple feature deformation generators with increasing corresponding output image sizes in series can ensure that the dressing model generates images with higher resolution, and ensure the clarity of the generated image and the clarity of the texture and color of the clothing to be dressed up.

[0118] In addition, the dressing model adds predicted optical flow field information and occlusion information, so that the posture and body shape of the object in the generated image are more accurate, the deformation of the clothing is more accurate, and the preset protection area and background area are more closely aligned with the target image, which improves the dressing effect and ensures that the generated image object is the person to be dressed up.

[0119] Next, after obtaining the trained dressing model, the second stage is entered, and virtual dressing can be performed based on the dressing model. Figure 3 The flowchart of a virtual dressing method based on a dressing model in one embodiment of the present specification is shown. The method can be implemented by a target program. The target program can be installed in an electronic device, and the electronic device can be implemented by any device, equipment, platform, device cluster, etc. with computing and processing capabilities. Figure 3 As shown, the dressing model includes a generation model, and the generation model includes a feature extraction module and a deformation generation module; the method includes the following steps:

[0120] In step S310, first feature information including clothing information of the first clothing is obtained from the first image, and second feature information including body shape and posture information of the object to be changed is obtained from the second image corresponding to the first image. The object to be changed is, for example, a person to be changed.

[0121] In one implementation, the first image includes a first garment, and first feature information including clothing information of the first garment can be extracted from the first image, wherein the process of extracting the first feature information can refer to the process of extracting the first sample feature information in the aforementioned embodiment of the training method for the dressing model, which will not be repeated here.

[0122] In one embodiment, the first image may include a first object wearing a first garment, the first feature information includes first limb region information, first limb key point information, first limb posture information and first limb segmentation information of the first object, the first limb region information includes clothing information of the first garment, and the first limb segmentation information includes body shape and posture information of the first object.

[0123] The second image includes the object to be replaced. In one case, the object to be replaced and the first object may be different real objects, which are dressed differently and in different postures. In another case, the object to be replaced and the first object may be the same real object, which are dressed the same (or different) and in different postures.

[0124] Correspondingly, the second feature information includes: second limb area information, second limb key point information, second limb posture information and second limb segmentation information of the object to be changed, the second limb segmentation information includes the body shape and posture information of the object to be changed, and the second limb area information includes a preset protection area belonging to the non-clothing wearing area of ​​the object to be changed.

[0125] Among them, for the method of extracting the first limb area information, the first limb key point information, the first limb posture information and the first limb segmentation information of the first object in the first image, and the method of extracting the second limb area information, the second limb key point information, the second limb posture information and the second limb segmentation information of the object to be changed in the second image, please refer to the method of extracting the initial limb area information, the initial limb key point information, the initial limb posture information and the initial limb segmentation information in the aforementioned training method embodiment of the dressing model, which will not be repeated here.

[0126] After obtaining the first feature information and the second feature information, in step S320, a feature extraction module is used to determine a plurality of first feature graphs based on the first feature information and a plurality of second feature graphs based on the second feature information. The plurality of second feature graphs include body features and posture features corresponding to the body shape and posture information of the object to be dressed.

[0127] In one embodiment, the feature extraction module may include a first feature extractor and a second feature extractor, and the first feature extractor and the second feature extractor are arranged in parallel; in step S320, the process of determining a plurality of first feature maps based on the first feature information includes: using the first feature extractor to process the first feature information to obtain a plurality of first feature maps, wherein the sizes of the plurality of first feature maps are different; in the process of determining a plurality of second feature maps based on the second feature information, includes: using the second feature extractor to process the second feature information to obtain a plurality of second feature maps, wherein the sizes of the plurality of second feature maps are different.

[0128] In one case, the plurality of first feature maps may include feature maps of multiple image sizes, and the plurality of first feature maps as a whole may include at least clothing features of the first garment (e.g., color, texture, contour, etc.), and may also include limb features of the first object (e.g., posture and body shape). In fact, for any of the first feature maps, it is output by a certain layer or a certain sub-extraction module (e.g., each sub-extractor of the first feature extractor) in the feature extraction module, and accordingly, any of the first feature maps may include at least one of the aforementioned clothing features of the first garment (e.g., color, texture, contour, etc.) and / or limb features of the first object (e.g., posture and body shape).

[0129] Several second feature maps may include features of multiple image sizes. Several second feature maps as a whole include body features corresponding to the body shape and posture information of the object to be changed, and may also include posture features that characterize the posture information of the target object. In the case where the second feature map also includes second limb key point information and second limb posture information, several second feature maps as a whole also include posture features that can better characterize the posture information of the object to be changed. In fact, for any of the second feature maps, it is output by a certain layer or a certain sub-extraction module (such as each sub-extractor of the second feature extractor) in the feature extraction module. Accordingly, any of the second feature maps may include at least one of the aforementioned body shape features and posture features. The second limb area information may include limb features of the non-clothing covered area of ​​the object to be changed (such as features of the head, hands, and feet).

[0130] Then in step S330, a deformation generation module is used to determine a target generation image based on a plurality of first feature maps and a plurality of second feature maps, randomly generated initial intermediate features, and corresponding randomly generated initial generation images. The target generation image includes the object to be changed wearing the deformed first clothing, and the deformed first clothing conforms to the body shape characteristics and posture characteristics of the object to be changed.

[0131] Among them, the initial intermediate features and the corresponding initial generated images can be randomly generated by the constant input module, i.e., the const module, included in the generation model, and are used to assist in generating the target generated image. In this step, a plurality of first feature maps and a plurality of second feature maps as well as the initial intermediate features and the corresponding initial generated images are input into the deformation generation module, so that the deformation generation module uses the plurality of first feature maps and a plurality of second feature maps to process the initial intermediate features and the corresponding initial generated images, and then uses the processed intermediate features and the processed generated images to obtain the target generated image, so as to deform the first garment (i.e., the limbs of the first object) based on the body shape features and posture features of the object to be changed, obtain the deformed first garment that meets the body shape features and posture features of the object to be changed, generate the target generated image of the object to be changed including the first garment after deformation, and realize the change of the object to be changed, that is, transfer the first garment to the body of the object to be changed.

[0132] In one embodiment, in order to better improve the dressing ability of the dressing model and ensure its dressing effect, the generation model further includes: a latent variable extractor; the feature extraction module further determines the target feature extraction result based on the second feature information, and the method further includes:

[0133] Based on the latent variable extractor, a body shape and posture vector representing the body shape and posture features of the object to be dressed up is extracted from the target feature extraction result; accordingly, in step S330, it can specifically include: determining a target generated image based on a number of first feature maps, a number of second feature maps, the body shape and posture vector, the initial intermediate features and the initial generated image.

[0134] The target feature extraction result may be the result output by the last sub-extractor in the second feature extractor (e.g., a result in the form of a feature map or a result in the form of a vector). Specifically, the target program may use a plurality of first feature maps, a plurality of second feature maps, and a body shape and posture vector to process the initial intermediate features and the initial generated image, and then use the processed intermediate features and the processed generated image to obtain the target generated image, so that the posture and body shape of the object in the target generated image are more consistent with the posture and body shape of the object to be replaced in the second image, thereby improving the replacement effect.

[0135] In one embodiment, in order to generate an image with higher definition, the deformation generation module may include a plurality of feature deformation generators arranged in series, and the output image sizes corresponding to the plurality of feature deformation generators are increased in sequence; the plurality of first feature maps and the plurality of second feature maps include first feature maps and second feature maps corresponding to each feature deformation generator respectively;

[0136] In step S330, the following steps 11-13 may be included: in step 11, using any target feature deformation generator among several feature deformation generators, based on its corresponding first feature map, second feature map and body posture vector, the current intermediate feature is processed to obtain an updated intermediate feature, and the current intermediate feature is the intermediate feature output by the previous feature deformation generator of the target feature deformation generator, or is the initial intermediate feature.

[0137] In step 12, an updated generated image is obtained based on the updated intermediate features and the current generated image, wherein the current generated image is a generated image output by a previous feature deformation generator of the target feature deformation generator, or an initial generated image.

[0138] In step 13, if the target feature deformation generator is the feature deformation generator at the end, a target generated image is determined based on the updated generated image.

[0139] It can be understood that the structures of the feature deformation generators among the several feature deformation generators are similar, and the processing process of the input data of each feature deformation generator is similar. The following takes any one of the several feature deformation generators (for example, the target feature deformation generator i) as an example to introduce its processing process of input data. The processing process of other feature deformation generators on their input data can refer to the processing process of the target feature deformation generator i on its input data. Among them, i is an integer from 1 to N, and N represents the number of several feature deformation generators. In one case, the several feature deformation generators can include 7 feature deformation generators, that is, N is 7.

[0140] Specifically, the target feature deformation generator i is used to process the current intermediate feature of the target feature deformation generator i based on its corresponding first feature map, second feature map and body posture vector to obtain the updated intermediate feature of the target feature deformation generator i. If the target feature deformation generator i is a feature deformation generator that is not in the first position, the current intermediate feature is the intermediate feature output by the feature deformation generator i-1 before the target feature deformation generator i. If the target feature deformation generator i is a feature deformation generator that is in the first position, the current intermediate feature is the initial intermediate feature randomly generated by the const module.

[0141] Next, based on the updated intermediate feature of the target feature deformation generator i and the current generated image of the target feature deformation generator i, the updated generated image of the target feature deformation generator i is obtained. Among them, if the target feature deformation generator i is a non-first feature deformation generator, the current generated image is the generated image output by the previous feature deformation generator i - 1 of the target feature deformation generator i; if the target feature deformation generator i is a first feature deformation generator, the current generated image is the initial generated image randomly generated by the const module.

[0142] After that, if the target feature deformation generator i is the last feature deformation generator (i.e., i = N, which is also the last feature deformation generator of the generation model), based on the updated generated image of the target feature deformation generator i, the target generated image is determined. In one implementation, the updated generated image of the target feature deformation generator N can be directly determined as the target generated image.

[0143] If the target feature deformation generator i (i < N) is not the last feature deformation generator, the updated intermediate feature and the updated generated image of the target feature deformation generator i are input into the next feature deformation generator i + 1 of the target feature deformation generator i, so that the feature deformation generator i + 1 processes the current intermediate feature of the feature deformation generator i + 1 (i.e., the updated intermediate feature of the target feature deformation generator i) based on its corresponding first feature map, second feature map, and body shape and pose vector, to obtain the updated intermediate feature of the feature deformation generator i + 1; then, based on the updated intermediate feature of the feature deformation generator i + 1 and the current generated image of the feature deformation generator i + 1 (i.e., the updated generated image of the target feature deformation generator i), the updated generated image of the feature deformation generator i + 1 is obtained. And so on, until the updated generated image of the last feature deformation generator N is obtained, and the target prediction image is determined based on it.

[0144] It can be understood that the sizes of the current intermediate feature and the current generated image of the target feature deformation generator i can be smaller than the output image size corresponding to the target feature deformation generator i. For example, the output image size corresponding to the target feature deformation generator i is 2 n *2 n , and the sizes of its current intermediate feature and current generated image can be 2 n-1 *2 n-1 , and the image sizes of the first feature map and the second feature map corresponding to the target feature deformation generator i can be 2 n *2 n .

[0145] In Figure 2ABased on the internal structure of the target feature deformation generator i shown in FIG. 1 , the aforementioned process of processing the current intermediate feature of the target feature deformation generator i may be: first, a learnable affine transformation (such as Figure 2A The body posture vector is transformed to obtain the specified convolutional network (such as Figure 2A The weight values ​​of each channel in the "conv" shown in FIG2 are then modulated and demodulated by a modulation module ("MOD" as shown in FIG2 ) and a demodulation module ("DEMOD" as shown in FIG2 ) to obtain the weight values ​​after modulation and demodulation.

[0146] The weight value is then applied to the specified convolutional network, that is, the weight value after modulation and demodulation is used as the weight value of the specified convolutional network, and then the upsampled current intermediate feature is input into the specified convolutional network to obtain the second intermediate feature, which includes the posture feature and body shape feature of the object to be replaced carried in the body shape posture vector.

[0147] Afterwards, based on the first feature map, the second feature map, and the second intermediate feature corresponding to the target feature deformation generator i, the updated intermediate feature of the target feature deformation generator is determined. In one implementation, the first feature map, the second feature map, and the second intermediate feature corresponding to the target feature deformation generator i may be connected to obtain the updated intermediate feature of the target feature deformation generator. Specifically, the first feature map, the second feature map F, and the second intermediate feature may be connected using a preset Concat function. The specific connection process may refer to the connection process of the first sample feature map, the second sample feature map, and the first intermediate feature corresponding to the target feature deformation generator i in the aforementioned embodiment, which will not be repeated here.

[0148] Next, the aforementioned process of obtaining the updated generated image may include: performing a convolution operation on the updated intermediate features of the target feature deformation generator i to obtain the updated intermediate features after the convolution operation, and fusing the updated intermediate features after the convolution operation with the current generated image of the target feature deformation generator i after upsampling to obtain the updated generated image of the target feature deformation generator i.

[0149] Afterwards, if the target feature deformation generator i is the last feature deformation generator (i.e., feature deformation generator N), the target generated image is determined based on the updated generated image of the target feature deformation generator N. If the target feature deformation generator i is not the last feature deformation generator, the updated intermediate features of the target feature deformation generator i and the updated generated image of the target feature deformation generator i are used as inputs of the next feature deformation generator i+1 of the target feature deformation generator i.

[0150] In another embodiment, in order to improve the clarity of the generated image and improve the authenticity of the generated image, that is, the posture and body shape of the object in the target prediction image are more compatible with the posture and body shape of the target object in the target image. The const module can also randomly initialize and generate optical flow field information (called initial optical flow field information), and then use the randomly generated optical flow field information as input to the deformation generation module, and continuously optimize the initial optical flow field information through the deformation generation module to improve its accuracy. Finally, the dressing model can output the optical flow field information between the first image and the second image, which can include the correspondence between the first clothing (or the first object) in the first image (each pixel point) and the object to be dressed in the second image (each pixel point).

[0151] In yet another embodiment, for the background area of ​​the second image, in order to ensure that only the object to be changed in the second image is changed, that is, in the image generated based on the changing model, only the clothing worn by the object to be changed in the second image is converted into the first clothing in the first image, while the background area of ​​the target image needs to remain unchanged. In addition, considering that the head, hands and feet of the object to be changed in the second image generally do not belong to the clothing wearing area, in order to ensure the quality of the generated image, for such limb parts, the corresponding limb parts of the object in the generated image (target generated image) need to remain unchanged relative to the second image, that is, the background area in the image generated based on the changing model needs to be the same as the background area of ​​the target image (remain unchanged), and the head, hands and feet of the object in the generated image need to be the same as the head, hands and feet of the target object in the target image (remain unchanged).

[0152] Correspondingly, the background area can be extracted from the second image in advance to obtain a background image, and the preset protection area can be extracted from the second image to obtain a preset protection area image (i.e., the image of the area where the head, hands and feet of the object to be changed are located). After that, after obtaining the updated generated image output by the feature deformation generator at the end, the background image and the preset protection area image can be fused with the updated generated image output by the feature deformation generator at the end to generate a target generated image in which the background and the preset protection area remain unchanged from the background and the preset protection area of ​​the second image, wherein the clothes worn by the object are replaced with the first clothes in the first image, so that the target generated image includes the object to be changed after changing clothes (wearing the deformed first clothes).

[0153] In order to ensure that the target generated image is not affected by the background area and the preset protection area (the head, hands and feet of the first object) in the first image. Accordingly, the const module can also randomly initialize and generate occlusion information (called initial occlusion information), and use the initial occlusion information as the input of the deformation generation module. The deformation generation module continuously optimizes the initial occlusion information to improve its accuracy. Finally, the dress-changing model outputs the occlusion information that can occlude the background area and the preset protection area in the first feature map corresponding to the first image after deformation, so that the dress-changing model has the ability to occlude the background area features and the preset protection area features in the first feature map corresponding to the first image, so as to ensure the fusion effect in the process of merging the background image and the preset protection area image extracted from the second image into the updated generated image output by the feature deformation generator at the end. Avoid the interference of the background area and the preset protection area in the first image with the background area and the preset protection area in the second image, and play the role of protecting the background area and the preset protection area of ​​the second image. Among them, the initial optical flow field information and the initial occlusion information can both exist in the form of images. The image containing occlusion information may be a binary image, which includes pixels with a first value (for example, 0) and pixels with a second value (for example, 1).

[0154] Accordingly, in step 11, the following steps 111-113 may be included: in step 111, using the current deformation occlusion information, a deformation occlusion operation is performed on the first feature map corresponding to the target feature deformation generator to obtain the first feature map after deformation and occlusion, and the current deformation occlusion information is the deformation occlusion information output by the previous feature deformation generator of the target feature deformation generator, or the initial deformation occlusion information obtained by initialization. Among them, the current deformation occlusion information includes the current optical flow field information and the current occlusion information, and the current occlusion information includes the predicted occlusion information for protecting the background area of ​​the second image and the occlusion information for protecting the preset protection area in the second image. The current optical flow field information at least includes the predicted correspondence between the first clothing in the first image and the object to be replaced in the second image. In one implementation, when the first image contains an object wearing clothing, this correspondence may also include the correspondence between the object in the first image and the object to be replaced in the second image in terms of posture.

[0155] In step 112, the current intermediate feature is processed using the body shape posture vector to obtain a first intermediate feature.

[0156] In step 113, based on the first feature map after deformation and occlusion, the second feature map corresponding to the target feature deformation generator, and the first intermediate feature, an updated intermediate feature of the target feature deformation generator is obtained.

[0157] In this implementation, the target feature deformation generator i is used to deform the first feature map corresponding to the target feature deformation generator i according to the current optical flow field information after upsampling of the target feature deformation generator i, that is, to perform a warp operation. Then, the deformed first feature map is multiplied with the current occlusion information after upsampling of the target feature deformation generator i to obtain the deformed and occluded first feature map. Among them, the occlusion information M i The predicted occlusion information of the background area of ​​the first feature map and the occlusion information of the preset protection area of ​​the first feature map may be included, and the first feature map after deformation processing and the current occlusion information M of the target feature deformation generator i may be combined. i By multiplying (i.e., multiplying with the occlusion information of the background area of ​​the first feature map and the occlusion information of the preset protection area of ​​the first feature map respectively), the background area and the preset protection area in the first feature map can be occluded to avoid their interference with the dressing result.

[0158] Afterwards, based on the first feature map after deformation and occlusion corresponding to the target feature deformation generator i, the second feature map corresponding to the target feature deformation generator i, and the body posture vector, the current intermediate feature of the target feature deformation generator i is processed to obtain the updated intermediate feature of the target feature deformation generator. Wherein, if the target feature deformation generator i is a feature deformation generator that is not in the first position, the current intermediate feature of the target feature deformation generator i is the intermediate feature output by the previous feature deformation generator i-1 of the target feature deformation generator i; if the target feature deformation generator i is a feature deformation generator in the first position, the current intermediate feature of the target feature deformation generator i is the initial intermediate feature. Wherein, the process of processing the current intermediate feature of the target feature deformation generator i can be referred to as follows. Figure 2A The intermediate feature F after processing by the target feature deformation generator is shown GAN i The process will not be described in detail here.

[0159] Afterwards, the updated intermediate features of the target feature deformation generator and the current generated image of the target feature deformation generator i are used to obtain the updated generated image of the target feature deformation generator. The process of obtaining the updated generated image of the target feature deformation generator can refer to the process of obtaining the processed predicted image of the target feature deformation generator in the aforementioned embodiment, which will not be repeated here.

[0160] Furthermore, it is also necessary to determine the updated deformed occlusion information of the target feature deformation generator (i.e., updated optical flow information and updated occlusion information) based on the updated intermediate features and the current deformed occlusion information of the target feature deformation generator i (i.e., current optical flow information and current occlusion information). Specifically, in one embodiment, the process of determining the updated deformed occlusion information of the target feature deformation generator may include: fusing the upsampled current deformed occlusion information and the updated intermediate features after the convolution operation to determine the updated deformed occlusion information.

[0161] The process of determining the updated deformation occlusion information, that is, determining the updated optical flow field information and the updated occlusion information, can refer to the above embodiments, based on Figure 2B The structure shown, the process of determining the processed optical flow field information and the processed occlusion information will not be repeated here.

[0162] In one embodiment, in order to ensure that the images of the background area and the preset protection area in the target image are not changed and to ensure the dressing effect, the generation model may also include: a fusion device; accordingly, the aforementioned process of determining the target generated image based on the updated generated image may include: using the fusion device to fuse the target generated image based on the updated generated image, the background image containing the background area of ​​the second image, the protection area image containing the preset protection area, and the target occlusion information output by the feature deformation generator at the end. The process of fusion to obtain the target generated image can refer to the process of fusion to obtain the target predicted image in the aforementioned embodiment, which will not be repeated here.

[0163] In this embodiment, limb segmentation information including body shape and posture information is added as input to the dressing model, so that the dressing model can extract the body shape and posture information of the object to be dressed in the second image, and then generate a posture and body shape of the object (clothing) that better fits the posture and body shape of the object to be dressed.

[0164] The use of multiple feature deformation generators with increasing corresponding output image sizes in series can ensure that the dressing model generates images with higher resolution, and ensure the clarity of the generated images and the clarity of the texture and color of the clothes to be changed. The dressing model adds predicted optical flow field information and occlusion information, so that the posture and body shape of the object in the generated image are more accurate, the deformation of the clothes is more accurate, and the preset protection area and background area are more in line with the target image, which improves the dressing effect and ensures that the generated image object is the effect of the person to be changed.

[0165] The foregoing describes certain embodiments of the present specification, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in an order different from that in the embodiments, and the desired results may still be achieved. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0166] Corresponding to the above method embodiment, the present specification embodiment provides a virtual dress-changing device 400 based on a dress-changing model, and its schematic block diagram is as follows: Figure 4 As shown, the dress-changing model includes a generation model, and the generation model includes a feature extraction module and a deformation generation module; the device includes:

[0167] The first acquisition module 410 is configured to acquire first feature information including clothing information of the first clothing in the first image, and acquire second feature information including body shape and posture information of the object to be changed in the second image corresponding to the first image;

[0168] A first determination module 420 is configured to use the feature extraction module to determine a plurality of first feature graphs based on the first feature information, and to determine a plurality of second feature graphs based on the second feature information, wherein the plurality of second feature graphs include body shape features and posture features corresponding to the body shape and posture information of the object to be dressed up;

[0169] The second determination module 430 is configured to use the deformation generation module to determine a target generation image based on the plurality of first feature maps and the plurality of second feature maps, the randomly generated initial intermediate features and the corresponding randomly generated initial generation image, wherein the target generation image includes the object to be changed wearing the deformed first clothing, and the deformed first clothing conforms to the body shape characteristics and posture characteristics of the object to be changed.

[0170] In an optional embodiment, the first image includes a first object wearing the first garment, the first feature information includes first limb region information, first limb key point information, first limb posture information and first limb segmentation information of the first object, the first limb region information includes clothing information of the first garment, and the first limb segmentation information includes body shape and posture information of the first object.

[0171] In an optional embodiment, the second feature information includes: second limb area information, second limb key point information, second limb posture information and second limb segmentation information of the object to be changed, the second limb segmentation information includes the body shape and posture information of the object to be changed, and the second limb area information includes a preset protection area of ​​the object to be changed that belongs to the non-clothing wearing area.

[0172] In an optional implementation, the feature extraction module includes a first feature extractor and a second feature extractor;

[0173] The first determination module 420 is specifically configured to use the first feature extractor to process the first feature information to obtain the several first feature maps, wherein the sizes of the several first feature maps are different; and use the second feature extractor to process the second feature information to obtain the several second feature maps, wherein the sizes of the several second feature maps are different.

[0174] In an optional implementation, the generation model further includes: a latent variable extractor; the feature extraction module further determines a target feature extraction result based on the second feature information, and the device further includes:

[0175] An extraction module (not shown in the figure), configured to extract a body shape and posture vector representing the body shape features and posture features of the object to be dressed up from the target feature extraction result based on the latent variable extractor;

[0176] The second determination module 430 is specifically configured to determine the target generated image based on the plurality of first feature maps, the plurality of second feature maps, the body shape posture vector, the initial intermediate feature and the initial generated image.

[0177] In an optional implementation, the deformation generation module includes a plurality of feature deformation generators arranged in series, and the output image sizes corresponding to the plurality of feature deformation generators are increased in sequence; the plurality of first feature maps and the plurality of second feature maps include first feature maps and second feature maps corresponding to each feature deformation generator, respectively;

[0178] The second determining module 430 includes:

[0179] A first processing unit (not shown in the figure) is configured to use any target feature deformation generator among the plurality of feature deformation generators to process the current intermediate feature based on its corresponding first feature map, second feature map and the body posture vector to obtain an updated intermediate feature, wherein the current intermediate feature is an intermediate feature output by a feature deformation generator before the target feature deformation generator, or is the initial intermediate feature;

[0180] The first obtaining unit (not shown in the figure) is configured to obtain an updated generated image based on the updated intermediate features and the current generated image to obtain the target generated image, wherein the current generated image is the generated image output by the previous feature deformation generator of the target feature deformation generator, or the initial generated image.

[0181] In an optional implementation manner, the second determining module 430 further includes:

[0182] The first determining unit (not shown in the figure) is configured to determine the target generated image based on the updated generated image if the target feature deformation generator is the feature deformation generator at the end.

[0183] In an optional implementation, the first obtaining unit is specifically configured to perform a deformation and occlusion operation on the first feature map corresponding to the target feature deformation generator using the current deformation and occlusion information to obtain the first feature map after deformation and occlusion, wherein the current deformation and occlusion information is the deformation and occlusion information output by the previous feature deformation generator of the target feature deformation generator, or the initial deformation and occlusion information obtained by initialization;

[0184] Processing the current intermediate feature using the body shape posture vector to obtain a first intermediate feature;

[0185] The first feature map after deformation and occlusion, the second feature map corresponding to the target feature deformation generator, and the first intermediate feature are connected to obtain an updated intermediate feature of the target feature deformation generator.

[0186] In an optional embodiment, the current deformation occlusion information includes current optical flow field information and current occlusion information, the current occlusion information includes predicted occlusion information for protecting the background area of ​​the second image and occlusion information for protecting a preset protection area in the second image, and the current optical flow field information at least includes a predicted correspondence between the first clothing in the first image and the object to be changed in the second image.

[0187] In an optional implementation, the first obtaining unit is further configured to determine the updated deformation occlusion information of the target feature deformation generator based on the updated intermediate feature and the current deformation occlusion information.

[0188] In an optional implementation, the generation model further includes: a fusion device;

[0189] The second determination module 430 is configured to use the fuser to fuse the target generated image based on the updated generated image, the background image including the background area of ​​the second image, the protection area image including the preset protection area, and the target occlusion information output by the feature deformation generator at the end.

[0190] In an alternative embodiment, if Figure 5 As shown, the device also includes:

[0191] The second acquisition module 510 is configured to acquire first sample feature information including sample clothing information of the sample clothing from the initial image, and acquire second sample feature information including body shape and posture information of the target object to be changed from the target image corresponding to the initial image;

[0192] A third determination module 520 is configured to use the feature extraction module to determine a plurality of first sample feature graphs based on the first sample feature information, and to determine a plurality of second sample feature graphs based on the second sample feature information, wherein the plurality of second sample feature graphs include body shape features and posture features corresponding to the body shape and posture information of the target object;

[0193] A fourth determination module 530 is configured to use the deformation generation module to determine a target prediction image based on the plurality of first sample feature maps and the plurality of second sample feature maps, the randomly generated intermediate features and their corresponding randomly generated prediction images, wherein the target prediction image includes the target object wearing the deformed sample clothing, and the deformed sample clothing conforms to the body shape characteristics and posture characteristics of the target object;

[0194] A fifth determination module 540 is configured to determine a current prediction loss based on the target prediction image and the target image;

[0195] The adjustment module 550 is configured to adjust the model parameters of the outfit-changing model based on the current predicted loss.

[0196] The above device embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The device embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments. For specific descriptions, please refer to the corresponding method embodiments.

[0197] Reference below Figure 6 , which shows a structural schematic diagram of an electronic device 600 suitable for implementing the embodiments of this specification. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of this specification.

[0198] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0199] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0200] In particular, according to an embodiment of the present specification, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present specification includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present specification are executed.

[0201] The embodiments of the present specification also provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the virtual dressing method based on the dressing model provided in the present specification.

[0202] It should be noted that the computer-readable medium described in the embodiments of this specification may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the embodiments of this specification, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the embodiments of this specification, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0203] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains first feature information including clothing information of the first clothing from the first image, and obtains second feature information including body shape and posture information of the object to be changed from the second image corresponding to the first image; uses the feature extraction module to determine a number of first feature graphs based on the first feature information, and determines a number of second feature graphs based on the second feature information, wherein the number of second feature graphs include body shape features and posture features corresponding to the body shape and posture information of the object to be changed; uses the deformation generation module to determine a target generated image based on the number of first feature graphs and the number of second feature graphs, the randomly generated initial intermediate features and the corresponding randomly generated initial generated images, wherein the target generated image includes the object to be changed wearing the deformed first clothing, and the deformed first clothing conforms to the body shape features and posture features of the object to be changed.

[0204] Computer program code for performing the operations of the embodiments of the present specification may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0205] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the storage medium and computing device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0206] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present invention may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0207] The specific implementation methods described above further describe the purpose, technical solutions and beneficial effects of the embodiments of the present invention in detail. It should be understood that the above description is only a specific implementation method of the embodiments of the present invention and is not intended to limit the scope of protection of the present invention. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solution of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A virtual dressing method based on a dressing model, wherein the dressing model includes a generation model, and the generation model includes a feature extraction module and a deformation generation module; the method includes: Acquire first feature information including clothing information of a first clothing item from the first image, and acquire second feature information including body shape and posture information of an object to be changed from a second image corresponding to the first image; Using the feature extraction module, determining a plurality of first feature graphs based on the first feature information, and determining a plurality of second feature graphs based on the second feature information, wherein the plurality of second feature graphs include body shape features and posture features corresponding to the body shape and posture information of the object to be dressed up; Using the deformation generation module, a target generation image is determined based on the plurality of first feature maps and the plurality of second feature maps, the randomly generated initial intermediate features and the corresponding randomly generated initial generation image, wherein the target generation image includes the object to be changed wearing the deformed first clothing, and the deformed first clothing conforms to the body shape characteristics and posture characteristics of the object to be changed.

2. The method of claim 1, wherein: The first image includes a first object wearing the first garment, the first feature information includes first limb region information, first limb key point information, first limb posture information and first limb segmentation information of the first object, the first limb region information includes clothing information of the first garment, and the first limb segmentation information includes body shape and posture information of the first object.

3. The method of claim 1, wherein: The second feature information includes: second limb area information, second limb key point information, second limb posture information and second limb segmentation information of the object to be changed, the second limb segmentation information includes the body shape and posture information of the object to be changed, and the second limb area information includes a preset protection area of ​​the object to be changed that belongs to the non-clothing wearing area.

4. The method of claim 1, wherein the feature extraction module comprises a first feature extractor and a second feature extractor; The determining a plurality of first feature graphs based on the first feature information includes: Using the first feature extractor, processing the first feature information to obtain the plurality of first feature maps, wherein the plurality of first feature maps have different sizes; The determining a plurality of second feature graphs based on the second feature information includes: The second feature information is processed by the second feature extractor to obtain the plurality of second feature maps, wherein the plurality of second feature maps have different sizes.

5. The method of claim 1, wherein the generating model further comprises: Latent variable extractor; The feature extraction module further determines a target feature extraction result based on the second feature information, and the method further includes: Based on the latent variable extractor, a body shape and posture vector representing the body shape and posture features of the object to be dressed up is extracted from the target feature extraction result; The determining of a target generated image based on the plurality of first feature maps and the plurality of second feature maps, the initial intermediate features and the corresponding initial generated image comprises: The target generated image is determined based on the plurality of first feature maps, the plurality of second feature maps, the body shape posture vector, the initial intermediate feature and the initial generated image.

6. The method of claim 5, wherein: The deformation generation module includes a plurality of feature deformation generators arranged in series, and the output image sizes corresponding to the plurality of feature deformation generators are increased in sequence; the plurality of first feature maps and the plurality of second feature maps include first feature maps and second feature maps corresponding to each feature deformation generator respectively; The step of determining the target generated image comprises: Using any target feature deformation generator among the plurality of feature deformation generators, based on its corresponding first feature map, second feature map and the body posture vector, processing the current intermediate feature to obtain an updated intermediate feature, wherein the current intermediate feature is an intermediate feature output by a feature deformation generator before the target feature deformation generator, or is the initial intermediate feature; Based on the updated intermediate features and the current generated image, an updated generated image is obtained to obtain the target generated image, wherein the current generated image is the generated image output by the previous feature deformation generator of the target feature deformation generator, or the initial generated image.

7. The method of claim 6, wherein: If the target feature deformation generator is the feature deformation generator at the end, the target generated image is determined based on the obtained updated generated image.

8. The method of claim 6, wherein: The obtaining of the updated intermediate features includes: Using the current deformation occlusion information, a deformation occlusion operation is performed on the first feature map corresponding to the target feature deformation generator to obtain a first feature map after deformation occlusion, wherein the current deformation occlusion information is the deformation occlusion information output by the previous feature deformation generator of the target feature deformation generator, or the initial deformation occlusion information obtained by initialization; Processing the current intermediate feature using the body shape posture vector to obtain a first intermediate feature; Based on the first feature map after deformation and occlusion, the second feature map corresponding to the target feature deformation generator and the first intermediate feature, an updated intermediate feature of the target feature deformation generator is obtained.

9. The method of claim 8, wherein: The current deformation occlusion information includes current optical flow field information and current occlusion information. The current occlusion information includes predicted occlusion information for protecting the background area of ​​the second image and occlusion information for protecting a preset protection area in the second image. The current optical flow field information at least includes a predicted correspondence between a first garment in the first image and an object to be changed in the second image.

10. The method of claim 8, further comprising: Based on the updated intermediate feature and the current deformation occlusion information, updated deformation occlusion information of the target feature deformation generator is determined.

11. The method of claim 9, wherein the generating model further comprises: Fusion device; The step of determining the target generated image based on the updated generated image comprises: The target generated image is obtained by fusing the fuser based on the updated generated image, the background image including the background area of ​​the second image, the protection area image including the preset protection area, and the target occlusion information output by the feature deformation generator at the end.

12. The method of claim 1, further comprising: Acquire first sample feature information including sample clothing information of the sample clothing from the initial image, and acquire second sample feature information including body shape and posture information of the target object to be changed from the target image corresponding to the initial image; Using the feature extraction module, determine a plurality of first sample feature graphs based on the first sample feature information, and determine a plurality of second sample feature graphs based on the second sample feature information, wherein the plurality of second sample feature graphs include body shape features and posture features corresponding to the body shape and posture information of the target object; Determine, by means of the deformation generation module, a target prediction image based on the plurality of first sample feature maps and the plurality of second sample feature maps, the randomly generated intermediate features and their corresponding randomly generated prediction images, wherein the target prediction image includes the target object wearing the deformed sample clothing, and the deformed sample clothing conforms to the body shape features and posture features of the target object; Determining a current prediction loss based on the target prediction image and the target image; Based on the current predicted loss, model parameters of the outfit changing model are adjusted.

13. A virtual dressing device based on a dressing model, wherein the dressing model includes a generation model, and the generation model includes a feature extraction module and a deformation generation module; the device includes: A first acquisition module is configured to acquire first feature information including clothing information of a first clothing item from the first image, and acquire second feature information including body shape and posture information of an object to be changed from a second image corresponding to the first image; A first determination module is configured to use the feature extraction module to determine a plurality of first feature graphs based on the first feature information, and to determine a plurality of second feature graphs based on the second feature information, wherein the plurality of second feature graphs include body shape features and posture features corresponding to the body shape and posture information of the object to be dressed; The second determination module is configured to use the deformation generation module to determine a target generation image based on the plurality of first feature maps and the plurality of second feature maps, the randomly generated initial intermediate features and the corresponding randomly generated initial generation image, wherein the target generation image includes the object to be changed wearing the deformed first clothing, and the deformed first clothing conforms to the body shape characteristics and posture characteristics of the object to be changed.

14. An electronic device comprising a memory and a processor, wherein: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 12 is implemented.