A human body image generation method and device based on posture feature discretization

By using a pose feature discretization method, human poses are decomposed into tokens with body structure semantics. A complete link is constructed using an autoencoder and an editing model, which solves the problems of unstable human pose editing and difficult data construction, and achieves stable local editing and image generation.

CN122888063BActive Publication Date: 2026-11-24NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611392303.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-11-24
Estimated Expiration
2046-09-09

AI Technical Summary

Technical Problem

Existing human pose editing methods suffer from localized instability, difficulty in constructing pose data, and a disconnect between pose editing and image generation, lacking text semantic parsing and making it difficult to form a complete end-to-end link.

Method used

By employing a pose feature discretization method, human poses are decomposed into tokens with body structure semantics. Through a pose discretization autoencoder and a semantically controlled pose editing model, stable local editing and image generation of human poses are achieved, thus constructing a complete pose-to-image generation chain.

Benefits of technology

It achieves stable and rapid semantic editing of local human poses, has a complete pose-to-image generation chain, solves the problems of unstable local editing and difficulty in constructing pose data, and supports pose data expansion under different text content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888063B_ABST
    Figure CN122888063B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for generating human images based on posture feature discretization, belonging to the field of human posture editing technology. The method uses a trained posture discretization autoencoder to discretize the source human posture image into a source posture token sequence, achieving pre-processing for stable editing of local human postures. Combined with a trained semantic control posture editing model, it can quickly complete semantic editing of local human postures. It can also expand the training set with semantic postures based on different text content, possessing a complete posture-to-image generation chain, solving the problems of unstable local editing and difficult posture data construction in current human posture editing methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and apparatus for generating human images based on posture feature discretization, belonging to the field of human posture editing technology. Background Technology

[0002] Human pose editing technology aims to generate images of target people freely using editable pose sequences. In the field of computer vision, research results on human pose generation and editing can be applied to virtual reality, film production, data augmentation, and other fields. Current human pose editing and image generation methods predict joint coordinates directly from text. However, there is a scarcity of alignment samples between text descriptions and target poses, making dataset construction difficult. Furthermore, pose editing and image generation are disconnected, and a complete end-to-end link from text semantic parsing and local pose editing to image generation has not yet been formed. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a human image generation method and apparatus based on posture feature discretization. It can decompose human posture into a combination of tokens with body structure semantics, can stably edit human posture locally, and has a complete posture-to-image generation link. It solves the problems of unstable local editing and difficult posture data construction in current human posture editing methods.

[0004] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution:

[0005] This invention provides a method for generating human images based on pose feature discretization, comprising:

[0006] Obtain the text semantic features of the source human body pose image, the text describing the direction of change of the target human body parts in the source human body pose image, and the prompt text used to generate the human body image;

[0007] Input the source human pose image into a pre-trained pose discretization autoencoder to obtain the source pose token sequence;

[0008] The source pose token sequence and text semantic features are input into a pre-trained semantic control pose editing model to obtain the editing increment of human pose changes.

[0009] The source pose token sequence is edited using incremental editing to obtain the edited human pose image;

[0010] The edited human pose image is used as a pose conditional image and input along with the prompt text into the pose conditional image generation model to generate an edited human image.

[0011] Furthermore, the training of the pose discretization autoencoder includes:

[0012] Obtain key point sequences from human pose images from a human pose image library, and use the human pose images and corresponding key point sequences as training samples to establish an encoder training set;

[0013] Construct an initial pose discretization autoencoder;

[0014] The initial pose discretization autoencoder is trained using the encoder training set, which generates a quantized pose token sequence. The reconstructed human pose map is then generated by decoding the quantized pose token sequence.

[0015] The first loss function is used to make the reconstructed human pose map during the training process approximate the input human pose map, and the quantization process is constrained.

[0016] The trained pose discretization autoencoder is obtained.

[0017] Furthermore, the step of training an initial pose discretized autoencoder using an encoder training set, enabling the initial pose discretized autoencoder to generate a quantized pose token sequence, and generating a reconstructed human pose map based on the quantized pose token sequence includes:

[0018] Based on the keypoint sequence, a joint feature sequence is generated, represented as follows:

[0019] ;

[0020] in, Represents the joint feature sequence. Indicates the first The joint features corresponding to each key point Indicates the total number of key points; , Indicates the first Visibility mask for key points, Indicates the first Visible joint features corresponding to each key point This represents the embedding vector of invisible joint features; , This represents the coordinate embedding function. Indicates the first The coordinates of the key points;

[0021] Construct a body part mask matrix , , Indicates the total number of gesture tokens;

[0022] Based on the body part mask matrix and joint feature sequence, multiple pose tokens with body part semantics are generated, represented as follows:

[0023] ;

[0024] in, Represents a continuous sequence of gesture tokens. Indicates the first A gesture token, , This represents the linear transformation weight matrix of the pose token. This represents the pose token bias vector. Indicates the first The body part feature corresponding to each posture token;

