Image processing method, image processing model training method and image generation method

The image processing model is used to denoise the image to be processed and the reference pose image to generate the target image, which solves the problem of generating different pose images in the existing technology, reduces the user's burden of image retouching, and improves processing efficiency and accuracy.

CN118365510BActive Publication Date: 2024-09-13ALIBABA DAMO (HANGZHOU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410797391.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-13
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively generate images of different postures, causing users to spend a lot of time and energy on image retouching in e-commerce and other scenarios, which increases the user's workload.

Method used

By obtaining the image to be processed and the reference pose image, using the denoising unit and feature extraction unit in the image processing model, image processing is implemented based on the pruning of the feature extraction unit, and the target image is generated so that it has the pose corresponding to the reference pose image.

Benefits of technology

It is possible to generate images of different postures without manual retouching by the user, significantly reducing the user's workload and burden, and improving image processing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365510B
    Figure CN118365510B
Patent Text Reader

Abstract

The embodiments of this specification provide an image processing method, an image processing model training method, and an image generation method, wherein the image processing method comprises: obtaining an image to be processed and a reference posture image corresponding to the image to be processed; inputting the image to be processed and the reference posture image into an image processing model to obtain a target image corresponding to the image to be processed, wherein the target image is obtained by denoising the reference posture image according to the image to be processed, and the image processing model comprises a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit. It is realized that images of different postures are generated for the image to be processed, and the user does not need to obtain images of different postures through manual methods, which greatly reduces the workload and burden of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of image processing technology, and in particular to an image processing method, a training method for an image processing model, and an image generation method. Background Art

[0002] With the rapid development of multimedia technology, more and more users have begun to have higher demands for images. For example, in e-commerce scenarios, merchants need to take pictures of models in different poses for the same clothing style to display the goods, but taking more pictures of models will cost merchants a lot. For another example, users need to obtain images of the same person in different poses, which often requires users to use photo editing software to edit the pictures themselves. If the number of edited pictures is large, it will increase the burden of editing pictures for users. Therefore, there is an urgent need for a method to generate images of different poses for users to reduce the burden on users. Summary of the invention

[0003] In view of this, the embodiments of this specification provide an image processing method, a training method of an image processing model, and an image generation method. One or more embodiments of this specification also relate to an image processing device, a training device of an image processing model, an image generation device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.

[0004] According to a first aspect of an embodiment of this specification, there is provided an image processing method, including:

[0005] Acquire an image to be processed and a reference posture image corresponding to the image to be processed;

[0006] The image to be processed and the reference posture image are input into an image processing model to obtain a target image corresponding to the image to be processed, wherein the target image is obtained by denoising the reference posture image according to the image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit.

[0007] According to a second aspect of the embodiments of this specification, there is provided an image processing apparatus, including:

[0008] An acquisition module is configured to acquire an image to be processed and a reference posture image corresponding to the image to be processed;

[0009] An input module is configured to input the image to be processed and the reference posture image into an image processing model to obtain a target image corresponding to the image to be processed, wherein the target image is obtained by denoising the reference posture image according to the image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit.

[0010] According to a third aspect of an embodiment of this specification, a training method for an image processing model is provided, which is applied to a cloud-side device, including:

[0011] Acquire sample training data, wherein the sample training data includes a sample image, a sample reference image corresponding to the sample image, and a sample posture image corresponding to the sample image;

[0012] Inputting the sample image and the sample reference image into an image processing model to obtain a predicted posture image;

[0013] Calculating a loss value of the image processing model according to the predicted posture image and the sample posture image;

[0014] Adjusting the model parameters of the image processing model according to the loss value, and continuing to train the image processing model until a training stop condition is reached;

[0015] Feedback the trained image processing model parameters to the target terminal.

[0016] According to a fourth aspect of an embodiment of this specification, a training device for an image processing model is provided, which is applied to a cloud-side device, including:

[0017] A data acquisition module is configured to acquire sample training data, wherein the sample training data includes a sample image, a sample reference image corresponding to the sample image, and a sample posture image corresponding to the sample image;

[0018] A data input module, configured to input the sample image and the sample reference image into an image processing model to obtain a predicted posture image;

[0019] a calculation module, configured to calculate a loss value of the image processing model according to the predicted posture image and the sample posture image;

[0020] A training module, configured to adjust a model parameter of the image processing model according to the loss value, and continue to train the image processing model until a training stop condition is reached;

[0021] The feedback module is configured to feed back the trained image processing model parameters to the target terminal.

[0022] According to a fifth aspect of the embodiments of this specification, there is provided an image generation method, which is applied to a cloud-side device, including:

[0023] In response to an image generation instruction sent by a target terminal, sending at least one preset model posture image to the target terminal;

[0024] Acquire a reference model posture image and a model image to be processed returned by the target terminal based on the at least one preset model posture image;

[0025] Inputting the model image to be processed and the reference model posture image into an image processing model to obtain a target model image corresponding to the model image to be processed, wherein the target model image is obtained by denoising the reference model posture image according to the model image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit;

[0026] The target model image is sent to the target terminal.

[0027] According to a sixth aspect of the embodiments of this specification, there is provided an image generation device, which is applied to a cloud-side device, including:

[0028] A first sending module is configured to send at least one preset model posture image to the target terminal in response to an image generation instruction sent by the target terminal;

[0029] An image acquisition module, configured to acquire a reference model posture image and a model image to be processed returned by the target terminal based on the at least one preset model posture image;

[0030] An image input module is configured to input the model image to be processed and the reference model posture image into an image processing model to obtain a target model image corresponding to the model image to be processed, wherein the target model image is obtained by denoising the reference model posture image according to the model image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit;

[0031] The second sending module is configured to send the target model image to the target terminal.

[0032] According to a seventh aspect of an embodiment of this specification, there is provided a computing device, including:

[0033] Memory and processor;

[0034] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned image processing method or image processing model training method or image generation method are implemented.

[0035] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned image processing method or image processing model training method or image generation method.

[0036] According to the ninth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned image processing method or image processing model training method or image generation method.

[0037] An embodiment of the present specification realizes image processing on a to-be-processed image and a reference posture image through an image processing model, specifically, a feature extraction unit and a denoising unit based on the image processing model, denoising the reference posture image according to the to-be-processed image to generate a target image, so that the target image has a posture corresponding to the reference posture image, thereby realizing generation of images of different postures for the to-be-processed image, without the need for the user to obtain images of different postures through manual methods, thereby greatly reducing the user's workload and burden. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a schematic diagram of an application scenario of an image processing method provided by an embodiment of this specification;

[0039] Figure 2 is a flow chart of an image processing method provided by an embodiment of this specification;

[0040] Figure 3 is a schematic diagram of a reference posture image provided by an embodiment of this specification;

[0041] Figure 4 It is a schematic diagram of the architecture of an image processing model provided by an embodiment of this specification;

[0042] Figure 5 It is a processing flow diagram of an image processing model provided by an embodiment of this specification;

[0043] Figure 6 is a processing flow chart of an image processing method provided by an embodiment of this specification;

[0044] Figure 7is a structural schematic diagram of an image processing device provided by an embodiment of this specification;

[0045] Figure 8 is a flowchart of a training method for an image processing model provided by an embodiment of this specification;

[0046] Fig. 9 It is a structural schematic diagram of a training device for an image processing model provided by an embodiment of this specification;

[0047] Fig.10 is a flow chart of an image generation method provided by an embodiment of this specification;

[0048] Fig.11 is a structural schematic diagram of an image generating device provided by an embodiment of this specification;

[0049] Fig.12 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0050] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0051] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0052] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0053] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0054] First, the terms involved in one or more embodiments of this specification are explained.

