Key point generation method, key point model training method and video generation method

By extracting key point sample data and motion constraints in the video frame, the key point generation model is optimized, which solves the problem of inaccurate target action prediction in the existing technology when the difference between the two frames is large, and achieves more accurate action prediction. .

CN118646938AInactive Publication Date: 2024-09-13HUA DATA TECH (SHANGHAI) CO LTD

Patent Information

Application Number
CN202410706471.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has the problem of inaccurate target action prediction when the difference between two frames is large.

Method used

By obtaining training samples, including key point sample data extracted from the first video frame, the second video frame and the third video frame, input the key point generation model, calculate the loss error according to the motion constraints of the target joint point, and adjust the model parameters until the iteration stop condition is met to optimize the prediction accuracy of the keypoint generation model.

Benefits of technology

The accuracy of target action prediction is improved, making the key point prediction between two video frames closer to the real value, and overcoming the problem of prediction inaccuracy with large differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646938A
    Figure CN118646938A
Patent Text Reader

Abstract

The invention provides a key point generation method, a training method of a key point model and a video generation method. The training method comprises the steps of obtaining a training sample; inputting the training sample into a key point generation model, and outputting key point prediction data of a video frame between the first video frame and the third video frame according to the key point generation model; calculating a loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data; the motion constraint condition comprises that the relative position relation of two adjacent target articulation points in the plurality of target articulation points in each video frame is unchanged; and adjusting network parameters of the key point generation model according to the loss error until an iteration stop condition is met. According to the method, the key point generation model is used for predicting the key points of the character actions in the two video frames, and the loss error is calculated according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data, so that the prediction value of the key point generation model is closer to the true value, and the prediction is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to providing a key point generation method and a model training method and a video generation method thereof. Background Art

[0002] In the prior art, video interpolation technology is widely used in this regard. Video interpolation is to insert multiple key frames between two pictures, shorten the display time between each frame, correct the illusion formed by the persistence of human vision, and thus produce a continuous action video. In order to interpolate the video, it is necessary to predict the movement of the object. Currently, the more widely used method is based on the optical flow method. The optical flow method calculates the displacement of a single pixel between two adjacent frames to obtain the object's motion flow field, thereby assisting in the calculation of the object's intermediate motion state. However, when the difference between two adjacent frames is large, it is difficult to predict accurately. Summary of the invention

[0003] The technical problem to be solved by the present invention is to overcome the problem of inaccurate prediction of target line action when the difference between two frames of images is relatively large in the prior art, and to provide a key point generation method and a training method of its model, a video generation method, a training device for the key point generation model, an electronic device and a computer program product.

[0004] The present invention solves the above technical problems through the following technical solutions:

[0005] A first aspect provides a training method for a key point generation model, the training method comprising:

[0006] Acquire training samples; the training samples include key point sample data extracted from the first video frame, the second video frame, and the third video frame, respectively, the key point sample data include position data of multiple target joints of the target object, the key point data is used to characterize the current action of the target, and the first video frame, the second video frame, and the third video frame are respectively intercepted from the target action video in sequence;

[0007] Inputting the training sample into a key point generation model, and outputting key point prediction data of video frames between the first video frame and the third video frame according to the key point generation model;

[0008] Calculating the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data; the motion constraint condition includes that the relative position relationship between two adjacent target joint points among the multiple target joint points in each video frame remains unchanged;

[0009] The network parameters of the key point generation model are adjusted according to the loss error until the iteration stop condition is met.

[0010] Optionally, calculating the loss error according to the operation constraint condition of the target joint point, the key point sample data and the key point prediction data includes:

[0011] For each two adjacent target joint points, calculate the position labels of the two adjacent target joint points in the first video frame and the third video frame according to the operation constraint conditions, calculate the predicted positions of the two adjacent target joint points according to the key point prediction data, and calculate the deviation between the predicted positions and the position labels;

[0012] The weighted result of the deviations corresponding to each two adjacent target joint points is determined as the constraint error;

[0013] The loss error is calculated based on the constraint error.

[0014] Optionally, the calculating the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data comprises:

[0015] Suppose the coordinates of the key point data of a group of joint groups extracted from the first video frame are The coordinates of the key point data of a group of joint groups extracted from the third video frame are

