A virtual fitting method for self-adapting length of a short opera garment

By using feature extraction and a try-on condition generator, combined with a try-on image generator and an adaptive adjustment module, the problems of lost pattern details and poor fit in virtual try-on of opera costumes are solved, achieving high-quality virtual try-on effects that adapt to different human postures and skin tones.

CN119672273BActive Publication Date: 2025-11-21NORTHWEST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411623688.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-11-21
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

Traditional virtual try-on methods struggle to handle complex patterns and unique shapes in opera costumes, especially Qinqiang opera costumes, resulting in lost pattern details, inaccurate colors, and poor fit between the costume and the body, failing to meet the diverse needs of different characters.

Method used

By employing a feature extractor and a try-on condition generator, combined with a try-on image generator, a skin tone adjustment module, and a length adaptive adjustment module, and through dense human pose prediction, semantic segmentation, and feature extraction, the system dynamically adjusts the length and shape of clothing while maintaining the integrity of clothing patterns and textures, thus addressing the issue of differences in skin tone and clothing style among different human bodies.

Benefits of technology

It enhances the naturalness and realism of virtual try-on, and is specifically optimized for the complex patterns and shapes of opera costumes, making the try-on effect closer to the real wearing experience and adapting to different body postures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672273B_ABST
    Figure CN119672273B_ABST
Patent Text Reader

Abstract

The application relates to a virtual fitting method for opera short clothes with adaptive length, which is based on a fitting condition generator and a fitting image generator, can dynamically adjust the length and shape of clothes, can improve the naturalness and reality of a fitting image while keeping the integrity of a clothes pattern and texture, and can solve the difference problem of different human skin colors and clothing styles to a greater extent by adding a skin color adjustment module and a long-short adaptive adjustment module. When facing opera clothing fitting, the complex patterns and shape characteristics of Qinqiang clothing are optimized, the fitting effect is greatly improved, the fitting effect is closer to the real wearing experience, and the application value and research significance are high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer graphics processing, and more specifically, to a virtual try-on method for adapting the length of a traditional Chinese opera short costume. Background Technology

[0002] With the rapid development of virtual reality (VR), augmented reality (AR), and deep learning technologies, virtual try-on technology has gradually become an important application tool in e-commerce platforms, digital clothing design, and cultural heritage preservation. Virtual try-on not only helps consumers understand the effect of clothing more intuitively before purchasing, but also provides designers with a tool to quickly verify design solutions. However, traditional virtual try-on methods face many challenges when dealing with complex patterns and special shapes of clothing (such as opera costumes), including problems such as loss of pattern details, inaccurate colors, and poor fit between clothing and the body.

[0003] Traditional Chinese opera costumes, especially those for genres like Qinqiang opera with deep cultural roots, typically feature intricate patterns, unique designs, and vibrant colors. The design of these costumes must not only reflect the character's identity and temperament but also meet the needs of the performance's movements. Traditional virtual try-on systems, however, offer fixed lengths and shapes, lacking adaptive adjustment capabilities and failing to meet the diverse needs of different characters. This is particularly problematic when trying on complex opera costumes. Summary of the Invention

[0004] To overcome at least one deficiency in the prior art, this application provides a virtual try-on method for adaptive length of traditional Chinese opera short costumes.

[0005] Firstly, a virtual try-on method for adapting the length of traditional Chinese opera short costumes is provided, including:

[0006] The process involves acquiring a portrait image and a target clothing image; performing dense human pose prediction based on the portrait image to obtain a pose image; performing semantic segmentation on the portrait image to obtain a semantic segmentation map; using a feature extractor to extract features from the target clothing image to obtain clothing features; using a feature extractor to extract features from the semantic segmentation map and the pose image to obtain human pose features; and using a try-on condition generator based on the clothing features and human pose features to obtain a semantic segmentation map of the human wearing the target clothing and a deformed clothing image.

[0007] A virtual try-on model is constructed, which includes a try-on image generator, a skin tone adjustment module, and a length adaptive adjustment module.

