Method for training video generation model, video generation method, device, equipment, storage medium and program product

By performing weight calculations for keypoint prediction and confidence determination in the video generation model, the problem of low portrait quality in portrait video generation is solved, and attention is paid to pixel-level detail features of the target object, thereby improving the video generation effect.

CN123164301APending Publication Date: 2026-11-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510688636.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing video generation models suffer from low image quality in portrait video generation, particularly in terms of unclear facial features and local details.

Method used

By predicting key points on ground truth video frames, determining the confidence level of the predicted key points, and determining the weight values ​​of pixels based on the confidence level, loss calculation is performed to update the parameters of the video generation model, thereby improving the attention to pixel-level detailed features of the target object.

Benefits of technology

It improves the video generation model's ability to generate videos of target objects, especially in portrait video generation, where the quality of facial and local details is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164301A_ABST
    Figure CN123164301A_ABST
Patent Text Reader

Abstract

This application provides a training method for a video generation model, a video generation method, an apparatus, a device, a storage medium, and a program product, which are at least applicable to the field of artificial intelligence technology. The method includes: predicting key points in ground truth video frames to obtain at least one predicted key point and the confidence level of each predicted key point in the ground truth video frames; determining the weight values ​​of pixels in the ground truth video frames based on the confidence levels of the at least one predicted key point; calculating a loss based on the first pixel value, the weight value, and the second pixel value of the pixels in the predicted video frames to obtain a loss result; and updating the model parameters of the video generation model to be trained based on the loss result to obtain a trained video generation model. This application can improve the video generation performance of the trained video generation model for target objects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and includes, but is not limited to, a training method for a video generation model, a video generation method, an apparatus, a device, a storage medium, and a program product. Background Technology

[0002] Currently, research on large-scale video generation models is receiving a great deal of attention, especially human-related video generation, which has important applications in film and television clip production, advertising clip production, digital human creation, and self-media content production.

[0003] However, the video generation models in related technologies are usually geared towards general scenarios. Therefore, when using video generation models to generate portrait videos, the quality of the portraits often suffers, such as the faces not resembling the subject or the various parts of the portrait being unclear. Summary of the Invention

[0004] This application provides a training method for a video generation model, a video generation method, an apparatus, a device, a storage medium, and a program product, which can be applied to at least the field of artificial intelligence. The video generation model trained by this application can pay more attention to the pixel-level details of the target object, thereby improving the video generation effect of the trained video generation model for the target object.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides a training method for a video generation model, comprising: acquiring a model-predicted video and a ground truth video; the model-predicted video is generated by the video generation model to be trained based on sample control conditions, and the ground truth video is the video corresponding to the sample control conditions, the model-predicted video including multiple predicted video frames; performing keypoint prediction on the ground truth video frames in the ground truth video to obtain at least one predicted keypoint in the ground truth video frames and the confidence level of each predicted keypoint; determining the weight values ​​of pixels in the ground truth video frames based on the confidence levels of the at least one predicted keypoint; performing loss calculation based on the first pixel value of the pixels in the ground truth video frames, the weight values, and the second pixel value of the pixels in the predicted video frames to obtain a loss result; and updating the model parameters of the video generation model to be trained based on the loss result to obtain a trained video generation model.

[0007] This application provides a training apparatus for a video generation model, comprising: a first acquisition module for acquiring a model-predicted video and a ground truth video; the model-predicted video is generated by the video generation model to be trained based on sample control conditions, and the ground truth video is a video corresponding to the sample control conditions, the model-predicted video including multiple predicted video frames; a keypoint prediction module for performing keypoint prediction on the ground truth video frames in the ground truth video to obtain at least one predicted keypoint in the ground truth video frames and the confidence level of each predicted keypoint; a weight determination module for determining the weight values ​​of pixels in the ground truth video frames based on the confidence levels of the at least one predicted keypoint; a loss calculation module for performing loss calculation based on the first pixel value of the pixels in the ground truth video frames, the weight values, and the second pixel value of the pixels in the predicted video frames to obtain a loss result; and a parameter update module for updating the model parameters of the video generation model to be trained based on the loss result to obtain a trained video generation model.

[0008] In the above scheme, the key point prediction module is further configured to: extract features from the ground truth video frame to obtain the frame feature vector of the ground truth video frame; perform a first feature mapping on the frame feature vector to obtain the position information of at least one predicted key point; and perform a second feature mapping on the frame feature vector and the position information to obtain the confidence level of each predicted key point.

[0009] In the above scheme, the weight determination module is further configured to: determine the predicted key points with confidence scores greater than a preset confidence threshold as target key points; the number of target key points is at least one; determine the target location of each target key point in the target object in the ground truth video frame; and determine the weight value of each pixel in the ground truth video frame based on the target location and the confidence score of each target key point.

[0010] In the above scheme, the weight determination module is further configured to: in response to the target part of any target joint being the face or hand of the target object, determine the target joint as a first joint; the number of the first joints is at least one; and determine the weight value of each pixel in the region where the first joint is located based on the confidence level of the first joint.

[0011] In the above scheme, the weight determination module is further configured to: determine the target circular region corresponding to each first joint point; wherein the target circular region is a circular region with the joint point coordinates of the first joint point as the center and a preset value as the radius; based on the target circular region of at least one first joint point, determine the weight value of each pixel in the first region where the at least one first joint point is located; the first region is the pixel region obtained by taking the union of the target circular regions of all first joint points.

[0012] In the above scheme, the weight determination module is further configured to: in response to the first joint point being a joint point located on the face of the target object, determine a first target circular region corresponding to the first joint point on the face; wherein the first target circular region is a circular region with the joint point coordinates of the first joint point on the face as the center and a first preset value as the radius; in response to the first joint point being a joint point located on the hand of the target object, determine a second target circular region corresponding to the first joint point on the hand; wherein the second target circular region is a circular region with the joint point coordinates of the first joint point on the hand as the center and a second preset value as the radius.

[0013] In the above scheme, the weight determination module is further configured to: for each pixel in the first region, in response to the pixel being located in a target circular region of a first joint, determine the weight value of the pixel by multiplying the confidence level of the first joint by a preset coefficient; in response to the pixel being located in a target circular region of multiple first joints, smooth the sum of the confidence levels of the multiple first joints to obtain a smoothed confidence level; and determine the weight value of the pixel by multiplying the smoothed confidence level by the preset coefficient.

[0014] In the above scheme, the weight determination module is further configured to: in response to the fact that the target part of any target joint is a body part of the target object, determine the any target joint as a second joint; the number of second joints is at least one; and determine the weight value of each pixel in the region where the second joint is located.

[0015] In the above scheme, the weight determination module is further configured to: determine the target rectangular region corresponding to all the second joints; wherein the target rectangular region is the smallest rectangular region surrounding all the second joints; and determine the weight value of each pixel in the target rectangular region as a first preset weight value.

[0016] In the above scheme, the weight determination module is further configured to: in response to any pixel not belonging to the target rectangular region and not belonging to the first region where at least one first joint is located, determine the weight value of the any pixel as a second preset weight value.

[0017] In the above scheme, the loss calculation module is further configured to: construct a correspondence between each pixel in the ground truth video frame and each pixel in the predicted video frame, forming multiple pixel pairs; wherein, the weight value corresponding to each pixel pair is the weight value of the pixel from the ground truth video frame in the pixel pair; determine the pixel value difference between the first pixel value of the pixel from the ground truth video frame and the second pixel value of the pixel from the predicted video frame in each pixel pair; and determine the loss result based on the pixel value difference of all pixel pairs and the weight value corresponding to the pixel pairs.

[0018] In the above scheme, the loss calculation module is further configured to: for each pixel pair, determine the square of the pixel value difference of the pixel pair to obtain the first value of the pixel pair; multiply the first value of the pixel pair by the weight value corresponding to the pixel pair to determine the loss value of the pixel pair; and summarize the loss values ​​of all pixel pairs to obtain the loss result.

[0019] This application provides a video generation method, the method comprising: acquiring a video generation request, the video generation request including control conditions; responding to the video generation request, generating a target video based on the control conditions using a pre-trained video generation model; wherein the video generation model is trained using the above-described video generation model training method.

[0020] This application provides a video generation apparatus, the apparatus comprising: a second acquisition module for acquiring a video generation request, the video generation request including control conditions; and a video generation module for generating a target video based on the control conditions using a pre-trained video generation model in response to the video generation request; wherein the video generation model is trained using the aforementioned video generation model training method.

[0021] This application provides an electronic device, including: a memory for storing computer-executable instructions or computer programs; and a processor for executing the computer-executable instructions or computer programs stored in the memory to implement the above-described training method or video generation method for the video generation model.

[0022] This application provides a computer program product that stores computer-executable instructions or a computer program, which are used to cause a processor to execute the computer-executable instructions or the computer program to implement the above-mentioned training method or video generation method for the video generation model.

[0023] This application provides a computer-readable storage medium storing computer-executable instructions or computer programs, which are used to cause a processor to execute the computer-executable instructions or computer programs to implement the above-described video generation model training method or video generation method.

[0024] The above scheme has the following beneficial effects:

[0025] In this embodiment of the application, when training the video generation model, keypoint prediction is performed on the ground truth video frames in the ground truth video to obtain at least one predicted keypoint in the ground truth video frame and the confidence level of each predicted keypoint. Based on the confidence level of the predicted keypoint, the weight value of the pixel in the ground truth video frame is determined, and then the loss is calculated in combination with the weight value. That is, a weighted loss calculation is performed on the first pixel value of each pixel in the ground truth video frame and the second pixel value of each pixel in the predicted video frame. Thus, since the weight values ​​used in the loss calculation process are determined based on the confidence levels of different prediction joints, these weight values ​​take into account the credibility of different prediction joints in the ground truth video. Furthermore, the weight value determined is for each pixel in the ground truth video frame, that is, for the pixel-level features in the ground truth video frame, the corresponding weight value is determined separately. Therefore, the loss result obtained by calculating the loss using these weight values ​​is a loss result that takes into account pixel-level features. Thus, training the video generation model based on this loss result enables the trained video generation model to pay more attention to the pixel-level details of the target object, thereby improving the video generation effect of the trained video generation model for the target object. Attached Figure Description

[0026] Figure 1 This is a framework diagram of the related technology's Chinese video generation;

[0027] Figure 2 This is a framework diagram of image-generated video in related technologies;

[0028] Figure 3 This is an optional architecture diagram of the training system for the video generation model provided in this application embodiment;

[0029] Figure 4 This is an optional architecture diagram of the video generation system provided in the embodiments of this application;