[0016] is the relative coordinate of one of the joint groups in the first key point data output by the key point sequence model, then the loss error of one of the joint groups is Wherein h is the height of the video frame in the training sample, and w is the width of the video frame in the training sample.

[0017] Optionally, the calculating the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data comprises:

[0018] Calculate the constraint error according to the operation constraint condition of the target joint point, the key point sample data and the key point prediction data;

[0019] Calculating a translation error based on the mean absolute error between the key point prediction data of the video frames between the first video frame and the third video frame and each target joint point in the key point data of the second video frame;

[0020] The loss error is calculated based on the translation error and the constraint error.

[0021] Optionally, inputting the training sample into a key point generation model, and outputting key point prediction data of video frames between the first video frame and the third video frame according to the key point generation model, comprises:

[0022] Normalizing the key point data according to the width and height of the video frame in the training sample;

[0023] The normalized key point data is input into the key point generation model, and the key point prediction data of the video frames between the first video frame and the third video frame are output according to the key point generation model.

[0024] In a second aspect, a key point generation method is provided, the key point generation method comprising:

[0025] Obtain two pictures of the same target object, input the two pictures into a key point generation model, and output key point prediction data between the two pictures according to the key point generation model as a key point sequence;

[0026] The key point generation model is trained by the key point generation model training method described above.

[0027] In a third aspect, a video generation method is provided, the video generation method comprising:

[0028] Get the target image and key point sequence,

[0029] Import the target image and key point sequence into the image-generated video diffusion model, obtain an image of the target performing the same action as the key point sequence, and synthesize the video;

[0030] The key point sequence is obtained by the key point generation method mentioned above.

[0031] In a fourth aspect, a training device for a key point generation model is provided, the training device comprising:

[0032] An acquisition module is used to acquire training samples; the training samples include key point sample data extracted from the first video frame, the second video frame and the third video frame respectively, the key point sample data includes position data of multiple target joints of the target object, the key point data is used to characterize the current action of the target, and the first video frame, the second video frame and the third video frame are respectively intercepted from the target action video in sequence;

[0033] A training module, used for inputting the training samples into a key point generation model, and outputting key point prediction data of video frames between the first video frame and the third video frame according to the key point generation model;

[0034] A loss calculation module, used to calculate the loss error according to the motion constraint conditions of the target joint points, the key point sample data and the key point prediction data; the motion constraint conditions include that the relative position relationship between two adjacent target joint points among the multiple target joint points in each video frame remains unchanged;

[0035] The optimization module is used to adjust the network parameters of the key point generation model according to the loss error until the iteration stop condition is met.

[0036] In a fifth aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the training method for the key point generation model described in any one of the above items is implemented.

[0037] In a sixth aspect, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the training method of the key point generation model described in any one of the above items is implemented.

[0038] On the basis of being in accordance with the common sense in the art, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present disclosure.

[0039] The positive progressive effect of the present invention is that after extracting the key point data of the characters in the previous and next video frames, the key point generation model is used to predict the key points of the characters' actions in the two video frames, and the loss error is calculated based on the motion constraints of the target joints, the key point sample data and the key point prediction data. This is used as a supervised definition constraint, and the model is trained by minimizing the constraint, optimizing the neural network model parameters, so that the predicted values ​​of the trained key point generation model are closer to the true values, thereby making the prediction of the target action more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A flowchart of a training method for a key point generation model provided by an exemplary embodiment of the present disclosure;

[0041] Figure 2 A schematic diagram of human body key point data after extraction provided by an exemplary embodiment of the present disclosure;

[0042] Figure 3 A schematic diagram of a certain adjacent joint movement vector provided for an exemplary embodiment of the present disclosure;

[0043] Figure 4 A schematic diagram of a certain adjacent joint movement vector after translation transformation provided by an exemplary embodiment of the present disclosure;

[0044] Figure 5 A flowchart of a key point generation method provided by an exemplary embodiment of the present disclosure;

[0045] Figure 6 A flowchart of a video generation method provided by an exemplary embodiment of the present disclosure;

[0046] Figure 7 A schematic diagram of a framework of an image-to-video character animation synthesis model provided by an exemplary embodiment of the present disclosure;

[0047] Figure 8 A module schematic diagram of a training device for a key point generation model provided by an exemplary embodiment of the present disclosure;