[0055] Stable Diffusion: A network structure for generation tasks, mainly composed of a variational autoencoder (VAE) and an image information creator (Unet) structure.

[0056] VAE (Variational Autoencoder): Variational Autoencoder is a generative model widely used in the field of machine learning. VAE consists of an encoder and a decoder, and can be applied to a variety of scenarios such as image generation, text generation, style transfer, etc.

[0057] With the rapid development of multimedia technology, more and more users have begun to have higher demands for images. For example, in e-commerce scenarios, merchants need to take pictures of models in different poses for the same clothing style to display the products, but taking more pictures of models will cost merchants a lot. For another example, users need to obtain images of the same person in different poses, which often requires users to use photo editing software to edit the pictures themselves. If the number of edited pictures is large, it will increase the burden of editing pictures for users.

[0058] In this specification, an image processing method, a training method for an image processing model and an image generation method are provided. This specification also involves an image processing device, a training device for an image processing model and an image generation device, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.

[0059] See also Figure 1 , Figure 1A schematic diagram of an application scenario of an image processing method provided according to an embodiment of the present specification is shown. In practical applications, taking the application of e-commerce scenarios as an example, before selling goods, merchants often take different model pictures for the same goods in order to achieve better sales results. These model pictures include model pictures with different poses, so that purchasing users can understand the goods in more detail to determine whether to buy the corresponding goods. However, these product model pictures are usually taken by merchants themselves or obtained using photo editing software, which will consume a lot of time and energy of merchants, and cost labor costs, which is a heavy burden for merchants.

[0060] Based on this, in one or more embodiments provided in this specification, an image processing method is provided, which can obtain the image to be processed and the reference pose image provided by the user (merchant), and process the image to be processed and the reference pose image based on the image processing model to generate a target image corresponding to the image to be processed, and the pose of the model in the target image is the same as that in the reference pose image. Figure 1 The sales interface corresponding to any product is shown. The products displayed on the sales interface include five different model display pictures. Based on the image processing method provided in this specification, the merchant only needs to provide any one of the five model display pictures and provide reference posture images corresponding to the other four model display pictures. The image processing model extracts features from the model display pictures provided by the merchant through the feature extraction unit, and inputs the extracted image features into the denoising unit. The denoising unit denoises the reference posture image with the image features as the denoising condition, and generates a target image corresponding to the reference posture image. In the image processing model provided in this specification, the feature extraction unit is obtained by pruning the denoising unit, so as to realize the lightweight of the image processing model, reduce the reasoning complexity of the image processing model, shorten the image processing time, and improve the efficiency of image processing.

[0061] It should be noted that the above-mentioned e-commerce scenario is only used as an example scenario for the image processing method provided in this specification. The image processing method provided in this specification is not limited to the above-mentioned e-commerce scenario, but can also be applied to other application scenarios that require generating images of different postures.

[0062] See also Figure 2 , Figure 2 A flowchart of an image processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0063] Step 202: Acquire an image to be processed and a reference posture image corresponding to the image to be processed.

[0064] Among them, the image to be processed refers to an image containing the object to be processed; the object to be processed refers to a person, animal or plant that needs to change its posture. The object to be processed can be a real person, animal or plant, or a virtual person, virtual animal or virtual plant. The reference posture image refers to an image containing a reference posture; the reference posture refers to the posture of the object to be processed after the posture is changed. For example, the image to be processed contains person a, and the posture of person a in the image to be processed is standing. It is necessary to change the posture of task a from standing to sitting, then the image containing the sitting posture is the reference posture image.

[0065] In practical applications, the specific expression of the reference posture can be a skeleton posture. In order to improve the accuracy of processing the image to be processed, the skeleton posture can also be annotated with posture key points to increase the density of the skeleton posture, so that when the image processing model processes the reference posture image, it can combine these posture key points for image processing, thereby improving the accuracy of subsequent image processing. Furthermore, the reference posture image can be an image containing a skeleton posture.

[0066] See also Figure 3 , Figure 3 FIG. 1 shows a schematic diagram of a reference posture image provided according to an embodiment of the present specification. Figure 3 The figure shows the reference pose image of the character. Figure 3 The reference pose image shown not only shows the reference pose that needs to be transformed for the object to be processed, but also annotates the pose key points, specifically the body key points, foot key points, and hand mesh information ( Figure 3 middle rectangular part).

[0067] In practical applications, the reference posture image may be provided by the user himself, or the server may provide a plurality of preset posture images to the user, and the user may select and determine the reference posture image from the plurality of preset posture images.

[0068] In a specific implementation manner provided in this specification, obtaining a reference posture image corresponding to the image to be processed includes:

[0069] Receiving an image generation instruction sent by a target terminal;

[0070] In response to the image generation instruction, sending at least one preset posture image to the target terminal;

[0071] A reference posture image returned by the target terminal based on the at least one preset posture image is acquired.

[0072] The image generation instruction refers to an instruction generated by the target terminal for obtaining a target image corresponding to the image to be processed. The target image refers to an image after the posture of the object to be processed in the image to be processed is transformed based on the reference posture image. The preset posture image refers to a pre-constructed reference posture image.

[0073] Specifically, when the target terminal has a need to generate a target image, an image generation instruction can be generated and sent to the server. After receiving the image generation instruction sent by the target terminal, the server obtains at least one preset posture image and sends the obtained at least one preset posture image to the target terminal. The target terminal can determine one of the at least one preset posture image as a reference posture image for subsequent image processing of the image to be processed, and send the selected reference posture image to the server. Furthermore, the target terminal can carry the image to be processed in the image generation instruction and send it to the server. After receiving the reference posture image subsequently returned by the target terminal, the server can perform image processing based on the image to be processed and the reference posture image; the target terminal can also send the image to be processed to the server together with the image to be processed when returning the reference posture image to the server.

[0074] Furthermore, the image to be processed can be a video frame, and the target image generated based on the image processing method is the video frame at different moments. Based on this, the image processing method provided in this specification can also be applied to video editing scenarios. For example, when the object to be processed is an animated character, the image processing method provided in this specification can generate a video frame at any moment in the animated video for the animated character, so as to be used for subsequent video editing processing.