[0030] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0031] Figure 6 This is an optional flowchart illustrating the training method of the video generation model provided in this application embodiment;

[0032] Figure 7This is a schematic diagram illustrating the implementation process of keypoint prediction for true video frames provided in an embodiment of this application;

[0033] Figure 8 This is a schematic diagram illustrating the implementation process for determining the weight values ​​of pixels in a true video frame, as provided in an embodiment of this application.

[0034] Figure 9 This is a schematic diagram of an implementation process provided in this application embodiment to determine the weight value of each pixel in a true video frame based on the target location and confidence level of each target joint.

[0035] Figure 10 This is a schematic diagram of another implementation process provided by the embodiments of this application for determining the weight value of each pixel in the true video frame based on the target location and confidence level of each target joint.

[0036] Figure 11 This is a schematic diagram of one implementation flow of the loss calculation process provided in the embodiments of this application;

[0037] Figure 12 This is an optional flowchart illustrating the video generation method provided in this application embodiment;

[0038] Figure 13 This is a model reasoning framework diagram of the video generation method provided in the embodiments of this application;

[0039] Figure 14 This is a flowchart illustrating the overall solution process provided in the embodiments of this application;

[0040] Figure 15 This is a single-frame image of a person and their corresponding 2D pose, provided in an embodiment of this application.

[0041] Figure 16 This is a before-and-after comparison diagram of the video generation method provided in the embodiments of this application;

[0042] Figure 17 This is another before-and-after comparison diagram of the video generation method provided in the embodiments of this application;

[0043] Figure 18 This is another before-and-after comparison diagram of the video generation method provided in the embodiments of this application. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit the application.

[0046] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0047] Numerous video generation models have emerged in related technologies, such as SVD, HunyuanVideo, Cogvideo, and Wan. Currently, human-centered video generation tasks are in high demand in scenarios such as digital human creation, film and television production, and advertising production. Figure 1 The diagram shows a framework for generating Chinese videos using related technologies. Inputs include a video 101 containing both people and background information, and a text description 102. The video 101 is encoded by a VAE encoder 103 to obtain image encoding features. The text description 102 is then processed by a large language model 104 to extract text features, and noise 105 is added. A text-generated video model 106 maps the image encoding features, text features, and noise 105 to obtain mapped features. Finally, the mapped features are decoded by a VAE decoder 107 to generate the video. Figure 2The diagram illustrates the framework of image-generated video in related technologies. Inputs include a text description (Caption) 201, an image 202, and a noisy input 203. The text description 201 is processed using a CLIP-Large model and a Multilayer Perceptron (MLP). The image 202 is processed using a Multimodal Large Language Model (MLLM) and text unit optimization (e.g., Token Refiner). The noisy input 203 is first patchified and then processed through a linear layer. Text and image features are extracted through their respective processing paths and then fused. The fused features are processed through a series of DiT (Diffusion Transformer) blocks, including single-stream and dual-stream DiT blocks. Afterward, timestep processing is performed; the timestep is processed by sinusoidal encoding and MLP, and then added to the fused features. Finally, during the generation process, the features processed by DiT blocks are modulated, linearly layered, and unpatchified to generate the final output video.

[0048] However, current video generation models are all geared towards general scenarios. When these models are used to generate portrait videos, the quality of the portraits is often poor, and the quality of local details is not high, such as finger imperfections, unclear faces, and foot imperfections.

[0049] To address at least one of the aforementioned problems in related technologies, this application provides a training method for a video generation model, a video generation method, an apparatus, a device, a storage medium, and a program product to solve the problem of low quality in the human image portion during human image video generation. The training method and video generation method described here are enhancement solutions. This solution is applicable to all human-related generation models, including image-generated video, text-generated video, or video generation under other control conditions.

[0050] Specifically, the video generation model training method provided in this application embodiment first obtains a model prediction video and a ground truth video. The model prediction video is generated by the video generation model to be trained based on sample control conditions, and the ground truth video is the video corresponding to the sample control conditions. Then, keypoint prediction is performed on the ground truth video frames in the ground truth video to obtain at least one predicted keypoint in the ground truth video frame and the confidence level of each predicted keypoint. Based on the confidence level of at least one predicted keypoint, the weight values ​​of the pixels in the ground truth video frame are determined. Then, loss calculation is performed based on the first pixel value, weight value, and second pixel value of the pixels in the ground truth video frame and the second pixel value of the pixels in the prediction video frame to obtain a loss result. Finally, based on the loss result, the model parameters of the video generation model to be trained are updated to obtain the trained video generation model. Furthermore, in the video generation method provided in this application embodiment, first, a video generation request is obtained, which includes control conditions. Then, in response to the video generation request, a target video is generated based on the control conditions using a pre-trained video generation model. The video generation model is trained using the aforementioned video generation model training method. Thus, in this embodiment, since the weight values ​​used in the loss calculation process are determined based on the confidence levels of different prediction joints, these weight values ​​take into account the credibility of different prediction joints in the ground truth video. Furthermore, the weight value determined is the weight value of each pixel in the ground truth video frame. That is, for the pixel-level features in the ground truth video frame, the corresponding weight values ​​are determined respectively. Therefore, the loss result obtained by calculating the loss using these weight values ​​is a loss result that takes into account pixel-level features. Thus, training the video generation model based on these loss results enables the trained video generation model to pay more attention to the pixel-level details of the target object, thereby improving the video generation effect of the trained video generation model for the target object.

[0051] Here, we first describe the exemplary applications of the video generation model training device and the video generation device in the embodiments of this application. The video generation model training device and the video generation device are electronic devices used to implement the training method of the video generation model and the video generation method, respectively. The video generation model training device and the video generation device provided in the embodiments of this application can be the same electronic device or different electronic devices. The video generation model training device and the video generation device (i.e., electronic devices) provided in the embodiments of this application can be implemented as terminals or as servers. In one implementation, the electronic device provided in the embodiments of this application can be implemented as any terminal with model training and video generation functions, such as a laptop, tablet, desktop computer, or intelligent robot; in another implementation, the electronic device provided in the embodiments of this application can also be implemented as a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiments of this application. Below, we will describe exemplary applications when the electronic device is implemented as a server.

[0052] See Figure 3 , Figure 3 This is an optional architecture diagram of the video generation model training system provided in this application embodiment. The video generation model training system 10 in this application embodiment includes at least a first terminal 100, a first network 200, and a first server 300. The first terminal 100 is equipped with a model training platform, which can be a platform for training the video generation model. The first server 300 can be a backend server of the model training platform. The first server 300 can constitute the training device for the video generation model in this application embodiment, that is, the training method of the video generation model in this application embodiment is implemented through the first server 300. The first terminal 100 is connected to the first server 300 through the first network 200, which can be a wide area network (WAN), a local area network (LAN), or a combination of both.

[0053] See Figure 3During the training of the video generation model, the first terminal 100 receives sample control conditions and ground truth video input by the user, and encapsulates the sample control conditions and ground truth video into a model training request. The first terminal 100 sends the model training request to the first server 300 through the first network 200. In response to the model training request, the first server 300 calls the video generation model to be trained to generate a predicted video based on the sample control conditions, and performs keypoint prediction on the ground truth video frames in the ground truth video to obtain at least one predicted keypoint and the confidence level of each predicted keypoint. Then, based on the confidence level of at least one predicted keypoint, the weight values ​​of the pixels in the ground truth video frames are determined. Next, based on the first pixel value, weight value, and second pixel value of the pixels in the predicted video frames, a loss calculation is performed to obtain the loss result. Finally, based on the loss result, the model parameters of the video generation model to be trained are updated to obtain the trained video generation model, and the model parameters of the trained video generation model are extracted. The first server 300 sends the model parameters of the trained video generation model to the first terminal 100, so as to deploy the trained video generation model on the first terminal 100, or to enable the first terminal 100 to call the trained video generation model to complete a new video generation task.

[0054] See Figure 4 , Figure 4 This is an optional architecture diagram of the video generation system provided in this application embodiment. The video generation system 20 in this application embodiment includes at least a second terminal 400, a second network 500, and a second server 600. A video generation application is deployed on the second terminal 400, which can provide video generation functions to complete the video generation task. The second server 600 can be a backend server of the video generation application. The second server 600 can constitute the video generation device of this application embodiment, that is, the video generation method of this application embodiment is implemented through the second server 600. The second terminal 400 is connected to the second server 600 through the second network 500, which can be a wide area network or a local area network, or a combination of both. In this application embodiment, the video generation system can be the same system as the training system of the above-mentioned video generation model. However, within this same system, the training method of the video generation model and the video generation method can be implemented separately. Correspondingly, the second terminal 400 can be the same terminal as the first terminal 100, the second network 500 can be the same network as the first network 200, and the second server 600 can be the same server as the first server 300.

[0055] See Figure 4In performing the video generation task, the second terminal 400 receives control conditions input by the user and encapsulates these conditions into a video generation request. The second terminal 400 then sends the video generation request to the second server 600 via the second network 500. In response to the video generation request, the second server 600 invokes a pre-trained video generation model to generate the target video based on the control conditions. After generating the target video, the second server 600 sends it back to the second terminal 400, which can then play the target video on its current interface.

[0056] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Figure 5 The illustrated electronic device can be a training device for a video generation model or a video generation device. The electronic device includes at least one processor 210, a memory 250, at least one network interface 220, and a user interface 230. The various components in the electronic device are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 5 The general labeled all buses as Bus System 240.

[0057] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0058] User interface 230 includes one or more output devices 231 that enable the presentation of media content, and one or more input devices 232.

[0059] Memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. Memory 250 may optionally include one or more storage devices physically located remote from processor 210. Memory 250 may include volatile memory or non-volatile memory, or both. Non-volatile memory may be read-only memory (ROM), and volatile memory may be random access memory (RAM). The memory 250 described in this application embodiment is intended to include any suitable type of memory. In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as illustrated below.

[0060] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; network communication module 252 is used to reach other computing devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 include: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.; input processing module 253 is used to detect and translate one or more user inputs or interactions from one or more input devices 232.

[0061] In some embodiments, the apparatus provided in this application may be implemented in software. Figure 5 A training device 254-1 for a video generation model stored in memory 250 is shown, or a video generation device 254-2 stored in memory 250. The training device 254-1 can be a training device for a video generation model in an electronic device, and it can be software in the form of programs and plugins, including the following software modules: a first acquisition module 2541, a keypoint prediction module 2542, a weight determination module 2543, a loss calculation module 2544, and a parameter update module 2545. The video generation device 254-2 can be a video generation device in an electronic device, and it can also be software in the form of programs and plugins, including the following software modules: a second acquisition module 2546 and a video generation module 2547. These modules are logically related and can therefore be arbitrarily combined or further split according to the functions they implement. The functions of each module will be described below.

