Method and device for generating real person model clothing image by one key, and storage medium
By extracting clothing area images and setting live model parameters, and using neural network models to generate live model clothing images, the problem of time-consuming and labor-intensive shooting of live model models in the e-commerce industry is solved, and fast and low-cost high-quality clothing image generation is achieved.
Patent Information
- Application Number
- CN202311241242.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2024-12-06
AI Technical Summary
The e-commerce clothing industry requires real-person models to take clothing images, which is time-consuming and labor-intensive and costly. It is difficult for the existing technology to efficiently generate real-person model clothing images in one click.
By obtaining the original clothing image, extracting the clothing area image and setting the personal parameters of the live model, the preset neural network model is used to combine the Grounding DINO and Segment Anything algorithm to generate the clothing mask, and post-processing is combined with the object detection algorithm to achieve one-click generation of the live model Clothing image.
It realizes the rapid generation of real-person clothing images without real-person models, saves manpower and material costs, and generates high-quality and beautiful clothing images through long-term training of neural network models and image super-resolution reconstruction algorithms.
Smart Images

Figure CN119091001A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method, a device and a storage medium for generating a clothing image of a real model with one click. Background Art
[0002] In the e-commerce clothing industry, e-commerce sellers often hire professional clothing photographers and real models, rent studios and equipment to shoot clothing, and then post-process the clothing photos. This method of clothing production is time-consuming, labor-intensive, and expensive. With the maturity of AI technology, real-life model clothing images can be generated with one click based on AI technology. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems in the related art to a certain extent. To this end, one object of the present invention is to provide a method, device and storage medium for generating clothing images of real models in one click, which can generate clothing images of real models in one click by using AI technology without shooting of real models.
[0004] The technical solution adopted by the present invention is: In a first aspect, the present invention provides a method for generating a clothing image of a real-life model with one click, the method comprising: acquiring an original clothing image, extracting a clothing area image from the original clothing image; setting personality parameters of the real-life model, generating a real-life model text prompt word and a real-life model model; inputting the clothing area image, the real-life model text prompt word and the real-life model model into a preset neural network model, and generating a clothing image of a real-life model with one click.
[0005] The step of extracting the clothing region image from the original clothing image includes: preprocessing the original clothing image to obtain pixel values of the clothing region image.
[0006] The original clothing image is preprocessed to obtain pixel values of the clothing area image, including: using the Grounding DINO algorithm to detect the clothing area in the original clothing image; extracting the pixel values of the detected clothing area to obtain a foreground image of the clothing area; using the Segment Anything algorithm to segment the clothing area and create a clothing mask to indicate the position of clothing pixels; using the clothing mask to extract the pixel values of the clothing area; and performing pixel expansion on the clothing area.
[0007] Among them, the pixel values of the detected clothing area are extracted to obtain the foreground image of the clothing area, and the clothing area is segmented by using the Segment Anything algorithm to create a clothing mask to represent the position of the clothing pixels, and the method also includes: extracting the normal map of the clothing area to generate the foreground image of the clothing area.
[0008] Among them, after the one-click generation of the real-life model clothing image, it also includes: post-processing the real-life model clothing image; the post-processing of the real-life model clothing image specifically includes: using a target detection algorithm to detect the real-life part image in the real-life model clothing image; enlarging the resolution of the real-life part image and regenerating the real-life part image; reducing the regenerated real-life part image to the original resolution; and fusing the newly generated real-life part image into the real-life model clothing image.
[0009] After the one-click generation of the clothing image of the real model, the method further includes: improving the resolution of the clothing image of the real model, generating images of various proportions and various large resolutions for users to choose to download.
[0010] The preset neural network model is formed by integrating multiple neural network models; the personality parameters of the real model include: age, gender, real model type, image orientation, or image background.
[0011] In a second aspect, the present invention provides a device for generating a clothing image of a live model with one click, the device comprising: a clothing area image extraction module, used to obtain an original clothing image and extract a clothing area image from the original clothing image; a live model setting module, used to set the personality parameters of the live model, generate a live model text prompt word and a live model model; a live model clothing image generation module, used to input the clothing area image, the live model text prompt word and the live model model into a preset neural network model, and generate a clothing image of the live model with one click.
[0012] It also includes: a real-life model clothing image processing module, which is used to post-process the real-life model clothing image; a large-resolution image generation module, which is used to improve the resolution of the real-life model clothing image and generate multiple large-resolution images of various proportions for users to choose to download.
[0013] In a third aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method as described above.
[0014] The beneficial effects of the present invention are: The present invention extracts clothing area images from original clothing images, sets the personality parameters of real models to generate text prompts for real models and real model models, and then inputs the clothing area images, the text prompts for real models and the real model models into a preset neural network model, so that real model clothing images can be generated with one click. This embodiment overcomes the technical problems of relying on cameras and real models to shoot clothing images in the prior art, which have slow imaging time and high costs, and realizes the one-click generation of real-life clothing images through AI technology, just like photos taken of real people wearing clothes. The present invention is easy to implement, has a fast filming time, and saves manpower and material costs.
[0015] Furthermore, the specific neural network model of the present invention is formed by the fusion of multiple neural network models. The present invention performs long-term training on the specific neural network model, so that the generated characters and clothes are coordinated and beautiful.
[0016] In addition, the present invention also performs image post-processing on the clothing image of the real model to make the generated clothing image more realistic, and make various parts of the real person, such as hands and face, clearer, more natural and more beautiful.
[0017] In addition, the present invention can use an image super-resolution reconstruction algorithm for the real-life model clothing image to improve the image resolution, enhance the image details and texture, and generate a higher quality image without changing the original image. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flow chart of an embodiment of a method for generating a clothing image of a real model with one key according to the present invention; Figure 2 yes Figure 1 A flowchart of an embodiment of step S11; Figure 3 yes Figure 1 A schematic structural diagram of an embodiment of step S13; Figure 4 It is a flow chart of another embodiment of the method for generating a clothing image of a real model with one key according to the present invention; Figure 5 yes Figure 4 A flowchart of an embodiment of step S24; Figure 6 It is a flow chart of another embodiment of the method for generating clothing images of real-life models by one key according to the present invention; Figure 7 It is a structural schematic diagram of an embodiment of a device for generating a clothing image of a real model with one key according to the present invention; Figure 8 yes Figure 7 A schematic structural diagram of an embodiment of a clothing area image extraction module 11; Fig. 9 It is a structural schematic diagram of another embodiment of the device for generating clothing images of real-life models with one click according to the present invention. DETAILED DESCRIPTION
[0019] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other. Embodiment 1
[0020] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of an embodiment of a method for generating clothing images of real-life models with one click according to the present invention. Figure 1 As shown, the method comprises the following steps: S11: acquiring an original clothing image, and extracting a clothing region image from the original clothing image; The original clothing image is the clothing image to be photographed, and the original clothing image can be obtained by uploading with one key. It can be understood that the original clothing image can be a clothing image photographed using a dummy model, or a clothing image hung on a hook.
[0021] Step S11 includes: preprocessing the original clothing image to obtain pixel values of the clothing region image, thereby obtaining the clothing region image.
[0022] See also Figure 2 , step S11 includes the following sub-steps: S111: using the Grounding DINO algorithm to detect the clothing area in the original clothing image; The Grounding DINO algorithm has a powerful zero-shot detection capability and can find any clothing in an image through a text description of the clothing.
[0023] S112: extracting pixel values of the detected clothing area, thereby obtaining a foreground image of the clothing area; S113: Segment Anything algorithm is used to segment the clothing area, and a clothing mask is created to indicate the position of clothing pixels; S114: using the clothing mask to extract pixel values of the clothing area; S115: Expand the pixels of the clothing area; The number of pixels that the clothing area should be expanded in the upper, lower, left, and right directions can be dynamically calculated. The specific calculation steps for the pixel expansion ratio are as follows: (1) Calculate the ratio of the pixels above the extension: (Width / Height) 4 *15, the maximum value does not exceed 0.32; (2) Calculate the ratio of the extended pixels below: (Width / Height) 7 *30, the maximum value does not exceed 0.54; (3) Set the left and right expansion pixel ratio: 0.1; Among them, Width and Height refer to the width and height of the extracted clothing area. After the pixel expansion ratio is calculated using the above method, the pixels of the clothing area can be expanded using this ratio. After the pixels are expanded, the edge of the clothing area will become smooth and natural, and a certain space will be created for the subsequent generation of real model images.
[0024] Preferably, between step S112 and step S113, the step of extracting the normal map of the clothing area to generate a foreground image of the clothing area is further included. In computer graphics, normal mapping is a technique for simulating the lighting effect of concave and convex areas. Normal mapping can add details to the model without adding polygons. A common usage scenario is to improve the appearance and add details to a low-polygon model. In this case, normal mapping is used to generate a foreground image of the clothing area. Figure 1 Generally, it is generated based on high polygon models or height maps. In order to highly restore clothing details, we use normal map models to generate normal maps of the original image, which can reproduce the surface details and realism of the clothing.
[0025] S12: Setting personality parameters of the live model, generating text prompt words of the live model and a live model model; The personality parameters of the real model include: age, gender, real model type, image orientation or image background. Optionally, the user can manually enter the age and gender of the real model through a text box or a selection box. The image orientation includes: front, side or back. The image background has a variety of backgrounds to choose from, such as: seaside, woods, lawn.
[0026] The real model type has multiple models to choose from. After entering the age and gender of the real model, the system will display multiple real model images. After the user selects one of the real model images, the system will use the selected real model image as the real model model.
[0027] S13: Input the clothing area image, the live model text prompt word and the live model model into a preset neural network model to generate a live model clothing image with one click.
[0028] The preset neural network model is formed by integrating multiple neural network models. Figure 3When the user presses the "Generate Image" button, the computer interface immediately displays a clothing image of a real model. The clothing image of the real model is realistic, just like a photo of a real model wearing the clothing. In addition, it can also come with a photo background.
[0029] In this embodiment, by extracting a clothing area image from an original clothing image, setting the personality parameters of a live model to generate a live model text prompt word and a live model model, and then inputting the clothing area image, the live model text prompt word and the live model model into a preset neural network model, a clothing image with a sense of realism can be generated with one click. This embodiment overcomes the technical problems of the prior art that clothing images need to be taken with cameras and live models, which are slow and costly, and realizes the one-click generation of live model clothing images through AI technology, just like photos taken of real people wearing clothes. Embodiment 2
[0030] See also Figure 4 , Figure 4 FIG. 2 is a flow chart of another embodiment of the method for generating clothing images of real models with one click according to the present invention. Figure 4 As shown, this method is Figure 1 The difference is that after step S13, it also includes the following steps: S24: Post-processing the clothing image of the real model.
[0031] Specifically, Figure 5 As shown, step S24 includes the following sub-steps: S241: Detecting real-person part images in the real-person model clothing image using a target detection algorithm; S242: enlarging the resolution of the real person's body part image and regenerating the real person's body part image; S243: reducing the regenerated real-life body part image to the original resolution; S244: Fusing the newly generated real-person part image into the real-person model clothing image.
[0032] In step S24, a target detection algorithm such as YOLO can be used to detect the real person part image in the real person model clothing image. The real person part can be a hand, a face, etc.
[0033] In this embodiment, by performing image post-processing on the clothing image of the real model, the generated clothing image of the real model is made more realistic, and the parts of the real person in the image, such as hands and face, are made clearer, more natural and more beautiful. Embodiment 3
[0034] See also Figure 6 , Figure 6FIG. 2 is a flow chart of another embodiment of the method for generating clothing images of real models by one key according to the present invention. Figure 6 As shown, this method is Figure 4 The difference is that after step S24, it also includes the following steps: S35: improving the resolution of the clothing image of the real model, and generating images of various proportions and large resolutions for the user to choose and download.
[0035] In other embodiments, step S35 may also be provided after step S33 of this embodiment.
[0036] In this embodiment, the image resolution is improved without changing the original image, so that the details and texture of the image can be enhanced and a higher quality image can be generated. Embodiment 4
[0037] See also Figure 7 , Figure 7 FIG. 1 is a schematic diagram of a structure of an embodiment of a device for generating clothing images of real models with one click according to the present invention. Figure 7 As shown, the device includes: a clothing area image extraction module 11, a real model setting module 12 and a real model clothing image generation module 13.
[0038] The clothing region image extraction module 11 is used to obtain an original clothing image and extract a clothing region image from the original clothing image. Figure 8 As shown, the clothing region image extraction module 11 includes a clothing region image detection unit 111, a clothing region foreground image generation unit 112, a clothing mask creation unit 113, a clothing pixel extraction unit 114, and a clothing region image pixel expansion unit 115. The clothing region image detection unit 111 is used to detect the clothing region in the original clothing image using the Grounding DINO algorithm. The clothing region foreground image generation unit 112 is used to extract the pixel value of the detected clothing region, thereby obtaining a foreground image of the clothing region. The clothing mask creation unit 113 is used to perform clothing segmentation on the clothing region using the SegmentAnything algorithm, and create a clothing mask to indicate the position of clothing pixels. The clothing pixel extraction unit 114 is used to use the clothing mask to extract the pixel value of the clothing region. The clothing region image pixel expansion unit 115 is used to perform pixel expansion on the clothing region.
[0039] The live model setting module 12 is used to set the personality parameters of the live model and generate live model text prompt words and live model models.
[0040] The live model clothing image generation module 13 is used to input the clothing area image, the live model text prompt words and the live model model into a preset neural network model to generate a live model clothing image with one click.
[0041] Specifically, the working methods of each module have been described in detail in the first embodiment and will not be repeated here. Embodiment 5
[0042] See also Fig. 9 , Fig. 9 FIG. 2 is a schematic diagram of another embodiment of the device for generating clothing images of real models with one click according to the present invention. Fig. 9 As shown, the device Figure 7 The difference is that it also includes: a real model clothing image processing module 24 and a large resolution image generation module 25.
[0043] The live model clothing image processing module 24 is used to perform post-processing on the live model clothing image.
[0044] The high-resolution image generation module 25 is used to increase the resolution of the real-life model clothing image and generate high-resolution images of various proportions for users to choose and download.
[0045] Specifically, the working method of the real model clothing image processing module 24 has been described in detail in the second embodiment, and will not be repeated here. The working method of the high-resolution image generation module 25 has been described in detail in the third embodiment, and will not be repeated here. Embodiment 6
[0046] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method described in the above embodiment.
[0047] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A method for generating a clothing image of a real model with one click, characterized in that: include: Acquire an original clothing image, and extract a clothing region image from the original clothing image; Set the personality parameters of the live model, generate the live model text prompt words and live model model; The clothing area image, the live model text prompt words and the live model model are input into a preset neural network model to generate a live model clothing image with one click.
2. The method according to claim 1, characterized in that The step of acquiring an original clothing image and extracting a clothing region image from the original clothing image comprises: The original clothing image is preprocessed to obtain pixel values of the clothing region image.
3. The method according to claim 2, characterized in that The preprocessing of the original clothing image to obtain pixel values of the clothing region image includes: Using the Grounding DINO algorithm to detect the clothing area in the original clothing image; Extracting pixel values of the detected clothing area to obtain a foreground image of the clothing area; The clothing area is segmented by using a Segment Anything algorithm, and a clothing mask is created to indicate the position of clothing pixels; Using the clothing mask to extract pixel values of the clothing area; The clothing area is pixel-expanded.
4. The method according to claim 3, characterized in that The step of extracting pixel values of the detected clothing area to obtain a foreground image of the clothing area, and the step of using the Segment Anything algorithm to segment the clothing area and create a clothing mask to indicate the position of clothing pixels further includes: A normal map of the clothing area is extracted to generate a foreground image of the clothing area.
5. The method according to claim 1, characterized in that: After the real-life model clothing image is generated by one key, the method further includes: post-processing the real-life model clothing image; The post-processing of the real-life model clothing image specifically includes: Using a target detection algorithm, detect the real person part image in the real person model clothing image; Enlarging the resolution of the real person's body part image and regenerating the real person's body part image; Scaling down the regenerated real-life parts images to their original resolution; The newly generated real-person part image is fused into the real-person model clothing image.
6. The method according to claim 1, characterized in that After the one-key generation of the real-life model clothing image, the method further includes: The resolution of the real-life model clothing image is improved, and images of various proportions and large resolutions are generated for users to choose to download.
7. The method according to any one of claims 1 to 6, characterized in that: The preset neural network model is formed by merging multiple neural network models; the personality parameters of the real model include: age, gender, real model type, image orientation, or image background.
8. A device for generating clothing images of real models with one click, characterized in that: include: A clothing region image extraction module is used to obtain an original clothing image and extract a clothing region image from the original clothing image; A live model setting module is used to set the personality parameters of the live model and generate live model text prompt words and live model models; The live model clothing image generation module is used to input the clothing area image, the live model text prompt words and the live model model into a preset neural network model to generate a live model clothing image with one click.
9. The device according to claim 8, characterized in that Also includes: A live model clothing image processing module, used for post-processing the live model clothing image; The high-resolution image generation module is used to improve the resolution of the real-life model clothing image and generate high-resolution images of various proportions for users to choose and download.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.