[0048] Fig. 9 The present invention is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0049] The present disclosure is further described below by way of examples, but the present disclosure is not limited to the scope of the examples.

[0050] Prefixes such as "first" and "second" are used in the embodiments of the present disclosure only to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes such as ordinal numbers to distinguish description objects in the embodiments of the present disclosure does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and no unnecessary limitation should be constituted due to the use of such prefixes. In addition, in the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.

[0051] Figure 1 A flowchart of a training method for a key point generation model provided by an exemplary embodiment of the present disclosure, the training method comprising the following steps:

[0052] Step 101, obtain training samples; the training samples include key point sample data extracted from the first video frame, the second video frame and the third video frame respectively, the key point sample data includes position data of multiple target joints of the target object, the key point data is used to characterize the current action of the target, and the first video frame, the second video frame and the third video frame are respectively captured in sequence from the target action video.

[0053] The number of training samples to be obtained can be determined according to actual conditions. It is understandable that the more training samples there are, the higher the accuracy of the key point generation model obtained by training. Multiple training samples can be presented in a set, that is, a training set.

[0054] Specifically, the target object disclosed in the present invention may include people, animals, robots, etc. In this embodiment, people are taken as an example, and the video uses the public UBC fashion dataset, which is a dataset released by the UBC Computer Vision Laboratory for research and development of tasks related to fashion, human posture and video generation. The dataset contains 500 training videos, and multiple data are collected for each video. If the number of video frames is 24 frames per second, each video can randomly select a starting frame as the first video frame, and then set the third video frame at intervals of 4, 8, 15, 30, 45, and 60 frames, so that 6 sets of data can be collected in one acquisition. If the number of video frames is 60 frames per second, each video can randomly select a starting frame as the first video frame, and then set the third video frame at intervals of 10, 20, 30, 40, 50, and 60 frames. The specific number of interval frames collected is related to the video dataset. If the number of video frames is relatively high, the collection interval can be extended, and this embodiment does not limit it. The middle frame between the first video frame and the third video frame is used as the second video frame. For example, if the third video frame is set at an interval of 8 frames, the 4th frame is the second video frame. If the middle frame is not an integer frame, it can be rounded up or down. For example, if the third video frame is set at an interval of 15 frames, the 7th or 8th frame is taken as the second video frame. After the acquisition is completed, the key point extraction algorithm such as Dwpose algorithm is used to extract the key points of the first video frame, the second video frame and the third video frame. Figure 2 The extracted data is used as training samples.

[0055] Step 102: input the training samples into a key point generation model, and output key point prediction data of video frames between the first video frame and the third video frame according to the key point generation model.

[0056] Specifically, the architecture of the neural network of the key point generation model in this embodiment can use several residual connected linear layers as the core of the network. Through model training, the key point generation model has the ability to predict the key point prediction data of the middle video frame between two frames through the first video frame and the third video frame. Furthermore, in the next round of iterative training, the key point prediction data of the middle video frame can be input into the key point generation model to output the key point prediction data of the video frame between the first video frame and the middle video frame. According to this method, the key point prediction data of all video frames between the first video frame and the third video frame are output. The specific number of key point prediction data of video frames that need to be generated between the first video frame and the third video frame can be set according to specific needs.

[0057] Step 103, calculating the loss error according to the motion constraint conditions of the target joint points, the key point sample data and the key point prediction data; the motion constraint conditions include that the relative position relationship between two adjacent target joint points among the multiple target joint points in each video frame remains unchanged.

[0058] Specifically, the loss error of the neural network needs to be calculated based on the key point prediction data and the key point data of the second video frame. Since the rotation speed and presentation length of two adjacent target joints are constant, the relative position relationship between the two adjacent target joints in each video frame is constant. Based on this as a motion constraint condition, the loss error is calculated.

[0059] Step 104: Adjust the network parameters of the key point generation model according to the loss error until the iteration stop condition is met.

[0060] The iteration stopping condition may include, but is not limited to: when the loss error is less than an error threshold or the number of iterations reaches a number threshold, the iteration stops.

[0061] In this embodiment, after the key point data of the characters in the previous and next video frames are extracted, the key point generation model is used to predict the key points of the character's actions in the two video frames, and the loss error is calculated based on the motion constraints of the target joints, the key point sample data and the key point prediction data. This is used as a supervised definition constraint, and the model is trained by minimizing the constraint. The neural network model parameters are optimized so that the predicted values ​​of the trained key point generation model are closer to the true values, thereby making the target action prediction more accurate.