[0062] In some embodiments, the apparatus provided in this application can be implemented in hardware. For example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the training method of the video generation model and the video generation method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0063] The training method for the video generation model and the video generation method provided in the various embodiments of this application can all be executed by an electronic device, which can be a server or a terminal. That is, the training method for the video generation model and the video generation method in the various embodiments of this application can be executed by a server, by a terminal, or through interaction between a server and a terminal.

[0064] The training method of the video generation model provided in the embodiments of this application will be described below. Figure 6 This is a schematic diagram of an optional flowchart of the training method for the video generation model provided in this application embodiment. The following will be combined with... Figure 6 The steps shown are explained as follows: Figure 6 As shown, taking the server as the execution subject of the video generation model training method as an example, the method includes the following steps S101 to S105:

[0065] Step S101: Obtain the model prediction video and the ground truth video.

[0066] Model-predicted videos are the output of a trained video generation model based on sample control conditions. Model-predicted videos include, but are not limited to, at least one of the following types: synthetic videos and dynamic image sequences. Synthetic videos are generated by the trained video generation model and can include animations, virtual character movements, and scene changes. Dynamic image sequences are a series of consecutive image frames generated by the trained video generation model to simulate the dynamic effects of real videos. When generating model-predicted videos, sample control conditions (such as text descriptions, speech signals, action sequences, or at least one other condition) can be input into the trained video generation model. The trained model generates the video based on the input sample control conditions using its internal generation mechanisms (such as Generative Adversarial Networks (GANs), Variational Autoencoders (VAEs), Transformers, etc.). The video output by the trained model is the model-predicted video, which typically contains multiple predicted video frames.

[0067] In this embodiment, the model-predicted video can be a predicted video generated in a virtual character generation scenario, such as videos including virtual anchors, virtual customer service representatives, and virtual characters. The model-predicted video can also be a predicted video generated in a motion simulation scenario, such as videos of people or objects performing actions like dancing, sports, or gestures. The model-predicted video can also be a predicted video generated in a content creation scenario, such as video content generated based on text descriptions for use in advertising, film and television, education, and other fields. Of course, it can also be a predicted video generated in a special effects generation scenario, such as generating special effects scenes like science fiction scenes or magic effects. The video content of the model-predicted video includes, but is not limited to, at least one of the following: character actions (such as virtual characters speaking, dancing, walking, etc.), scene changes (such as virtual scene transitions, dynamic changes of objects, etc.), and special effects displays (such as dynamic displays of special effects like flames, water flow, and light and shadow).

[0068] The ground truth video is the video corresponding to the sample control conditions and serves as the target for model training. The ground truth video can also be called the labeled video. A labeled video can be a real video or an annotated video, used to guide the video generation model to generate videos that more closely resemble real-world content. A labeled video includes multiple labeled video frames (i.e., ground truth video frames). The types of labeled videos include, but are not limited to, at least one of the following: real video and annotated video. Real video refers to actually filmed videos containing real human actions, scene changes, etc. Annotated video refers to videos that have been manually annotated; the annotations may include key point positions, action types, and scene elements, etc. In this application embodiment, real videos can be obtained by filming real scenes or human actions with a camera. Alternatively, real videos can be annotated to extract key information (such as key point positions, action sequences, etc.), and the annotated video can be used as a labeled video for model training.

[0069] Labeled videos serve as the training targets for models, used to calculate loss and update model parameters. In motion capture systems, captured real-world motion can be used as labeled videos. In film and television production scenarios, live-action videos can be used as labels to train models to generate special effects or virtual scenes. The content of labeled videos can include: human actions (such as real people speaking, dancing, walking, etc.), scene changes (such as transitions between real scenes, dynamic changes of objects, etc.), and annotation information (such as the positions of key points of people, action types, scene elements, etc.).

[0070] In video generation models, control conditions are key information input into the model, guiding it to generate videos with specific content. During model training, the control conditions input into the video generation model can be called sample control conditions. These control conditions provide the video generation model with information such as the context, style, and content of the generation target, helping the model understand what type of video needs to be generated.

[0071] In this embodiment, the video generation model to be trained is a basic model used to obtain a video generation module capable of performing a specific video generation task after model training. The video generation model to be trained can be categorized into various types of basic models based on its architecture and generation mechanism. Each basic model has its unique advantages and applicable scenarios, and can be trained using different types of data. The video generation models to be trained provided in this embodiment include, but are not limited to, the following basic models: Generative Adversarial Networks (including Video Generative Adversarial Networks, Conditional Generative Adversarial Networks, etc.), Variational Autoencoders (including Video Variational Autoencoders, Conditional Variational Autoencoders, etc.), Transformer architectures (including Video Transformer, Conditional Video Transformer, etc.), Autoregressive models (including PixelRNN / PixelCNN, Conditional Autoregressive models, etc.), and hybrid models (e.g., GAN+VAE, Transformer+GAN, etc.). The sample data for the video generation model to be trained includes real video data and labeled data. Real video data includes real video clips of human actions, scene changes, etc., while labeled data refers to videos with labeled information, such as keypoint positions and action types. The sample data for the variational autoencoder also includes real video data and labeled data.

[0072] Step S102: Perform keypoint prediction on the ground truth video frames in the ground truth video to obtain at least one predicted keypoint in the ground truth video frame and the confidence level of each predicted keypoint.

[0073] Keypoint detection is a computer vision technique used to detect and locate key parts (i.e., keypoints) of a human body, object, or other target object from ground-out video frames. These keypoints are typically feature points of the target object, such as the head, shoulders, elbows, wrists, hips, knees, and ankles of a human body, or corners and center points of an object. The goal of keypoint detection is to automatically identify the location of these key parts using specific computational methods, and to provide each keypoint with coordinates (which can be two-dimensional or three-dimensional) and a confidence score (indicating the reliability of the detection).

[0074] In this embodiment, a joint point prediction model can be used to predict joint points in ground truth video frames within ground truth video. The joint point prediction process can include the following steps: First, data preprocessing: Input ground truth video frames and perform image standardization processing, such as adjusting the size, resolution, and color space of the ground truth video frames to suit the input requirements of the joint point detection model. Next, model selection: Select a pre-trained joint point detection model based on task requirements. Then, load the weights of the pre-trained joint point detection model. Next, joint point detection: Input the pre-processed ground truth video frames into the joint point detection model, which outputs the position coordinates and confidence score of each joint point. Then, result processing: Extract the position and confidence score of the joint points from the output of the joint point detection model, and further process the joint points as needed, such as filtering low-confidence joint points and smoothing joint point trajectories. Finally, visualization processing: For example, plot the detected joint points onto the original image for intuitive viewing of the results.

[0075] In this embodiment, keypoints can be extracted from ground truth video frames using pre-trained keypoint detection models. These keypoint detection models include: OpenPose (a deep learning-based multi-person pose estimation model capable of simultaneously detecting the poses of multiple people), AlphaPose (a ResNet-based single-person pose estimation model with high accuracy, suitable for single-person pose detection), HRNet (a high-resolution network suitable for human pose estimation, providing high-precision keypoint detection), and DWPose (a lightweight pose estimation model optimized through two-stage distillation, suitable for real-time applications). The keypoint extraction process provided in this embodiment will be explained below using the DWPose model as an example.

[0076] The DWPose model is a high-efficiency full-body pose estimation model that achieves high-precision pose estimation through a two-stage distillation method. DWPose is based on the Two-Stage Pose Distillation (TPD) framework, using a teacher model (such as RTMPose) to guide the training of a student model. Its core lies in the following: the first stage distillation combines feature distillation and logistic distillation, helping the student model learn the intermediate features and outputs of the teacher model; the second stage distillation further optimizes the student model, improving its performance in complex scenes. When extracting key points using the DWPose model, data preprocessing can be performed first. For example, the input ground truth video frames can be resized or cropped to fit the input requirements of the DWPose model, and a pre-trained DWPose model can be loaded. Then, the preprocessed ground truth video frames are input into the DWPose model, which outputs the predicted key point positions and provides a confidence score for each key point. The confidence score represents the DWPose model's confidence in predicting the key points and is typically a value between 0 and 1. The predicted key points can then be plotted onto the ground truth video frames for a visual overview of the results.

[0077] In the process of joint extraction, confidence is an important indicator used to measure the reliability of the joint detection model in detecting the location of joints. Specifically, confidence is a value between 0 and 1, representing the degree of confidence of the joint detection model in the detection result of a certain joint. When the confidence value is 1, it means that the joint detection model is very certain that the location of the joint is correct, and when the confidence value is 0, it means that the joint detection model is completely uncertain about the location of the joint. For the case where the confidence value is between 0 and 1, it represents the degree of certainty of the joint detection model in the location of the joint. The closer the value is to 1, the higher the confidence. Confidence plays several important roles in the joint extraction process: (1) Filtering low-quality detection results. By setting a confidence threshold (e.g., 0.5 or 0.7), joint detection results with low confidence can be filtered out, thereby improving the quality of the detection results. (2) Evaluating model performance. Confidence can be used to evaluate the performance of the joint detection model. For example, by calculating the precision and recall of high-confidence joints, a more comprehensive understanding of the performance of the joint detection model can be obtained. (3) Handling occlusion and complex scenes: In cases of occlusion or complex backgrounds, confidence can help the keypoint detection model handle these situations more robustly. Keypoints with low confidence can be marked as unreliable, thus avoiding misleading subsequent applications (such as video generation).

[0078] The method for calculating confidence varies depending on the selected joint detection model. This application provides the following methods: First, direct confidence from model output. The joint detection model (such as OpenPose, HRNet, etc.) directly outputs the confidence score for each joint along with its location. These confidence scores can be part of the output of the last layer of the joint detection model. Second, confidence based on probability distribution. The joint detection model models the joint locations as a Gaussian distribution, and the confidence score can be represented as the peak probability of the Gaussian distribution. Third, confidence based on post-processing. When multiple possible joint locations are detected, non-maximum suppression (NMS) is used to select the location with the highest confidence score, and this location is taken as the final detection result.

[0079] In some embodiments, see Figure 7 In step S102, keypoint prediction is performed on the ground truth video frames in the ground truth video, which can be achieved through the following steps S1021 to S1023:

[0080] Step S1021: Extract features from the ground truth video frames to obtain the frame feature vectors of the ground truth video frames.

[0081] The purpose of feature extraction from ground truth video frames is to extract useful features from them, which will be used for subsequent keypoint location prediction and confidence calculation.