[0025] , Indicates the first The gesture token is paired with the first... Normalized weight coefficients for each key point , Represents a mask matrix for body parts The Middle Line number The original mask value of the column, Represents a mask matrix for body parts The Middle Line number The original binary mask value of the column, Represents a constant; Represents the encoded joint feature sequence The Middle The joint features corresponding to each key point , Indicates encoder;

[0026] Construct a discrete attitude codebook, represented as: ;

[0027] in, Represents a discrete attitude codebook. Indicates the first Each codebook vector This represents the total number of codebook vectors in the discrete attitude codebook;

[0028] The attitude token sequence is quantized using a discrete attitude codebook to obtain a quantized attitude token sequence.

[0029] The pose reconstruction process is performed based on the quantized pose token sequence to generate a reconstructed human pose.

[0030] Furthermore, the quantization process includes:

[0031] The distance between each pose token and each codebook vector is calculated using the following formula:

[0032] ;

[0033] in, express and The distance between, Represents the L2 norm;

[0034] The codebook vector closest to the pose token is selected as the quantization result, represented as:

[0035] ;

[0036] ;

[0037] in, express The quantitative results express Discrete attitude codebook index. express The corresponding codebook vector;

[0038] The quantized attitude token sequence and its corresponding discrete codebook index are represented as follows:

[0039] ;

[0040] ;

[0041] in, Represents a quantized gesture token sequence. This represents the set of discrete codebook indices.

[0042] Furthermore, the first loss function is expressed as follows:

[0043] ;

[0044] in, This represents the total loss function for training the pose discretized autoencoder. This represents the pose reconstruction loss function. This represents the quantization constraint loss function. This indicates the weight of the quantization constraint loss;

[0045] ;

[0046] in, Indicates the first The coordinates of the key points Indicates the total number of key points. Represents a constant. Indicates the first Visibility mask for key points, express Reconstructed coordinates of key points Represents the L1 norm;

[0047] ;

[0048] in, This indicates that the gradient operation is stopped. Represents a quantized continuous gesture token sequence. Represents a continuous sequence of gesture tokens. This represents the L2 norm.

[0049] Furthermore, the training of the semantic control pose editing model includes:

[0050] The source pose sample image is obtained from the human body basic pose image library. The source pose sample image is input into the pre-trained pose discretization autoencoder to obtain the source pose sample token sequence and the corresponding source discrete codebook index set.

[0051] Select local body parts from the source pose sample image;

[0052] Based on the source pose sample token sequence and the corresponding source discrete codebook index set, the selected local body parts of the human body are edited to obtain the target pose sample image of the human body parts with changes; wherein, the editing process includes processing the direction change of the body parts and processing the intensity of the direction change.

[0053] Based on the selected human body parts, the direction of change of the body parts, and the intensity of the change of direction, generate corresponding semantic text examples;

[0054] Construct a semantic pose pair training set based on the source pose sample image, the target pose sample image, and the semantic text examples;

[0055] Construct an initial semantic control pose editing model;

[0056] An initial semantic control pose editing model is trained on the training set using semantic pose, enabling the initial semantic control pose editing model to correctly predict the editing increment of editing the source pose sample image into the target pose sample image, thus obtaining the trained semantic control pose editing model.

[0057] Furthermore, the step of editing selected local body parts based on the source pose sample token sequence and the corresponding source discrete codebook index set to obtain a target pose sample image showing changes in the local body parts includes:

[0058] Using the codebook nearest neighbor search method, the target local token corresponding to a local body part is obtained from the source pose sample token sequence, represented as: ;

[0059] in, Indicates the quantified first Individual posture sample token, Indicates the posture of a part of the human body The corresponding target local token; express Discrete attitude codebook index The corresponding codebook vector;

[0060] The distance between the target local token corresponding to a specific body part and other codebook vectors in the discrete pose codebook is calculated using the following formula: ;

[0061] in, express Other codebook vectors distance, Represents the L2 norm;

[0062] Select the top T codebook vectors that are closest to the target local token and whose discrete attitude codebook indices are not equal, as candidate codebook vectors to form a candidate set;

[0063] One candidate codebook vector is selected sequentially from the candidate set, the target local token is mixed, and the non-target local tokens are kept unchanged to obtain the edited source pose sample token sequence.

[0064] The target pose sample image is generated by decoding the edited source pose sample token sequence.

[0065] Furthermore, the step of training an initial semantically controlled pose editing model on a training set using semantic poses, enabling the initial semantically controlled pose editing model to correctly predict the editing increment for editing a source pose sample image into a target pose sample image, thus obtaining a trained semantically controlled pose editing model, includes:

[0066] Obtain the source pose sample token sequence and the text semantic features of the semantic text example from the source pose sample image;

[0067] The source pose sample token sequence is fused with text semantic features to obtain fused features;

[0068] Predict the editing increment based on fusion characteristics;

[0069] Based on the semantic features of the text, predict the category of the human body part to which the edit increment belongs;

