A garment image de-wrinkling method based on single-step diffusion and residual adjustment
By combining single-step diffusion and residual adjustment methods with clothing area masking and detail restoration models, the problems of low efficiency and insufficient detail preservation in clothing image wrinkle removal are solved, achieving efficient and flexible wrinkle removal processing effects.
Patent Information
- Application Number
- CN202611482954.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-11-24
AI Technical Summary
Existing methods for removing wrinkles from clothing images are inefficient, lack the ability to preserve details, and have difficulty in flexibly adjusting the processing intensity. Fixed scale division methods cannot adapt to different clothing sizes and image ratio changes.
A method based on single-step diffusion and residual adjustment is adopted to generate an image through a single sampling update. Combined with clothing region masking and detail restoration model, multi-scale decomposition and independent intensity adjustment are performed to achieve wrinkle removal of clothing images.
It improves the efficiency of wrinkle removal processing for clothing images, enhances the ability to preserve details and improves processing adaptability, achieving high-quality, adjustable wrinkle removal effects.
Smart Images

Figure CN123160244A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method for removing wrinkles from clothing images based on single-step diffusion and residual adjustment. Background Technology
[0002] With the development of applications such as e-commerce display, still image enhancement, and virtual try-on, the demand for wrinkle removal processing of clothing images is constantly increasing. Clothing is prone to wrinkles during the shooting process due to wearing, compression, or changes in posture, which affects the appearance of the clothing. Therefore, it is necessary to reduce wrinkles while preserving details such as fabric texture, printed text, and outline edges.
[0003] Existing methods for removing wrinkles from clothing images mainly include manual retouching, generative adversarial networks (GANs), and diffusion model methods. Among them, manual retouching has low processing efficiency and its effectiveness depends on operational experience; GAN methods have high requirements for training data and are prone to detail distortion; while diffusion model-based methods can achieve good image generation results, they usually require multiple sampling updates, resulting in high computational costs, and reducing the number of samplings can easily lead to problems such as texture attenuation and local blurring.
[0004] In addition, existing methods typically use a fixed processing intensity to adjust the overall image, making it difficult to independently control wrinkle features at different spatial scales. At the same time, the fixed scale division method is difficult to adapt to different clothing sizes and image proportions, and may also increase redundant calculations when adjusting the processing effect multiple times. Summary of the Invention
[0005] To overcome, to some extent, the problems of low processing efficiency, insufficient detail preservation in the generated results, and difficulty in flexibly adjusting the processing intensity of clothing images in related technologies, this application provides a clothing image wrinkle removal method based on single-step diffusion and residual adjustment.
[0006] The proposed solution is as follows: A method for removing wrinkles from clothing images based on single-step diffusion and residual adjustment includes: Acquire an original image containing the target garment, perform region recognition on the target garment in the original image to obtain a garment region mask, and determine the relative scale of the garment based on the effective width of the target garment in the original image; The original image is input into the garment wrinkle removal diffusion model, and a single-step generated image is generated through a single sampling update. Based on the clothing area mask, the target clothing area in the single-step generated image is fused with the non-target area in the original image to obtain the image to be repaired; The original image and the image to be repaired are input into the garment wrinkle removal detail repair model. The original image provides a garment detail reference, and the image to be repaired provides the wrinkle removal appearance basis to obtain a high-definition reference image. The image processing residual is obtained based on the difference between the original image and the high-definition reference image. The target boundary scale is determined based on the relative scale of the clothing. The image processing residual is decomposed into multiple scales. The scale components are grouped according to the relationship between the spatial scale corresponding to each scale component and the target boundary scale to obtain coarse-scale residuals and fine-scale residuals that can jointly reconstruct the image processing residual. Obtain coarse-scale intensity and fine-scale intensity. Based on the high-definition reference image, determine the amount of backfilling of the coarse-scale residual according to the coarse-scale intensity, and determine the amount of backfilling of the fine-scale residual according to the fine-scale intensity. Add the corresponding coarse-scale residual and fine-scale residual backfilled to the high-definition reference image to obtain the output image after removing wrinkles from the clothing.
[0007] Preferably, the step of performing region recognition on the target garment in the original image to obtain a garment region mask, and determining the relative scale of the garment based on the effective width of the target garment in the original image, includes: The original image is segmented to obtain the target clothing region corresponding to the target clothing, and a clothing region mask corresponding to the position of the original image is generated based on the target clothing region. A target garment bounding frame is determined based on the target garment area, and the width of the target garment bounding frame is determined as the effective width of the target garment. The relative scale of the garment is determined based on the ratio between the effective width of the target garment and the width of the original image.
[0008] Preferably, the step of inputting the original image into the garment wrinkle removal diffusion model and generating a single-step generated image through a single sampling update includes: The original image is used as an image condition input into the garment wrinkle removal diffusion model to construct an internal image representation of the original image; In the single-step sampling configuration, the internal image representation is sampled and updated once, and the sampled and updated image representation is decoded to obtain the single-step generated image; The garment de-wrinkling diffusion model is obtained through single-step distillation training. The single-step distillation training uses a multi-step diffusion teacher model to generate a de-wrinkled target image based on an image of wrinkled garment as supervision, enabling the garment de-wrinkling diffusion model to learn to generate a de-wrinkled image through a single sampling update.
[0009] Preferably, the step of fusing the target clothing region in the single-step generated image with the non-target region in the original image based on the clothing region mask to obtain the image to be repaired includes: The generated image is adjusted to correspond to the image size and color representation of the original image; The target clothing area, the non-target area, and the boundary area of the target clothing area are determined based on the clothing area masking. The corresponding image content from the single-step generated image is used within the target clothing area, while the corresponding image content from the original image is retained within the non-target area. Then, the single-step generated image and the original image are fused position-by-position within the boundary area according to the soft weight corresponding to the clothing area mask, to obtain the image to be repaired.
[0010] Preferably, the step of inputting the original image and the image to be repaired into the garment wrinkle removal detail repair model, using the original image to provide a garment detail reference and the image to be repaired to provide a wrinkle removal appearance basis, to obtain a high-definition reference image, includes: The original image and the image to be repaired, which correspond to spatial locations, are used as dual image inputs. The clothing detail repair model extracts clothing detail information from the original image and wrinkle removal appearance information from the image to be repaired. Based on the clothing detail information and the wrinkle-free appearance information, the image to be repaired is repaired in detail. While maintaining the wrinkle-free appearance of the image to be repaired, local blurring and detail attenuation are repaired to obtain the high-definition reference image corresponding to the spatial position of the original image. The clothing wrinkle removal and detail restoration model is trained using a training original image, a training image to be restored, and a high-definition restoration target image that have a corresponding relationship. The high-definition restoration target image is used as the restoration supervision to learn the image restoration relationship from the training original image and the training image to be restored to the high-definition restoration target image.
[0011] Preferably, the step of obtaining the whole image processing residual based on the difference between the original image and the high-definition reference image, and determining the target boundary scale based on the relative scale of the clothing, includes: The original image and the high-definition reference image are unified to the same size, color space and numerical range, and the image processing residual is determined based on the image differences at corresponding positions of the two. Based on the relative scale of the garment and the image width corresponding to the image processing residual, the effective pixel width of the target garment in the residual processing coordinates is determined; Obtain the relative boundary ratio of the boundary scale used to characterize the coarse and fine scales relative to the proportion of the effective pixel width of the target garment, and determine the target boundary scale based on the effective pixel width and the relative boundary ratio; When the target boundary scale exceeds the scale range of the preset multi-scale decomposition, the target boundary scale is limited to the minimum or maximum scale corresponding to the scale range.
[0012] Preferably, the step of performing multi-scale decomposition on the whole image processing residual, and grouping the scale components according to the relationship between the spatial scale corresponding to each scale component and the target boundary scale, to obtain coarse-scale residuals and fine-scale residuals that can jointly reconstruct the whole image processing residual, includes: The Laplacian pyramid with a preset number of layers is constructed from the residual of the whole image processing. Low-pass filtering and downsampling are performed on each layer in sequence. The difference between the current layer image and the next layer image obtained by upsampling is determined as the detail component of the corresponding layer, and the low-pass component of the coarsest layer is retained. Determine the spatial scale corresponding to each of the detailed components, and determine the coarsest layer whose spatial scale does not exceed the target boundary scale as the boundary layer; The finer detail components, which are finer than the spatial scale corresponding to the boundary layer, are included in the fine-scale residual. The detail components corresponding to the boundary layer, the coarser detail components, and the low-pass components of the coarsest layer are included in the coarse-scale residual. The coarse-scale residual and the fine-scale residual are restored to the complete image coordinates, so that the coarse-scale residual and the fine-scale residual can jointly reconstruct the whole image processing residual.
[0013] Preferably, the step of determining the amount of backfilling the coarse-scale residual based on the coarse-scale intensity, determining the amount of backfilling the fine-scale residual based on the fine-scale intensity, and backfilling the corresponding coarse-scale residual and the fine-scale residual to the high-definition reference image to obtain the output image after removing wrinkles from the clothing includes: The coarse-scale intensity and the fine-scale intensity are obtained respectively, as the processing state changes continuously from the closed state to the fully processed state. The coarse-scale residual back-addition ratio that changes in the opposite direction to the coarse-scale intensity is determined based on the coarse-scale intensity, and the fine-scale residual back-addition ratio that changes in the opposite direction to the fine-scale intensity is determined based on the fine-scale intensity. According to the coarse-scale residual back-addition ratio and the fine-scale residual back-addition ratio, the coarse-scale residual and the fine-scale residual are respectively back-added to the high-definition reference image to obtain the output image; Specifically, when both the coarse-scale intensity and the fine-scale intensity are in a closed processing state, the coarse-scale residual and the fine-scale residual are all added back to restore the output image to the original image; when both the coarse-scale intensity and the fine-scale intensity are in a fully processed state, the coarse-scale residual and the fine-scale residual are not added back to make the output image the high-definition reference image.
[0014] Preferably, the method further includes: After obtaining the high-resolution reference image, the coarse-scale residual, and the fine-scale residual for the first time, the high-resolution reference image, the relative scale of the clothing, the scale components obtained from the multi-scale decomposition, the coarse-scale residual, and the fine-scale residual are cached. When the original image, the target clothing region, the generation configuration corresponding to the clothing wrinkle removal diffusion model, and the repair configuration corresponding to the clothing wrinkle removal detail repair model remain unchanged, and only the coarse-scale intensity and the fine-scale intensity change, the cached high-definition reference image, the coarse-scale residual, and the fine-scale residual are called, and the corresponding residual back-addition amount is re-determined according to the changed coarse-scale intensity and fine-scale intensity to obtain the updated output image; When the original image, the target clothing area, the generation configuration, or the repair configuration changes, the image processing procedure corresponding to the changed content is re-executed, and the corresponding cached results are updated.
[0015] Preferably, the setting methods for the coarse-scale strength and the fine-scale strength include an overall strength adjustment method and an independent strength adjustment method; Under the overall strength adjustment mode, the coarse-scale strength and the fine-scale strength are set to the same strength value, and the amount of recovery of the coarse-scale residual and the fine-scale residual is adjusted synchronously according to the strength value; In the independent intensity adjustment mode, the coarse-scale intensity and the fine-scale intensity are set respectively. The amount of backfilling of the coarse-scale residual is adjusted according to the coarse-scale intensity, and the amount of backfilling of the fine-scale residual is adjusted according to the fine-scale intensity, so as to control the degree of wrinkle removal processing of clothing images at different spatial scales respectively.
[0016] The technical solution provided in this application may include the following beneficial effects: The clothing image wrinkle removal method based on single-step diffusion and residual adjustment provided in this application inputs the original image into a clothing wrinkle removal diffusion model, and generates a single-step generated image through a single sampling update. This reduces the number of samplings in the diffusion model generation process, lowers the computational overhead in the image wrinkle removal process, and improves processing efficiency. Simultaneously, the method fuses the single-step generated image with non-target clothing areas in the original image to obtain the image to be repaired. Both the original image and the image to be repaired are then input into a clothing wrinkle removal detail restoration model, combining the clothing detail information in the original image with the wrinkle-removed appearance information in the image to be repaired, thereby reducing the wrinkle appearance of the clothing. While mitigating wrinkles, this method improves the preservation of details such as garment texture, printed text, and edges. Furthermore, by determining the relative scale of the garment based on its size in the original image and then determining the target boundary scale based on this relative scale, the residual of the entire image processing is decomposed into coarse and fine scale residuals. This allows the residual decomposition process to adapt to the processing needs of garment images of different sizes. Moreover, by separately acquiring the coarse and fine scale intensities, the coarse and fine scale residuals are independently adjusted, enabling flexible control of the wrinkle removal effect at different spatial scales and improving the adjustability of the garment image processing effect. Therefore, this application can reduce the computational load of garment image wrinkle removal processing while improving the detail preservation ability and processing adaptability of the wrinkle removal results, achieving high-quality, adjustable garment image wrinkle removal processing.
[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] Figure 1 This is a flowchart illustrating a method for removing wrinkles from clothing images based on single-step diffusion and residual adjustment, provided in one embodiment of this application. Figure 2 This is a schematic diagram of the input-output relationship of a garment wrinkle removal and detail repair model provided in one embodiment of this application; Figure 3 This is a schematic diagram of a residual decomposition process based on clothing scale adaptation provided in one embodiment of this application; Figure 4 This is a schematic diagram of a clothing image wrinkle removal process based on cache reuse, provided in one embodiment of this application. Detailed Implementation
[0020] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0021] Example 1 Figure 1 This is a flowchart illustrating a method for removing wrinkles from clothing images based on single-step diffusion and residual adjustment, provided in one embodiment of this application. (Refer to...) Figure 1 A method for removing wrinkles from clothing images based on single-step diffusion and residual adjustment, comprising: S1. Obtain the original image containing the target clothing, perform region recognition on the target clothing in the original image to obtain the clothing region mask, and determine the relative scale of the clothing based on the effective width of the target clothing in the original image. S2. Input the original image into the clothing wrinkle removal diffusion model, and generate a single-step generated image through one sampling update; S3. Based on the clothing area masking, the target clothing area in the single-step generated image is fused with the non-target area in the original image to obtain the image to be repaired. S4. Input the original image and the image to be repaired into the garment wrinkle removal detail repair model. Use the original image to provide a reference for garment details and use the image to be repaired to provide a basis for the wrinkle removal appearance, and obtain a high-definition reference image. S5. Obtain the whole image processing residual based on the difference between the original image and the high-definition reference image. Determine the target boundary scale based on the relative scale of the clothing. Perform multi-scale decomposition on the whole image processing residual. Group each scale component according to the relationship between the spatial scale corresponding to each scale component and the target boundary scale to obtain the coarse scale residual and fine scale residual that can jointly reconstruct the whole image processing residual. S6. Obtain the coarse-scale intensity and fine-scale intensity. Based on the high-definition reference image, determine the amount of coarse-scale residual to be added back according to the coarse-scale intensity, and determine the amount of fine-scale residual to be added back according to the fine-scale intensity. Add the corresponding coarse-scale residual and fine-scale residual back to the high-definition reference image to obtain the output image after removing the wrinkles from the clothing.
[0022] This embodiment provides a method for removing wrinkles from clothing images based on single-step diffusion and residual adjustment. This method processes clothing images containing wrinkles, reducing computational overhead during generation while minimizing wrinkles and preserving clothing details. The overall processing includes steps such as image acquisition, single-step diffusion generation, region fusion, detail restoration, residual decomposition, and residual adjustment output.
[0023] Specifically, firstly, an original image containing the target garment is acquired. This original image is a static image containing information about the garment and its folds. Region recognition is performed on the original image to determine the region where the target garment is located, and a garment region mask corresponding to the location in the original image is generated to distinguish the target garment region from non-target regions. Simultaneously, the relative scale of the garment is determined based on its size information in the original image. This relative scale characterizes the proportional relationship between the target garment and the overall size of the original image, thus providing a scale reference for subsequent residual processing.
[0024] Subsequently, the original image is input into the garment de-wrinkling diffusion model, and a single-step generated image is generated through a single sampling update. The garment de-wrinkling diffusion model employs a single-step generation method, performing a sampling update based on the image information corresponding to the original image during inference, and decoding the updated image representation to obtain a single-step generated image containing the de-wrinkling effect. Compared to diffusion processing methods that require multiple sampling updates, this embodiment reduces the computational process in the generation stage through a single-step generation method, improving the efficiency of garment image processing.
[0025] Furthermore, the single-step generated image and the original image are fused based on the clothing area mask. Within the target clothing area, the corresponding content from the single-step generated image is used to replace the clothing folds; within non-target areas, the corresponding content from the original image is retained to avoid additional impact on the background and non-target areas. The resulting fusion process yields an image to be repaired, which retains information about non-clothing areas from the original image while also including the appearance of the clothing area after the single-step diffusion process.
[0026] Then, the original image and the image to be repaired are input into the garment wrinkle removal detail restoration model to obtain a high-definition reference image. The original image provides reference information for details such as garment texture, printed text, and edge structure, while the image to be repaired provides the basic appearance of the garment after wrinkle removal. Based on the information correlation between the two images, the garment wrinkle removal detail restoration model repairs local blurring, texture attenuation, and other issues in the image to be repaired, restoring the garment's detail while maintaining the wrinkle removal effect, and outputting a high-definition reference image corresponding to the spatial position of the original image.
[0027] Furthermore, the image processing residual is determined based on the difference between the original image and the high-resolution reference image. Since the high-resolution reference image represents the image result after garment wrinkle removal processing, while the original image contains the original wrinkle state, the difference between the two can reflect the image changes generated during the garment wrinkle removal process. A target boundary scale is determined based on the relative scale of the garment, and the image processing residual is decomposed into multiple scales according to the target boundary scale. The residual components corresponding to different spatial scales are divided into coarse-scale residuals and fine-scale residuals, enabling the residual processing to adapt to the scale changes of wrinkle features in garment images of different sizes.
[0028] Finally, the coarse-scale intensity and fine-scale intensity are obtained to control the degree of residual adjustment. Using the high-resolution reference image as the basis for adjustment, the amount of coarse-scale residual addition is determined based on the coarse-scale intensity, and the amount of fine-scale residual addition is determined based on the fine-scale intensity. The corresponding coarse-scale and fine-scale residuals are then added back to the high-resolution reference image to obtain the output image after wrinkle removal from the garment. By adjusting the degree of residual addition at different scales, the wrinkle processing effect at different scales can be adjusted while maintaining the overall appearance of the garment.
[0029] In this embodiment, by combining a single-step diffusion generation method with a detail restoration process, the detail attenuation problem in the single-step generation result is improved by utilizing the detail information provided by the original image while reducing the number of sampling steps in the diffusion model. Simultaneously, by determining the target boundary scale based on the relative scale of the clothing and adaptively dividing the overall image processing residual into multiple scales, the residual adjustment process can adapt to the processing needs of clothing images of different sizes. Furthermore, by separately controlling the re-addition degree of coarse-scale and fine-scale residuals, flexible adjustment of the wrinkle removal effect at different spatial scales is achieved. Therefore, this embodiment can improve the wrinkle removal processing efficiency of clothing images while enhancing the detail preservation capability and adjustability of the output image.
[0030] Example 2 Some embodiments of the clothing image de-wrinkling method based on single-step diffusion and residual adjustment perform region identification on the target clothing in the original image to obtain a clothing region mask, and determine the relative scale of the clothing based on the effective width of the target clothing in the original image, including: The original image is segmented to obtain the target clothing region corresponding to the target clothing, and a clothing region mask corresponding to the position in the original image is generated based on the target clothing region. Determine the bounding box of the target garment based on the target garment area, and set the width of the bounding box of the target garment as the effective width of the target garment. The relative scale of the garment is determined based on the ratio between the effective width of the target garment and the width of the original image.
[0031] The original image is input into the garment wrinkle removal diffusion model, and a single-step generated image is generated through a single sampling update, including: The original image is used as an image condition input into the clothing de-wrinkling diffusion model to construct an internal image representation of the original image; In the single-step sampling configuration, the internal image representation is sampled and updated once, and the sampled and updated image representation is decoded to obtain the single-step generated image; Among them, the clothing wrinkle removal diffusion model is obtained through single-step distillation training. The single-step distillation training uses the wrinkle removal target image generated by the multi-step diffusion teacher model based on the wrinkle clothing image as supervision, so that the clothing wrinkle removal diffusion model learns to generate wrinkle removal images through one sampling update.
[0032] Based on the clothing region masking, the target clothing region in the single-step generated image is fused with the non-target region in the original image to obtain the image to be repaired, including: Adjust the generated image in one step to the image size and color representation corresponding to the original image; Determine the target clothing area, non-target areas, and the boundary area of the target clothing area based on the clothing area masking; Within the target clothing area, the corresponding image content from the generated image is used in a single step. Within the non-target area, the corresponding image content from the original image is retained. In the boundary area, the generated image and the original image are fused position by position according to the soft weight corresponding to the clothing area mask to obtain the image to be repaired.
[0033] The original image and the image to be repaired are input into the garment wrinkle removal detail repair model. The original image provides a reference for garment details, and the image to be repaired provides the basis for the wrinkle removal appearance, resulting in a high-resolution reference image, including: The original image and the image to be repaired, which correspond to spatial locations, are used as dual image inputs. The clothing detail repair model for removing wrinkles is used to extract clothing detail information from the original image and wrinkle removal appearance information from the image to be repaired. Based on the clothing details and wrinkle removal appearance information, the image to be repaired is repaired in detail. While maintaining the wrinkle removal appearance of the image to be repaired, local blurring and detail attenuation are repaired to obtain a high-definition reference image corresponding to the spatial position of the original image. Among them, the clothing wrinkle removal and detail restoration model is trained by training original images, training images to be restored and high-definition restoration target images with corresponding relationships. The high-definition restoration target image is used as restoration supervision to learn the image restoration relationship from the training original image and the training images to the high-definition restoration target image.
[0034] This embodiment, based on Embodiment 1, further explains the image acquisition, single-step diffusion generation, and detail restoration processes in the garment image wrinkle removal process. (Refer to...) Figure 2 This embodiment identifies the target clothing area in the original image, generates a wrinkle-removing result using a single-step diffusion model, and then repairs it by combining the clothing detail information in the original image. This improves processing efficiency while mitigating texture loss and detail attenuation issues that may occur during the single-step generation process.
[0035] Specifically, the process begins by acquiring an original image containing the target garment. This original image is a static image containing the garment to be processed and its corresponding wrinkle information. Image segmentation is then performed on the original image to obtain the target garment region. A garment region mask, corresponding to the spatial location of the original image, is generated based on this target garment region. This garment region mask distinguishes the target garment region from non-target regions. In subsequent region fusion, only the wrinkle-removing content is replaced in the target garment region, while the original image information of the non-target regions is preserved, thus avoiding impact on the background or other unprocessed areas.
[0036] Further, a bounding box for the target garment is determined based on the target garment region, and the width corresponding to the bounding box is taken as the effective width of the target garment. The relative scale of the garment is determined based on the ratio between the effective width of the target garment and the overall width of the original image. The relative scale of the garment is used to describe the size proportion of the target garment in the current image, providing a reference for scale division in the subsequent residual processing process, so that garment images of different sizes can be processed with appropriate scales.
[0037] Subsequently, the original image is input into the clothing de-wrinkling diffusion model, and a single-step generated image is generated through single-step sampling. Specifically, the clothing de-wrinkling diffusion model is trained based on single-step distillation. During training, a high-quality de-wrinkling target image generated by a multi-step diffusion teacher model is used as supervision information, enabling the clothing de-wrinkling diffusion model to learn to generate de-wrinkled images under a single-step sampling configuration. In actual processing, the clothing de-wrinkling diffusion model constructs a corresponding image representation based on the original image and performs a sampling update. The updated image representation is then decoded to obtain the single-step generated image. The single-step generated image is the complete image result after processing by the diffusion model, but region fusion based on clothing region masking has not yet been performed.
[0038] Furthermore, the generated image is adjusted to correspond to the size and color representation of the original image, and the generated image and the original image are fused according to the clothing region mask. Specifically, the corresponding content from the generated image is used within the target clothing region, while the corresponding content from the original image is retained in the non-target region. At the boundary between the target clothing region and the non-target region, smooth fusion is performed according to the weights corresponding to the clothing region mask to reduce visual discontinuities at the region boundaries. After the above processing, the image to be repaired is obtained.
[0039] In practice, the target area is weighted accordingly, and the boundary is weighted softly between 0 and 1. The region re-attachment relationship can be expressed as equation (1): ; in, This indicates the image to be repaired. This indicates the area of clothing being covered. This indicates that the image is generated in a single step. Represents the original image. This represents the multiplication of values at the same pixel location. When the weight is 0, it indicates that the current position belongs to a non-target area. When the weight is between 0 and 1, it indicates that the current position is located at the boundary of the target clothing area. The generated image and the original image are fused by weight to achieve a smooth transition of the boundary.
[0040] Then, the original image and the image to be repaired are input into the garment wrinkle removal detail repair model to obtain a high-definition reference image. The original image serves as a detail reference image, providing original detail information such as garment texture, printed text, and edge structure; the image to be repaired serves as the appearance base image, providing appearance information of the wrinkle-removed garment after single-step diffusion processing. Based on the correlation between the two types of image information, the garment wrinkle removal detail repair model repairs local blurred areas and detail attenuation areas in the image to be repaired, so that the output high-definition reference image maintains the wrinkle removal effect while restoring the original detail of the garment. The input of the original image and the image to be repaired into the garment wrinkle removal detail repair model to obtain a high-definition reference image can be expressed as Equation (2): ; in, Represents a high-resolution reference image. This represents a model for repairing wrinkles and details in clothing.
[0041] The garment wrinkle removal and detail restoration model can be trained using corresponding training samples. These training samples include corresponding original training images, images to be restored, and high-resolution restoration target images. During training, the high-resolution restoration target image serves as supervision, enabling the garment wrinkle removal and detail restoration model to learn to generate corresponding restoration results based on the detail information provided by the original image and the wrinkle removal appearance information provided by the image to be restored. After training, the garment wrinkle removal and detail restoration model can output a high-resolution reference image by receiving only the original image and the image to be restored during actual processing.
[0042] This embodiment combines a single-step diffusion generation method with a dual-image detail restoration method, enabling garment images to achieve wrinkle removal without relying on multiple diffusion sampling. It also utilizes detail information from the original image to compensate for texture loss and local blurring that may occur during single-step generation. Simultaneously, by masking the garment area, the processing range is limited, concentrating wrinkle removal on the target garment area and reducing the possibility of alteration to non-target areas. Therefore, this embodiment improves garment image processing efficiency while enhancing the detail preservation and overall visual quality of the wrinkle removal results.
[0043] Example 3 Some embodiments of the clothing image wrinkle removal method based on single-step diffusion and residual adjustment obtain the whole image processing residual based on the difference between the original image and the high-resolution reference image, and determine the target boundary scale based on the relative scale of the clothing, including: The original image and the high-definition reference image are unified to the same size, color space and numerical range, and the image processing residual is determined based on the image differences at corresponding positions. Based on the relative scale of the clothing and the image width corresponding to the residual of the whole image processing, determine the effective pixel width of the target clothing in the residual processing coordinates; Obtain the relative boundary ratio of the boundary scale used to characterize the coarse and fine scales relative to the proportion of the effective pixel width of the target garment, and determine the target boundary scale based on the effective pixel width and the relative boundary ratio. When the target boundary scale exceeds the preset multi-scale decomposition scale range, the target boundary scale is limited to the minimum or maximum scale corresponding to the scale range.
[0044] The residuals from the whole image processing are decomposed into multiple scales, and the scale components are grouped according to the relationship between the spatial scale corresponding to each scale component and the target boundary scale. This yields coarse-scale residuals and fine-scale residuals that can jointly reconstruct the residuals from the whole image processing, including: The residual of the whole image is processed to construct a Laplacian pyramid with a preset number of layers. Low-pass filtering and downsampling are performed on each layer in sequence. The difference between the current layer image and the next layer image obtained by upsampling is determined as the detail component of the corresponding layer, and the low-pass component of the coarsest layer is retained. Determine the spatial scale corresponding to each detailed component, and define the coarsest layer whose spatial scale does not exceed the target boundary scale as the boundary layer; The finer detail components corresponding to the boundary layer are classified into the fine-scale residual, and the fine detail components corresponding to the boundary layer, the coarser detail components corresponding to the boundary layer, and the low-pass components of the coarsest layer are classified into the coarse-scale residual. The coarse-scale residual and the fine-scale residual are restored to the complete image coordinates respectively, so that the coarse-scale residual and the fine-scale residual can jointly reconstruct the whole image processing residual.
[0045] This embodiment, based on Embodiment 1, further explains the residual generation in the process of wrinkle removal from clothing images and the adaptive multi-scale decomposition process based on clothing size. (Refer to...) Figure 3 In this embodiment, the residual processing scale is determined based on the size of the target garment in the original image, and the residual of the whole image processing is divided into coarse and fine scales based on the target boundary scale, so that when adjusting the wrinkle removal effect of garment images of different sizes, a residual decomposition method matching the main body of the garment can be adopted.
[0046] Specifically, after obtaining the high-resolution reference image, the original image and the high-resolution reference image are unified to the same image size, color space, and numerical range to eliminate the influence of different image representations on subsequent residual calculations. Then, the overall image processing residual is determined based on the pixel differences between the original image and the high-resolution reference image at corresponding positions. This overall image processing residual represents the overall image change information generated during the conversion from the original image to the high-resolution reference image. It includes not only changes caused by the reduction of clothing wrinkles but also image differences generated by processes such as texture restoration and detail adjustment.
[0047] Specifically, the difference between the original image and the high-definition reference image can be expressed as Equation (3): ; in, This indicates the residuals after processing the entire image. Represents the original image. This represents a high-resolution reference image.
[0048] After obtaining the residual image from the whole image processing, the effective pixel width of the target garment in the residual processing coordinates is determined based on the aforementioned relative garment scale. Specifically, the relative garment scale reflects the size ratio of the target garment area in the original image, and the actual processing scale corresponding to the target garment is calculated based on this ratio. Furthermore, the target boundary scale is determined by combining a preset relative boundary ratio, so that the division between the coarse-scale processing area and the fine-scale processing area varies according to the main body size of the target garment.
[0049] Subsequently, the residuals from the whole image processing are decomposed into multiple scales. In this embodiment, the Laplacian pyramid is used to decompose the residuals from the whole image processing. Residual components at different spatial scales are obtained through layer-by-layer low-pass filtering and downsampling, while retaining the low-frequency information corresponding to the coarsest layer. For the residual components obtained from each layer, the boundary between coarse-scale and fine-scale components is determined based on the relationship between their corresponding spatial scale and the target boundary scale.
[0050] Specifically, the scale components are sorted according to their spatial scale, and the boundary layer corresponding to the target boundary scale is determined. Among them, the residual components located in the finer spatial scale range are classified as fine-scale residuals, which are used to represent image differences at the level of details such as clothing texture, local creases, and edge changes; the residual components located in the coarser spatial scale range and the coarsest low-frequency components are classified as coarse-scale residuals, which are used to represent image differences at a larger scale such as the overall shape of clothing, large-scale changes in brightness and darkness, and overall folding trends.
[0051] After the above processing, coarse-scale residuals and fine-scale residuals are obtained. Both the coarse-scale residuals and the fine-scale residuals are restored to complete image coordinates, so that they can jointly represent the complete image processing residuals. Specifically, the coarse-scale residuals and the fine-scale residuals satisfy equation (4): ; in, Indicates coarse-scale residuals. This represents the fine-scale residual.
[0052] In this embodiment, the target boundary scale is not determined by a fixed pixel size, but dynamically based on the actual size of the target garment in the current image. When the target garment occupies a large proportion of the image, the target boundary scale is adjusted accordingly, allowing larger-scale garment structural changes to be processed using coarse-scale residuals. When the target garment occupies a small proportion, the target boundary scale changes accordingly, allowing detailed changes to be segmented at an appropriate scale. This avoids the problem of inconsistent image processing effects for garments of different sizes caused by a fixed-scale segmentation method.
[0053] This embodiment incorporates the relative scale of clothing into the residual multi-scale decomposition process, enabling the residual division to be adaptively adjusted based on the main body size of the target clothing. Compared with the fixed-scale residual processing method, it can improve the adaptability of the image processing of clothing of different sizes. At the same time, by dividing the overall image processing residual into coarse-scale residual and fine-scale residual, it provides a basis for subsequent adjustment of the wrinkle removal effect at different spatial scales, allowing for the differentiation and control of the overall shape adjustment of clothing and the local detail adjustment, thereby improving the flexibility and stability of the wrinkle removal processing of clothing images.
[0054] Example 4 In some embodiments, a clothing image wrinkle removal method based on single-step diffusion and residual adjustment determines the amount of coarse-scale residual to be added back based on the coarse-scale intensity and the amount of fine-scale residual to be added back based on the fine-scale intensity. The corresponding coarse-scale and fine-scale residuals are then added back to a high-resolution reference image to obtain the wrinkle-removed output image of the clothing. This includes: Obtain the coarse-scale intensity and fine-scale intensity that change continuously from the closed processing state to the fully processed state, respectively; The proportion of coarse-scale residual addition that changes in the opposite direction to the coarse-scale intensity is determined based on the coarse-scale intensity, and the proportion of fine-scale residual addition that changes in the opposite direction to the fine-scale intensity is determined based on the fine-scale intensity. According to the coarse-scale residual back-addition ratio and the fine-scale residual back-addition ratio, the coarse-scale residual and the fine-scale residual are respectively back-added to the high-definition reference image to obtain the output image; Specifically, when both coarse and fine scale intensity are in the off processing state, the coarse and fine scale residuals are all added back to restore the output image to the original image; when both coarse and fine scale intensity are in the full processing state, the coarse and fine scale residuals are not added back to make the output image a high-definition reference image.
[0055] It should be noted that the methods for setting coarse-scale strength and fine-scale strength include overall strength adjustment and independent strength adjustment. Under the overall strength adjustment mode, the coarse-scale strength and fine-scale strength are set to the same strength value, and the amount of recovery of the coarse-scale residual and fine-scale residual is adjusted synchronously according to the strength value; In the independent intensity adjustment mode, coarse-scale intensity and fine-scale intensity are set separately. The amount of backfilling of coarse-scale residual is adjusted according to coarse-scale intensity, and the amount of backfilling of fine-scale residual is adjusted according to fine-scale intensity, so as to control the degree of wrinkle removal processing of clothing images at different spatial scales.
[0056] This embodiment, based on Embodiment 3, further explains the effect adjustment process based on coarse-scale residuals and fine-scale residuals in the wrinkle removal process of clothing images. This embodiment independently controls the residual components corresponding to different spatial scales by setting coarse-scale intensity and fine-scale intensity separately, thereby achieving separate adjustment of overall wrinkle changes and local detail changes in clothing, improving the flexibility of wrinkle removal processing effects.
[0057] Specifically, after obtaining a high-resolution reference image, coarse-scale residuals, and fine-scale residuals, coarse-scale intensity and fine-scale intensity are obtained according to user-set or preset processing parameters. The coarse-scale intensity is used to control the degree of influence of the coarse-scale residuals on the output image, and the fine-scale intensity is used to control the degree of influence of the fine-scale residuals on the output image. By setting the two types of intensity separately, independent adjustments can be made for changes in clothing images at different spatial scales.
[0058] Using a high-resolution reference image as the base image for residual adjustment, the back-addition ratio corresponding to the coarse-scale residual is determined based on the coarse-scale intensity, and the back-addition ratio corresponding to the fine-scale residual is determined based on the fine-scale intensity. Specifically, when the intensity corresponding to a certain scale increases, it indicates that the processing effect at that scale is enhanced, the back-addition degree of the corresponding scale residual decreases, and the output result is closer to the high-resolution reference image; when the intensity corresponding to a certain scale decreases, it indicates that more original image information is retained, the back-addition degree of the corresponding scale residual increases, and the output result is closer to the original image.
[0059] Specifically, assuming a high-definition reference image is the base image, the coarse-scale residual and the fine-scale residual are added back according to their respective proportions, and the output image can be expressed as equation (5): ; in, Indicates the output image. Represents a high-resolution reference image. Indicates coarse-scale residuals. This represents the fine-scale residual. Indicates coarse-scale strength. Indicates fine-scale intensity.
[0060] The above methods allow for adjustments to the influence of coarse-scale and fine-scale residuals on the output image. For example, when it is necessary to reduce the overall wrinkle variation in clothing, the coarse-scale intensity can be adjusted to reduce and re-add the corresponding coarse-scale residual; when it is necessary to further restore details such as clothing texture and local creases, the fine-scale intensity can be adjusted to allow the fine-scale residual to participate in the reconstruction of the output image as needed.
[0061] Furthermore, this embodiment supports both overall strength adjustment and independent strength adjustment modes. In overall strength adjustment mode, the coarse-scale strength and fine-scale strength are set to the same value, allowing the coarse-scale residual and fine-scale residual to be adjusted to the same degree, achieving uniform control over the overall wrinkle removal effect. In independent strength adjustment mode, the coarse-scale strength and fine-scale strength are set separately, allowing the coarse-scale residual and fine-scale residual to use different addition ratios, thereby controlling the overall shape change and local detail changes of the garment respectively.
[0062] Furthermore, during the intensity adjustment process, when both coarse-scale and fine-scale intensity are in a closed processing state, all coarse-scale and fine-scale residuals are added back to the high-definition reference image, restoring the output result to the original image state; when both coarse-scale and fine-scale intensity are in a fully processed state, the corresponding residuals are no longer added back, keeping the output result in the state of the high-definition reference image. By setting clear adjustment boundaries, the continuity and controllability of the intensity adjustment process can be guaranteed.
[0063] This embodiment further divides the overall image processing residual into coarse-scale residuals and fine-scale residuals, and sets corresponding intensity parameters for each, enabling independent adjustment of the wrinkle removal effect at different spatial scales. Compared to using a single intensity parameter to control overall image changes, this embodiment can make targeted adjustments based on different needs of overall garment structural changes and local detail changes, improving the flexibility of wrinkle removal effect adjustment while maintaining the natural appearance of the garment. Furthermore, by using residual reconstruction based on a high-definition reference image, different adjustment results are all built on the same generation and repair foundation, improving the consistency of the output results.
[0064] Example 5 The garment image wrinkle removal method based on single-step diffusion and residual adjustment in some embodiments further includes: After obtaining the high-resolution reference image, coarse-scale residual, and fine-scale residual for the first time, the high-resolution reference image, the relative scale of clothing, the scale components obtained from multi-scale decomposition, the coarse-scale residual, and the fine-scale residual are cached. When the original image, the target clothing region, the generation configuration corresponding to the clothing de-wrinkling diffusion model, and the repair configuration corresponding to the clothing de-wrinkling detail repair model remain unchanged, and only the coarse-scale intensity and the fine-scale intensity change, the cached high-definition reference image, coarse-scale residual, and fine-scale residual are called, and the corresponding residual back-addition amount is re-determined according to the changed coarse-scale intensity and fine-scale intensity to obtain the updated output image. When the original image, target clothing area, generation configuration, or repair configuration changes, the image processing procedure corresponding to the changed content is re-executed, and the corresponding cached results are updated.
[0065] This embodiment, based on Embodiment 4, further explains the caching and rapid adjustment process of the processing results during the wrinkle removal process of clothing images. (Refer to...) Figure 4 This embodiment caches the intermediate results generated during the initial processing. While keeping the input image, model processing configuration, and target clothing area unchanged, it can quickly obtain output images with different processing effects by adjusting only the wrinkle removal processing intensity without repeating the diffusion generation and detail repair processes, thereby reducing the computational overhead in the repeated processing process.
[0066] Specifically, during the initial wrinkle removal process of the garment image, the high-resolution reference image, the relative scale of the garment, the scale components obtained after multi-scale decomposition, the coarse-scale residual, and the fine-scale residual are obtained sequentially according to the methods described in Examples 1 to 4. The above processing results are cached as the basic data for subsequent intensity adjustment. Specifically, the high-resolution reference image serves as the base image for residual reconstruction, the relative scale of the garment records the scale information corresponding to the target garment, the scale components support residual recombination, and the coarse-scale and fine-scale residuals are used for re-addition adjustment based on different intensity parameters.
[0067] After the initial processing result is cached, if the user only adjusts the coarse-scale intensity and the fine-scale intensity, while the original image, the target clothing region, the generation configuration corresponding to the clothing de-wrinkling diffusion model, and the repair configuration corresponding to the clothing de-wrinkling detail repair model remain unchanged, the high-resolution reference image, coarse-scale residual, and fine-scale residual in the cache are directly called. The corresponding residual addition amount is re-determined based on the adjusted coarse-scale intensity and fine-scale intensity, and a new output image is generated based on the residual recombination process.
[0068] Specifically, in the above scenario, the process of generating a single-step image from the original image input clothing de-wrinkling diffusion model is no longer repeated, nor is the process of obtaining a high-resolution reference image from the original image and the image to be repaired input clothing de-wrinkling detail restoration model. Instead, the cached processing results are directly used for residual adjustment. This method allows for rapid response to output requirements corresponding to different intensity parameters when the user continuously adjusts the processing effect.
[0069] Furthermore, when a change is detected in the original image, or a change is detected in the target clothing area, or a change is detected in the generation configuration corresponding to the clothing de-wrinkling diffusion model or the repair configuration corresponding to the clothing de-wrinkling detail repair model, since the data basis corresponding to the aforementioned cached results has changed, the corresponding image processing process is re-executed, and the cached results related to the changed content are updated to ensure that the data used in the subsequent adjustment process remains consistent with the current processing conditions.
[0070] For example, in processing the same garment image, after the user initially selects a certain wrinkle removal intensity parameter and completes the processing, the system saves the corresponding high-resolution reference image, coarse-scale residual, and fine-scale residual. When the user wants to enhance or weaken the wrinkle removal effect, they only need to adjust the coarse-scale intensity and fine-scale intensity. The system can then reassemble and output the image based on the saved data without rerunning the single-step diffusion generation process and detail restoration process. When the user changes the garment image to be processed or adjusts the generation and restoration configurations, the system re-executes the complete processing flow and updates the cached data.
[0071] This embodiment caches key intermediate results during the garment image wrinkle removal process, separating the intensity adjustment process from the image generation process. This maintains output consistency while avoiding redundant calculations caused by re-executing model inference for each intensity change. Therefore, this embodiment reduces computational resource consumption during interactive adjustment and improves response efficiency when switching between different processing effects, making it suitable for image processing scenarios requiring multiple adjustments to the garment wrinkle removal effect.
[0072] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0073] It should be noted that in the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means at least two.
[0074] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0075] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0076] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0077] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0078] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0079] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0080] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for removing wrinkles from clothing images based on single-step diffusion and residual adjustment, characterized in that, include: Acquire an original image containing the target garment, perform region recognition on the target garment in the original image to obtain a garment region mask, and determine the relative scale of the garment based on the effective width of the target garment in the original image; The original image is input into the garment wrinkle removal diffusion model, and a single-step generated image is generated through a single sampling update. Based on the clothing area mask, the target clothing area in the single-step generated image is fused with the non-target area in the original image to obtain the image to be repaired; The original image and the image to be repaired are input into the garment wrinkle removal detail repair model. The original image provides a garment detail reference, and the image to be repaired provides the wrinkle removal appearance basis to obtain a high-definition reference image. The image processing residual is obtained based on the difference between the original image and the high-definition reference image. The target boundary scale is determined based on the relative scale of the clothing. The image processing residual is decomposed into multiple scales. The scale components are grouped according to the relationship between the spatial scale corresponding to each scale component and the target boundary scale to obtain coarse-scale residuals and fine-scale residuals that can jointly reconstruct the image processing residual. Obtain coarse-scale intensity and fine-scale intensity. Based on the high-definition reference image, determine the amount of backfilling of the coarse-scale residual according to the coarse-scale intensity, and determine the amount of backfilling of the fine-scale residual according to the fine-scale intensity. Add the corresponding coarse-scale residual and fine-scale residual backfilled to the high-definition reference image to obtain the output image after removing wrinkles from the clothing.
2. The method according to claim 1, characterized in that, The step of performing region identification on the target clothing in the original image to obtain a clothing region mask, and determining the relative scale of the clothing based on the effective width of the target clothing in the original image, includes: The original image is segmented to obtain the target clothing region corresponding to the target clothing, and a clothing region mask corresponding to the position of the original image is generated based on the target clothing region. A target garment bounding frame is determined based on the target garment area, and the width of the target garment bounding frame is determined as the effective width of the target garment. The relative scale of the garment is determined based on the ratio between the effective width of the target garment and the width of the original image.
3. The method according to claim 1, characterized in that, The step of inputting the original image into the clothing wrinkle removal diffusion model and generating a single-step generated image through a single sampling update includes: The original image is used as an image condition input into the garment wrinkle removal diffusion model to construct an internal image representation of the original image; In the single-step sampling configuration, the internal image representation is sampled and updated once, and the sampled and updated image representation is decoded to obtain the single-step generated image; The garment de-wrinkling diffusion model is obtained through single-step distillation training. The single-step distillation training uses a multi-step diffusion teacher model to generate a de-wrinkled target image based on an image of wrinkled garment as supervision, enabling the garment de-wrinkling diffusion model to learn to generate a de-wrinkled image through a single sampling update.
4. The method according to claim 1, characterized in that, The step of fusing the target clothing region in the single-step generated image with the non-target region in the original image based on the clothing region mask to obtain the image to be repaired includes: The generated image is adjusted to correspond to the image size and color representation of the original image; The target clothing area, the non-target area, and the boundary area of the target clothing area are determined based on the clothing area masking. The corresponding image content from the single-step generated image is used within the target clothing area, while the corresponding image content from the original image is retained within the non-target area. Then, the single-step generated image and the original image are fused position-by-position within the boundary area according to the soft weight corresponding to the clothing area mask, to obtain the image to be repaired.
5. The method according to claim 1, characterized in that, The process involves inputting both the original image and the image to be repaired into a garment wrinkle removal detail repair model. The original image provides a reference for garment details, while the image to be repaired provides the basis for the wrinkle removal appearance, resulting in a high-definition reference image. The original image and the image to be repaired, which correspond to spatial locations, are used as dual image inputs. The clothing detail repair model extracts clothing detail information from the original image and wrinkle removal appearance information from the image to be repaired. Based on the clothing detail information and the wrinkle-free appearance information, the image to be repaired is repaired in detail. While maintaining the wrinkle-free appearance of the image to be repaired, local blurring and detail attenuation are repaired to obtain the high-definition reference image corresponding to the spatial position of the original image. The clothing wrinkle removal and detail restoration model is trained using a training original image, a training image to be restored, and a high-definition restoration target image that have a corresponding relationship. The high-definition restoration target image is used as the restoration supervision to learn the image restoration relationship from the training original image and the training image to be restored to the high-definition restoration target image.
6. The method according to claim 1, characterized in that, The step of obtaining the whole image processing residual based on the difference between the original image and the high-definition reference image, and determining the target boundary scale based on the relative scale of the clothing, includes: The original image and the high-definition reference image are unified to the same size, color space and numerical range, and the image processing residual is determined based on the image differences at corresponding positions of the two. Based on the relative scale of the garment and the image width corresponding to the image processing residual, the effective pixel width of the target garment in the residual processing coordinates is determined; Obtain the relative boundary ratio of the boundary scale used to characterize the coarse and fine scales relative to the proportion of the effective pixel width of the target garment, and determine the target boundary scale based on the effective pixel width and the relative boundary ratio; When the target boundary scale exceeds the scale range of the preset multi-scale decomposition, the target boundary scale is limited to the minimum or maximum scale corresponding to the scale range.
7. The method according to claim 6, characterized in that, The process of multi-scale decomposing the residual of the whole image processing and grouping the scale components according to the relationship between the spatial scale corresponding to each scale component and the target boundary scale to obtain coarse-scale residuals and fine-scale residuals that can jointly reconstruct the residual of the whole image processing includes: The Laplacian pyramid with a preset number of layers is constructed from the residual of the whole image processing. Low-pass filtering and downsampling are performed on each layer in sequence. The difference between the current layer image and the next layer image obtained by upsampling is determined as the detail component of the corresponding layer, and the low-pass component of the coarsest layer is retained. Determine the spatial scale corresponding to each of the detailed components, and determine the coarsest layer whose spatial scale does not exceed the target boundary scale as the boundary layer; The finer detail components, which are finer than the spatial scale corresponding to the boundary layer, are included in the fine-scale residual. The detail components corresponding to the boundary layer, the coarser detail components, and the low-pass components of the coarsest layer are included in the coarse-scale residual. The coarse-scale residual and the fine-scale residual are restored to the complete image coordinates, so that the coarse-scale residual and the fine-scale residual can jointly reconstruct the whole image processing residual.
8. The method according to claim 1, characterized in that, The process of determining the amount of back-addition of the coarse-scale residual based on the coarse-scale intensity and the amount of back-addition of the fine-scale residual based on the fine-scale intensity, and then back-adding the corresponding coarse-scale residual and the fine-scale residual to the high-definition reference image to obtain the output image after removing wrinkles from the clothing includes: The coarse-scale intensity and the fine-scale intensity are obtained respectively, as the processing state changes continuously from the closed state to the fully processed state. The coarse-scale residual back-addition ratio that changes in the opposite direction to the coarse-scale intensity is determined based on the coarse-scale intensity, and the fine-scale residual back-addition ratio that changes in the opposite direction to the fine-scale intensity is determined based on the fine-scale intensity. According to the coarse-scale residual back-addition ratio and the fine-scale residual back-addition ratio, the coarse-scale residual and the fine-scale residual are respectively back-added to the high-definition reference image to obtain the output image; Specifically, when both the coarse-scale intensity and the fine-scale intensity are in a closed processing state, the coarse-scale residual and the fine-scale residual are all added back to restore the output image to the original image; when both the coarse-scale intensity and the fine-scale intensity are in a fully processed state, the coarse-scale residual and the fine-scale residual are not added back to make the output image the high-definition reference image.
9. The method according to claim 8, characterized in that, The method further includes: After obtaining the high-resolution reference image, the coarse-scale residual, and the fine-scale residual for the first time, the high-resolution reference image, the relative scale of the clothing, the scale components obtained from the multi-scale decomposition, the coarse-scale residual, and the fine-scale residual are cached. When the original image, the target clothing region, the generation configuration corresponding to the clothing wrinkle removal diffusion model, and the repair configuration corresponding to the clothing wrinkle removal detail repair model remain unchanged, and only the coarse-scale intensity and the fine-scale intensity change, the cached high-definition reference image, the coarse-scale residual, and the fine-scale residual are called, and the corresponding residual back-addition amount is re-determined according to the changed coarse-scale intensity and fine-scale intensity to obtain the updated output image; When the original image, the target clothing area, the generation configuration, or the repair configuration changes, the image processing procedure corresponding to the changed content is re-executed, and the corresponding cached results are updated.
10. The method according to claim 8, characterized in that, The methods for setting the coarse-scale intensity and the fine-scale intensity include an overall intensity adjustment method and an independent intensity adjustment method; Under the overall strength adjustment mode, the coarse-scale strength and the fine-scale strength are set to the same strength value, and the amount of recovery of the coarse-scale residual and the fine-scale residual is adjusted synchronously according to the strength value; In the independent intensity adjustment mode, the coarse-scale intensity and the fine-scale intensity are set respectively. The amount of backfilling of the coarse-scale residual is adjusted according to the coarse-scale intensity, and the amount of backfilling of the fine-scale residual is adjusted according to the fine-scale intensity, so as to control the degree of wrinkle removal processing of clothing images at different spatial scales respectively.