[0062] In one embodiment, the loss error is calculated according to the operation constraint conditions of the target joint point, the key point sample data and the key point prediction data, including:

[0063] For every two adjacent target joints, the position labels of the two adjacent target joints in the first video frame and the third video frame are calculated respectively according to the operating constraints, the predicted positions of the two adjacent target joints are calculated according to the key point prediction data, and the deviation between the predicted position and the position label is calculated; the weighted result of the deviation corresponding to each two adjacent target joints is determined as the constraint error; and the loss error is calculated based on the constraint error.

[0064] Specifically, Figure 2 In the human key point data shown, adjacent joint points 2 and 3 can represent the right arm of a person (hereinafter referred to as 2-3), and the others are similar. That is, the two adjacent joint points satisfy the natural human motion trajectory, because the rotation speed and the length of the presentation of the two adjacent target joint points are unchanged. The 2-3 nodes in the first video frame, the second video frame, and the third video frame in the training set are displayed in vector form, such as Figure 3 As shown, from left to right are the adjacent representations of nodes 2-3 in the first video frame, the adjacent representations of nodes 2-3 in the second video frame, and the adjacent representations of nodes 2-3 in the third video frame. The vectors of these three are translated to Figure 4 As shown. Then the constraints can be expressed as but not limited to: Based on the above operating constraints, the position labels of two adjacent target joint points in the first video frame and the third video frame can be calculated, that is, the coordinate system is established with the bottom and left border of the video frame image, and the coordinates of the target joint point in the i-th frame video frame are expressed as Available And calculate the deviation between the predicted position and the position label; determine the weighted result of the deviation corresponding to each two adjacent target joint points as the constraint error; and calculate the loss error based on the constraint error.

[0065] Preferably, eight parts of the human body, 2-3, 3-4, 5-6, 6-7, 8-9, 9-10, 11-12, and 12-13, are selected from the human body key point data. Since the joint rotation of the human body is mainly closely related to the above eight parts, the loss error is calculated for the above eight parts according to the constraint error.

[0066] In this embodiment, the constraint error is determined according to the target motion law, the goal and direction of model training are provided, the model parameters are updated by calculating the gradient of the loss function, the prediction error is gradually reduced, and the prediction accuracy of the key point generation model is improved.

[0067] In one embodiment, calculating the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data includes:

[0068] Suppose the coordinates of the key point data of a group of joint groups extracted from the first video frame are The coordinates of the key point data of a group of joint groups extracted from the third video frame are

[0069] is the coordinate of one of the joint groups in the first key point data output by the key point sequence model, then the loss error of one of the joint groups is

[0070] Specifically, according to the derivation in the previous embodiment, Establish a coordinate system based on the bottom and left border of the video frame image, and set the corresponding coordinates as Available Based on this, the loss loss can be defined as are the coordinates of the two key points 2-3 output by the key point sequence model. Then

[0071] The weighted result of the deviations corresponding to each two adjacent target joint points is determined as the constraint error.

[0072] Preferably, weighted results of deviations corresponding to eight parts of the human body, 2-3, 3-4, 5-6, 6-7, 8-9, 9-10, 11-12, and 12-13, are selected from the human body key point data and determined as the constraint error.

[0073] In this embodiment, the constraint error is determined by a specific loss calculation formula. Due to the existence of the square, it is more sensitive to large errors, which helps to quickly reduce large errors and make the model more accurate in prediction.

[0074] In one embodiment, calculating the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data includes:

[0075] The translation error is calculated based on the average absolute error between the key point prediction data of the video frames between the first video frame and the third video frame and each target joint point in the key point data of the second video frame; and the loss error is calculated based on the translation error.

[0076] Specifically, between the first video frame and the third video frame, each joint point will undergo translational movement when the target moves. The model parameters can be further converged by calculating the translation loss error. Since the key point data of the second video frame is real data, the translation loss error is calculated based on the average absolute error between the key point prediction data of the video frames between the first video frame and the third video frame and each target joint point in the key point data of the second video frame. For each predicted value and the true value p i , calculate the absolute difference between them Add up all the absolute differences to get the total absolute error. Divide the total absolute error by the number of data points n to get the mean absolute error.