[0070] The predicted pose token sequence is obtained by replacing the corresponding positions in the source pose sample token sequence with edit increments;

[0071] The predicted target pose map is generated by decoding the predicted pose token sequence.

[0072] A second loss function is used to make the predicted target pose map close to the target pose sample map, and the prediction process of the human body part category to which the editing increment belongs is constrained;

[0073] A well-trained semantic control pose editing model is obtained.

[0074] Furthermore, the second loss function is expressed as follows:

[0075] ;

[0076] in, This represents the total loss function for training the semantic control pose editing model. Represents the attitude loss function. This represents the token selection constraint function. This indicates the selection of constraint loss weights;

[0077] ;

[0078] in, Indicates the first [object] in the predicted target attitude diagram. Coordinates of key points The first one in the target attitude sample image Coordinates of key points Indicates the total number of key points. This represents the smoothed L1 loss function;

[0079] ;

[0080] in, Indicates the posture of a part of the human body The predicted probability of corresponding human body parts.

[0081] In another aspect, the present invention provides a human image generation apparatus based on pose feature discretization, comprising:

[0082] The parameter acquisition module is used to acquire the source human body posture image, the text semantic features of the text describing the direction of change of the target human body parts in the source human body posture image, and the prompt text used to generate human body images.

[0083] The pose token generation module is used to input the source human pose map into a pre-trained pose discretization autoencoder to obtain the source pose token sequence.

[0084] The edit increment prediction module is used to input the source pose token sequence and text semantic features into a pre-trained semantic control pose editing model to obtain the edit increment of human pose changes.

[0085] The human pose editing module is used to edit the source pose token sequence using editing increments to obtain the edited human pose image;

[0086] The human body image generation module is used to input the edited human body pose diagram as a pose condition diagram, along with prompt text, into the pose condition image generation model to generate the edited human body image.

[0087] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0088] This invention employs a trained pose discretization autoencoder to discretize the source human pose image into a source pose token sequence, achieving pre-processing for stable editing of local human poses. Combined with a trained semantic control pose editing model, it can quickly complete semantic editing of local human poses. It can also expand the training set with semantic poses based on different text content, possessing a complete pose-to-image generation chain, and solving the problems of unstable local editing and difficult pose data construction in current human pose editing methods. Attached Figure Description

[0089] Figure 1 This is a flowchart of a human image generation method based on pose feature discretization provided in an embodiment of the present invention;

[0090] Figure 2 This is a flowchart of the training process of the attitude discretization autoencoder provided in an embodiment of the present invention;

[0091] Figure 3 This is a flowchart of generating a reconstructed human pose diagram provided in an embodiment of the present invention;

[0092] Figure 4 This is a flowchart of the training process of the semantic control pose editing model provided in this embodiment of the invention;

[0093] Figure 5 This is a flowchart illustrating the correct prediction of editing increments provided in an embodiment of the present invention;

[0094] Figure 6 This is a schematic diagram of a human image generation device based on pose feature discretization provided in an embodiment of the present invention. Detailed Implementation

[0095] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0096] Example 1

[0097] like Figure 1 As shown, a method for generating human images based on pose feature discretization includes:

[0098] Step 1: Obtain the source human body pose image, the text semantic features of the text describing the direction of change of the target human body parts in the source human body pose image, and the prompt text used to generate the human body image;

[0099] In this embodiment, the target body parts include: head, left arm, right arm, torso, left leg, and right leg;

[0100] The direction of change of the target part of the human body includes at least one of the following: upward, downward, leftward, rightward, raised, lowered, extended, retracted, and deflected.

[0101] Step 2: Input the source human pose image into a pre-trained pose discretization autoencoder to obtain the source pose token sequence; specifically:

[0102] like Figure 2 As shown, the training of the pose discretization autoencoder includes:

[0103] Obtain key point sequences from human pose images from a human pose image library, and use the human pose images and corresponding key point sequences as training samples to establish an encoder training set;

[0104] Construct an initial pose discretization autoencoder;

[0105] In this embodiment, the attitude discretization autoencoder includes a coordinate embedding module, an invisible joint embedding module, an attitude encoder, an attitude decoder, and a key point recovery module connected in sequence.

[0106] The attitude encoder includes a multi-layer stacked Mix structure, and a normalization layer, a mask linear layer, and a fully connected layer that are sequentially connected to the multi-layer stacked Mix structure.

[0107] The Mix structure includes a Token multilayer perceptron, a residual summation and layer normalization layer, and a channel mixing multilayer perceptron connected in sequence.

[0108] The pose decoder consists of a mask linear layer, a fully connected layer, a multi-layer stacked Mix structure, a normalization layer, and a fully connected layer connected in sequence.

[0109] like Figure 3 As shown, an initial pose discretized autoencoder is trained using an encoder training set, which generates a quantized pose token sequence. The reconstructed human pose map is then generated by decoding the quantized pose token sequence. This process includes:

[0110] Based on the keypoint sequence, a joint feature sequence is generated, represented as follows:

[0111] ;

[0112] in, Represents the joint feature sequence. Indicates the first The joint features corresponding to each key point Indicates the total number of key points; , Indicates the first Visibility mask for key points, Indicates the first Visible joint features corresponding to each key point This represents the embedding vector of invisible joint features; , This represents the coordinate embedding function. Indicates the first The coordinates of the key points;

[0113] Construct a body part mask matrix , , Indicates the total number of gesture tokens;

[0114] In this embodiment, the pose tokens include head token, left arm token, right arm token, torso token, left leg token, right leg token, upper body token, lower body token, and full body token. Based on the body part mask matrix and joint feature sequence, multiple pose tokens with body part semantics are generated, represented as follows: ;

[0115] in, Represents a continuous sequence of gesture tokens. Indicates the first A gesture token, , This represents the linear transformation weight matrix of the pose token. This represents the pose token bias vector. Indicates the first The body part feature corresponding to each posture token;

[0116] , Indicates the first The gesture token is paired with the first... Normalized weight coefficients for each key point , Represents a mask matrix for body parts The Middle Line number The original mask value of the column, Represents a mask matrix for body parts The Middle Line number The original binary mask value of the column, Represents a constant; Represents the encoded joint feature sequence The Middle The joint features corresponding to each key point , Indicates encoder;

[0117] Construct a discrete attitude codebook, represented as: ;

[0118] in, Represents a discrete attitude codebook. Indicates the first Each codebook vector This represents the total number of codebook vectors in the discrete attitude codebook;

[0119] The attitude token sequence is quantized using a discrete attitude codebook to obtain a quantized attitude token sequence, including:

[0120] The distance between each pose token and each codebook vector is calculated using the following formula:

[0121] ;

[0122] in, express and The distance between, Represents the L2 norm;

[0123] The codebook vector closest to the pose token is selected as the quantization result, represented as:

[0124] ;

[0125] ;

[0126] in, express The quantitative results express Discrete attitude codebook index. express The corresponding codebook vector;

[0127] The quantized attitude token sequence and its corresponding discrete codebook index are represented as follows:

[0128] ;

[0129] ;

[0130] in, Represents a quantized gesture token sequence. Represents a discrete codebook index set;

[0131] The pose reconstruction process is performed based on the quantized pose token sequence, and the reconstructed human pose is generated by decoding.

[0132] The first loss function is used to make the reconstructed human pose map during the training process approximate the input human pose map, and the quantization process is constrained.

[0133] The first loss function is expressed as follows:

[0134] ;

[0135] in, This represents the total loss function for training the pose discretized autoencoder. This represents the pose reconstruction loss function. This represents the quantization constraint loss function. This indicates the weight of the quantization constraint loss;

[0136] ;

[0137] in, express Reconstructed coordinates of key points Represents the L1 norm;

[0138] ;

[0139] in, This indicates that the gradient operation has been stopped.

[0140] The trained pose discretization autoencoder is obtained.

[0141] Step 3: Input the source pose token sequence and text semantic features into the pre-trained semantic control pose editing model to obtain the editing increment of human pose changes; specifically:

[0142] like Figure 4 As shown, the training of the semantic control pose editing model includes:

[0143] The source pose sample image is obtained from the human body basic pose image library. The source pose sample image is input into the pre-trained pose discretization autoencoder to obtain the source pose sample token sequence and the corresponding source discrete codebook index set.

[0144] The source pose sample token sequence is represented as: ;

[0145] in, This represents the source pose sample token sequence. Indicates the first Token in the source pose sample Token sequence There are one source attitude token, and the total number of source attitude tokens in the source attitude sample token sequence is [number]. indivual;

[0146] The set of source discrete codebook indices is represented as: ;

[0147] in, Represents the set of source discrete codebook indices. express The discrete attitude codebook index, the total number of discrete attitude codebook indices in the source discrete codebook index set is indivual;

[0148] Select local body parts from the source pose sample image;

[0149] Based on the source pose sample token sequence and the corresponding source discrete codebook index set, the selected local body parts are edited to obtain a target pose sample image showing changes in the local body parts, including:

[0150] Using the codebook nearest neighbor search method, the target local token corresponding to a local body part is obtained from the source pose sample token sequence, represented as: ;

[0151] in, Indicates the quantified first Individual posture sample token, Indicates the posture of a part of the human body The corresponding target local token; express Discrete attitude codebook index The corresponding codebook vector;

[0152] It should be noted that, It can be one of the following: head token, left arm token, right arm token, torso token, left leg token, and right leg token;

[0153] The distance between the target local token corresponding to a specific body part and other codebook vectors in the discrete pose codebook is calculated using the following formula: ;

[0154] in, express Other codebook vectors The distance;

[0155] Select the top T codebook vectors that are closest to the target local token and whose discrete attitude codebook indices are not equal, as candidate codebook vectors to form a candidate set;