[0075] Step 204: Input the image to be processed and the reference posture image into an image processing model to obtain a target image corresponding to the image to be processed, wherein the target image is obtained by denoising the reference posture image according to the image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit.

[0076] After obtaining the image to be processed and the reference posture image corresponding to the image to be processed, the image to be processed and the reference posture image can be input into the image processing model. After the image processing model processes the image to be processed and the reference posture image, a target image with a different posture from that in the image to be processed is generated.

[0077] The image processing model refers to a model that generates a target image based on the image to be processed and the reference pose image, and the pose of the object to be processed in the image to be processed is different from that in the target image. In practical applications, the image processing model can be a diffusion model, a stable diffusion model, etc.

[0078] See also Figure 4 , Figure 4 The schematic diagram of the architecture of an image processing model provided according to one embodiment of the present specification is shown. The image processing model may specifically include a feature extraction unit, a denoising unit, a first image encoder, a second image encoder, a posture encoder, a local encoder, and an image decoder.

[0079] A feature extraction unit is used to extract visual features of the image to be processed. A denoising unit is used to perform cyclic denoising on the reference pose image. The feature extraction unit and the denoising unit can specifically be a Unet structure. The first image encoder and the image decoder can specifically constitute the encoder and decoder of a VAE, and the second image encoder can specifically be an image encoder in a CLIP (Contrastive Language-Image Pre-training) model or other models. The first image encoder and the second image encoder are both used to encode the image to be processed. A pose encoder is used to encode the reference pose image. A local encoder is used to encode the local part image of the object to be processed.

[0080] Since the local encoder is used to encode the local part image of the object to be processed, that is, when processing the image to be processed, the local part information of the object to be processed is combined, thereby improving the accuracy of generating the target image. Therefore, when the object to be processed is not a person or an animal, there is no need to use the local encoder to encode the local part image of the object to be processed. In this case, the local encoder may not be deployed in the image processing model.

[0081] The following explains the specific processing process of the image processing model.

[0082] In a specific implementation provided in this specification, the image processing model includes an image encoder and an image decoder;

[0083] Inputting the image to be processed and the reference posture image into an image processing model to obtain a target image corresponding to the image to be processed, including:

[0084] Inputting the image to be processed into the image encoder to obtain image coding features corresponding to the image to be processed, and inputting the reference posture image into the image encoder to obtain posture coding features corresponding to the reference posture image;

[0085] Inputting the image coding feature into the feature extraction unit to obtain image extraction features;

[0086] Inputting the image extraction feature, the image coding feature and the posture coding feature into the denoising unit to obtain a target image feature;

[0087] The target image features are input into the image decoder to obtain the target image.

[0088] Among them, image coding features refer to coding features obtained after encoding the processed image; posture coding features refer to coding features obtained after encoding the reference posture image; image extraction features refer to visual features obtained after feature extraction of the processed image based on the feature extraction unit, specifically extracted features obtained after feature extraction of image coding features; target image features refer to image features generated after denoising the posture coding features based on image coding features and image extraction features.

[0089] Specifically, after obtaining the image to be processed and the reference posture image, the image to be processed and the reference posture image are respectively input into the image encoder of the image processing model, and the image coding features corresponding to the image to be processed and the posture coding features corresponding to the reference posture image can be obtained. The image coding features obtained by encoding are input into the feature extraction unit of the image processing model, and the image extraction features of the image to be processed can be obtained. Furthermore, the image extraction features, image coding features and posture coding features are input into the denoising unit of the image processing model, and the image extraction features and image coding features are used as denoising conditions to denoise the posture coding features to obtain the target image features, and then the target image features are input into the image decoder of the image processing model, and the image decoder decodes the obtained target image features to obtain the target image, and the posture of the object to be processed in the target image is the same as the reference posture in the reference posture image.

[0090] When the object to be processed is a person or animal with various body parts such as face, hands, and feet, in order to improve the image quality of the generated target image, the important parts of the object to be processed can be cropped to focus on processing the cropped parts. In actual applications, the parts that need to be focused on in the subsequent processing can be customized by the user, such as face, feet, etc.

[0091] Based on this, in a specific implementation manner provided in this specification, the method further includes:

[0092] Identifying a target part in the image to be processed;

[0093] According to the target part, the image to be processed is cropped to obtain an image of the target part.

[0094] The target part refers to any part of the object to be processed that needs to be cropped. The target part image refers to an image containing the target part.

[0095] Specifically, when it is necessary to process an important part of the object to be processed, the target part in the image to be processed is identified, the area of ​​the target part in the image to be processed is determined according to the target part, and the image to be processed is cropped according to the area where the target part is located to obtain a target part image that only contains the target part.

[0096] For example, if the object to be processed in the image to be processed is person A, and it is determined that the face of person A needs to be cropped, then the target part is the face of person A. The face of person A is identified in the image to be processed, and the area where the face of person A is located is cropped from the image to be processed to obtain a facial image containing the face of person A.

[0097] Based on this, the implementation process of inputting the image to be processed into the image encoder of the image processing model and obtaining the image coding features corresponding to the image to be processed is specifically as follows:

[0098] In a specific implementation provided in this specification, the image encoder includes a first image encoder, a second image encoder and a local encoder;

[0099] Inputting the image to be processed into the image encoder to obtain image coding features corresponding to the image to be processed includes:

[0100] Inputting the image to be processed into the first image encoder to obtain a first image coding feature corresponding to the image to be processed;

[0101] Inputting the image to be processed into the second image encoder to obtain a second image coding feature corresponding to the image to be processed;

[0102] The target part image is input into the local encoder to obtain the target part coding feature corresponding to the target part image.

[0103] Among them, the first image coding feature refers to the coding feature obtained after the first image encoder encodes the processed image; the second image coding feature refers to the coding feature obtained after the second image encoder encodes the processed image; the target part coding feature refers to the coding feature obtained after the local encoder encodes the target part image.

[0104] Specifically, the image to be processed is input into the image encoder of the image processing model, that is, the image to be processed is input into the first image encoder of the image processing model to obtain the first image coding feature corresponding to the image to be processed, and the image to be processed is input into the second image encoder of the image processing model to obtain the second image coding feature corresponding to the image to be processed. Since when the object to be processed is a person or an animal, the target part of the object to be processed can be cropped to obtain the target part image, therefore, the target part image can also be input into the local encoder deployed in the image processing model to obtain the target part coding feature corresponding to the target part image.

[0105] Accordingly, the reference posture image is input into the image encoder of the image processing model, and the implementation process of obtaining the posture encoding feature is as follows:

[0106] In a specific implementation provided in this specification, the image encoder includes a posture encoder;

[0107] Inputting the reference posture image into the image encoder to obtain posture coding features corresponding to the reference posture image includes:

[0108] The reference posture image is input into the posture encoder to obtain posture coding features corresponding to the reference posture image.