[0008] The virtual try-on image is obtained by inputting the human body semantic segmentation graph wearing the target clothes, the deformed clothes image, the portrait image and the posture image into the virtual try-on model; the initial try-on image retaining the high-quality features of the human body posture and the clothes is obtained by the try-on image generator according to the human body semantic segmentation graph wearing the target clothes, the deformed clothes image, the portrait image and the posture image; the try-on image after skin color adjustment is obtained by the skin color adjustment module by using the skin color information to perform weighted fusion on the skin area of the initial try-on image; the virtual try-on image is obtained by the long-short adaptive adjustment module by using the human body skeleton information to adjust the try-on image after the skin color adjustment so as to match the length of the clothes with the human body posture.

[0009] In one embodiment, the feature extractor includes a plurality of residual blocks connected in sequence.

[0010] In one embodiment, the try-on condition generator includes a plurality of feature fusion modules connected in sequence, and each feature fusion module is configured to perform convolution operation on a first input to obtain a first convolution result; perform gating processing on a second input to obtain a gating processing result; multiply the second convolution result and the gating processing result to obtain a first multiplication result; perform convolution operation on the first multiplication result to obtain a second convolution result, and multiply the second convolution result and the first multiplication result to obtain a second multiplication result, which is the first output;

[0011] The second multiplication result is subjected to convolution operation to obtain a third convolution result;

[0012] The second input is subjected to convolution operation to obtain a fourth convolution result;

[0013] The fourth convolution result is multiplied by the third convolution result to obtain a third multiplication result;

[0014] The third multiplication result is added to the third convolution result to obtain a second output;

[0015] The first feature fusion module of the plurality of feature fusion modules takes the clothes feature as the first input and takes the human body posture feature as the second input; and the first input of other feature fusion modules is the result of adding the clothes feature and the first output of the previous feature fusion module, and the second input is the result of optical flow prediction of the human body posture feature and the second output of the previous feature fusion module;

[0016] The first output of the last feature fusion module is the deformed clothes image, and the second output is the human body semantic segmentation graph wearing the target clothes.

[0017] In one embodiment, the try-on image generator includes a convolution layer, a plurality of residual blocks and a convolution layer connected in sequence.

[0018] In one embodiment, the skin color adjustment module is configured to:

[0019] obtaining an average value of RGB values of all pixels of the skin region in the initial try-on image, i.e. skin color information;

[0020] According to the skin color information, the following formula is used to obtain the try-on image after skin color adjustment:

[0021] I2(x, y) = aI1(x, y) + (1 - a)C

[0022] where I1(x, y) is the RGB value of pixel (x, y) in the initial try-on image, C is the skin color information, a is a weighting coefficient, and I2(x, y) is the RGB value of pixel (x, y) in the try-on image after skin color adjustment.

[0023] In one embodiment, the long-short adaptive adjustment module is used to:

[0024] obtaining skeleton key point coordinates according to the posture image;

[0025] setting an expected garment length according to the distance from the hip to the ankle in the skeleton key point coordinates, and using the following formula to determine the length proportion factor λ of the garment:

[0026]

[0027] where L1 is the expected garment length, and L2 is the original length of the target garment.

[0028] multiplying the longitudinal coordinate of each pixel in the try-on image after skin color adjustment by the length proportion factor λ of the garment to obtain a virtual try-on image.

[0029] In one embodiment, constructing the virtual try-on model includes training the virtual try-on model, and the loss function used in the training process is:

[0030] L = Σ x,y w(x, y)(|I1(x + 1, y) - I1(x, y)| + |I1(x, y + 1) - I1(x, y)|)

[0031] where L is the loss function, I1(x, y) is the RGB value of pixel (x, y) in the initial try-on image, I1(x + 1, y) is the RGB value of pixel (x + 1, y) in the initial try-on image, I1(x, y + 1) is the RGB value of pixel (x, y + 1) in the initial try-on image, and w(x, y) is the weight coefficient of pixel (x, y).

[0032]

[0033] where, is the gradient of pixel (x, y) in the x direction, Let β be the gradient of pixel (x,y) in the y-direction, and β be a parameter that controls the degree of smoothness.