[0082] In this embodiment, when extracting features from ground truth video frames, the input ground truth video frames can be preprocessed. For example, the ground truth video frames can be adjusted to the size required by the feature extraction network (a deep learning model) in the joint detection model (e.g., 256x256 or 384x288); the pixel values ​​of the ground truth video frames can be normalized to the range of [0,1] or [-1,1]. Alternatively, data augmentation (e.g., random cropping, flipping, etc.) can be performed on the ground truth video frames to improve the generalization ability of the feature extraction network. A pre-trained convolutional neural network (e.g., ResNet, HRNet, etc.) can be used as a feature extractor, and the input ground truth video frames can be mapped to a high-dimensional feature space through operations such as convolutional layers, pooling layers, and activation functions. The high-dimensional feature vector (i.e., the frame feature vector of the ground truth video frame) after processing by the feature extraction network is a multi-dimensional tensor.

[0083] Step S1022: Perform a first feature mapping on the frame feature vector to obtain the position information of at least one predicted joint point.

[0084] Performing the first feature mapping on the frame feature vector means mapping the frame feature vector to the position information of the predicted key points, and predicting the position of each predicted key point in the ground truth video frame.

[0085] In this embodiment, when performing the first feature mapping on the frame feature vector, a position prediction network (also a deep learning model) in the joint detection model can be used. For example, convolutional layers or fully connected layers can be used to map the frame feature vector to joint positions. The output position information is the two-dimensional coordinates (x, y) of each predicted joint. During the first feature mapping process, when the position prediction network performs position decoding, it can convert the predicted heatmap into joint coordinates and determine the joint position by finding the peak position in the heatmap.

[0086] Step S1023: Perform a second feature mapping on the frame feature vector and position information to obtain the confidence level of each predicted key point.

[0087] Performing a second feature mapping on the frame feature vector and position information refers to calculating the confidence level of each predicted joint. The confidence level of each predicted joint represents the reliability of the joint detection model's prediction of that predicted joint.

[0088] In this embodiment, when performing a second feature mapping on the frame feature vector and position information, the second feature mapping process can be implemented through a confidence prediction network (also a deep learning model) in the keypoint detection model. For example, convolutional layers or fully connected layers can be used to map the frame feature vector and position information to confidence. The output of the confidence prediction network can be the confidence of each predicted keypoint, ranging from [0,1]. During the second feature mapping process, when performing confidence decoding, the confidence prediction network can convert the predicted confidence heatmap into the confidence value of each predicted keypoint.

[0089] In this embodiment, steps S1021 to S1023 are used to predict key points in ground truth video frames. This not only achieves high-precision key point localization, but also captures rich image information through feature extraction of the ground truth video frames using a deep learning model, providing a foundation for accurate key point localization. The first feature mapping process maps the extracted feature vectors to key point positions, accurately predicting the coordinates of each key point in the image, thus achieving high-precision key point localization. The second feature mapping process combines the frame feature vectors and the predicted key point position information to perform a second feature mapping, providing a confidence assessment for each predicted key point. The confidence score represents the reliability of the key point detection model in predicting key points, helping to filter out inaccurate key points in subsequent processing. Furthermore, deep learning models typically have good robustness and can handle images with different lighting, angles, and backgrounds, thereby improving the robustness of key point extraction. Through confidence assessment, inaccurate key point predictions can be identified and suppressed, further enhancing the robustness of key point extraction. Meanwhile, deep learning models can learn complex image features and adapt to various complex scenarios, such as multi-person pose estimation and occlusion handling. Through the first feature mapping, the location of key points in complex scenarios, such as in cases of occlusion or multiple overlapping objects, can be predicted. Therefore, the above key point extraction process can achieve high-precision and robust key point localization, and provide confidence assessment, adapting to complex scenarios and real-time processing requirements.

[0090] Step S103: Determine the weight values ​​of pixels in the ground truth video frame based on the confidence of at least one predicted key point.

[0091] In some embodiments, see Figure 8 In step S103, determining the weight values ​​of pixels in the true video frame can be achieved through the following steps S1031 to S1033:

[0092] Step S1031: The predicted key points with a confidence level greater than the preset confidence threshold are identified as target key points.

[0093] Here, predicted keypoints with high confidence can be selected based on a preset confidence threshold and used as target keypoints for subsequent processing. In this embodiment, the preset confidence threshold can be set according to the needs of the model training task (for example, the preset confidence threshold can be set to 0.5 or 0.7). All predicted keypoints can be traversed, and predicted keypoints with confidence greater than the preset confidence threshold can be retained as target keypoints. The number of target keypoints is at least one.

[0094] In this embodiment of the application, each target joint in the filtered list of target joints includes its joint position and confidence level.

[0095] Step S1032: Determine the target location of each target joint in the target object within the ground truth video frame.

[0096] Here, the target location of each target key point within the target object can be identified (for example, the target location can be divided into the face, hand, body, etc.).

[0097] In this embodiment, the location of a joint can be defined according to the needs of the model training task. For example, in human pose estimation, the location of a joint may include the head, shoulder, elbow, wrist, hip, knee, ankle, etc. Each target joint can be assigned a location based on predefined locations.

[0098] Step S1033: Based on the target location and confidence level of each target joint, determine the weight value of each pixel in the ground truth video frame.

[0099] Here, based on the target location and confidence level of the target joint, a weight value is assigned to each pixel in the ground truth video frame. This weight value is then used to calculate the loss during subsequent training, thereby training the video generation model. In this embodiment, different types of target joints can have different weight allocation strategies.

[0100] In this embodiment, steps S1031 to S1033, by filtering predicted keypoints with high confidence, reduce the impact of false detections and enhance the robustness of the model. Furthermore, the weight allocation strategy for different types of target keypoints can be dynamically adjusted, enabling the model to better handle complex scenes, such as multi-person pose estimation and occlusion handling. By filtering target keypoints, the number of keypoints that need to be processed is reduced, optimizing computational efficiency.

[0101] In one implementation, see Figure 9 In step S1033, the weight value of each pixel in the ground truth video frame is determined based on the target location and confidence level of each target joint. This can be achieved through the following steps S10331 to S10332:

[0102] Step S10331: In response to the fact that the target part of any target joint is the face or hand of the target object, the target joint is determined as the first joint.

[0103] Here, target joints located in specific body parts (such as the face or hand) are identified and marked as first joints. In the implementation, the face or hand can be defined as the first body part first. Then, all target joints are iterated over, and their types are checked to see if they belong to the first body part. If so, they are marked as first joints. There is at least one first joint.

[0104] Step S10332: Determine the weight value of each pixel in the region where the first joint is located based on the confidence level of the first joint.

[0105] Here, weight values ​​can be assigned to the pixels in the region where the first joint is located based on the confidence level of the first joint, so that these pixels have different importance in subsequent processing.

[0106] In this embodiment of the application, the determination of the weight value of each pixel in the region where the first joint point is located based on the confidence level of the first joint point in step S10332 can be achieved in the following way: First, determine the target circular region corresponding to each first joint point; wherein, the target circular region is a circular region with the joint point coordinates of the first joint point as the center and a preset value as the radius; then, based on the target circular region of at least one first joint point, determine the weight value of each pixel in the first region where at least one first joint point is located; the first region is the pixel region obtained by taking the union of the target circular regions of all first joint points.

[0107] In this embodiment, a target circular region can be defined for each first joint point so that weights can be assigned to pixels within these circular regions in subsequent steps. When defining the target circular region, different radii can be selected for different regions. Then, for each first joint point, a target circular region is generated with the joint point coordinates as the center and a corresponding preset value as the radius.

[0108] After obtaining the target circular regions of all first joints, these regions can be merged to obtain a first region, and a weight value can be assigned to each pixel within this first region. Specifically, a logical AND operation can be used to find the union of all target circular regions to obtain the mask for the first region. For each pixel in the first region, a weight value can be assigned based on the confidence level of the predicted joint corresponding to that pixel.

[0109] Here, the target circular region corresponding to each first joint point is determined, including the following two cases:

[0110] The first method involves determining a first target circular region corresponding to the first joint point on the face of the target object, in response to the first joint point being a joint point located on the face. This first target circular region is a circular region with the joint point coordinates of the first joint point on the face as its center and a first preset value as its radius. For example, for a first joint point located on the face, the first preset value (e.g., 10 pixels) is used as the radius of the first target circular region. In other words, if a first joint point is a facial joint point located in the face region, a target circular region for that first joint point can be formed with its joint point coordinates as its center and the first preset value as its radius.

[0111] The second approach involves determining a second target circular region corresponding to the first joint point on the hand of the target object, in response to the first joint point being a joint point on the hand. This second target circular region is a circular region centered on the joint point coordinates of the first joint point on the hand, with a second preset value as its radius. For example, for a first joint point on the hand, a second preset value (e.g., 15 pixels) is used as the radius of the second target circular region. In other words, if a first joint point is a hand joint point located in the hand region, a target circular region for that first joint point can be formed with its joint point coordinates as the center and the first preset value as the radius. It should be noted that the first preset value can be the same as or different from the second preset value; alternatively, the first preset value can be less than the second preset value. This application does not limit the magnitude or relationship of the first and second preset values.

[0112] In this embodiment, steps S10331 to S10332 assign corresponding weight values ​​to the pixels in the region where the first joint is located, allowing these pixels to receive different attention in subsequent loss calculations, thereby improving the training accuracy of the model. Different weight allocation strategies can be applied to joints in different locations, enabling the model to better handle complex scenes, such as multi-person pose estimation and occlusion handling.

[0113] In this embodiment of the application, when determining the weight value of each pixel in the first region where at least one first joint is located based on the target circular region of at least one first joint, it can be achieved in the following way: for each pixel in the first region, in response to the pixel being located in the target circular region of one first joint, the product of the confidence level of the first joint and a preset coefficient is determined as the weight value of the pixel; in response to the pixel being located in the target circular region of multiple first joints, the sum of the confidence levels of the multiple first joints is smoothed to obtain a smoothed confidence level, and then the product of the smoothed confidence level and the preset coefficient is determined as the weight value of the pixel.

[0114] Here, when determining the weight value of each pixel in the first region where at least one first joint point is located, for each pixel in the first region, if the pixel is located within the target circular region of a single first joint point, the weight value assigned to the pixel located within the target circular region of a single first joint point is the product of the confidence level of that first joint point and a preset coefficient. That is, when determining the target circular region, for each first joint point, the target circular region corresponding to that first joint point can be generated first. Then, for a pixel located within a single target circular region, the product of the confidence level of the first joint point and the preset coefficient is used as the weight value of that pixel.