[0156] One candidate codebook vector is selected sequentially from the candidate set, the target local token is mixed, and the non-target local tokens are kept unchanged to obtain the edited source pose sample token sequence.

[0157] The target local token is mixed and represented as follows: ;

[0158] in, This indicates the edited target local token. Represents the candidate codebook vector;

[0159] Keeping the non-target local token unchanged, it is represented as: , ;

[0160] in, Indicates a non-target local token;

[0161] This leads to the edited source pose sample token sequence, represented as:

[0162] ;

[0163] in, This represents the edited source pose sample token sequence. express The Middle Individual Posture Token The total number of Zhongyuan Posture Tokens is indivual;

[0164] The target pose sample image is generated by decoding the edited source pose sample token sequence.

[0165] Generate a target pose sample image, represented as:

[0166] ;

[0167] in, This represents a sample image of the target pose. Indicates decoder;

[0168] It should be noted that, in this embodiment, the editing process includes processing the changes in the orientation of body parts and processing the intensity of the orientation changes. First, the target posture sample image in this application is not directly generated. Since the codebook vectors in the discrete posture codebook have different directions, after selecting a candidate codebook vector from the candidate set and performing a mixing process on the target local token, the edited source posture sample token is obtained. Its orientation is random. It is necessary to compare the decoded edited posture sample image with the source posture sample image to know whether its changed direction is upward, downward, left, right, raised, lowered, unfolded, retracted, or deflected. Then, according to the magnitude of its change in orientation, text descriptions such as "slight," "obvious," or "significant" about the intensity are added. Finally, a target posture sample image with changes in the orientation of body parts and the intensity of the orientation changes is formed.

[0169] Based on the selected human body parts, the direction of change of the body parts, and the intensity of the change of direction, generate corresponding semantic text examples;

[0170] Construct a semantic pose pair training set based on the source pose sample image, the target pose sample image, and the semantic text examples;

[0171] Construct an initial semantic control pose editing model;

[0172] An initial semantically controlled pose editing model is trained on the training set using semantic pose mapping. This initial model is designed to correctly predict the editing increment that transforms a source pose image into a target pose image, resulting in a well-trained semantically controlled pose editing model. Figure 5 As shown, it includes:

[0173] Obtain the source pose sample token sequence and the text semantic features of the semantic text example from the source pose sample image;

[0174] In this embodiment, the text semantic features are extracted using an existing pre-trained text encoder, and are represented as follows:

[0175] ;

[0176] in, Representing the semantic features of the text. This represents a semantic text example. Indicates a text encoder;

[0177] The text encoder can use the Transformer language model or the sentence vector model, so its specific working principle will not be elaborated here.

[0178] The source pose sample token sequence is fused with text semantic features to obtain fused features; specifically:

[0179] Project the semantic features of the text onto the token dimension of the source pose sample;

[0180] Copy the text semantic features to the Token position of each source pose sample;

[0181] For the Each source posture sample token, after fusion processing, is represented as:

[0182] ;

[0183] in, Indicates the first The fusion features corresponding to the tokens of each source posture sample This represents the textual semantic features projected onto the same dimension as the source pose sample Token. This indicates vector concatenation;

[0184] Then there is ; This represents the fused feature sequence, with a total number of fused features. indivual;

[0185] Based on fusion characteristics, predict the editing increment, including:

[0186] ;

[0187] ;

[0188] in, This represents the initial prediction edit increment sequence. Indicates the first The initial prediction edit increment corresponding to each source pose sample token This represents the Token editor in the semantic control gesture editing model;

[0189] In this embodiment, the Token editor includes a fully connected layer, a normalization layer, a GELU activation function, a Dropout layer, and a fully connected layer connected in sequence.

[0190] This embodiment uses a residual gating mechanism to edit the amplitude, for the first... The initial predicted edit increment is represented as: ;

[0191] in, Indicates the first The predicted edit increment corresponding to each source posture sample token Represents the gate vector, This represents element-wise multiplication;

[0192] ;

[0193] in, This represents the hyperbolic tangent activation function. This represents the gated feature mapping weight matrix. Represents the gate bias vector;

[0194] Obtain the predicted edit increment sequence ;

[0195] Based on the semantic features of the text, predict the category of the human body part to which the edit increment belongs; specifically:

[0196] Inputting text semantic features into the token selector in the semantically controlled pose editing model is represented as:

[0197] ;

[0198] ;

[0199] ;

[0200] in, This indicates that the semantic classification output is the original score vector. Represents the text semantic projection weight matrix. This represents the classification bias vector. Represents the normalized exponential activation function. This represents the predicted probability distribution vector for each body part. Indicates the first Each posture token corresponds to a predicted probability of a human body part. Indicates the first The index of the human body part with the highest probability of prediction using a single gesture token;

[0201] The predicted pose token sequence is obtained by incrementally replacing the corresponding positions in the source pose sample token sequence, including:

[0202] Construct a target local token mask based on the predicted human body part category of the edit increment, represented as:

[0203] ;