[0034] Secondly, a virtual try-on device for adapting the length of a traditional Chinese opera short costume is provided, comprising:

[0035] The preprocessing module is used to acquire human portrait images and target clothing images; perform dense human pose prediction based on the human portrait images to obtain pose images; perform semantic segmentation on the human portrait images to obtain semantic segmentation maps; use a feature extractor to extract features from the target clothing images to obtain clothing features; use a feature extractor to extract features from the semantic segmentation maps and pose images to obtain human pose features; and use a try-on condition generator based on clothing features and human pose features to obtain a semantic segmentation map of the human body wearing the target clothing and a deformed clothing image.

[0036] The model building module is used to build a virtual try-on model, which includes a try-on image generator, a skin tone adjustment module, and a length adaptive adjustment module.

[0037] The virtual try-on module is used to input the semantic segmentation map of the human body wearing the target clothing, the deformed clothing image, the human portrait image, and the pose image into the virtual try-on model to obtain a virtual try-on image. The try-on image generator uses the semantic segmentation map of the human body wearing the target clothing, the deformed clothing image, the human portrait image, and the pose image to obtain an initial try-on image that retains high-quality features of the human posture and clothing. The skin color adjustment module uses skin color information to perform weighted fusion on the skin area of ​​the initial try-on image to obtain a skin color-adjusted try-on image. The length adaptive adjustment module uses human skeleton information to adjust the skin color-adjusted try-on image to match the clothing length with the human posture, thus obtaining a virtual try-on image.

[0038] Thirdly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the aforementioned virtual try-on method for adaptive length of traditional opera costumes.

[0039] Fourthly, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the aforementioned virtual try-on method for adaptive length of traditional opera costumes.

[0040] Compared with the prior art, the opera short self-adaptive length virtual fitting method has the following beneficial effects: the opera short self-adaptive length virtual fitting method based on the fitting condition generator and the fitting image generator can not only dynamically adjust the length and shape of the garment, but also improve the naturalness and realism of the fitting image while maintaining the integrity of the garment pattern and texture. In addition, by adding the skin color adjustment module and the long-short self-adaptive adjustment module, the difference between different human skin colors and clothing styles can be solved to a greater extent. When facing opera clothing fitting, especially for the complex patterns and shape characteristics of Qinqiang clothing, the fitting effect is greatly improved, making it closer to the real wearing experience, and having high application value and research significance. BRIEF DESCRIPTION OF DRAWINGS

[0041] The present application can be better understood by reference to the following description taken in conjunction with the accompanying drawings, which together with the detailed description, form a part of this specification. In the drawings:

[0042] Figure 1 A flowchart of an opera short self-adaptive length virtual fitting method is shown;

[0043] Figure 2 A structural schematic diagram of a feature extractor is shown;

[0044] Figure 3 A structural schematic diagram of a fitting image generator is shown;

[0045] Figure 4 A structural schematic diagram of a fitting condition generator is shown;

[0046] Figure 5 A virtual fitting effect schematic diagram is shown;

[0047] Figure 6 A virtual fitting effect schematic diagram of opera clothing is shown;

[0048] Figure 7 A structural block diagram of an opera short self-adaptive length virtual fitting device is shown. DETAILED DESCRIPTION

[0049] In the following, exemplary embodiments of the present application will be described with reference to the accompanying drawings. In the specification, all features of the actual embodiments are not described for the sake of clarity and brevity. However, it should be appreciated that many embodiment-specific decisions can be made in the process of developing any such actual embodiment in order to achieve the specific goals of the developers, and these decisions can vary from embodiment to embodiment.

[0050] It should be noted that, in order not to obscure the application with unnecessary details, only the structures closely related to the scheme according to the application are shown in the drawings, and other details not related to the application are omitted.

[0051] It should be understood that the application is not limited to the described embodiments by virtue of the description below with reference to the drawings. In this context, the embodiments can be combined with each other, features can be replaced or borrowed between different embodiments, and one or more features can be omitted in one embodiment.