[0115] If a pixel is located within the target circular region of multiple first joints, then it is the intersection point of these target circular regions. The weight assigned to this pixel is calculated by summing the confidence scores of the multiple first joints, smoothing the sum, and then using the product of the smoothed confidence score and a preset coefficient as the weight value for that pixel. In other words, the overlapping region can be determined first, identifying pixels located within multiple target circular regions. The sum of the confidence scores of the multiple first joints is then smoothed to obtain a smoothed confidence score. Finally, the product of the smoothed confidence score and a preset coefficient is used as the weight value for that pixel.

[0116] In this embodiment, smoothing the sum of confidence scores can be achieved using any of the following methods: normalization, softmax function, Gaussian smoothing, moving average, or median filtering. Smoothing can reduce short-term fluctuations in confidence scores, making the confidence score distribution more stable. It can also reduce the impact of noise and improve the robustness of the model.

[0117] By employing the aforementioned weight allocation method for different pixels, different weight values ​​are assigned to pixels within the target circular region of the first joint, giving these pixels varying importance in subsequent processing and thus improving the accuracy of joint extraction. Smoothing the sum of confidence scores for multiple first joints reduces weight value fluctuations in overlapping areas, enhancing the model's robustness. Different types of joints can have different weight allocation strategies, enabling the model to better handle complex scenes, such as multi-person pose estimation and occlusion handling.

[0118] In another implementation, see Figure 10 In step S1033, the weight value of each pixel in the ground truth video frame is determined based on the target location and confidence level of each target joint. This can be achieved through the following steps S10333 to S10334:

[0119] Step S10333: In response to the fact that the target part of any target joint is a body part of the target object, the target joint is determined as a second joint; the number of second joints is at least one.

[0120] Here, target joints located in specific areas (such as body parts) can be identified and marked as second joints. For example, body parts can be defined as second parts based on the needs of the model training task. Then, by traversing the target joints, it is checked whether the type of the target joint belongs to the second part; if so, the target joint is marked as a second joint.

[0121] Step S10334: Determine the weight value of each pixel in the region where the second joint point is located.

[0122] In this embodiment, weight values ​​are assigned to the pixels in the region where the second joint is located, so that these pixels have different importance in subsequent processing.

[0123] In this embodiment of the application, the determination of the weight value of each pixel in the region where the second joint is located in step S10334 can be achieved in the following way: First, determine the target rectangular region corresponding to all the second joints; wherein, the target rectangular region is the smallest rectangular region that surrounds all the second joints; then, determine the weight value of each pixel in the target rectangular region as a first preset weight value.

[0124] In the implementation process, the target rectangular region can be determined first. For example, for all second joints, the minimum rectangular region enclosing these second joints can be calculated. This can be achieved using a minimum bounding box algorithm (such as the rotating caliper method) or a simple minimum bounding rectangle method. For each pixel within the target rectangular region, a first preset weight value (e.g., 1.0) is assigned.

[0125] By employing the methods described above, different weight values ​​can be assigned to pixels in the region where the second joint is located, giving these pixels different importance in subsequent processing and thus improving the accuracy of joint extraction. Different types of joints can have different weight allocation strategies, enabling the model to better handle complex scenes.

[0126] In some embodiments, if any pixel does not belong to the target rectangular region and does not belong to the first region where at least one first joint is located, then the weight value of that pixel can be determined to be the second preset weight value. That is, if any pixel does not belong to the face region, the hand region, or the body region, then the weight value of that pixel can be directly set to the second preset weight value. It should be noted that the second preset weight value here can be equal to the first preset weight value mentioned above.

[0127] For example, pixels that do not belong to the face area, hand area, or body area can include pixels in the following locations: background pixels, pixels at the edges of clothing, pixels at the locations of accessories, shadows and reflections around the portrait, pixels at the location of hair, and pixels at the locations of other elements related to the portrait.

[0128] Background pixels are those unrelated to the target object (i.e., the portrait). They can be pixels in the natural environment (such as landscapes, sky, trees, buildings, etc.), indoor scenes (such as walls, floors, furniture, etc.), or any other non-human objects. Regarding pixels at the edges of clothing, although clothing is part of the body, its edges may not completely overlap with the body area. For example, folds, flowing parts, or decorations (such as ties, scarves, hats, etc.) may extend beyond the body boundary and not be around any joint points of the body. Regarding pixels at the location of accessories, accessories refer to items worn on the body, such as necklaces, earrings, and bracelets. These accessory pixels are not part of the face, hands, or body area, but are part of the portrait. Regarding pixels of shadows and reflections around the portrait, since shadows and reflections are effects of light acting on the portrait, they may appear around the portrait but are not part of the face, hands, or body area. Regarding pixels at the location of hair, although hair is part of the portrait, it is not part of the face, hands, or body area. Regarding the pixel locations of other elements related to the portrait, in some cases, the portrait may be associated with other elements that do not belong to the face, hand, or body area. For example, if a person is holding a prop (such as an umbrella or a bouquet of flowers), the prop is not part of the hand area. Therefore, the pixel of the prop is the pixel of the location of other elements related to the portrait. Similarly, if a person is sitting in a chair, the chair is not part of the body area. Therefore, the pixel of the chair is also the pixel of the location of other elements related to the portrait.

[0129] In this embodiment, when processing pixel weight allocation, the importance of different regions is considered, and a default weight value is assigned to pixels that do not belong to a specific region. This helps simplify calculations and ensures that the weight allocation of the entire image is complete. For pixels that do not belong to the target rectangular region and do not belong to the first region where at least one first joint point is located, the weight value of the pixel can be directly determined to be a preset second preset weight value.

[0130] The above method ensures that each pixel has a weight value, avoiding omissions in weight allocation. Furthermore, different weight values ​​are assigned to the regions where the first and second joints are located; these weight values ​​can be higher than the second preset weight value, thus highlighting the importance of these regions. By directly assigning the default second preset weight value to pixels that do not belong to a specific region, the weight allocation calculation process is simplified.

[0131] Step S104: Based on the first pixel value and weight value of the pixel in the ground truth video frame and the second pixel value of the pixel in the predicted video frame, the loss is calculated to obtain the loss result.

[0132] In some embodiments, see Figure 11 The loss calculation process in step S104 can be implemented through the following steps S1041 to S1043:

[0133] Step S1041: Construct the correspondence between each pixel in the ground truth video frame and each pixel in the predicted video frame to form multiple pixel pairs.

[0134] The weight value corresponding to each pixel pair is the weight value of the pixel in the pixel pair that comes from the ground truth video frame.

[0135] Here, a pixel-to-pixel correspondence is established between the ground truth video frames and the predicted video frames to facilitate subsequent pixel-level loss calculations. It can be assumed that the ground truth and predicted video frames are of the same size, and that each pixel has a corresponding pixel in both frames. Therefore, each pixel in the ground truth video frame can be paired with its corresponding pixel in the predicted video frame, forming multiple pixel pairs.

[0136] Step S1042: Determine the pixel value difference between the first pixel value of the pixel from the ground truth video frame and the second pixel value of the pixel from the predicted video frame in each pixel pair.

[0137] Step S1043: Determine the loss result based on the pixel value difference of all pixel pairs and the weight value corresponding to the pixel pairs.

[0138] In this embodiment, the loss result is determined based on the pixel value difference of all pixel pairs and the weight value corresponding to the pixel pair. This can be achieved in the following way: For each pixel pair, the square of the pixel value difference of the pixel pair is determined to obtain the first value of the pixel pair; then, the product of the first value of the pixel pair and the weight value corresponding to the pixel pair is determined as the loss value of the pixel pair; finally, the loss values ​​of all pixel pairs are summarized to obtain the loss result of the video generation model.

[0139] The above method, using pixel-level loss calculation, allows for a more accurate evaluation of the video generation model's performance. By introducing weights, the importance of different pixels in the loss calculation can be adjusted, enabling the model to focus more on important regions. The loss results can then guide the optimization of the video generation model, improving the quality of the generated videos.

[0140] Step S105: Based on the loss result, update the model parameters of the video generation model to be trained to obtain the trained video generation model.

[0141] In this embodiment of the application, when training the video generation model, keypoint prediction is performed on the ground truth video frames in the ground truth video to obtain at least one predicted keypoint in the ground truth video frame and the confidence level of each predicted keypoint. Based on the confidence level of the predicted keypoint, the weight value of the pixel in the ground truth video frame is determined, and then the loss is calculated in combination with the weight value. That is, a weighted loss calculation is performed on the first pixel value of each pixel in the ground truth video frame and the second pixel value of each pixel in the predicted video frame. Thus, since the weight values ​​used in the loss calculation process are determined based on the confidence levels of different prediction joints, these weight values ​​take into account the credibility of different prediction joints in the ground truth video. Furthermore, the weight value determined is for each pixel in the ground truth video frame, that is, for the pixel-level features in the ground truth video frame, the corresponding weight value is determined separately. Therefore, the loss result obtained by calculating the loss using these weight values ​​is a loss result that takes into account pixel-level features. Thus, training the video generation model based on this loss result enables the trained video generation model to pay more attention to the pixel-level details of the target object, thereby improving the video generation effect of the trained video generation model for the target object.

[0142] The following examples illustrate the application scenarios of the video generation model training method provided in this application. The video generation model training method provided in this application can be applied to at least the following exemplary scenarios: training a video generation model for generating virtual characters, training a video generation model for generating motion-driven videos, training a video generation model for generating medical rehabilitation training videos, etc.

[0143] In training a video generation model for virtual character creation, the process involves acquiring generated virtual character video frames and ground truth videos (labeled videos containing virtual characters). Keypoint prediction is performed on the ground truth videos to obtain the confidence scores of the virtual character's facial and body keypoints. Then, based on these confidence scores, weights are assigned to each pixel. Next, the pixel values ​​of the virtual character video frames are compared with those of the ground truth video frames, and a loss is calculated using the weights. The parameters of the video generation model are then updated based on the loss results, optimizing the quality of the generated videos. For example, to generate a virtual anchor, the input control condition is the text description: "The anchor introduces a new product." The ground truth video is a video of a real anchor introducing a product, annotated with lip movements and gestures. Through these training steps, the video generation model can learn how to generate realistic virtual anchor videos.

[0144] In training a video generation model for motion-driven video generation, two methods can be employed: generating videos of human movements and ground truth videos (labeled videos containing human movements). Keypoint prediction is performed on the ground truth video frames to obtain the confidence scores of the human body's keypoints. Then, based on the keypoint confidence scores, a weight value is assigned to each pixel. Next, the pixel values ​​of the frames in the human movement video are compared with the pixel values ​​of the ground truth video frames, and the loss is calculated using the weight values. The model parameters are then updated based on the loss result to optimize the quality of the generated video. For example, to generate a dance video, the input control condition is a sequence of realistic dance movements, and the ground truth video is a video of a professional dancer performing, labeled with the dancer's keypoint positions. Through these training steps, the video generation model can learn how to generate realistic dance videos.