[0204] in, Indicates the first The local binary mask corresponding to each gesture token;

[0205] The edit increment is predicted using the target local token mask constraint, and the formula is as follows:

[0206] ;

[0207] in, This indicates a constraint on the edit increment. This represents the local binary mask sequence corresponding to the gesture token;

[0208] Generate a predicted pose token sequence : ;

[0209] The predicted target pose map is generated by decoding the predicted pose token sequence, and is represented as follows:

[0210] ;

[0211] in, This represents the predicted target attitude diagram.

[0212] A second loss function is used to make the predicted target pose map close to the target pose sample map, and the prediction process of the human body part category to which the editing increment belongs is constrained;

[0213] The second loss function is expressed as follows:

[0214] ;

[0215] in, This represents the total loss function for training the semantic control pose editing model. Represents the attitude loss function. This represents the token selection constraint function. This indicates the selection of constraint loss weights;

[0216] ;

[0217] in, Indicates the first [object] in the predicted target attitude diagram. Coordinates of key points The first one in the target attitude sample image Coordinates of key points Indicates the total number of key points. This represents the smoothed L1 loss function;

[0218] ;

[0219] in, Indicates the posture of a part of the human body Predicted probability for corresponding body parts;

[0220] A well-trained semantic control pose editing model is obtained.

[0221] Step 4: Edit the source pose token sequence using incremental editing to obtain the edited human pose image;

[0222] Step 5: Input the edited human pose image as a pose condition image, along with the prompt text, into the pose condition image generation model to generate the edited human image.

[0223] The pose-conditional image generation model used in this embodiment is an existing image generation model, including a pose-conditional control model and a diffusion generation model. It utilizes the ControlNet network to constrain the generation process of the diffusion model. The prompt text is used to describe the appearance, clothing, background and style of the person, so its specific working principle will not be described in detail.

[0224] Example 2

[0225] like Figure 6 As shown, a human image generation device based on pose feature discretization includes:

[0226] The parameter acquisition module is used to acquire the source human body posture image, the text semantic features of the text describing the direction of change of the target human body parts in the source human body posture image, and the prompt text used to generate human body images.

[0227] The pose token generation module is used to input the source human pose map into a pre-trained pose discretization autoencoder to obtain the source pose token sequence.

[0228] The edit increment prediction module is used to input the source pose token sequence and text semantic features into a pre-trained semantic control pose editing model to obtain the edit increment of human pose changes.

[0229] The human pose editing module is used to edit the source pose token sequence using editing increments to obtain the edited human pose image;

[0230] The human body image generation module is used to input the edited human body pose diagram as a pose condition diagram, along with prompt text, into the pose condition image generation model to generate the edited human body image.

[0231] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here.

[0232] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0233] This invention is described with reference to flowchart illustrations of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each step in the flowchart can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 One or more processes or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0234] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 The function specified in one or more processes.

[0235] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 Steps of a specified function in one or more processes.