[0052] The embodiment of the application provides a virtual try-on method for opera short clothes with adaptive length, Figure 1 A flowchart of the virtual try-on method for opera short clothes with adaptive length is shown, referring to Figure 1 The method comprises the following steps.

[0053] In step S1, a portrait image and a target clothing image are obtained; human dense pose prediction is performed based on the portrait image to obtain a pose image; semantic segmentation is performed on the portrait image to obtain a semantic segmentation image; a feature extractor is used to extract features of the target clothing image to obtain clothing features; the feature extractor is used to extract features of the semantic segmentation image and the pose image to obtain human pose features; and a try-on condition generator is used to obtain a human semantic segmentation image wearing the target clothing and a deformed clothing image based on the clothing features and the human pose features.

[0054] In this step, a dense pose prediction model is used to perform human dense pose prediction based on the portrait image to capture the pose changes of human details, and a pose image is obtained. The dense pose prediction model may, for example, use DensePose.

[0055] Then, a pre-trained semantic segmentation model is used to perform semantic segmentation on the portrait image to obtain a semantic segmentation image, and different parts of the human body are segmented into different categories (such as head, upper body, trousers, etc.), which provides semantic information for subsequent deformation of the clothing. The semantic segmentation model may, for example, use FCN (Fully Convolutional Network) and U-Net. FCN improves the classification network into a semantic segmentation network and uses a full convolution layer for end-to-end training. U-Net uses an encoder-decoder architecture and performs segmentation through the splicing of feature maps.

[0056] Then, a feature extractor is used to extract clothing features and human pose features, Figure 2 A structural schematic diagram of the feature extractor is shown, specifically referring to Figure 2The feature extractor comprises a plurality of residual blocks (ResBlock) connected in sequence. Here, the residual blocks can be set to 4 or other numbers, and each residual block is used to implement residual operation and 2 times down-sampling, and the residual block comprises a plurality of convolutional layers (Convolutional Layer), batch normalization layers (Batch Normalization Layer), activation functions (Activation Function) and residual connections (Residual Connection).

[0057] In step S2, a virtual fitting model is constructed, and the virtual fitting model comprises a fitting image generator, a skin color adjustment module and a long-short adaptive adjustment module.

[0058] In step S3, the virtual fitting image is obtained by inputting the human body semantic segmentation image of the person wearing the target garment, the deformed garment image, the portrait image and the posture image into the virtual fitting model. The fitting image generator obtains an initial fitting image retaining high-quality features of the human body posture and the garment according to the human body semantic segmentation image of the person wearing the target garment, the deformed garment image, the portrait image and the posture image. The skin color adjustment module performs weighted fusion on the skin area of the initial fitting image by using skin color information to obtain a fitting image with adjusted skin color. The long-short adaptive adjustment module adjusts the fitting image with adjusted skin color by using human body skeleton information to match the length of the garment with the human body posture, thereby obtaining the virtual fitting image.

[0059] Specifically, Figure 3 The structure of the fitting image generator is shown in a schematic diagram, as shown in Figure 3 The fitting image generator comprises convolutional layers, a plurality of residual blocks and convolutional layers connected in sequence. Here, the residual blocks can be set to 8 or other numbers, and except for the last residual block, the other residual blocks are used to implement residual operation and 2 times up-sampling, and the last residual block implements residual operation. Here, a series of residual blocks are used to process the input features. SPADE (Swin Transformer Attention) is used in the residual block to normalize the input image, so that the details between the garment and the human body posture are retained. The input image is resized before each residual block and connected to the activation layer, thereby ensuring that the high-quality features of the posture and the garment are retained in the image generation process.

[0060] In this embodiment, based on the try-on condition generator and try-on image generator, not only can the length and shape of the clothing be dynamically adjusted, but the naturalness and realism of the try-on images can also be improved while maintaining the integrity of the clothing patterns and textures. Furthermore, by adding a skin tone adjustment module and a length adaptive adjustment module, the differences in skin tone and clothing style among different people can be addressed to a greater extent. When trying on opera costumes, optimizations are specifically made for the complex patterns and shapes of Qinqiang opera costumes, greatly improving the try-on effect and making it closer to a realistic wearing experience, thus possessing high application value and research significance.