[0145] In training a video generation model for medical rehabilitation training videos, the process involves acquiring generated rehabilitation training videos and ground truth videos (labeled videos containing rehabilitation movements). Keypoint prediction is performed on the ground truth video frames to obtain the confidence level of the keypoint locations for each rehabilitation movement. Then, based on the confidence level of each keypoint, a weight value is assigned to each pixel. Next, the pixel values ​​of the rehabilitation training video frames are compared with the pixel values ​​of the ground truth video frames, and the loss is calculated using the weight values. Finally, the model parameters are updated based on the loss result to optimize the quality of the generated video. For example, to generate a rehabilitation training video, the input control condition is the text description "shoulder rehabilitation training movements," and the ground truth video is a video of a therapist performing shoulder rehabilitation training, labeled with the keypoint locations of the movements. Through these training steps, the video generation model can learn how to generate correct rehabilitation training videos.

[0146] In this embodiment of the application, after training the video generation model using the aforementioned training method, the trained video generation model can also be used to generate videos. Based on this, this embodiment of the application provides a video generation method. Figure 12 This is an optional flowchart illustrating the video generation method provided in this application embodiment. The following will be combined with... Figure 12 The steps shown are explained as follows: Figure 12 As shown, taking the server as the execution subject of the video generation method as an example, the method includes the following steps S201 to S202:

[0147] Step S201: Obtain a video generation request, which includes control conditions.

[0148] In this embodiment, the control conditions can take various forms, depending on the requirements of the video generation task. For example, the types of control conditions include: text descriptions, voice signals, action sequences, image or video clips, and other information.

[0149] Text descriptions refer to describing the content of a video in natural language, such as "a puppy chasing butterflies in a park" or "a night view of a futuristic city." Text descriptions provide semantic information to video generation models, helping them understand the themes, scenes, and actions of the videos to be generated. Text descriptions can be input by the user or obtained from text datasets. Control conditions for text description types can be applied to text-to-video tasks, such as advertising video generation, film and television content creation, and educational video production. Speech signals, such as the voice of a person speaking, are used to drive the lip movements and facial expressions of virtual characters, enabling the characters in the generated video to synchronize with the speech. They can be recorded through a microphone or obtained from audio datasets. Control conditions for speech signals can be applied to voice-driven virtual character generation, such as virtual anchors and virtual customer service representatives. Action sequences include a series of motion data, which are the joint positions and motion trajectories extracted from real-world motion videos. Action sequences are used to drive the movements of people or objects, enabling the people or objects in the generated video to move according to the specified action sequence. They can be obtained through motion capture devices (such as Kinect and MoCap systems) or from motion datasets. Action sequence type control conditions can be applied to action-driven video generation, such as dance video generation and motion simulation. Image or video clips include a picture or a video segment, serving as a reference for the generated video. Image or video clips provide a visual style or content reference for the video generation model, helping it generate videos with a style consistent with the reference image or video clip. Images or video clips can be uploaded by the user or obtained from image / video datasets. Image or video clip type control conditions can be applied to image-to-video tasks, such as generating a video of a person's actions based on a photograph, or generating similar video content based on a video clip. In addition to the above control conditions, other information can be included, such as style tags (e.g., "sci-fi style," "retro style"), timestamps (used to control the video's rhythm), scene tags (e.g., "indoor," "outdoor"), etc. These other information types of control conditions provide richer contextual information for the video generation model, helping it generate videos that better meet user needs. Other information types of control conditions can be specified by the user or extracted from the dataset. Other information type control conditions can be applied to various scenarios that require fine control over video generation, such as special effects video generation and brand promotional video generation.

[0150] Control conditions play a crucial role in video generation. They provide context for the generation goal, offering background information to the video generation model and helping it understand what content needs to be generated. Control conditions can also guide the model to generate videos with specific styles, such as "sci-fi," "retro," or "cartoon." The model generates videos that conform to these style tags. Control conditions can also drive dynamic content within the video. For action-driven video generation tasks, control conditions (such as action sequences) directly drive the movements of people or objects in the video. For example, given a dance sequence, the model can generate a video of a person dancing. Control conditions also ensure the coherence and consistency of the generated content. For instance, given a photograph of a person as a reference, the model can generate videos of that person in different poses, ensuring that the appearance and style of the person in the generated videos are consistent.

[0151] The method of obtaining control conditions depends on the specific application scenario and task requirements. The control condition acquisition methods provided in this application include at least one of the following: user input, dataset extraction, and sensor acquisition. User input refers to users providing control conditions by inputting text descriptions through an interface, uploading images or video clips, or recording voice signals. For example, on a video generation platform, a user can input "generate a sci-fi style futuristic city video," or upload a photo of a person and specify that a video of the person dancing should be generated. Dataset extraction refers to the extraction of control conditions from a pre-prepared dataset in some automated tasks. For example, extracting motion sequences from a labeled motion dataset, or extracting text descriptions from a text dataset. Sensor acquisition refers to the acquisition of control conditions through motion capture devices for motion-driven video generation tasks. For example, capturing motion sequences of real people and inputting them as control conditions into a model to generate a video of a virtual person's motion.

[0152] Control conditions are widely used in various video generation tasks. Here are some specific application scenarios: In virtual character generation, virtual anchors, virtual customer service representatives, and virtual characters can be generated. Control conditions can include text descriptions (e.g., "Generate a virtual anchor to introduce a product"), voice signals (to drive lip movements and facial expressions), and character reference images (to generate virtual characters with a style consistent with the reference image). In motion-driven video generation, videos of people or objects' movements, such as dance or sports, can be generated. Control conditions can include motion sequences (joint positions and movement trajectories extracted from real motion videos) and character reference images (to generate motion videos with a style consistent with the reference image). In content creation, video content can be generated based on text descriptions for advertising, film, education, and other fields. Control conditions can include text descriptions (e.g., "Generate an advertising video showcasing product features") and style tags (e.g., "Science fiction style," "Retro style"). In special effects video generation, special effects scenes, such as science fiction scenes and magic effects, can be generated. Control conditions can include text descriptions (e.g., "Generate a fire effect scene") and reference images (to generate special effects videos with a style consistent with the reference image).

[0153] Before inputting the control conditions into the video generation model, the control conditions can be preprocessed to ensure that the video generation model can correctly understand and utilize this information. The preprocessing steps provided in this application embodiment include: (1) Text description processing: word segmentation and part-of-speech tagging (segmenting the text description and tagging the part of speech of each word), semantic understanding (using natural language processing models (such as Bidirectional Encoder Representations from Transformers (BERT) and Generative Pre-trained Transformer (GPT)) to extract the semantic information of the text description), keyword extraction (extracting keywords in the description, such as subject, action, scene, etc.). (2) Speech signal processing: speech recognition (converting the speech signal into text and extracting the semantic information of the speech), feature extraction (extracting the features of the speech, such as tone, speech rate, timbre, etc.). (3) Action sequence processing: joint extraction (using motion capture equipment or video analysis algorithms (such as OpenPose) to extract the joint positions in the action sequence), normalization processing (normalizing the joint positions to make them suitable for model input). (4) Image or video clip processing: feature extraction (using image processing algorithms (such as convolutional neural networks (CNN)) to extract features of images or video clips) and style analysis (analyzing the style of images or video clips and extracting style features).

[0154] Step S202: In response to the video generation request, the target video is generated based on the control conditions using a pre-trained video generation model.

[0155] The following examples illustrate the application scenarios of the video generation method provided in this application. The video generation method provided in this application can be applied to at least the following exemplary scenarios: content creation and entertainment, education and training, advertising and marketing, medical and health, film and television production, tourism and culture, and news and media.

[0156] In content creation and entertainment scenarios, the video generation method provided in this application can be used for short video creation, helping self-media creators quickly generate interesting and engaging short video content, such as comedy skits, animated stories, and special effects videos. Creators can input text scripts or descriptions, and the video generation model generates corresponding video footage based on the input. For example, inputting "a puppy chasing butterflies in the park" will generate footage of the puppy running and butterflies fluttering. In the implementation process, deep learning-based generative adversarial networks or variational autoencoders can be used as the base model for the video generation model. The base model can be trained using the training method provided in this application to obtain the video generation model. Alternatively, the video generation method provided in this application can be used for animation production, such as in the production of animated films and TV series, to quickly generate the actions and scenes of animated characters, reducing the workload of manual drawing. Based on the character settings and storylines, the video generation model can generate dynamic footage of the characters. For example, inputting "the protagonist is fighting a monster in the forest" will generate an animated video of the protagonist wielding a sword and the monster roaring. In the implementation process, a video generation model based on the Transformer architecture, such as VideoBERT, can be used to generate animated videos that conform to the description. Alternatively, the video generation method provided in this application embodiment can be used to generate game videos, such as game trailers and cutscenes for game developers, or exciting clips from game live streams for players. For example, the video generation model generates game footage based on the game's settings and gameplay. For instance, given the input "players are chasing enemies on motorcycles in the desert," the video generation model will generate a video in the corresponding game style.

[0157] In educational and training scenarios, the video generation method provided in this application can be used to produce teaching videos, such as scientific experiment demonstrations and historical event reenactments, to help students better understand and learn knowledge. It can also be used to generate virtual training scenarios, such as virtual work scenarios like doctor surgical simulations in skills training.

[0158] In advertising and marketing scenarios, the video generation method provided in this application can be used to generate product advertising videos, quickly creating advertising videos for new products to showcase their features and usage scenarios. For example, a product demonstration video can be generated based on the product description and advertising script. It can also be used to generate brand promotional videos, showcasing the brand's history, culture, etc.

[0159] In medical and health scenarios, the video generation method provided in this application can be used to generate medical images, producing simulated medical images for training doctors' diagnostic abilities or developing new diagnostic algorithms. For example, based on medical knowledge and disease characteristics, the video generation model generates corresponding medical image videos. It can also generate rehabilitation training videos, providing guidance to rehabilitation patients on performing correct rehabilitation movements. For instance, based on rehabilitation plans and movement requirements, the video generation model generates rehabilitation training videos. For example, it can generate videos of patients performing shoulder rehabilitation exercises.

[0160] In film and television production scenarios, the video generation method provided in this application can be used to generate special effects videos, such as complex special effects scenes like alien creatures and magical effects in film and television production. It can also be used to recreate historical scenes, such as recreating historical events in historical films and television dramas.