[0077] In one embodiment, calculating the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data includes:

[0078] The constraint error is calculated based on the operating constraints of the target joint point, the key point sample data and the key point prediction data. The translation error is calculated based on the average absolute error between the key point prediction data of the video frames between the first video frame and the third video frame and the key point data of the second video frame. The loss error is calculated based on the translation error and the constraint error.

[0079] Specifically, the loss error can be obtained by weighted calculation based on the previous constraint error and translation error, wherein the weighted value of the constraint error is higher. The network parameters of the key point generation model are adjusted according to the loss error until the iteration stop condition is met.

[0080] In this embodiment, the loss error is calculated by the mean absolute error between each target joint point, and the loss error is calculated after weighting the constraint error, which can further converge the model parameters and improve the accuracy of model prediction.

[0081] In one embodiment, the training samples are input into a key point generation model, and key point prediction data of video frames between the first video frame and the third video frame are output according to the key point generation model, further comprising:

[0082] Normalize the key point data according to the width and height of the video frame in the training sample;

[0083] The normalized key point data is input into a key point generation model, and the key point prediction data of the video frames between the first video frame and the third video frame are output according to the key point generation model.

[0084] Specifically, the coordinates of the extracted key points are divided by the height and width of the original image to obtain the relative positions of the key points, the key point data are normalized, and the normalized key point data are input into the key point generation model to output key point prediction data.

[0085] In one embodiment, calculating the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data includes:

[0086] Suppose the coordinates of the key point data of a group of joint groups extracted from the first video frame are The coordinates of the key point data of a group of joint groups extracted from the third video frame are set up is the relative coordinate of one of the joint groups in the first key point data output by the key point sequence model, then the loss error of one of the joint groups is Where h is the height of the video frame in the training sample, and w is the width of the video frame in the training sample.

[0087] Specifically, according to the previous embodiments, Establish a coordinate system based on the bottom and left border of the video frame image, and set the corresponding coordinates as For the video frame height in the training sample is h, and the video frame width in the training sample is w, the above formula can be obtained:

[0088]

[0089] set up is the normalized coordinate of one of the joint groups in the first key point data output by the key point sequence model, then the loss error of one of the joint groups after normalization is Where h is the height of the video frame in the training sample, and w is the width of the video frame in the training sample.

[0090] In this embodiment, the normalized key point data can free the entire algorithm from the constraints of image size, facilitating subsequent model training and calculation of loss errors.

[0091] Figure 5 A key point sequence generation method is provided as an exemplary embodiment of the present invention, and the key point sequence generation method includes:

[0092] Step 501: Obtain two pictures of the same target object;

[0093] Step 502: input the two pictures into a key point generation model, and output key point prediction data between the two pictures according to the key point generation model as a key point sequence;

[0094] The key point generation model is trained by the key point generation model training method in any of the above embodiments.

[0095] In this embodiment, two pictures of the same target object are used, one picture is used as the initial frame and the other picture is used as the end frame, and the two pictures are input into the key point generation model. The key point generation model can predict the key point prediction data of the middle video frame between the two frames through the first video frame and the third video frame, and then the key point prediction data of the middle video frame is input into the key point generation model to output the key point prediction data of the video frame between the first video frame and the middle video frame. According to this method, the key point prediction data of all video frames between the first video frame and the third video frame are output. The key point prediction data of how many video frames need to be generated between the first video frame and the third video frame can be set according to specific needs. Thus, all the prediction data can be combined to obtain a key point sequence. The key point sequence can be used to characterize the change of the target action from one picture to another.

[0096] Figure 6 An exemplary embodiment of the present invention provides a video generation method, the video generation method comprising:

[0097] Step 601: Obtain target image and key point sequence.

[0098] Step 602: Import the target image and the key point sequence into the image generation video diffusion model, obtain an image of the target performing the same action as the key point sequence, and synthesize the video;

[0099] The key point sequence is obtained by the key point generation method in the above embodiment.