[0061] In one embodiment, Figure 4 A schematic diagram of the fitting condition generator is shown. (See attached diagram) Figure 4 The fitting condition generator includes multiple feature fusion modules connected in sequence. Each feature fusion module performs a convolution operation on a first input to obtain a first convolution result; it then performs gating processing on a second input to obtain a gating result. This gating processing is based on a gate unit (Gate), employs gating machinism, and uses sigmmod to enhance the module's memory and fusion capabilities. The second convolution result and the gating result are multiplied to obtain a first multiplication result; the first multiplication result is then convolved to obtain a second convolution result; and the second convolution result is multiplied by the first multiplication result to obtain a second multiplication result, which is the first output.

[0062] The result of the second multiplication is convolved to obtain the third convolution result;

[0063] Perform a convolution operation on the second input to obtain the fourth convolution result;

[0064] The result of the fourth convolution is multiplied by the result of the third convolution to obtain the result of the third multiplication;

[0065] The result of the third multiplication is added to the result of the third convolution to obtain the second output;

[0066] The first feature fusion module in the multiple feature fusion modules takes clothing features as its first input and human pose features as its second input. The other feature fusion modules take clothing features as their first input and the result of adding the first output of the previous feature fusion module to the first input, and human pose features as their second input and the result of optical flow prediction (warping) of the second output of the previous feature fusion module to the second input.

[0067] The first output of the last feature fusion module is the deformed clothing image, and the second output is the semantic segmentation map of the human body wearing the target clothing.

[0068] In this embodiment, the feature fusion module is used to dynamically learn the relationship between the garment features and the human pose features, to obtain a deformed garment image and a human semantic segmentation map wearing the target garment, so as to ensure that the garment can still naturally fit the human body under different poses, and to avoid obvious misalignment or deformation.

[0069] In one embodiment, the skin color adjustment module is used to:

[0070] obtain the average value of the RGB values of all pixels in the skin region in the initial try-on image, i.e., skin color information;

[0071] According to the skin color information, the following formula is used to obtain the skin color adjusted try-on image:

[0072] I2(x,y)=αI1(x,y)+(1-α)C

[0073] where I1(x,y) is the RGB value of pixel (x,y) in the initial try-on image, C is the skin color information, α is the weighting coefficient, and I2(x,y) is the RGB value of pixel (x,y) in the skin color adjusted try-on image.

[0074] In this embodiment, the extracted skin color information is used to perform weighted fusion on the skin region in the initial try-on image, so that the generated skin color is closer to the original skin color of the portrait. This process can effectively solve the influence of different lighting and skin color differences on the try-on result, making the generated portrait more natural and realistic in vision.

[0075] Here, the weighting coefficient α is the optimal weighting coefficient determined by the model training process. The SSIM (Structural Similarity), FID (Frechet Inception Distance), and LPIPS (Learned Perceptual Image Patch Similarity) between the initial try-on image and the skin color adjusted try-on image can be calculated, LPIPS is a deep learning-based image quality evaluation method, FID is an index for evaluating the performance of image generation models; and the average value of the three indexes is calculated as the similarity result; if the similarity result is less than a set threshold, α is increased and the training is performed again until the similarity result reaches the set threshold, and the optimal weighting coefficient is obtained.

[0076] In one embodiment, the long-short adaptive adjustment module is used to:

[0077] obtain the skeleton key point coordinates according to the pose image;

[0078] The expected garment length is set according to the distance from the hip to the ankle in the skeleton key point coordinates, and the following formula is used to determine the length scale factor λ of the garment:

[0079]

[0080] Wherein, L1 is the expected garment length, L2 is the original length of the target garment; λ is used to control the proportion of longitudinal expansion.

[0081] The longitudinal coordinate of each pixel in the skin color adjusted try-on image is multiplied by the length scale factor λ of the garment to obtain the virtual try-on image.