[0109] Specifically, the reference posture image is input into the image encoder of the image processing model, that is, the acquired reference posture image is input into the posture encoder of the image processing model to obtain the posture coding features corresponding to the reference posture image.

[0110] Furthermore, after obtaining the first image coding feature, the first image coding feature can be calculated by a feature extraction unit of the image processing model to extract the image visual feature of the image to be processed.

[0111] In a specific implementation manner provided in this specification, the image coding feature is input into the feature extraction unit to obtain the image extraction feature, including:

[0112] Inputting the first image coding feature into the feature extraction unit to obtain a key feature to be processed and a value feature to be processed;

[0113] The key feature to be processed and the value feature to be processed are determined as image extraction features.

[0114] The key feature to be processed refers to the key feature of the image to be processed obtained based on the self-attention calculation, and is specifically expressed in the form of a key feature vector, i.e., a key feature vector. The value feature to be processed refers to the value feature of the image to be processed obtained based on the self-attention calculation, and is specifically expressed in the form of a value feature vector, i.e., a value feature vector.

[0115] Specifically, after obtaining the first image coding feature, the first image coding feature is input into the feature extraction unit of the image processing model, so as to extract the visual features of the image to be processed by calculating the first image coding feature. In practical applications, the feature extraction unit includes a self-attention subunit, and the first image coding feature is input into the feature extraction unit, specifically, the first image coding feature is input into the self-attention subunit of the feature extraction unit, and the key feature to be processed and the value feature to be processed of the first image coding feature are obtained by performing self-attention calculation on the first image coding feature, and the key feature to be processed and the value feature to be processed are determined as the image extraction features of the image to be processed.

[0116] Since the image visual features extracted from the image to be processed are the same at any time step, and since the feature extraction unit is only used to extract features from the image to be processed, it is not necessary to perform iterative denoising when extracting features from the image to be processed based on the feature extraction unit. Therefore, in one or more embodiments provided in this specification, the method for obtaining the feature extraction unit is as follows:

[0117] In a specific implementation provided in this specification, the method further includes:

[0118] Acquire the denoising unit, and copy the denoising unit to obtain a feature extraction unit to be determined;

[0119] Identify the cross-attention sub-unit in the feature extraction unit to be determined, and delete the cross-attention sub-unit in the feature extraction unit to be determined from the feature extraction unit to be determined, so as to obtain a feature extraction unit.

[0120] The feature extraction unit to be determined refers to a unit obtained by copying the denoising unit.

[0121] In practical applications, iterative denoising is often performed in cross-attention sub-units. In one or more embodiments provided in this specification, the feature extraction unit does not need to perform iterative denoising. Therefore, after acquiring and copying the denoising unit to obtain the feature extraction unit to be determined, the cross-attention sub-units existing in the feature extraction unit to be determined can be identified, and the identified cross-attention sub-units can be deleted from the feature extraction unit to be determined to obtain the feature extraction unit.

[0122] By deleting the cross-attention sub-unit in the feature extraction unit to be determined, it is no longer necessary to perform iterative denoising when the feature extraction unit is running. Without affecting the processing of the first image coding feature, the processing speed of the image processing model is improved and the processing time is shortened.

[0123] Accordingly, the feature extraction unit to be determined is obtained by replicating the denoising unit, and therefore, the denoising unit also includes a self-attention subunit and a cross-attention subunit. The denoising unit is used to denoise the reference posture image, and therefore, the noise data also needs to be input into the denoising unit.

[0124] In a specific implementation provided in this specification, the denoising unit includes a self-attention subunit and a cross-attention subunit;

[0125] Inputting the image extraction feature, the image coding feature and the posture coding feature into the denoising unit to obtain the target image feature includes:

[0126] Splicing the second image coding feature and the target part coding feature to obtain an image splicing feature;

[0127] Inputting the posture encoding feature and preset noise data into the denoising unit, inputting the image extraction feature into the self-attention subunit, and inputting the image splicing feature into the cross-attention subunit;

[0128] The posture coding feature is denoised according to the image extraction feature and the image stitching feature to obtain a denoised posture feature, the denoised posture feature is determined as a new posture coding feature, and the step of denoising the posture coding feature according to the image extraction feature and the image stitching feature is continued until the iteration stop condition is reached to obtain the target image feature.

[0129] Specifically, after obtaining the second image coding feature and the target part coding feature, the second image coding feature and the target part coding feature are feature spliced ​​to obtain an image splicing feature. The posture coding feature and the preset noise data are input into the denoising unit, the image extraction feature, i.e., the key feature to be processed and the value feature to be processed, are input into the self-attention subunit of the denoising unit, the image splicing feature is input into the cross-attention subunit of the denoising unit, and the posture coding feature is guided to be denoised through the image splicing feature, the key feature to be processed and the value feature to be processed to obtain the denoised posture feature. At this point, the first iterative denoising of the posture coding feature is completed. The denoised posture feature is used as a new posture coding feature, and the new posture coding feature (i.e., the denoised posture feature) is continuously denoised until the iteration is completed to obtain the target image feature. Further, after the iterative denoising is completed, the obtained target image feature is input into the image decoder, and the target image feature is decoded to obtain the target image.

[0130] The target image is obtained by denoising the reference posture image based on the image to be processed. Therefore, the posture of the object to be processed in the target image is the same as the reference posture in the reference posture image. Therefore, the posture of the object to be processed in the generated target image is different from the posture of the object to be processed in the image to be processed.

[0131] See also Figure 5 , Figure 5 FIG. 1 shows a processing flow diagram of an image processing model provided according to an embodiment of the present specification. Figure 5 As shown, the image to be processed and the reference posture image corresponding to the image to be processed are obtained, and the image to be processed is input into the first image encoder of the image processing model to obtain the first image coding feature. The obtained first image coding feature is input into the feature extraction unit of the image processing model, specifically the self-attention subunit of the input feature extraction unit, and the key feature to be processed and the value feature to be processed are obtained by performing self-attention calculation on the first image coding feature, and the key feature to be processed and the value feature to be processed are input into the denoising unit of the image processing model, specifically the self-attention subunit of the input denoising unit. The image to be processed is input into the second image encoder of the image processing model to obtain the second image coding feature. In order to improve the accuracy of the generated target image, the target part of the object to be processed is identified, and the image to be processed is cropped to obtain the target part image. The target part image is input into the local encoder of the image processing model, and the target part image is encoded to obtain the target part coding feature. Further, the second image coding feature and the target part coding feature are feature spliced ​​to obtain the image splicing feature, and the image splicing feature is input into the denoising unit of the image processing model, specifically the image splicing feature is input into the cross attention subunit of the denoising unit.