[0236] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for generating human images based on pose feature discretization, characterized in that, include: Obtain the text semantic features of the source human body pose image, the text describing the direction of change of the target human body parts in the source human body pose image, and the prompt text used to generate the human body image; Input the source human pose image into a pre-trained pose discretization autoencoder to obtain the source pose token sequence; The training of the pose discretized autoencoder includes: Obtain key point sequences from human pose images from a human pose image library, and use the human pose images and corresponding key point sequences as training samples to establish an encoder training set; Construct an initial pose discretization autoencoder; An initial pose discretized autoencoder is trained using an encoder training set. This initial pose discretized autoencoder generates a quantized pose token sequence, and a reconstructed human pose map is generated based on the quantized pose token sequence, including: Based on the keypoint sequence, a joint feature sequence is generated, represented as follows: ; in, Represents the joint feature sequence. Indicates the first The joint features corresponding to each key point Indicates the total number of key points; , Indicates the first Visibility mask for key points, Indicates the first Visible joint features corresponding to each key point This represents the embedding vector of invisible joint features; , This represents the coordinate embedding function. Indicates the first The coordinates of the key points; Construct a body part mask matrix , , Indicates the total number of gesture tokens; Based on the body part mask matrix and joint feature sequence, multiple pose tokens with body part semantics are generated, represented as follows: ; in, Represents a continuous sequence of gesture tokens. Indicates the first A gesture token, , This represents the linear transformation weight matrix of the pose token. This represents the pose token bias vector. Indicates the first The body part feature corresponding to each posture token; , Indicates the first The gesture token is paired with the first... Normalized weight coefficients for each key point , Represents a mask matrix for body parts The Middle Line number The original mask value of the column, Represents a mask matrix for body parts The Middle Line number The original binary mask value of the column, Represents a constant; Represents the encoded joint feature sequence The Middle The joint features corresponding to each key point , Indicates encoder; Construct a discrete attitude codebook, represented as: ; in, Represents a discrete attitude codebook. Indicates the first codebook vectors This represents the total number of codebook vectors in the discrete attitude codebook; The attitude token sequence is quantized using a discrete attitude codebook to obtain a quantized attitude token sequence. The pose reconstruction process is performed based on the quantized pose token sequence to generate a reconstructed human pose. The first loss function is used to make the reconstructed human pose map during the training process approximate the input human pose map, and the quantization process is constrained. Obtain a well-trained pose discretized autoencoder; The source pose sample token sequence is represented as: ; in, This represents the source pose sample token sequence. Indicates the first Token in the source pose sample Token sequence Individual posture token; The source pose token sequence and text semantic features are input into a pre-trained semantic control pose editing model to obtain the editing increment of human pose changes. The training of the semantic control pose editing model includes: The source pose sample image is obtained from the human body basic pose image library. The source pose sample image is input into the pre-trained pose discretization autoencoder to obtain the source pose sample token sequence and the corresponding source discrete codebook index set. Select local body parts from the source pose sample image; Based on the source pose sample token sequence and the corresponding source discrete codebook index set, the selected local body parts of the human body are edited to obtain the target pose sample image of the human body parts with changes; wherein, the editing process includes processing the direction change of the body parts and processing the intensity of the direction change. Based on the selected human body parts, the direction of change of the body parts, and the intensity of the change of direction, generate corresponding semantic text examples; Construct a semantic pose pair training set based on the source pose sample image, the target pose sample image, and semantic text examples; Construct an initial semantic control pose editing model; An initial semantically controlled pose editing model is trained on the training set using semantic pose mapping. This initial model is designed to correctly predict the editing increment that transforms a source pose sample image into a target pose sample image. The resulting trained semantically controlled pose editing model includes: Obtain the source pose sample token sequence and the text semantic features of the semantic text example from the source pose sample image; The source pose sample token sequence is fused with text semantic features to obtain fused features; Predict the editing increment based on fusion characteristics; Based on the semantic features of the text, predict the category of the human body part to which the edit increment belongs; The predicted pose token sequence is obtained by replacing the corresponding positions in the source pose sample token sequence with edit increments; The predicted target pose map is generated by decoding the predicted pose token sequence. A second loss function is used to make the predicted target pose map close to the target pose sample map, and the prediction process of the human body part category to which the editing increment belongs is constrained; Obtain the trained semantic control pose editing model; The source pose token sequence is edited using incremental editing to obtain the edited human pose image; The edited human pose image is used as a pose conditional image and input along with the prompt text into the pose conditional image generation model to generate an edited human image.

2. The human image generation method based on pose feature discretization according to claim 1, characterized in that, The quantization process includes: The distance between each pose token and each codebook vector is calculated using the following formula: ; in, express and The distance between, Represents the L2 norm; The codebook vector closest to the pose token is selected as the quantization result, represented as: ; ; in, express The quantitative results express Discrete attitude codebook index. express The corresponding codebook vector; The quantized attitude token sequence and its corresponding discrete codebook index are represented as follows: ; ; in, Represents a quantized gesture token sequence. This represents the set of discrete codebook indices.

3. The human image generation method based on pose feature discretization according to claim 1, characterized in that, The first loss function is expressed as follows: ; in, This represents the total loss function for training the pose discretized autoencoder. This represents the pose reconstruction loss function. This represents the quantization constraint loss function. This indicates the weight of the quantization constraint loss; ; in, Indicates the first The coordinates of the key points Indicates the total number of key points. Represents a constant. Indicates the first Visibility mask for key points, Indicates the first Reconstructed coordinates of key points Represents the L1 norm; ; in, This indicates that the gradient operation is stopped. Represents a quantized gesture token sequence. Represents a continuous sequence of gesture tokens. This represents the L2 norm.

4. The human image generation method based on pose feature discretization according to claim 1, characterized in that, The process involves editing selected local body parts based on the source pose sample token sequence and the corresponding source discrete codebook index set to obtain a target pose sample image showing changes in the local body parts, including: Using the codebook nearest neighbor search method, the target local token corresponding to a local body part is obtained from the source pose sample token sequence, represented as: ; in, Indicates the quantified first Individual posture sample token, Indicates the posture of a part of the human body The corresponding target local token; express Discrete attitude codebook index The corresponding codebook vector; The distance between the target local token corresponding to a specific body part and other codebook vectors in the discrete pose codebook is calculated using the following formula: ; in, express Other codebook vectors distance, Represents the L2 norm; Select the token that is closest to the target local token and whose discrete pose codebook index is not equal. T Each codebook vector is used as a candidate codebook vector to form a candidate set; One candidate codebook vector is selected sequentially from the candidate set, the target local token is mixed, and the non-target local tokens are kept unchanged to obtain the edited source pose sample token sequence. The target pose sample image is generated by decoding the edited source pose sample token sequence.