[0161] In tourism and cultural settings, the video generation method provided in this application can be used to generate videos of tourist attractions, creating promotional videos that showcase the beauty and unique features of these sites. It can also be used to generate videos showcasing cultural heritage, demonstrating the restoration process and historical value of cultural heritage.

[0162] In news and media scenarios, the video generation method provided in this application can be used to generate simulated news event videos. For example, in news reports, simulated news event videos can be generated to help viewers better understand the events. Based on the description and background of the news event, the video generation model can generate related videos. For example, generating scene videos of natural disasters. It can also generate highlights from sports events, producing videos of exciting moments in sports reporting for use in news reports and social media dissemination. For example, generating videos of a player's game-winning shot in a basketball game.

[0163] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0164] To address the issue of low image quality in human portrait video generation, this application proposes an enhancement scheme, namely the training method for the aforementioned video generation model and the video generation method. This scheme is applicable to all human-related video generation models, including image-generated video, text-generated video, or video generation under other controlled input conditions.

[0165] The methods in this application embodiment are applicable to various product forms. For example, a voice-activated digital human: inputting a voice clip (i.e., control condition) and a reference image of a person allows the person in the image to speak using the methods provided in this application embodiment. Another example is a picture-based dancing (motion-driven): inputting a video clip, extracting the motion sequence from the video clip as control conditions, and uploading a reference image of a person allows the person in the image to move. Yet another example is text-to-video or image-to-video generation: tasks involving the generation of human portrait videos can all utilize the solutions provided in this application embodiment during the training process. Figure 13 The diagram shown is a model reasoning framework diagram of the video generation method provided in this application embodiment. Figure 13 The control condition 1301 can be of various types, such as text, speech, or action sequences.

[0166] The training method for the video generation model and the video generation method provided in this application embodiment are described below. The training method for the video generation model and the video generation method provided in this application embodiment can be based on human 2D pose. The overall process diagram is shown below. Figure 14 As shown. See also Figure 14 The detailed calculation process of the training method for the video generation model provided in this application embodiment includes:

[0167] First, human joint point extraction is performed. For the portrait video (i.e., the ground truth video in the training set), the Dwpose model is used to extract the 2D pose of each video frame (i.e., the aforementioned ground truth video frame). The display effect of a single frame of portrait and corresponding 2D pose is as follows. Figure 15 As shown, the 2D pose of the human body is composed of 134 joints, as... Figure 15 As shown, each frame of the 2D pose in the portrait video includes multiple joints 151, with the body having 18 joints, the feet having 6 joints, the face having 68 joints, and the hands having 42 joints (21 joints each for the left and right hands). Connecting these joints yields the following... Figure 15 The 2D pose display effect shown.

[0168] After extracting the human body's key points, the awareness area is calculated. For a given key point p... i The confidence level of the model prediction is When the confidence level is greater than a certain preset confidence threshold, for example, the preset confidence threshold can be expressed as τ j If so, then the key point is considered to be clear and of high quality.

[0169] Because the face and hand regions have relatively dense joints, while the body region has relatively sparse joints, different processing strategies are used for these two regions. However, only joints with a confidence level greater than τ are calculated. j The key points.

[0170] Specifically, for the face and hand regions, the key point p i Using the coordinates of the joints as the center, draw a circle with radius r (i.e., the target circular region mentioned above). For the body region, calculate the smallest rectangle (rectangle) enclosed by all body joints (i.e., the target rectangular region mentioned above), and let the diagonal coordinates of the smallest rectangle be (x, y, r). min ,y min ), (x max ,y max Therefore, the key region S a The calculation process can be expressed as the following formula (1):

[0171]

[0172] Where, p i S represents the i-th joint; hand S indicates the hand area. face S represents the face region. body Indicates a body region. circle(p) i ,r) represents the joint point p i A circular region with its joint coordinates as its center and radius r; rect(x min,max ,y min,max ) represents the diagonal coordinates as (x min ,y min ), (x max ,y max The rectangular area.

[0173] After calculating the key regions, the weight values ​​of each pixel can be calculated. For each pixel in the face and hand regions, if multiple target circular regions overlap, the confidence scores of the joints corresponding to the overlapping target circular regions are accumulated to obtain the sum of confidence scores, and the sum of confidence scores is Gaussian smoothed. The new confidence score (i.e., the smoothed confidence score) is multiplied by a fixed coefficient ω1 (i.e., the preset coefficient mentioned above) as the weight value of the pixel. For each pixel in the human body region, ω2 (i.e., the first preset weight value mentioned above) can be directly set as the weight value of the pixel. Therefore, the weight value calculation process can be expressed as the following formula (2):

[0174]

[0175] Where M(x) represents the weight value of pixel x; T represents Gaussian smoothing. The key area corresponding to the joints in the human hand region (i.e., the circular area of ​​the second target mentioned above) is indicated. The key regions corresponding to the joints of the face region (i.e., the circular region of the first target mentioned above) are represented. The key region corresponding to the joints of the body region (i.e., the target rectangular region mentioned above) is represented by "else". "else" indicates the region other than the target rectangular region. and Other areas besides these.

[0176] After calculating the weight values ​​of each pixel, the loss can be calculated. In this embodiment, the loss of the video generation model can be the mean square error (MSE) loss. Let GT be the real image (i.e., the real video frame in the real video) and Pred be the model prediction image (i.e., the prediction video frame in the prediction video). Then, the loss value L(x) for any pixel x can be expressed as the following formula (3):

[0177] L(x) = (GT(x) - Pred(x)) 2 (3).

[0178] Where GT(x) represents the pixel value of pixel x in the real image, and Pred(x) represents the pixel value of pixel x in the model-predicted image.

[0179] For different regions of the portrait, multiply by the different weight values ​​mentioned above. The final loss result L final The form is as follows: (4)

[0180] L final =[GT(x)-Pred(x)] 2 ⊙M(x) (4).

[0181] Here, ⊙ represents the Hadamard Product operation.

[0182] Based on the video generation model trained using the aforementioned training method, this application further provides a video generation method applied to the video generation model trained using the same method. This video generation method is an enhancement method that can significantly improve the clarity of portraits, enhance the quality of human body parts such as faces and hands, and improve the usability of the generated results.

[0183] Figures 16 to 18 These are before-and-after comparison images of the video generation method provided in the embodiments of this application, wherein... Figures 16 to 18Part (a) in the text refers to video frames in the target video that were not generated using the video generation method provided in this application, i.e., video frames before the video generation method provided in this application was used. Figures 16 to 18 Part (b) in the document consists of video frames from the target video generated using the video generation method provided in the embodiments of this application. Figures 16 to 18 As can be seen from the before-and-after comparison chart, the video generation method provided in this application embodiment can clearly indicate the quality of human body parts such as the face and hands.

[0184] It is understood that in the embodiments of this application, if data related to user information or enterprise information is involved, when the embodiments of this application are applied to specific products or technologies, it is necessary to obtain user permission or consent, or to obfuscate this information in order to eliminate the correspondence between this information and the user; and the collection and processing of related data should strictly comply with the requirements of relevant laws and regulations when applied in practice, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0185] The following continues to describe the exemplary structure of the training device 254-1 for the video generation model provided in this application embodiment as a software module. In some embodiments, such as Figure 5 As shown, the training device 254-1 for the video generation model includes: a first acquisition module 2541, used to acquire the model prediction video and the ground truth video; the model prediction video is generated by the video generation model to be trained based on sample control conditions, and the ground truth video is the video corresponding to the sample control conditions, the model prediction video includes multiple prediction video frames; a keypoint prediction module 2542, used to predict keypoints in the ground truth video frames to obtain at least one predicted keypoint in the ground truth video frames and the confidence level of each predicted keypoint; a weight determination module 2543, used to determine the weight values ​​of pixels in the ground truth video frames based on the confidence levels of the at least one predicted keypoint; a loss calculation module 2544, used to perform loss calculation based on the first pixel value of the pixels in the ground truth video frames, the weight values, and the second pixel value of the pixels in the prediction video frames to obtain a loss result; and a parameter update module 2545, used to update the model parameters of the video generation model to be trained based on the loss result to obtain the trained video generation model.

[0186] In some embodiments, the keypoint prediction module 2542 is further configured to: extract features from the ground truth video frame to obtain a frame feature vector of the ground truth video frame; perform a first feature mapping on the frame feature vector to obtain position information of at least one predicted keypoint; and perform a second feature mapping on the frame feature vector and the position information to obtain the confidence level of each predicted keypoint.

[0187] In some embodiments, the weight determination module 2543 is further configured to: determine predicted joints with confidence scores greater than a preset confidence threshold as target joints; the number of target joints is at least one; determine the target location of each target joint in the target object in the ground truth video frame; and determine the weight value of each pixel in the ground truth video frame based on the target location and the confidence score of each target joint.

[0188] In some embodiments, the weight determination module 2543 is further configured to: determine the target joint as a first joint in response to the target part of any target joint being the face or hand of the target object; the number of the first joints is at least one; and determine the weight value of each pixel in the region where the first joint is located based on the confidence level of the first joint.

[0189] In some embodiments, the weight determination module 2543 is further configured to: determine a target circular region corresponding to each first joint point; wherein the target circular region is a circular region with the joint point coordinates of the first joint point as the center and a preset value as the radius; determine the weight value of each pixel point in the first region where the at least one first joint point is located based on the target circular region of at least one first joint point; the first region is a pixel region obtained by taking the union of the target circular regions of all first joint points.

[0190] In some embodiments, the weight determination module 2543 is further configured to: in response to the first joint being a joint located on the face of a target object, determine a first target circular region corresponding to the first joint on the face; wherein the first target circular region is a circular region with the joint coordinates of the first joint on the face as its center and a first preset value as its radius; in response to the first joint being a joint located on the hand of a target object, determine a second target circular region corresponding to the first joint on the hand; wherein the second target circular region is a circular region with the joint coordinates of the first joint on the hand as its center and a second preset value as its radius.

[0191] In some embodiments, the weight determination module 2543 is further configured to: for each pixel in the first region, in response to the pixel being located in a target circular region of a first joint, determine the weight value of the pixel by multiplying the confidence level of the first joint by a preset coefficient; in response to the pixel being located in a target circular region of multiple first joints, smooth the sum of the confidence levels of the multiple first joints to obtain a smoothed confidence level; and determine the weight value of the pixel by multiplying the smoothed confidence level by the preset coefficient.

[0192] In some embodiments, the weight determination module 2543 is further configured to: determine the target joint as a second joint in response to the fact that the target part of any target joint is a body part of the target object; the number of the second joints is at least one; and determine the weight value of each pixel in the region where the second joint is located.