[0132] The reference posture image is input into the posture encoder of the image processing model, and the reference posture image is encoded to obtain the posture encoding feature. The preset noise data and the posture encoding feature are input into the denoising unit of the image processing model, that is, the posture encoding feature is added to the preset noise data and input into the denoising unit. In the denoising unit, the key feature to be processed, the value feature to be processed and the image splicing feature are used as the guiding conditions for denoising the posture encoding feature after the addition of noise to obtain the denoised posture feature. The obtained denoised posture feature is used as the new posture encoding feature, and iterative denoising is continued until the iterative denoising is completed to obtain the target image feature. The denoised target image feature is input into the image decoder of the image processing model, and the target image feature is decoded to obtain the target image.

[0133] The image processing method provided in this specification deletes the cross-attention sub-unit in the feature extraction unit so that the feature extraction unit does not need to participate in iterative denoising during operation, thereby improving the processing efficiency of the image processing model, performing image processing in combination with the target part of the object to be processed, and improving the accuracy of the generated target image.

[0134] Furthermore, the training process of the image processing model is as follows:

[0135] In a specific implementation manner provided in this specification, the image processing model is trained according to the following method:

[0136] Acquire sample training data, wherein the sample training data includes a sample image, a sample reference image corresponding to the sample image, and a sample posture image corresponding to the sample image;

[0137] Inputting the sample image and the sample reference image into the image processing model to obtain a predicted posture image;

[0138] Calculating a loss value of the image processing model according to the predicted posture image and the sample posture image;

[0139] The model parameters of the image processing model are adjusted according to the loss value, and the image processing model is continued to be trained until a training stop condition is reached.

[0140] The sample training data refers to the sample data used to train the image processing model, and the sample training data includes the sample image, the sample reference image corresponding to the sample image, and the sample pose image corresponding to the sample image. The sample image is the image to be processed that needs to be processed by the image processing model during the training of the image processing model; the sample reference image is the reference pose image that needs to be processed by the image processing model during the training of the image processing model, that is, the reference pose image corresponding to the sample image; the sample pose image is the actual pose image after the sample image is processed.

[0141] The sample training data may be sample data (including sample images, sample reference images and sample pose images) obtained from a sample training data set, or may be image pairs (including sample images, sample reference images and sample pose images) created in a customized manner before training the image processing model; the sample training data set refers to a set consisting of sample images, sample reference images and sample pose images; the predicted pose image refers to a pose image after image processing that is output when the sample image and the sample reference image are input into the image processing model; the loss value refers to the difference between the sample pose image and the predicted pose image, which is used to measure the difference between the sample pose image and the predicted pose image.

[0142] Specifically, the sample image, the sample reference image and the sample posture image are obtained by the above-mentioned method of obtaining the sample image, the sample reference image and the sample posture image, and the sample image and the sample reference image are input into the image processing model to obtain the predicted posture image.

[0143] The image processing model is used to generate sample pose images of sample images. At this time, the image processing model is an untrained model. There will be a deviation between the determined predicted pose image and the actual sample pose image, and the model parameters of the image processing model need to be adjusted accordingly. Specifically, the loss value of the image processing model is calculated based on the output predicted pose image and the sample pose image. The loss function for calculating the loss value can be a 0-1 loss function, a square loss function, a cross entropy loss function, etc. in actual applications. In this specification, preferably, a cross entropy loss function or a square loss function is selected as the loss function for calculating the loss value, and the model parameters of the image processing model are adjusted according to the loss value. The image processing model is continued to be trained based on the adjusted model parameters for the next batch of sample training data until the stop condition of the model training is reached.

[0144] Specifically, the model training stopping conditions include that the loss value is less than a preset threshold and / or the training rounds reach a preset round.

[0145] In a specific implementation provided in this specification, taking the loss value being less than a preset threshold as the training stop condition as an example, the preset threshold is 0.2. When the loss value is less than 0.2, it is considered that the image processing model training is completed.

[0146] In another specific implementation provided in the present specification, taking the preset training rounds as the training stop condition as an example, the preset training rounds are 30 rounds. When the training rounds of the training sample training data reach 30 rounds, the image processing model training is considered to be completed.

[0147] In another specific implementation provided in the present specification, two training stop conditions, a preset threshold and a preset training round, are set, and the loss value and the training round are determined at the same time. When either the loss value or the training round meets the training stop condition, the image processing model training is considered to be completed.

[0148] It should be noted that in one or more embodiments provided in this specification, the image processing model is trained based on a pre-trained image processing model. During the training of the image processing model, the model parameters of the first image encoder, the second image encoder and the local encoder may be frozen, that is, the first image encoder, the second image encoder and the local encoder do not participate in the model training, and the feature extraction unit, the denoising unit and the posture encoder are trained.

[0149] The image processing method provided in this specification includes: obtaining an image to be processed and a reference posture image corresponding to the image to be processed; inputting the image to be processed and the reference posture image into an image processing model to obtain a target image corresponding to the image to be processed, wherein the target image is obtained by denoising the reference posture image according to the image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit.

[0150] One or more embodiments of the present specification achieve the following: pruning the cross-attention sub-unit in the feature extraction unit to achieve lightweight image processing model, shorten the processing time of the image processing model, and improve image processing efficiency; since the feature extraction of the image to be processed is achieved through the self-attention sub-unit, pruning the cross-attention sub-unit will not affect the feature extraction process, thereby ensuring the accuracy of image processing; adding foot key points and hand mesh information to the reference pose image to improve the density and accuracy of the reference pose; based on the feature extraction unit and denoising unit of the image processing model, the reference pose image is denoised according to the image to be processed to generate a target image, so that the target image has the pose corresponding to the reference pose image, thereby generating images of different poses for the image to be processed, without the need for the user to obtain images of different poses through manual methods, thereby reducing the user's workload and burden.

[0151] The following combination Figure 6 , taking the application of the image processing method provided in this specification in an e-commerce scenario as an example, the image processing method is further described. Figure 6 A flowchart of an image processing method provided by an embodiment of the present specification is shown. Figure 6As shown, the image processing model includes a VAE encoder, a VAE decoder, a posture encoder, an image encoder, a face encoder, a feature extraction unit, and a denoising unit. The model image to be processed and the reference model posture image corresponding to the model image to be processed are obtained, and the model image to be processed is input into the VAE encoder of the image processing model to obtain a first image coding feature. The obtained first image coding feature is input into the feature extraction unit of the image processing model, specifically, the first image coding feature is input into the self-attention subunit of the feature extraction unit, and the image key feature and the image value feature are obtained by performing self-attention calculation on the first image coding feature, and the image key feature and the image value feature are input into the denoising unit of the image processing model, specifically, the image key feature and the image value feature are input into the self-attention subunit of the denoising unit. Since the visual features extracted from the model image to be processed are the same at any time step, and since the feature extraction unit is only used to extract features from the model image to be processed, there is no need to perform iterative denoising when extracting features from the model image to be processed based on the feature extraction unit. Based on this, in order to improve the lightweight of the image processing model and the processing efficiency of the image processing model, the cross-attention sub-unit in the feature extraction unit can be pruned, and feature extraction can be performed based on the pruned feature extraction unit.