5. The human image generation method based on pose feature discretization according to claim 1, characterized in that, The second loss function is expressed as follows: ; in, This represents the total loss function for training the semantic control pose editing model. Represents the attitude loss function. This represents the token selection constraint function. This indicates the selection of constraint loss weights; ; in, Indicates the first [object] in the predicted target attitude diagram. Coordinates of key points The first one in the target attitude sample image Coordinates of key points Indicates the total number of key points. This represents the smoothed L1 loss function; ; in, Indicates the posture of a part of the human body The predicted probability of corresponding human body parts.

6. A human image generation device based on pose feature discretization, characterized in that, include: The parameter acquisition module is used to acquire the source human body posture image, the text semantic features of the text describing the direction of change of the target human body parts in the source human body posture image, and the prompt text used to generate human body images. The pose token generation module is used to input the source human pose map into a pre-trained pose discretization autoencoder to obtain the source pose token sequence. The training of the pose discretized autoencoder includes: Obtain key point sequences from human pose images from a human pose image library, and use the human pose images and corresponding key point sequences as training samples to establish an encoder training set; Construct an initial pose discretization autoencoder; An initial pose discretized autoencoder is trained using an encoder training set. This initial pose discretized autoencoder generates a quantized pose token sequence, and a reconstructed human pose map is generated based on the quantized pose token sequence, including: Based on the keypoint sequence, a joint feature sequence is generated, represented as follows: ; in, Represents the joint feature sequence. Indicates the first The joint features corresponding to each key point Indicates the total number of key points; , Indicates the first Visibility mask for key points, Indicates the first Visible joint features corresponding to each key point This represents the embedding vector of invisible joint features; , This represents the coordinate embedding function. Indicates the first The coordinates of the key points; Construct a body part mask matrix , , Indicates the total number of gesture tokens; Based on the body part mask matrix and joint feature sequence, multiple pose tokens with body part semantics are generated, represented as follows: ; in, Represents a continuous sequence of gesture tokens. Indicates the first A gesture token, , This represents the linear transformation weight matrix of the pose token. This represents the pose token bias vector. Indicates the first The body part feature corresponding to each posture token; , Indicates the first The gesture token is paired with the first... Normalized weight coefficients for each key point , Represents a mask matrix for body parts The Middle Line number The original mask value of the column, Represents a mask matrix for body parts The Middle Line number The original binary mask value of the column, Represents a constant; Represents the encoded joint feature sequence The Middle The joint features corresponding to each key point , Indicates encoder; Construct a discrete attitude codebook, represented as: ; in, Represents a discrete attitude codebook. Indicates the first codebook vectors This represents the total number of codebook vectors in the discrete attitude codebook; The attitude token sequence is quantized using a discrete attitude codebook to obtain a quantized attitude token sequence. The pose reconstruction process is performed based on the quantized pose token sequence to generate a reconstructed human pose. The first loss function is used to make the reconstructed human pose map during the training process approximate the input human pose map, and the quantization process is constrained. Obtain a well-trained pose discretized autoencoder; The source pose sample token sequence is represented as: ; in, This represents the source pose sample token sequence. Indicates the first Token in the source pose sample Token sequence Individual posture token; The edit increment prediction module is used to input the source pose token sequence and text semantic features into a pre-trained semantic control pose editing model to obtain the edit increment of human pose changes. The training of the semantic control pose editing model includes: The source pose sample image is obtained from the human body basic pose image library. The source pose sample image is input into the pre-trained pose discretization autoencoder to obtain the source pose sample token sequence and the corresponding source discrete codebook index set. Select local body parts from the source pose sample image; Based on the source pose sample token sequence and the corresponding source discrete codebook index set, the selected local body parts of the human body are edited to obtain the target pose sample image of the human body parts with changes; wherein, the editing process includes processing the direction change of the body parts and processing the intensity of the direction change. Based on the selected human body parts, the direction of change of the body parts, and the intensity of the change of direction, generate corresponding semantic text examples; Construct a semantic pose pair training set based on the source pose sample image, the target pose sample image, and semantic text examples; Construct an initial semantic control pose editing model; An initial semantically controlled pose editing model is trained on the training set using semantic pose mapping. This initial model is designed to correctly predict the editing increment that transforms a source pose sample image into a target pose sample image. The resulting trained semantically controlled pose editing model includes: Obtain the source pose sample token sequence and the text semantic features of the semantic text example from the source pose sample image; The source pose sample token sequence is fused with text semantic features to obtain fused features; Predict the editing increment based on fusion characteristics; Based on the semantic features of the text, predict the category of the human body part to which the edit increment belongs; The predicted pose token sequence is obtained by replacing the corresponding positions in the source pose sample token sequence with edit increments; The predicted target pose map is generated by decoding the predicted pose token sequence. A second loss function is used to make the predicted target pose map close to the target pose sample map, and the prediction process of the human body part category to which the editing increment belongs is constrained; Obtain the trained semantic control pose editing model; The human pose editing module is used to edit the source pose token sequence using editing increments to obtain the edited human pose image; The human body image generation module is used to input the edited human body pose diagram as a pose condition diagram, along with prompt text, into the pose condition image generation model to generate the edited human body image.