[0100] Specifically, in order to solve the problem of large differences between two adjacent frames, when deep learning is used for interpolation, the large differences between two adjacent frames mean that a larger receptive field is required, that is, a larger convolution kernel or a deeper network is used, which has a greater impact on the scale and efficiency of the network. In the present embodiment, two stages are used to interpolate between two pictures. In the first stage, a key point generation model is used to extract the key point information of the target in the previous and next pictures, and the key points are predicted to obtain a series of key points of the intermediate frames; in the second stage, a diffusion model is used to take a series of key points and reference pictures as input to generate continuous and smooth intermediate frame pictures to generate a video. A series of pictures that retain the reference picture information and maintain the key point movements are generated from a character reference picture and a sequence of key point pictures. The present disclosure adopts the Diffusion model. In addition, other methods can be used to generate, such as generative models such as GANs. Specifically, the framework of Animate Anyone (image to video character animation synthesis model) can be used. As Figure 7 As shown. After the encoder is used to encode the original data into the latent space, the diffusion model is used in the latent space to generate feature values ​​that are consistent with the key point actions and retain the character information of the reference picture, and then decoded to generate a smooth video with the final picture sequence that is consistent with the key point actions and retains the character information of the reference picture. Among them, the key point data of the target picture can be the same as the video frame that generates the key point sequence, or it can be different.

[0101] In this embodiment, by generating a video diffusion model through pictures, a series of pictures retaining the reference picture information and maintaining the key point actions can be generated from a character reference picture and a key point picture sequence, and then synthesized into the required video.

[0102] Corresponding to the aforementioned embodiment of the training method for a key point generation model, the present disclosure also provides an embodiment of a training device for a key point generation model.

[0103] Figure 8 A module schematic diagram of a training device for a key point generation model provided by an exemplary embodiment of the present disclosure, the system comprising:

[0104] Acquisition module 1, used to acquire training samples; the training samples include key point sample data extracted from the first video frame, the second video frame and the third video frame respectively, the key point sample data includes position data of multiple target joints of the target object, the key point data is used to characterize the current action of the target, and the first video frame, the second video frame and the third video frame are respectively intercepted from the target action video in sequence;

[0105] Training module 2, used for inputting training samples into a key point generation model, and outputting key point prediction data of video frames between the first video frame and the third video frame according to the key point generation model;

[0106] The loss calculation module 3 is used to calculate the loss error according to the motion constraint conditions of the target joint points, the key point sample data and the key point prediction data; the motion constraint conditions include that the relative position relationship between two adjacent target joint points among the multiple target joint points in each video frame remains unchanged;

[0107] The optimization module 4 is used to adjust the network parameters of the key point generation model according to the loss error until the iteration stop condition is met.

[0108] In this embodiment, after the key point data of the characters in the previous and next video frames are extracted, the key point generation model is used to predict the key points of the character's actions in the two video frames, and the loss error is calculated based on the motion constraints of the target joints, the key point sample data and the key point prediction data. This is used as a supervised definition constraint, and the model is trained by minimizing the constraint. The neural network model parameters are optimized so that the predicted values ​​of the trained key point generation model are closer to the true values, thereby making the target action prediction more accurate.

[0109] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution.

[0110] Fig. 9 This is a structural schematic diagram of an electronic device showing an example embodiment of the present disclosure, wherein the electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor, and when the processor executes the computer program, the training method of the key point generation model described in any of the above embodiments is implemented. Fig. 9 The electronic device 90 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0111] like Fig. 9 As shown, the electronic device 90 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).

[0112] The bus 93 includes a data bus, an address bus, and a control bus.

[0113] The memory 92 may include a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .

[0114] The memory 92 may also include a program tool 925 (or utility) having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.

[0115] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the training method of the key point generation model provided in any of the above embodiments.

[0116] The electronic device 90 may also communicate with one or more external devices 94 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 95. Furthermore, the electronic device 90 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 96. As shown, the network adapter 96 communicates with other modules of the electronic device 90 via a bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0117] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0118] The present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements the training method of the key point generation model described in any one of the above items.

[0119] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.

[0120] Although the specific embodiments of the present disclosure are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present disclosure, but these changes and modifications all fall within the protection scope of the present disclosure.

Claims