[0193] In some embodiments, the weight determination module 2543 is further configured to: determine a target rectangular region corresponding to all second joints; wherein the target rectangular region is the smallest rectangular region surrounding all second joints; and determine the weight value of each pixel in the target rectangular region as a first preset weight value.

[0194] In some embodiments, the weight determination module 2543 is further configured to: in response to any pixel not belonging to the target rectangular region and not belonging to the first region where at least one first joint is located, determine the weight value of the any pixel as a second preset weight value.

[0195] In some embodiments, the loss calculation module 2544 is further configured to: construct a correspondence between each pixel in the ground truth video frame and each pixel in the predicted video frame, forming multiple pixel pairs; wherein, the weight value corresponding to each pixel pair is the weight value of the pixel from the ground truth video frame in the pixel pair; determine the pixel value difference between the first pixel value of the pixel from the ground truth video frame and the second pixel value of the pixel from the predicted video frame in each pixel pair; and determine the loss result based on the pixel value difference of all pixel pairs and the weight value corresponding to the pixel pairs.

[0196] In some embodiments, the loss calculation module 2544 is further configured to: for each pixel pair, determine the square of the pixel value difference of the pixel pair to obtain a first value of the pixel pair; multiply the first value of the pixel pair by the weight value corresponding to the pixel pair to determine the loss value of the pixel pair; and summarize the loss values ​​of all pixel pairs to obtain the loss result.

[0197] The following continues to describe the exemplary structure of the video generation apparatus 254-2 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 5 As shown, the video generation device 254-2 includes: a second acquisition module 2546, used to acquire a video generation request, the video generation request including control conditions; and a video generation module 2547, used to generate a target video based on the control conditions using a pre-trained video generation model in response to the video generation request; wherein the video generation model is trained using the above-described video generation model training method.

[0198] It should be noted that the description of the apparatus in this application embodiment is similar to the description of the method embodiment described above, and has similar beneficial effects as the method embodiment; therefore, it will not be repeated. For technical details not disclosed in this apparatus embodiment, please refer to the description of the method embodiment of this application for understanding.

[0199] This application provides an electronic device, including: a memory for storing computer-executable instructions or computer programs; and a processor for executing the computer-executable instructions or computer programs stored in the memory to implement the above-described method.

[0200] This application provides a computer program product, which includes computer-executable instructions or a computer program stored in a computer-readable storage medium; wherein, when the processor of an electronic device reads the computer-executable instructions or the computer program from the computer-readable storage medium and executes the computer-executable instructions or the computer program, the above-described method is implemented.

[0201] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will perform the aforementioned method, for example, as... Figure 6 The method shown, or, as Figure 12 The method shown.

[0202] In some embodiments, the storage medium may be a computer-readable storage medium, such as a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or a compact disk-read-only memory (CD-ROM); or it may be a device that includes one or any combination of the above-mentioned memories.

[0203] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0204] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file containing other programs or data, for example, in one or more scripts within a Hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., files storing one or more modules, subroutines, or code sections). As an example, executable instructions may be deployed to execute on a single electronic device, or on multiple electronic devices located in one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0205] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A training method for a video generation model, characterized in that, The method includes: Acquire model-predicted videos and ground truth videos; the model-predicted videos are generated by a video generation model to be trained based on sample control conditions, the ground truth videos are videos corresponding to the sample control conditions, and the model-predicted videos include multiple predicted video frames. Perform keypoint prediction on the ground value video frames in the ground value video to obtain at least one predicted keypoint in the ground value video frame and the confidence level of each predicted keypoint. Based on the confidence level of the at least one predicted key point, the weight values ​​of the pixels in the ground truth video frame are determined; The loss is calculated based on the first pixel value of the pixel in the ground truth video frame, the weight value, and the second pixel value of the pixel in the predicted video frame to obtain the loss result; Based on the loss result, the model parameters of the video generation model to be trained are updated to obtain the trained video generation model.

2. The method according to claim 1, characterized in that, The step of predicting keypoints in the ground truth video frames to obtain at least one predicted keypoint in the ground truth video frame and the confidence level of each predicted keypoint includes: Feature extraction is performed on the ground truth video frame to obtain the frame feature vector of the ground truth video frame; Perform a first feature mapping on the frame feature vector to obtain the position information of at least one predicted key point; A second feature mapping is performed on the frame feature vector and the position information to obtain the confidence level of each predicted joint point.

3. The method according to claim 1, characterized in that, Determining the weight values ​​of pixels in the ground truth video frame based on the confidence level of the at least one predicted keypoint includes: Predicted key points with a confidence level greater than a preset confidence threshold are identified as target key points; the number of target key points is at least one. Determine the target location of each target joint point within the target object in the true video frame. Based on the target location and confidence level of each target key point, the weight value of each pixel in the ground truth video frame is determined.

4. The method according to claim 3, characterized in that, The step of determining the weight value of each pixel in the ground truth video frame based on the target location and the confidence level of each target joint includes: In response to the target part being the face or hand of the target object, the target joint is defined as a first joint; the number of first joints is at least one. Based on the confidence level of the first joint, determine the weight value of each pixel in the region where the first joint is located.

5. The method according to claim 4, characterized in that, The step of determining the weight value of each pixel in the region where the first joint is located based on the confidence level of the first joint includes: Determine the target circular region corresponding to each first joint point; wherein, the target circular region is a circular region with the joint point coordinates of the first joint point as the center and a preset value as the radius; Based on the target circular region of at least one first joint, determine the weight value of each pixel in the first region where the at least one first joint is located; the first region is the pixel region obtained by taking the union of the target circular regions of all first joints.

6. The method according to claim 5, characterized in that, The determination of the target circular region corresponding to each first joint point includes: In response to the fact that the first joint point is a joint point located on the face of the target object, a first target circular region corresponding to the first joint point of the face is determined; wherein, the first target circular region is a circular region with the joint point coordinates of the first joint point of the face as the center and a first preset value as the radius. In response to the first joint being a joint located on the hand of the target object, a second target circular region corresponding to the first joint of the hand is determined; wherein, the second target circular region is a circular region with the joint coordinates of the first joint of the hand as the center and a second preset value as the radius.

7. The method according to claim 5, characterized in that, The determination of the weight value of each pixel in the first region where the at least one first joint is located, based on the target circular region of at least one first joint, includes: For each pixel in the first region, In response to the pixel being located in a target circular region of a first joint, the product of the confidence level of the first joint and a preset coefficient is determined as the weight value of the pixel. In response to the pixel being located in a target circular region of multiple first joints, the sum of the confidence scores of the multiple first joints is smoothed to obtain a smoothed confidence score; and the product of the smoothed confidence score and the preset coefficient is determined as the weight value of the pixel.

8. The method according to claim 3, characterized in that, The step of determining the weight value of each pixel in the ground truth video frame based on the target location and the confidence level of each target joint includes: In response to the fact that the target part of any target joint is a body part of the target object, the target joint is determined as a second joint; the number of second joints is at least one. Determine the weight value of each pixel in the region where the second joint is located.

9. The method according to claim 8, characterized in that, Determining the weight value of each pixel in the region where the second joint is located includes: Determine the target rectangular region corresponding to all second joints; wherein, the target rectangular region is the smallest rectangular region that surrounds all the second joints; The weight value of each pixel in the target rectangular region is determined to be a first preset weight value.

10. The method according to claim 9, characterized in that, The method further includes: In response to any pixel not belonging to the target rectangular region and not belonging to the first region where at least one first joint is located, the weight value of the pixel is determined to be a second preset weight value.

11. The method according to any one of claims 1 to 10, characterized in that, The loss calculation is performed based on the first pixel value of the pixel in the ground truth video frame, the weight value, and the second pixel value of the pixel in the predicted video frame to obtain the loss result, including: A correspondence is established between each pixel in the ground truth video frame and each pixel in the predicted video frame, forming multiple pixel pairs; wherein, the weight value corresponding to each pixel pair is the weight value of the pixel in the pixel pair from the ground truth video frame; Determine the pixel value difference between the first pixel value of the pixel from the ground truth video frame and the second pixel value of the pixel from the predicted video frame in each pixel pair; The loss result is determined based on the pixel value difference of all pixel pairs and the weight value corresponding to the pixel pairs.

12. The method according to claim 11, characterized in that, The step of determining the loss result based on the pixel value difference of all pixel pairs and the weight value corresponding to the pixel pairs includes: For each pair of pixels, the square of the pixel value difference between the pair is determined to obtain the first value of the pair of pixels. The loss value of the pixel pair is determined by multiplying the first value of the pixel pair with the weight value corresponding to the pixel pair. The loss results are obtained by summing the loss values ​​of all pixel pairs.

13. A video generation method, characterized in that, The method includes: Obtain a video generation request, which includes control conditions; In response to the video generation request, a target video is generated based on the control conditions using a pre-trained video generation model; wherein the video generation model is trained using the training method of the video generation model according to any one of claims 1 to 12.

14. A training device for a video generation model, characterized in that, The device includes: The first acquisition module is used to acquire model prediction videos and ground truth videos; the model prediction videos are generated by a video generation model to be trained based on sample control conditions, the ground truth videos are videos corresponding to the sample control conditions, and the model prediction videos include multiple prediction video frames. The key point prediction module is used to predict key points in the ground truth video frame to obtain at least one predicted key point in the ground truth video frame and the confidence level of each predicted key point. The weight determination module is used to determine the weight value of the pixel in the ground truth video frame based on the confidence level of the at least one predicted key point. The loss calculation module is used to perform loss calculation based on the first pixel value of the pixel in the ground truth video frame, the weight value, and the second pixel value of the pixel in the predicted video frame, and obtain the loss result. The parameter update module is used to update the model parameters of the video generation model to be trained based on the loss result, so as to obtain the trained video generation model.

15. A video generation apparatus, characterized in that, The device includes: The second acquisition module is used to acquire a video generation request, wherein the video generation request includes control conditions; A video generation module is configured to, in response to the video generation request, generate a target video based on the control conditions using a pre-trained video generation model; wherein the video generation model is trained using the training method of the video generation model according to any one of claims 1 to 12.

16. An electronic device, characterized in that, include: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the training method of the video generation model according to any one of claims 1 to 12, or implements the video generation method according to claim 13.

17. A computer-readable storage medium, characterized in that, The device stores computer-executable instructions or computer programs that, when executed by a processor, implement the training method of the video generation model according to any one of claims 1 to 12, or implement the video generation method according to claim 13.

18. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the training method of the video generation model according to any one of claims 1 to 12, or the video generation method according to claim 13.