[0082] In this embodiment, for the case that the style of the target garment is quite different from the original garment, the skeleton key point coordinates in the JSON file in the posture image are obtained, and the expected garment length is set according to the distance from the hip to the ankle in the skeleton key point coordinates. Because the posture of the opera character image is complex and has characteristics, the hand posture is complex, but the center point and the gravity center point are usually at the hip, so the hip position of the human body is located. The skin color adjusted try-on image is repositioned and adjusted according to the skeleton key point coordinates, so that the length of the garment matches the human posture. By adaptively adjusting the shape of the garment, the generated try-on result is not limited to the length of the original garment, but can realize virtual try-on effect of any length on the basis of ensuring the integrity of the garment texture and style. Figure 5 The virtual try-on effect schematic diagram is shown. Figure 6 The virtual try-on effect schematic diagram of the opera short clothes is shown.

[0083] In one embodiment, constructing the virtual try-on model includes training the virtual try-on model, the data set used in the model training is the VITON-HD data set, and the loss function used in the training process is:

[0084] L = ∑ x,y w(x,y)(|I1(x+1,y)-I1(x,y)|+|I1(x,y+1)-I1(x,y)|)

[0085] Wherein, L is the loss function, I1(x,y) is the RGB value of pixel (x,y) in the initial try-on image, I1(x+1,y) is the RGB value of pixel (x+1,y) in the initial try-on image, I1(x,y+1) is the RGB value of pixel (x,y+1) in the initial try-on image; w(x,y) is the weight coefficient of pixel (x,y);

[0086]

[0087] Wherein, is the gradient of pixel (x,y) in the x direction, is the gradient of the pixel (x, y) in the y direction, and β is a parameter that controls the degree of smoothing.

[0088] Here, a larger β will make the weight of the edge region lower, thus preserving more details. The weight coefficient w(x, y) will approach zero in the edge region, reducing the smoothing of this region, while approaching 1 in the smoothing region, performing more smoothing. Using the loss function in the above embodiment for model training can constrain the try-on image generator to reduce exaggerated deformation and maintain good garment details.

[0089] Based on the same inventive concept as the virtual try-on method with adaptive length of short opera clothes, the embodiment also provides a virtual try-on device with adaptive length of short opera clothes, Figure 7 The structural block diagram of the virtual try-on device with adaptive length of short opera clothes is shown, which comprises:

[0090] The preprocessing module 71 is configured to obtain a portrait image and a target garment image; perform human dense pose prediction based on the portrait image to obtain a pose image; perform semantic segmentation on the portrait image to obtain a semantic segmentation image; perform feature extraction on the target garment image using a feature extractor to obtain garment features; perform feature extraction on the semantic segmentation image and the pose image using the feature extractor to obtain human pose features; and obtain a human semantic segmentation image wearing the target garment and a deformed garment image based on the garment features and the human pose features using a try-on condition generator;

[0091] The model construction module 72 is configured to construct a virtual try-on model, wherein the virtual try-on model comprises a try-on image generator, a skin color adjustment module, and a long-short adaptive adjustment module.

[0092] The virtual try-on module 73 is configured to input the human semantic segmentation image wearing the target garment, the deformed garment image, the portrait image, and the pose image into the virtual try-on model to obtain a virtual try-on image; the try-on image generator obtains an initial try-on image that retains high-quality features of the human pose and the garment based on the human semantic segmentation image wearing the target garment, the deformed garment image, the portrait image, and the pose image; the skin color adjustment module performs weighted fusion on the skin region of the initial try-on image using skin color information to obtain a try-on image with adjusted skin color; and the long-short adaptive adjustment module adjusts the try-on image with adjusted skin color using human skeleton information to match the garment length with the human pose, thereby obtaining the virtual try-on image.

[0093] The virtual try-on device with adaptive length of short opera clothes of the embodiment has the same inventive concept as the virtual try-on method with adaptive length of short opera clothes described above, and thus the specific embodiments of the device can be seen in the embodiment part of the virtual try-on method with adaptive length of short opera clothes described above, and the technical effects thereof correspond to those of the above method, which will not be described here again.

[0094] The embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the virtual fitting method of the opera short with adaptive length.