1. A training method for a key point generation model, characterized in that: The training method comprises: Acquire training samples; the training samples include key point sample data extracted from the first video frame, the second video frame, and the third video frame, respectively, the key point sample data include position data of multiple target joints of the target object, the key point data is used to characterize the current action of the target, and the first video frame, the second video frame, and the third video frame are respectively intercepted from the target action video in sequence; Inputting the training sample into a key point generation model, and outputting key point prediction data of video frames between the first video frame and the third video frame according to the key point generation model; Calculating the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data; the motion constraint condition includes that the relative position relationship between two adjacent target joint points among the multiple target joint points in each video frame remains unchanged; The network parameters of the key point generation model are adjusted according to the loss error until the iteration stop condition is met.

2. The training method according to claim 1, characterized in that: Calculating the loss error according to the operation constraint condition of the target joint point, the key point sample data and the key point prediction data includes: For each two adjacent target joint points, calculate the position labels of the two adjacent target joint points in the first video frame and the third video frame according to the operation constraint conditions, calculate the predicted positions of the two adjacent target joint points according to the key point prediction data, and calculate the deviation between the predicted positions and the position labels; The weighted result of the deviations corresponding to each two adjacent target joint points is determined as the constraint error; The loss error is calculated based on the constraint error.

3. The training method according to claim 1, characterized in that: The calculation of the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data comprises: Suppose the coordinates of the key point data of a group of joint groups extracted from the first video frame are The coordinates of the key point data of a group of joint groups extracted from the third video frame are is the relative coordinate of one of the joint groups in the first key point data output by the key point sequence model, then the loss error of one of the joint groups is Wherein h is the height of the video frame in the training sample, and w is the width of the video frame in the training sample.

4. The training method according to claim 1, characterized in that: The calculation of the loss error according to the motion constraint condition of the target joint point, the key point sample data and the key point prediction data comprises: Calculate the constraint error according to the operation constraint condition of the target joint point, the key point sample data and the key point prediction data; Calculating a translation error based on the mean absolute error between the key point prediction data of the video frames between the first video frame and the third video frame and each target joint point in the key point data of the second video frame; The loss error is calculated based on the translation error and the constraint error.

5. The training method according to claim 1, characterized in that: Inputting the training sample into a key point generation model, and outputting key point prediction data of video frames between the first video frame and the third video frame according to the key point generation model, comprising: Normalizing the key point data according to the width and height of the video frame in the training sample; The normalized key point data is input into the key point generation model, and the key point prediction data of the video frames between the first video frame and the third video frame are output according to the key point generation model.

6. A key point generation method, characterized in that: The key point generation method comprises: Get two pictures of the same target object; Inputting two pictures into a key point generation model, and outputting key point prediction data between the two pictures according to the key point generation model as a key point sequence; The key point generation model is trained by the key point generation model training method described in any one of claims 1 to 5.

7. A video generation method, characterized in that: The video generation method comprises: Get the target image and key point sequence; Import the target image and key point sequence into the image-generated video diffusion model, obtain an image of the target performing the same action as the key point sequence, and synthesize the video; The key point sequence is obtained by the key point generation method described in claim 6.

8. A training device for a key point generation model, characterized in that: The training device comprises: An acquisition module is used to acquire training samples; the training samples include key point sample data extracted from the first video frame, the second video frame and the third video frame respectively, the key point sample data includes position data of multiple target joints of the target object, the key point data is used to characterize the current action of the target, and the first video frame, the second video frame and the third video frame are respectively intercepted from the target action video in sequence; A training module, used for inputting the training samples into a key point generation model, and outputting key point prediction data of video frames between the first video frame and the third video frame according to the key point generation model; A loss calculation module, used to calculate the loss error according to the motion constraint conditions of the target joint points, the key point sample data and the key point prediction data; the motion constraint conditions include that the relative position relationship between two adjacent target joint points among the multiple target joint points in each video frame remains unchanged; The optimization module is used to adjust the network parameters of the key point generation model according to the loss error until the iteration stop condition is met.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor executes the computer program According to any one of claims 1 to 5 Training method for key point generation model.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the training method of the key point generation model described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Transition frame prediction model training method and transition frame prediction method

    CN113112577A

  • Image processing method and device, and storage medium

    CN115578610A

  • Gesture recognition method and device, electronic equipment and storage medium

    CN116092183A

  • Action migration model training method, action migration method and electronic equipment

    CN117853750A

  • Motion model refinement based on contact analysis and optimization

    US20210335028A1

Cited By

  • Motion capture method and related device

    CN119229344A