[0152] The model image to be processed is input into the image encoder of the image processing model to obtain a second image coding feature. In order to improve the accuracy of the generated target model image, the model image to be processed is cropped by identifying the face of the model in the model image to be processed to obtain a face part image. The facial image is input into the face encoder of the image processing model to encode the facial image to obtain a facial coding feature. Furthermore, the second image coding feature is feature spliced ​​with the facial coding feature to obtain an image splicing feature, and the image splicing feature is input into the denoising unit of the image processing model, specifically, the image splicing feature is input into the cross attention subunit of the denoising unit.

[0153] The reference model pose image is input into the pose encoder of the image processing model, and the reference model pose image is encoded to obtain pose encoding features. The noise data and pose encoding features are input into the denoising unit of the image processing model, that is, the pose encoding features are added to the noise data and input into the denoising unit. In the denoising unit, the image key features, image value features and image splicing features are used as guiding conditions for denoising the pose encoding features after adding noise to obtain denoised pose features. The obtained denoised pose features are used as new pose encoding features, and iterative denoising is continued until the iterative denoising is completed to obtain the target image features. The denoised target image features are input into the VAE decoder of the image processing model, and the target image features are decoded to obtain the target model image.

[0154] An embodiment of the present specification realizes pruning the cross-attention sub-unit in the feature extraction unit, realizes the lightweight of the image processing model, shortens the processing time of the image processing model, and improves the image processing efficiency; since the feature extraction of the model image to be processed is realized through the self-attention sub-unit, pruning the cross-attention sub-unit will not affect the feature extraction process, thereby ensuring the accuracy of image processing; based on the feature extraction unit and the denoising unit of the image processing model, the reference model posture image is denoised according to the model image to be processed, and a target model image is generated, so that the target model image has the posture corresponding to the reference model posture image, thereby realizing the generation of images with different postures for the model image to be processed, without the need for the user to obtain images with different postures through manual methods, thereby reducing the user's workload and burden.

[0155] Corresponding to the above method embodiment, this specification also provides an image processing device embodiment, Figure 7 FIG. 2 shows a schematic diagram of the structure of an image processing device provided by an embodiment of the present specification. Figure 7 As shown, the device comprises:

[0156] An acquisition module 702 is configured to acquire an image to be processed and a reference posture image corresponding to the image to be processed;

[0157] The input module 704 is configured to input the image to be processed and the reference posture image into an image processing model to obtain a target image corresponding to the image to be processed, wherein the target image is obtained by denoising the reference posture image according to the image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit.

[0158] Optionally, the image processing model includes an image encoder and an image decoder;

[0159] The input module 704 is further configured to:

[0160] Inputting the image to be processed into the image encoder to obtain image coding features corresponding to the image to be processed, and inputting the reference posture image into the image encoder to obtain posture coding features corresponding to the reference posture image;

[0161] Inputting the image coding feature into the feature extraction unit to obtain image extraction features;

[0162] Inputting the image extraction feature, the image coding feature and the posture coding feature into the denoising unit to obtain a target image feature;

[0163] The target image features are input into the image decoder to obtain the target image.

[0164] Optionally, the device further comprises:

[0165] A recognition module, configured to recognize a target part in the image to be processed;

[0166] The cropping module is configured to crop the image to be processed according to the target part to obtain an image of the target part.

[0167] Optionally, the image encoder includes a first image encoder, a second image encoder and a local encoder;

[0168] The input module 704 is further configured to:

[0169] Inputting the image to be processed into the first image encoder to obtain a first image coding feature corresponding to the image to be processed;

[0170] Inputting the image to be processed into the second image encoder to obtain a second image coding feature corresponding to the image to be processed;

[0171] The target part image is input into the local encoder to obtain the target part coding feature corresponding to the target part image.

[0172] Optionally, the input module 704 is further configured to:

[0173] Inputting the first image coding feature into the feature extraction unit to obtain a key feature to be processed and a value feature to be processed;

[0174] The key feature to be processed and the value feature to be processed are determined as image extraction features.

[0175] Optionally, the denoising unit includes a self-attention subunit and a cross-attention subunit;

[0176] The input module 704 is further configured to:

[0177] Splicing the second image coding feature and the target part coding feature to obtain an image splicing feature;

[0178] Inputting the posture encoding feature and preset noise data into the denoising unit, inputting the image extraction feature into the self-attention subunit, and inputting the image splicing feature into the cross-attention subunit;

[0179] The posture coding feature is denoised according to the image extraction feature and the image stitching feature to obtain a denoised posture feature, the denoised posture feature is determined as a new posture coding feature, and the step of denoising the posture coding feature according to the image extraction feature and the image stitching feature is continued until the iteration stop condition is reached to obtain the target image feature.

[0180] Optionally, the image encoder includes a posture encoder;

[0181] The input module 704 is further configured to:

[0182] The reference posture image is input into the posture encoder to obtain posture coding features corresponding to the reference posture image.

[0183] Optionally, the device further comprises:

[0184] A copy module is configured to obtain the denoising unit and copy the denoising unit to obtain a feature extraction unit to be determined;

[0185] The deletion module is configured to identify the cross-attention sub-unit in the feature extraction unit to be determined, and delete the cross-attention sub-unit in the feature extraction unit to be determined from the feature extraction unit to be determined, so as to obtain a feature extraction unit.

[0186] Optionally, the acquisition module 702 is further configured to:

[0187] Receiving an image generation instruction sent by a target terminal;

[0188] In response to the image generation instruction, sending at least one preset posture image to the target terminal;

[0189] A reference posture image returned by the target terminal based on the at least one preset posture image is acquired.

[0190] Optionally, the device further includes a model training module configured to:

[0191] Acquire sample training data, wherein the sample training data includes a sample image, a sample reference image corresponding to the sample image, and a sample posture image corresponding to the sample image;

[0192] Inputting the sample image and the sample reference image into the image processing model to obtain a predicted posture image;

[0193] Calculating a loss value of the image processing model according to the predicted posture image and the sample posture image;

[0194] The model parameters of the image processing model are adjusted according to the loss value, and the image processing model is continued to be trained until a training stop condition is reached.

[0195] The image processing device provided in this specification includes: an acquisition module, configured to acquire an image to be processed and a reference posture image corresponding to the image to be processed; an input module, configured to input the image to be processed and the reference posture image into an image processing model to obtain a target image corresponding to the image to be processed, wherein the target image is obtained by denoising the reference posture image according to the image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit.

[0196] One or more embodiments of the present specification achieve the following: pruning the cross-attention sub-unit in the feature extraction unit to achieve lightweight image processing model, shorten the processing time of the image processing model, and improve image processing efficiency; since the feature extraction of the image to be processed is achieved through the self-attention sub-unit, pruning the cross-attention sub-unit will not affect the feature extraction process, thereby ensuring the accuracy of image processing; adding foot key points and hand mesh information to the reference pose image to improve the density and accuracy of the reference pose; based on the feature extraction unit and denoising unit of the image processing model, the reference pose image is denoised according to the image to be processed to generate a target image, so that the target image has the pose corresponding to the reference pose image, thereby generating images of different poses for the image to be processed, without the need for the user to obtain images of different poses through manual methods, thereby reducing the user's workload and burden.