[0095] The embodiment of the present application provides a computer program product, including computer program / instruction, the computer program / instruction is executed by a processor to realize the virtual fitting method of the opera short with adaptive length.

[0096] The above is only various embodiments of the present application, but the protection scope of the present application is not limited to this, any person skilled in the art in the technical range disclosed by the present application can easily think of changes or replacements, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A virtual try-on method for adapting the length of a traditional Chinese opera short garment, characterized in that, include: Acquire portrait images and target clothing images; Based on the human portrait image, perform dense human pose prediction to obtain a pose image; The portrait image is semantically segmented to obtain a semantic segmentation map; a feature extractor is used to extract features from the target clothing image to obtain clothing features. A feature extractor is used to extract features from the semantic segmentation map and the pose image to obtain human pose features; a try-on condition generator is used to obtain a semantic segmentation map of the human body wearing the target clothing and a deformed clothing image based on the clothing features and the human pose features. Construct a virtual try-on model, which includes a try-on image generator, a skin tone adjustment module, and a length adaptive adjustment module; The semantic segmentation image of the human body wearing the target clothing, the deformed clothing image, the human portrait image, and the posture image are input into the virtual try-on model to obtain a virtual try-on image; the try-on image generator obtains an initial try-on image that retains high-quality features of the human posture and clothing based on the semantic segmentation image of the human body wearing the target clothing, the deformed clothing image, the human portrait image, and the posture image. The skin tone adjustment module uses skin color information to perform weighted fusion on the skin area of ​​the initial try-on image to obtain a skin tone-adjusted try-on image; the length adaptive adjustment module uses human skeleton information to adjust the skin tone-adjusted try-on image so that the clothing length matches the human posture to obtain a virtual try-on image. The fitting condition generator includes multiple feature fusion modules connected in sequence. The feature fusion module is used to perform a convolution operation on a first input to obtain a first convolution result; perform gating processing on a second input to obtain a gating processing result; multiply the first convolution result and the gating processing result to obtain a first multiplication result; perform a convolution operation on the first multiplication result to obtain a second convolution result; and multiply the second convolution result and the first multiplication result to obtain a second multiplication result, which is the first output. The second multiplication result is then convolved to obtain the third convolution result. Perform a convolution operation on the second input to obtain the fourth convolution result; The fourth convolution result is multiplied by the third convolution result to obtain the third multiplication result; The result of the third multiplication is added to the result of the third convolution to obtain the second output; The first feature fusion module in the plurality of feature fusion modules takes the clothing feature as its first input and the human posture feature as its second input; the other feature fusion modules take the clothing feature as its first input and the result of adding the first output of the previous feature fusion module to the clothing feature, and the result of optical flow prediction of the human posture feature and the second output of the previous feature fusion module as their second input. The first output of the last feature fusion module is the deformed clothing image, and the second output is the semantic segmentation map of the human body wearing the target clothing. The skin tone adjustment module is used for: Calculate the average RGB values ​​of all pixels in the skin area of ​​the initial fitting image, which is the skin color information; The skin color information is used to obtain the skin tone-adjusted fitting image using the following formula: in, Pixels in the initial try-on image RGB values, For skin color information, These are weighting coefficients. Pixels in the try-on image after skin tone adjustment RGB values; The length adaptive adjustment module is used for: Obtain the coordinates of key points of the skeleton from the pose image; The desired garment length is set based on the distance from the hip to the ankle in the coordinates of the key points of the skeleton. The garment length proportion factor is determined using the following formula. : in, For the desired garment length, The original length of the target garment; Multiply the ordinate of each pixel in the skin tone-adjusted try-on image by the length ratio factor of the garment. This yields virtual try-on images.

2. The method as described in claim 1, characterized in that, The feature extractor comprises multiple residual blocks connected in sequence.

3. The method as described in claim 1, characterized in that, The try-on image generator includes a convolutional layer, multiple residual blocks, and a convolutional layer connected in sequence.

4. The method as described in claim 1, characterized in that, The construction of the virtual try-on model includes training the virtual try-on model, and the loss function used in the training process is: in, For loss function, Pixels in the initial try-on image RGB values, Pixels in the initial try-on image RGB values, Pixels in the initial try-on image RGB values; For pixels The weighting coefficients; in, For pixels In Gradient of direction, For pixels In Gradient of direction, Parameters used to control the smoothness.

5. A virtual try-on device for adapting the length of a traditional Chinese opera short costume, characterized in that, include: The preprocessing module is used to acquire portrait images and target clothing images; Based on the human portrait image, perform dense human pose prediction to obtain a pose image; The portrait image is semantically segmented to obtain a semantic segmentation map; a feature extractor is used to extract features from the target clothing image to obtain clothing features. A feature extractor is used to extract features from the semantic segmentation map and the pose image to obtain human pose features; a try-on condition generator is used to obtain a semantic segmentation map of the human body wearing the target clothing and a deformed clothing image based on the clothing features and the human pose features. The model building module is used to build a virtual try-on model, which includes a try-on image generator, a skin tone adjustment module, and a length adaptive adjustment module. The virtual try-on module is used to input the semantic segmentation map of the human body wearing the target clothing, the deformed clothing image, the human portrait image, and the posture image into the virtual try-on model to obtain a virtual try-on image; the try-on image generator obtains an initial try-on image that retains high-quality features of the human posture and clothing based on the semantic segmentation map of the human body wearing the target clothing, the deformed clothing image, the human portrait image, and the posture image. The skin tone adjustment module uses skin color information to perform weighted fusion on the skin area of ​​the initial try-on image to obtain a skin tone-adjusted try-on image; the length adaptive adjustment module uses human skeleton information to adjust the skin tone-adjusted try-on image so that the clothing length matches the human posture to obtain a virtual try-on image. The fitting condition generator includes multiple feature fusion modules connected in sequence. The feature fusion module is used to perform a convolution operation on a first input to obtain a first convolution result; perform gating processing on a second input to obtain a gating processing result; multiply the first convolution result and the gating processing result to obtain a first multiplication result; perform a convolution operation on the first multiplication result to obtain a second convolution result; and multiply the second convolution result and the first multiplication result to obtain a second multiplication result, which is the first output. The second multiplication result is then convolved to obtain the third convolution result. Perform a convolution operation on the second input to obtain the fourth convolution result; The fourth convolution result is multiplied by the third convolution result to obtain the third multiplication result; The result of the third multiplication is added to the result of the third convolution to obtain the second output; The first feature fusion module in the plurality of feature fusion modules takes the clothing feature as its first input and the human posture feature as its second input; the other feature fusion modules take the clothing feature as its first input and the result of adding the first output of the previous feature fusion module to the clothing feature, and the result of optical flow prediction of the human posture feature and the second output of the previous feature fusion module as their second input. The first output of the last feature fusion module is the deformed clothing image, and the second output is the semantic segmentation map of the human body wearing the target clothing. The skin tone adjustment module is used for: Calculate the average RGB values ​​of all pixels in the skin area of ​​the initial fitting image, which is the skin color information; The skin color information is used to obtain the skin tone-adjusted fitting image using the following formula: in, Pixels in the initial try-on image RGB values, For skin color information, These are weighting coefficients. Pixels in the try-on image after skin tone adjustment RGB values; The length adaptive adjustment module is used for: Obtain the coordinates of key points of the skeleton from the pose image; The desired garment length is set based on the distance from the hip to the ankle in the coordinates of the key points of the skeleton. The garment length proportion factor is determined using the following formula. : in, For the desired garment length, The original length of the target garment; Multiply the ordinate of each pixel in the skin tone-adjusted try-on image by the length ratio factor of the garment. This yields virtual try-on images.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the virtual try-on method for adaptive length of opera short costumes as described in any one of claims 1-4.

7. A computer program product, characterized in that, Includes a computer program / instruction, which, when executed by a processor, implements the virtual try-on method for adaptive length of opera short costume as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Human body posture transformation method and system for virtual fitting of clothes

    CN113297944A

  • Virtual fitting map generation method with controllable clothes length

    CN116168186A