[0197] The above is a schematic scheme of an image processing device of this embodiment. It should be noted that the technical scheme of the image processing device and the technical scheme of the above-mentioned image processing method belong to the same concept, and the details not described in detail in the technical scheme of the image processing device can be referred to the description of the technical scheme of the above-mentioned image processing method.

[0198] See also Figure 8 , Figure 8 A flowchart of a method for training an image processing model provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0199] Step 802: Acquire sample training data, wherein the sample training data includes a sample image, a sample reference image corresponding to the sample image, and a sample posture image corresponding to the sample image.

[0200] Step 804: Input the sample image and the sample reference image into an image processing model to obtain a predicted posture image.

[0201] Step 806: Calculate the loss value of the image processing model based on the predicted posture image and the sample posture image.

[0202] Step 808: Adjust the model parameters of the image processing model according to the loss value, and continue to train the image processing model until the training stop condition is reached.

[0203] Step 810: Feedback the trained image processing model parameters to the target terminal.

[0204] The training method of the image processing model is applied to the cloud-side device, and its specific implementation process is the same as the training process of the image processing model in the above-mentioned image processing method. The specific implementation process of the training method of the image processing model can refer to the training process of the image processing model in the above-mentioned image processing method, and this specification will not repeat it here. After the training of the image processing model is completed, the model parameters of the trained image processing model can be fed back to the target terminal.

[0205] By training the image processing model on the cloud-side device and feeding back the trained model parameters to the target terminal after the training is completed, it is possible to obtain the trained image processing model parameters from the cloud-side device without the user having to train the image processing model, thereby reducing the difficulty for the user to train the image processing model.

[0206] Corresponding to the above method embodiment, this specification also provides an embodiment of a training device for an image processing model. Fig. 9 FIG. 1 is a schematic diagram showing a structure of a training device for an image processing model provided by an embodiment of the present specification. Fig. 9 As shown, the device is applied to a cloud-side device, including:

[0207] The data acquisition module 902 is configured to acquire sample training data, wherein the sample training data includes a sample image, a sample reference image corresponding to the sample image, and a sample posture image corresponding to the sample image;

[0208] A data input module 904 is configured to input the sample image and the sample reference image into an image processing model to obtain a predicted posture image;

[0209] A calculation module 906 is configured to calculate a loss value of the image processing model according to the predicted posture image and the sample posture image;

[0210] A training module 908 is configured to adjust the model parameters of the image processing model according to the loss value, and continue to train the image processing model until a training stop condition is reached;

[0211] The feedback module 910 is configured to feed back the trained image processing model parameters to the target terminal.

[0212] The image processing model training device provided in this specification trains the image processing model on a cloud-side device and feeds back the trained model parameters to the target terminal after the training is completed. This eliminates the need for users to train the image processing model and allows the trained image processing model parameters to be obtained from the cloud-side device, thereby reducing the difficulty for users to train the image processing model.

[0213] The above is a schematic scheme of a training device for an image processing model of this embodiment. It should be noted that the technical scheme of the training device for the image processing model and the technical scheme of the training method for the image processing model described above belong to the same concept, and the details not described in detail in the technical scheme of the training device for the image processing model can be found in the description of the technical scheme of the training method for the image processing model described above.

[0214] See also Fig.10 , Fig.10 A flowchart of an image generation method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0215] Step 1002: In response to an image generation instruction sent by a target terminal, at least one preset model posture image is sent to the target terminal.

[0216] The image generation method is applied to a cloud-side device. The image generation instruction refers to an instruction generated by a target terminal for obtaining a target model image corresponding to a model image to be processed. The target model image refers to an image obtained by transforming the pose of a model in the model image to be processed based on a reference model pose image. The preset model pose image refers to a pre-constructed reference model pose image.

[0217] Specifically, the target terminal generates an image generation instruction and sends the image generation instruction to the cloud side device. After receiving the image generation instruction sent by the target terminal, the cloud side device obtains at least one preset model pose image and sends the obtained at least one preset model pose image to the target terminal.

[0218] Step 1004: Acquire a reference model pose image and a model image to be processed returned by the target terminal based on the at least one preset model pose image.

[0219] Specifically, the target terminal may determine one of at least one preset model pose image as a reference model pose image for subsequent image processing of the model image to be processed, and the cloud-side device may obtain the reference model pose image selected by the target terminal.

[0220] Step 1006: input the model image to be processed and the reference model posture image into an image processing model to obtain a target model image corresponding to the model image to be processed.

[0221] The target model image is obtained by denoising the reference model posture image according to the model image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit.

[0222] Step 1008: Send the target model image to the target terminal.

[0223] In the image generation method, after obtaining the model image to be processed and the reference model posture image, the specific implementation process of inputting the model image to be processed and the reference model posture image into the image processing model for image processing is the same as the implementation process of the above-mentioned image processing method. The specific implementation process of the image generation method can refer to the implementation process of the above-mentioned image processing method, and this specification will not repeat it here. After generating the target model image corresponding to the model image to be processed, the target model image can be sent to the target terminal.

[0224] An embodiment of the present specification realizes image processing of a model image to be processed and a reference model pose image through an image processing model, specifically, a feature extraction unit and a denoising unit based on the image processing model, denoising the reference model pose image according to the model image to be processed to generate a target model image, so that the target model image has a pose corresponding to the reference model pose image, thereby achieving generation of images of different poses for the model image to be processed, without the need for the user to obtain images of different poses through manual methods, thereby greatly reducing the user's workload and burden.

[0225] Corresponding to the above method embodiment, this specification also provides an image generating device embodiment, Fig.11 FIG. 1 is a schematic diagram showing the structure of an image generating device provided by an embodiment of the present specification. Fig.11 As shown, the device is applied to a cloud-side device, including:

[0226] The first sending module 1102 is configured to send at least one preset model posture image to the target terminal in response to an image generation instruction sent by the target terminal;

[0227] The image acquisition module 1104 is configured to acquire the reference model posture image and the model image to be processed returned by the target terminal based on the at least one preset model posture image;

[0228] The image input module 1106 is configured to input the model image to be processed and the reference model posture image into an image processing model to obtain a target model image corresponding to the model image to be processed, wherein the target model image is obtained by denoising the reference model posture image according to the model image to be processed, the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit;

[0229] The second sending module 1108 is configured to send the target model image to the target terminal.

[0230] The image generation device provided in the present specification performs image processing on a model image to be processed and a reference model posture image through an image processing model, specifically a feature extraction unit and a denoising unit based on the image processing model, denoises the reference model posture image according to the model image to be processed to generate a target model image, so that the target model image has a posture corresponding to the reference model posture image, thereby achieving generation of images of different postures for the model image to be processed, without the need for the user to obtain images of different postures through manual methods, thereby greatly reducing the user's workload and burden.

[0231] The above is a schematic scheme of an image generating device of this embodiment. It should be noted that the technical scheme of the image generating device and the technical scheme of the above image generating method belong to the same concept, and the details not described in detail in the technical scheme of the image generating device can be referred to the description of the technical scheme of the above image generating method.

[0232] Fig.12 The block diagram of a computing device 1200 according to one embodiment of the present specification is shown. The components of the computing device 1200 include but are not limited to a memory 1210 and a processor 1220. The processor 1220 is connected to the memory 1210 via a bus 1230, and the database 1250 is used to store data.

[0233] The computing device 1200 also includes an access device 1240 that enables the computing device 1200 to communicate via one or more networks 1260. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1240 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0234] In one embodiment of the present specification, the above components of the computing device 1200 and Fig.12 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.12 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0235] The computing device 1200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1200 may also be a mobile or stationary server.

[0236] Among them, the processor 1220 is used to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the above-mentioned image processing method or image processing model training method or image generation method.

[0237] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the image processing method or the training method of the image processing model or the image generation method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the image processing method or the training method of the image processing model or the image generation method embodiment.

[0238] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned image processing method or image processing model training method or image generation method.

[0239] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the image processing method or the training method of the image processing model or the image generation method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the image processing method or the training method of the image processing model or the image generation method embodiment.

[0240] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned image processing method or image processing model training method or image generation method.

[0241] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above-mentioned image processing method or the training method of the image processing model or the image generation method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above-mentioned image processing method or the training method of the image processing model or the image generation method.

[0242] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0243] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0244] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0245] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0246] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can understand and use this specification well. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. An image processing method, comprising: Acquire an image to be processed and a reference posture image corresponding to the image to be processed; The image to be processed and the reference posture image are input into an image processing model to obtain a target image corresponding to the image to be processed, wherein the target image is obtained by denoising the reference posture image according to the image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit.

2. The method of claim 1, wherein the image processing model comprises an image encoder and an image decoder; Inputting the image to be processed and the reference posture image into an image processing model to obtain a target image corresponding to the image to be processed, including: Inputting the image to be processed into the image encoder to obtain image coding features corresponding to the image to be processed, and inputting the reference posture image into the image encoder to obtain posture coding features corresponding to the reference posture image; Inputting the image coding feature into the feature extraction unit to obtain image extraction features; Inputting the image extraction feature, the image coding feature and the posture coding feature into the denoising unit to obtain a target image feature; The target image features are input into the image decoder to obtain the target image.

3. The method of claim 2, further comprising: Identifying a target part in the image to be processed; According to the target part, the image to be processed is cropped to obtain an image of the target part.

4. The method of claim 3, wherein the image encoder comprises a first image encoder, a second image encoder, and a local encoder; Inputting the image to be processed into the image encoder to obtain image coding features corresponding to the image to be processed includes: Inputting the image to be processed into the first image encoder to obtain a first image coding feature corresponding to the image to be processed; Inputting the image to be processed into the second image encoder to obtain a second image coding feature corresponding to the image to be processed; The target part image is input into the local encoder to obtain the target part coding feature corresponding to the target part image.

5. The method according to claim 4, inputting the image coding feature into the feature extraction unit to obtain the image extraction feature, comprising: Inputting the first image coding feature into the feature extraction unit to obtain a key feature to be processed and a value feature to be processed; The key feature to be processed and the value feature to be processed are determined as image extraction features.

6. The method of claim 4, wherein the denoising unit comprises a self-attention subunit and a cross-attention subunit; Inputting the image extraction feature, the image coding feature and the posture coding feature into the denoising unit to obtain the target image feature includes: Splicing the second image coding feature and the target part coding feature to obtain an image splicing feature; Inputting the posture encoding feature and preset noise data into the denoising unit, inputting the image extraction feature into the self-attention subunit, and inputting the image splicing feature into the cross-attention subunit; The posture coding feature is denoised according to the image extraction feature and the image stitching feature to obtain a denoised posture feature, the denoised posture feature is determined as a new posture coding feature, and the step of denoising the posture coding feature according to the image extraction feature and the image stitching feature is continued until the iteration stop condition is reached to obtain the target image feature.

7. The method of claim 2, wherein the image encoder comprises a pose encoder; Inputting the reference posture image into the image encoder to obtain posture coding features corresponding to the reference posture image includes: The reference posture image is input into the posture encoder to obtain posture coding features corresponding to the reference posture image.

8. The method of claim 1, further comprising: Acquire the denoising unit, and copy the denoising unit to obtain a feature extraction unit to be determined; Identify the cross-attention sub-unit in the feature extraction unit to be determined, and delete the cross-attention sub-unit in the feature extraction unit to be determined from the feature extraction unit to be determined, so as to obtain a feature extraction unit.

9. The method according to claim 1, obtaining a reference posture image corresponding to the image to be processed, comprising: Receiving an image generation instruction sent by a target terminal; In response to the image generation instruction, sending at least one preset posture image to the target terminal; A reference posture image returned by the target terminal based on the at least one preset posture image is acquired.

10. The method according to claim 1, wherein the image processing model is trained according to the following method: Get sample training data, where The sample training data includes a sample image, a sample reference image corresponding to the sample image, and a sample posture image corresponding to the sample image; Inputting the sample image and the sample reference image into the image processing model to obtain a predicted posture image; Calculating a loss value of the image processing model according to the predicted posture image and the sample posture image; The model parameters of the image processing model are adjusted according to the loss value, and the image processing model is continued to be trained until a training stop condition is reached.

11. A training method for an image processing model, applied to a cloud-side device, comprising: Acquire sample training data, wherein the sample training data includes a sample image, a sample reference image corresponding to the sample image, and a sample posture image corresponding to the sample image; Inputting the sample image and the sample reference image into an image processing model to obtain a predicted posture image, wherein the predicted posture image is obtained by denoising the sample reference image according to the sample image, the image processing model comprises a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit; Calculating a loss value of the image processing model according to the predicted posture image and the sample posture image; Adjusting the model parameters of the image processing model according to the loss value, and continuing to train the image processing model until a training stop condition is reached; Feedback the trained image processing model parameters to the target terminal.

12. An image generation method, applied to a cloud-side device, comprising: In response to an image generation instruction sent by a target terminal, sending at least one preset model posture image to the target terminal; Acquire a reference model posture image and a model image to be processed returned by the target terminal based on the at least one preset model posture image; Inputting the model image to be processed and the reference model posture image into an image processing model to obtain a target model image corresponding to the model image to be processed, wherein the target model image is obtained by denoising the reference model posture image according to the model image to be processed, and the image processing model includes a denoising unit and a feature extraction unit, and the feature extraction unit is obtained based on pruning the denoising unit; The target model image is sent to the target terminal.

13. A computing device comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 12 are implemented.

14. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.

15. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.