Video generation method and device, electronic equipment and computer storage medium
By acquiring and splicing multi-view image features, combined with the cross-attention mechanism, the shortcomings of the diffusion model in maintaining local features are solved, and the authenticity and viewing value of video generation are improved.
Patent Information
- Application Number
- CN202410746372.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-01
AI Technical Summary
Existing diffusion models are difficult to maintain the clarity and authenticity of local features in object video generation, resulting in limited authenticity and viewing value of video content.
By obtaining the generated image set and reference image set of the target object, extract the local object reference image, combine the semantic embedding and local embedding features for feature splicing, input the trained video generation model for prediction, and use the cross attention mechanism to capture the local objects from different perspectives. characteristic relationship.
It improves the prediction effect of the video generation model on target objects and local objects, and enhances the authenticity and simulation effect of the generated video.
Smart Images

Figure CN118736068A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual content generation, and more specifically, to a video generation method, device, electronic equipment and computer storage medium. Background Art
[0002] In the field of digital media and virtual content generation, semantics-to-image (T2I) technology has experienced tremendous progress and has gradually expanded to semantics-to-video (T2V) research. Diffusion models have become a new focus in this research field due to their high-quality image generation effects.
[0003] In recent years, diffusion models have shown potential in dynamic video generation, especially in object video production. However, when diffusion models are trained based on basic images of objects, they usually only care about the overall feature state of the object, and often ignore some local features that need to be presented, making it difficult to maintain the clarity and authenticity of these local features under changing viewing angles, which limits the authenticity and viewing value of the video content. Summary of the invention
[0004] The present invention aims to overcome at least one defect of the above-mentioned prior art and provide a video generation method, device, electronic device and computer storage medium, which are used to provide a video generation method, device, electronic device and computer storage medium that can simulate and reproduce the corresponding local features of an individual more efficiently and accurately.
[0005] According to one aspect of the present application, a video generation method is provided, the generation method comprising:
[0006] Acquire a generated image set of a target object, wherein the generated image set includes at least one single-frame image containing the target object;
[0007] Acquire a reference image set of a target object, wherein the reference image set includes a plurality of single-frame images of different viewing angles of the target object;
[0008] Extracting a local object reference image corresponding to each single frame image in a reference image set, and constructing a local object reference image set based on all the local object reference images;
[0009] Constructing a target skeleton point sequence of the target object;
[0010] The generated image set, reference image set, local object reference image set and target skeleton point sequence of the target object are input into the trained video generation model for prediction to obtain the target action video of the target object.
[0011] In an optional embodiment, the step of inputting the generated image set, the reference image set, the local object reference image set and the target skeleton point sequence of the target object into the trained video generation model for prediction includes:
[0012] Perform feature splicing on the reference image set of the target object and the reference image set of the local object to obtain fused reference features of the target object;
[0013] The fused reference features, generated image set and target bone point sequence of the target object are input into the trained video generation model for prediction.
[0014] In an optional implementation, the step of performing feature stitching on the reference image set of the target object and the reference image set of the local object to obtain the fused reference features of the target object includes:
[0015] Acquire the semantic embedding reference features of each of the single-frame images in the reference image set of the target object, and splice all the semantic embedding reference features in the reference image set to obtain the semantic embedding splicing reference features;
[0016] Acquire a local embedding reference feature of each local object reference image in a local object reference image set of the target object, and splice all the local embedding reference features in the local object reference image set to obtain a local embedding splicing reference feature;
[0017] Feature splicing processing is performed according to the semantic embedding splicing reference features and the local embedding splicing reference features to obtain the fused reference features of the target object.
[0018] In an optional embodiment, before inputting the fused reference features, generated image set and target bone point sequence of the target object into the trained video generation model for prediction, it also includes adjusting the dimensions of the spliced semantic embedded splicing reference features and the local embedded splicing reference features to unify the dimensions of the spliced semantic embedded splicing reference features and the semantic embedded splicing reference features.
[0019] In an optional embodiment, in the process of inputting the fused reference features, generated image set and target bone point sequence of the target object into the trained video generation model for prediction:
[0020] The fused reference features are used as global features of the video generation model, and are integrated with the generated image set and the target bone point sequence in the video generation model through a cross-attention mechanism.
[0021] In an optional embodiment, the video generation model includes at least a semantic feature network, a local feature network, a fusion splicing network and a video generation network;
[0022] The semantic feature network is used to extract semantic features according to the input reference image set, extract semantic embedding reference features corresponding to each single-frame image in the reference image set, and splice all the obtained semantic embedding reference features to obtain semantic embedding splicing reference features;
[0023] The local feature network is used to extract local features according to the local object reference image set, extract local embedding reference features corresponding to each single frame image in the local object reference image set, and splice all the obtained local embedding reference features to obtain semantic embedding splicing reference features;
[0024] The fusion splicing network is used to perform feature splicing processing according to the semantic embedding reference features and the local embedding reference features to obtain fusion reference features;
[0025] The video generation network predicts based on the fused reference features, the generated image set and the corresponding target skeleton point sequence to generate a target action video.
[0026] In an optional implementation, the method further includes pre-training the video generation model, wherein the training includes:
[0027] Acquire a training sample set, wherein the training sample set includes at least one group of training samples, any group of the training samples includes a training image set, a training reference image set and a local object training image set, wherein the training image set includes at least one single-frame image containing the same training object; the training reference image set includes a plurality of training reference images containing the same training object, each of the training reference images corresponds to a different perspective of the training object; the local object training image set includes a plurality of local object images, each of the plurality of local object images corresponds to the same local object of the training object, and each of the local object images is obtained by extracting from the corresponding training reference image;
[0028] Constructing a corresponding training skeleton point sequence for each group of training samples;
[0029] Training the video generation model to be trained according to each group of the training samples and the corresponding training skeleton point sequence in the training sample set;
[0030] A test sample set is constructed and the trained video generation model is tested by using the test sample set to obtain the trained video generation model.
[0031] According to a second aspect of the present application, a video generating device is provided, the generating device comprising:
[0032] A target acquisition module is used to acquire a generated image set of a target object, wherein the generated image set includes at least one single-frame image containing the target object; and to acquire a reference image set of the target object, wherein the reference image set includes a plurality of single-frame images containing the target object from different perspectives; and to extract a local object reference image corresponding to each single-frame image in the reference image set, and to construct a local object reference image set based on all the local object reference images; and to construct a target skeleton point sequence of the target object;
[0033] The video generation module is used to input the generated image set, reference image set, local object reference image set and target skeleton point sequence of the target object into the trained video generation model for prediction to obtain the target action video of the target object.
[0034] In an optional implementation manner, the generating device further includes:
[0035] A training sample acquisition module is used to obtain a training sample set, wherein the training sample set includes at least one group of training samples, and any group of the training samples includes a training image set, a training reference image set and a local object training image set, wherein the training image set includes at least one single-frame image containing the same training object; the training reference image set includes a plurality of training reference images containing the same training object, and each of the training reference images corresponds to a different perspective of the training object; the local object training image set includes a plurality of local object images, and the plurality of local object images correspond to the same local object of the training object, and each of the local object images is obtained by extracting from the corresponding training reference image; and a corresponding training skeleton point sequence is constructed for each group of the training samples;
[0036] A model training module, used for training the video generation model to be trained according to each group of the training samples and the corresponding training skeleton point sequence in the training sample set;
[0037] The model testing module is used to construct a test sample set and test the trained video generation model through the test sample set to obtain the trained video generation model.
[0038] According to a third aspect of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement a video generation method described in the first aspect.
[0039] According to a fourth aspect of the present application, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed, the video generation method described in the first aspect is implemented.
[0040] Based on any one of the above aspects, a video generation method, device, electronic device and computer storage medium provided by an embodiment of the present application obtains a generated image set of the target object, and constructs single-frame images of the target object from different perspectives as a reference image set, and obtains a corresponding local object reference image set for the target local object from each single-frame image of the reference image set, and inputs the reference image set, the local object reference image set, the generated image set and the target skeleton point sequence into the trained video generation model for prediction, so that the video generation model can better predict the target local object according to the corresponding local features under multiple perspectives, so as to achieve a better simulation effect of the target object and the target local object, thereby greatly improving the simulation effect of the generated target action video. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 A schematic diagram of an application scenario of the video generation method provided in this embodiment.
[0043] Figure 2 This is a flowchart of the steps of the video generation method provided in this embodiment.
[0044] Figure 3 This is a structural diagram of the video generation model provided in this embodiment.
[0045] Figure 4 This is the network structure diagram of Animate Anyone.
[0046] Figure 5 A flow chart of the steps for obtaining the fused reference features provided in this embodiment.
[0047] Figure 6 A flow chart of the training steps of the video generation model provided in this embodiment.
[0048] Figure 7 This is a device structure diagram of the video generating device provided in this embodiment.
[0049] Figure 8 This is a structural diagram of an electronic device provided in this embodiment.
[0050] Figures are labeled: server 100, terminal 200, semantic feature network 11, local feature network 12, dimension adjustment network 13, fusion and splicing network 14, video generation network 15, target acquisition module 21, video generation module 22, training sample acquisition module 31, model training module 32, model testing module 33, memory 41, processor 42, bus 43, communication interface 44. DETAILED DESCRIPTION
[0051] The drawings of this application are only used for illustrative purposes and should not be construed as limiting the present application. In order to better illustrate the following embodiments, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; it is understandable to those skilled in the art that some well-known structures and their descriptions in the drawings may be omitted.
[0052] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0054] With the continuous development of live broadcast platforms, short video platforms, and artificial intelligence technology, people have gradually begun to use artificial intelligence to generate virtual content, from the initial generation of virtual images by semantics, and gradually transitioning to the generation of videos by semantics. The diffusion model has shown great potential in the generation of dynamic virtual videos, especially in the generation of dynamic videos of characters. People began to pay attention to how to improve the performance of the diffusion model in body motion capture, feature retention, and content coherence. Under this trend, people launched the Animate Anyone model, which can obtain the target video that matches the skeleton point action by inputting a single-frame target image and a skeleton point sequence of the target action to be output;
[0055] However, although models such as the Animate Anyone model have good efficiency, they can only extract features from single-frame images. Single-frame images usually show the overall information of the target object. Since the model focuses on the overall information of the target object, it cannot restore the features of the local objects in the target object well, which makes the generated video lack "authenticity"; assuming that the target object is a person, and in order to restore the action of the person, the single-frame image used as a reference is usually a photo of the whole person, then the facial features of the target person cannot be restored well through the single-frame image. If the facial features are not well restored, the face of the target person in the video may be distorted or deformed, thereby reducing the effect of the generated video. In order to generate more vivid and accurate character action videos, this embodiment obtains reference images from multiple angles, extracts the target local image from the reference image, inputs the reference image and the target local reference image into the model for learning, and captures the relationship between local features under different perspectives through the cross-attention mechanism during the learning process.
[0056] This embodiment provides a technical solution that can solve the above-mentioned problem. The specific implementation methods of this application are described in detail below in conjunction with the accompanying drawings.
[0057] For example, the following is a schematic diagram of an application scenario of a video generation method provided in an embodiment of the present application. Figure 1 As shown, the application scenario includes at least a server 100 and a terminal 200 that can communicate with the server 100. The server 100 has an image processing function and can also have a data transmission function for video streams and audio streams; the terminal device 200 has a streaming media playback function and can also have an image processing function.
[0058] It is understandable that the server 100 can be an independent electronic device or a cluster of multiple electronic devices; the terminal 200 can be a smart phone terminal, a personal computer, a tablet computer, a car terminal, etc., but is not limited thereto.
[0059] In one practicable manner, the server 100 and the terminal 200 may respectively execute the video generation method provided in the embodiment of the present application, or, optionally, the video generation method provided in the embodiment of the present application is partially executed in the server 100 and partially executed in the terminal 200.
[0060] like Figure 2 As shown, this embodiment provides a video generation method, which may include:
[0061] S1: Acquire a generated image set of a target object, wherein the generated image set includes at least one single-frame image containing the target object;
[0062] It can be understood that the target object in this embodiment can be a person, an animal, a virtual person or an animal, etc. When the target object is an actual person or an animal, the single-frame image of the target object can be obtained by video capture or by taking a photo; when the target object is a virtual person or an animal, it can be obtained by corresponding video capture, or directly through the image, or a three-dimensional model of the target object can be created using 3D modeling technology in computer graphics, and the corresponding image of the virtual person or animal can be obtained based on the created three-dimensional model.
[0063] In one practicable manner, when the number of the single-frame images in the generated image set exceeds two, the background of each single-frame image remains consistent and contains the target object; further, the appearance, image, clothing, etc. of the target object in all the single-frame images remain consistent.
[0064] Preferably, all of the single-frame images in the generated image set contain local objects of the target object that need to be predicted; exemplarily, if the target object is a person and the local object is a face, then all of the single-frame images in the generated image set contain the face of the target object person.
[0065] S2: Acquire a reference image set of the target object, wherein the reference image set includes a plurality of single-frame images of different viewing angles of the target object;
[0066] It can be understood that the appearance, clothing, etc. of the target object in each single-frame image in the reference image set remain consistent; further, each single-frame image in the reference image contains a local object of the target object that needs to be predicted; exemplarily, if the target object is a person and the local object is a face, then all the single-frame images in the reference image set contain the face of the target object person.
[0067] Optionally, when the number of the single-frame images in the generated image set is sufficient, the viewing angles of the single-frame images are different, and all contain local objects of the target object, the generated image set can be used as the reference image set.
[0068] S3: extracting a local object reference image corresponding to each single frame image in the reference image set, and constructing a local object reference image set according to all the local object reference images;
[0069] It can be understood that in step S3, the reference image set is retained, and the portion of the local object of the target object contained in each single frame image in the reference image set is extracted to form the local object reference image.
[0070] Exemplarily, if the target object is a person and the local object of the target object is a face, the part containing the face in the single-frame image in the reference image set is extracted to form the local object reference image.
[0071] S4: constructing a target skeleton point sequence of the target object;
[0072] It can be understood that the target skeleton point sequence includes a plurality of skeleton point images with a time sequence, and each skeleton point image represents one of the target actions.
[0073] It is understandable that the single-frame image in the reference image set used as a reference represents the entire target object, while the local object of the target object accounts for a very small proportion in the single-frame image in the reference image set. When the single-frame image is to be adjusted to the target size for generation, the information of the local object of the target object is even less. In order to solve this problem, effective and clear information of the local object of the target object is extracted from the original images of multiple single-frame images for model prediction, which can improve the authenticity and restoration of the generated video.
[0074] S5: Inputting the generated image set, reference image set, local object reference image set and target skeleton point sequence of the target object into the trained video generation model for prediction to obtain the target action video of the target object.
[0075] Preferably, the video generation model of this embodiment is set based on a stable diffusion model. Figure 3 The structure diagram of the video generation model of this embodiment is shown. In this embodiment, the video generation model may include a semantic feature network 11, a local feature network 12, a dimension adjustment network 13, a fusion splicing network 14 and a video generation network 15;
[0076] The semantic feature network 11 is used to extract semantic features according to the reference image set, extract semantic embedding reference features corresponding to each single frame image in the reference image set, and splice all the obtained semantic embedding reference features to obtain semantic embedding splicing reference features;
[0077] The semantic feature network 11 can be constructed based on a semantic feature extraction model. For example, the semantic feature network 11 can be constructed based on a Clip feature extraction model. The Clip feature extraction model is a graphic recognition model that trains a large amount of data corresponding to semantics and images, and realizes graphic recognition by matching the similarity between the embedded features of semantics and the embedded features of images.
[0078] The local feature network 12 is used to extract local features according to the local object reference image set, extract local embedding reference features corresponding to each single frame image in the local object reference image set, and splice all the obtained local embedding reference features to obtain semantic embedding splicing reference features;
[0079] The local feature network 12 can be constructed based on a feature recognition model. It should be noted that the feature recognition model can be a pre-trained feature recognition model or a feature recognition model to be trained. Setting it as a pre-trained feature recognition model can reduce training and identify specific local objects more quickly; setting it as a feature recognition model to be trained can better learn and train the required local objects; and the feature recognition model only needs the features of the identified local objects, and does not need to identify the results based on the features. Therefore, the network layer for the final identification in the model can be removed in specific applications; exemplarily, if the target local object is a face, the local feature network 12 can be constructed based on a face recognition model. When the local feature network 12 is constructed based on a face recognition model, the last softmax layer in the face recognition model is removed, that is, the final face recognition result is not needed, only the features of the acquired face are needed.
[0080] The dimension adjustment network 13 is used to adjust the dimensions of the spliced semantic embedding splicing reference features and the local embedding splicing reference features, so that the dimensions of the spliced semantic embedding splicing reference features and the semantic embedding splicing reference features are unified, which is convenient for subsequent fusion splicing; preferably, the dimension adjustment network 13 can be set by a learnable fully connected layer;
[0081] The fusion splicing network 14 is used to splice the adjusted semantic embedding reference features and local embedding reference features to obtain fusion reference features; preferably, the splicing of the fusion splicing network 14 is set to be performed in the channel dimension.
[0082] The video generation network 15 makes predictions based on the fused reference features, the generated image set and the corresponding target bone point sequence to generate a target action video; preferably, the video generation network 15 uses the fused reference features as global features and integrates them with the generated image set and the corresponding target bone point sequence through a cross-attention mechanism.
[0083] In a preferred implementation of this embodiment, the video generation model can be constructed based on the open source Animate Anyone model. Figure 4 The overall structure of the Animate Anyone model is shown, and the Animate Anyone model includes a VAE (Variational auto-encoder) encoder VAE Enc, ReferenceNets, Denoising Unet, a pose guide Pose Guider, a CLIP (Contrastive Language-Image Pre-Training) image encoder CLIP, a VAE decoder VAE Dec, and a temporal layer (corresponding to the Temporal-Attention part in the figure);
[0084] Specifically, the VAE encoder VAE Enc is used to encode the input reference image Reference Image; the pose guide Pose Guider is used to encode the input bone point sequence Pose Sequence, and the bone point sequence Pose Sequence is fused with multiple frames of noise Noise after encoding; the ReferenceNets is used to extract the image features of the encoded reference image Reference Image; the Denoising Unet is used to generate a video according to the encoded bone point sequence Pose Sequence and the image features obtained by the ReferenceNets, including denoising the video and performing spatial attention operations and cross-attention operations respectively by the spatial attention component Spatial-Attention and the cross-attention component Cross-Attention of the calculation module of the Denoising Unet; the temporal layer is set in the Denoising Unet, specifically integrated after the spatial attention component and the cross-attention component, and is used to model the relationship between the input bone point sequence and multiple frames in the reference image through the temporal attention group Temporal-Attention to simulate a continuous and smooth temporal motion process; the CLIP image encoder CLIP is used to extract the input reference image Reference The semantic features of the image are extracted, and the extracted semantic features are input into the cross-attention component of the Denoising Unet for cross-attention operation; the VAE decoder is used to decode the results output by the Denoising Unet to generate video clips; h and w are the width and height of each bone point image in the bone point sequence PoseSequence input, representing the spatial dimension, and t represents the time dimension;
[0085] Then, based on the Animate Anyone model, the semantic feature network 11 of the video generation model of this embodiment can be set based on the CLIP image encoder, and the CLIP image encoder is used to extract semantic embedding reference features for each single frame image in the reference image set; the video generation network 15 can be set based on the VAE encoder, ReferenceNets, Denoising Unet, posture guide, VAE decoder and time layer;
[0086] It can be understood that in an optional implementation of the present embodiment, the video generation network 15 can encode the single frame image in the input generated image set through the VAE encoder, and extract features from the encoded ReferenceNets; at the same time, encode the target bone point sequence through the posture guide, and input the encoded target bone point sequence into the Denoising Unet; in this process, the fused reference feature is used as a global feature and integrated with the features in the ReferenceNets and the bone point sequence in the Denoising Unet through a cross-attention mechanism, and then the integration result is added to the temporal feature through the time layer, and finally output to the VAE decoder to decode the target action video.
[0087] It should be noted that, if the number of the single-frame images in the generated image set exceeds one, multiple ReferenceNets in the video generation network 15 can be set in parallel, and the number of ReferenceNets set matches the number of the single-frame images. Each ReferenceNets extracts the features of one of the single-frame images, and then the features extracted by all ReferenceNets are integrated.
[0088] Further, in a preferred embodiment, the step S5 of inputting the generated image set, the reference image set, the local object reference image set and the target skeleton point sequence of the target object into the trained video generation model for prediction may include:
[0089] Perform feature splicing on the reference image set of the target object and the reference image set of the local object to obtain fused reference features;
[0090] Preferably, Figure 5 As shown, the step of acquiring the fused reference features of the target object may include:
[0091] A1: obtaining a semantic embedding reference feature of each single-frame image in a reference image set of the target object, and splicing all the semantic embedding reference features in the reference image set to obtain a semantic embedding splicing reference feature;
[0092] It is understandable that in this embodiment, step A1 can perform feature extraction through the semantic feature network 11, and the details are as follows:
[0093] A2: obtaining a local embedding reference feature of each local object reference image in the local object reference image set of the target object, and splicing all the local embedding reference features in the local object reference image set to obtain a local embedding splicing reference feature;
[0094] It is understandable that in this embodiment, step A2 can perform feature extraction through the local feature network 12, and the details are as follows:
[0095] A3: Perform feature splicing processing according to the semantic embedding splicing reference features and the local embedding splicing reference features to obtain the fused reference features of the target object.
[0096] It is understandable that in this embodiment, step A3 can be fused and spliced by the fusion and splicing network 14;
[0097] Preferably, in the feature stitching process of step A3, it is also necessary to adjust the dimensions of the semantic embedding stitching reference feature and the local embedding stitching reference feature. Since the local embedding stitching reference feature is obtained based on the local object reference image, and the local object reference image is extracted from the reference image, the size of the local object reference image is different from that of the reference image, which leads to different dimensions of the semantic embedding stitching reference feature and the local embedding stitching reference feature. Unifying the dimensions can better achieve stitching. Specifically, the adjustment of the dimensions can be performed through the above-mentioned dimension adjustment network 13. For details, see the description of the dimension adjustment network 13.
[0098] The fused reference features, generated image set and target bone point sequence of the target object are input into the trained video generation model for prediction.
[0099] It can be understood that in this embodiment, the fused reference features, the generated image set and the corresponding target bone point sequence can be input into each network structure in the video generation model, that is, the single-frame image in the generated image set is encoded by the VAE encoder, and the encoded single-frame image is input into the corresponding ReferenceNets for feature extraction, the target bone point sequence is encoded by the posture guide, and the encoded target bone point sequence is input into the corresponding Denoising Unet, the fused reference features are used as global features, and are integrated with the features obtained by the ReferenceNets and the target bone point sequence of the Denoising Unet through a cross-attention mechanism, and then processed through the spatial attention mechanism and the temporal attention mechanism of the temporal layer, and finally the video clip is decoded by the VAE decoder.
[0100] Among them, Q=W of the cross attention mechanism Q z t , where Q(Query) is the query vector of the cross-attention mechanism, W Q =conv(R (N*Z)*C*H*W ), represents the learnable matrix of the query vector Q, R (N*Z)*C*H*W The dimension R of the latent representation of each layer in the video generation network 15 is N*C*K*H*W The purpose of reshaping is to better perform cross-attention operations on the fused splicing features. N represents the batch size, C represents the number of channels, Z represents the length of the output video, and H and W represent the height and width of the potential representation of each layer respectively; t represents the added noise; the matrices corresponding to the key vector K(Key) and value vector V(Values) of the cross attention mechanism are respectively expressed as
[0101] K=W K *P
[0102] V=W v *P
[0103] Where, P represents the fusion splicing feature, W K and W v Respectively represent the learnable matrices corresponding to the key vector K and the value vector V; the fused concatenation feature can be expressed as:
[0104]
[0105] In the formula, clip_embedding i Represents the semantic embedding reference feature of the ith one, id_embedding i represents the i-th local embedding reference feature, W R Represents the learnable matrix of the dimension adjustment network 13.
[0106] In this embodiment, the problem of inconsistent dimensions of batch size is solved by fusion splicing. At the same time, the splicing operation is set to be performed in the channel dimension, so that the key vector K and value vector V of the subsequent cross-attention mechanism contain multiple groups of data, and the query vector Q as a potential representation can query the most relevant feature output from the information of multiple groups of data.
[0107] Furthermore, in this embodiment, if Figure 6 As shown, the method further includes pre-training the video generation model, and the training may include:
[0108] B1: Acquire a training sample set, wherein the training sample set includes at least one group of training samples, and any group of the training samples includes a training image set, a training reference image set, and a local object training image set, wherein the training image set includes at least one single-frame image containing the same training object; the training reference image set includes a plurality of training reference images containing the same training object, and each of the training reference images corresponds to a different perspective of the training object; the local object training image set includes a plurality of local object images, and the plurality of local object images correspond to the same local object of the training object, and each of the local object images is obtained by extracting from the corresponding training reference image; construct a corresponding training skeleton point sequence for each group of the training samples;
[0109] B2: training the video generation model to be trained according to each group of the training samples and the corresponding training skeleton point sequence in the training sample set;
[0110] B3: Construct a test sample set and test the trained video generation model through the test sample set to obtain the trained video generation model.
[0111] It can be understood that in this embodiment, the training process of the video generation model is similar to the video generation process in terms of the overall data processing method. The difference is that the video generation model needs to perform multiple learning and training based on the training samples in the training sample set during the training process, and the network in the video generation model is continuously updated during the learning and training process;
[0112] In addition, in a preferred embodiment, the training of the video generation model may include two stages, exemplarily, Figure 4 Taking the Animate Anyone model shown as an example, in the first stage of training of the video generation model, the time layer is excluded, and the VAE encoder VAE Enc, the pose guide Pose Guider, the CLIP image encoder CLIP, and the VAE decoder VAE Dec are used for training. The optimization goal of this stage is to enable the model to generate high-quality animation images under the conditions of single-frame reference images and training skeleton point sequences under multiple different perspectives;
[0113] In the second stage of training of the video generation model, the time layer is introduced into the video generation model trained in the first stage, and the video generation model is initialized using the pre-trained weights in AnimateDiff. Then, the model is trained using the acquired video clips for timing training and the timing skeleton point sequences corresponding to the video clips. In this stage of training, only the time layer is trained, and the weights of other networks are fixed. This stage is to introduce timing features into the training to ensure that the generated video has good coherence and reduce inconsistency between frames.
[0114] In this embodiment, a generated image set of the target object is obtained, and single-frame images of the target object from different perspectives are constructed as a reference image set. A corresponding local object reference image set is obtained for the local objects of the target object from each single-frame image of the reference image set. The reference image set, the local object reference image set, the generated image set and the target skeleton point sequence are input into the trained video generation model for prediction. This enables the video generation model to better predict the target local objects according to the corresponding local features under multiple perspectives, so as to achieve a better simulation effect of the target object and the target local object, thereby greatly improving the simulation effect of the generated target action video.
[0115] Based on the same inventive concept, this embodiment also provides a video generating device, wherein: Figure 7 The device structure diagram of the generating device of this embodiment is shown, and the generating device may include:
[0116] The target acquisition module 21 is used to acquire a generated image set of a target object, wherein the generated image set includes at least one single-frame image containing the target object; and to acquire a reference image set of the target object, wherein the reference image set includes a plurality of single-frame images containing the target object from different perspectives; and to extract a local object reference image corresponding to each single-frame image in the reference image set, and to construct a local object reference image set based on all the local object reference images; and to construct a target bone point sequence of the target object;
[0117] In this embodiment, the target acquisition module 21 can be used to respectively execute Figure 2 For the detailed description of the target acquisition module 21 , reference may be made to the description of the steps S1 , S2 , S3 and S4 .
[0118] The video generation module 22 is used to input the generated image set, reference image set, local object reference image set and target skeleton point sequence of the target object into the trained video generation model for prediction to obtain the target action video of the target object.
[0119] In this embodiment, the video generation module 22 can be used to perform Figure 2 As shown in step S5, for the specific description of the video generation module 22, reference may be made to the description of step S5;
[0120] In a preferred embodiment, the generating device may further include:
[0121] The training sample acquisition module 31 is used to obtain a training sample set, wherein the training sample set includes at least one group of training samples, and any group of the training samples includes a training image set, a training reference image set and a local object training image set, wherein the training image set includes at least one single-frame image containing the same training object; the training reference image set includes a plurality of training reference images containing the same training object, and each of the training reference images corresponds to a different perspective of the training object; the local object training image set includes a plurality of local object images, and the plurality of local object images correspond to the same local object of the training object, and each of the local object images is obtained by extracting from the corresponding training reference image; and a corresponding training skeleton point sequence is constructed for each group of the training samples;
[0122] In this embodiment, the training sample collection module 31 can be used to perform Figure 6 As shown in step A1, for the specific description of the target acquisition module 21, reference may be made to the description of step A1.
[0123] A model training module 32, used for training the video generation model to be trained according to each group of the training samples and the corresponding training skeleton point sequence in the training sample set;
[0124] In this embodiment, the model training module 32 can be used to perform Figure 6 As shown in step A2, for the specific description of the target acquisition module 21, reference may be made to the description of step A2.
[0125] The model testing module 33 is used to construct a test sample set and test the trained video generation model through the test sample set to obtain the trained video generation model.
[0126] In this embodiment, the model testing module 33 can be used to perform Figure 6 As shown in step A3, for the specific description of the target acquisition module 21, reference may be made to the description of step A3.
[0127] In addition, in a preferred embodiment, the video generation module 22 specifically includes:
[0128] A feature fusion module, used for performing feature splicing on the reference image set and the local object reference image set to obtain fused reference features;
[0129] The prediction module is used to input the fused reference features, generated image set and target skeleton point sequence of the target object into the trained video generation model for prediction to obtain the target action video of the target object.
[0130] In this embodiment, the feature fusion module can be implemented by the fusion splicing network 14 described above;
[0131] Based on the same inventive concept, this embodiment also provides an electronic device, Figure 8 The structure diagram of the electronic device of this embodiment is shown, which includes a memory 41 and a processor 42. The memory 41 stores computer-readable instructions, and the processor 42 executes the computer-readable instructions to implement the video generation method of this embodiment.
[0132] Preferably, the electronic device further includes a bus 43 and a communication interface 44 , and the processor 42 , the communication interface 44 and the memory 41 are connected via the bus 43 .
[0133] The memory 41 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 44 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 43 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus 43 may be divided into an address bus, a data bus, a control bus, etc. (not fully drawn in the figure).
[0134] The processor 42 may be an integrated circuit chip with signal processing capability. In the specific implementation process, each step in the embodiment of the above method may be completed by the hardware integrated logic circuit or software instructions in the processor 42. The above processor 42 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, which may implement or execute the methods, steps, and logic diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or the processor 42 may also be any conventional processor 42, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 41, and the processor 42 reads the information in the memory 41 and completes the steps of the method of the above embodiment in combination with its hardware.
[0135] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor 42, the computer-executable instructions prompt the processor 42 to implement a video generation method described above. The specific implementation can be found in the embodiment, which will not be repeated here.
[0136] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0137] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the claims of the present invention shall be included in the protection scope of the claims of the present invention.
Claims
1. A video generation method, characterized in that: The generation method comprises: Acquire a generated image set of a target object, wherein the generated image set includes at least one single-frame image containing the target object; Acquire a reference image set of a target object, wherein the reference image set includes a plurality of single-frame images of different viewing angles of the target object; Extracting a local object reference image corresponding to each single frame image in a reference image set, and constructing a local object reference image set based on all the local object reference images; Constructing a target skeleton point sequence of the target object; The generated image set, reference image set, local object reference image set and target skeleton point sequence of the target object are input into the trained video generation model for prediction to obtain the target action video of the target object.
2. A video generation method according to claim 1, characterized in that: The step of inputting the generated image set, the reference image set, the local object reference image set and the target skeleton point sequence of the target object into the trained video generation model for prediction comprises: Perform feature splicing on the reference image set of the target object and the reference image set of the local object to obtain fused reference features of the target object; The fused reference features, generated image set and target bone point sequence of the target object are input into the trained video generation model for prediction.
3. A video generation method according to claim 2, characterized in that: The step of performing feature stitching on the reference image set of the target object and the reference image set of the local object to obtain the fused reference features of the target object includes: Acquire the semantic embedding reference features of each of the single-frame images in the reference image set of the target object, and splice all the semantic embedding reference features in the reference image set to obtain the semantic embedding splicing reference features; Acquire a local embedding reference feature of each local object reference image in a local object reference image set of the target object, and splice all the local embedding reference features in the local object reference image set to obtain a local embedding splicing reference feature; Feature splicing processing is performed according to the semantic embedding splicing reference features and the local embedding splicing reference features to obtain the fused reference features of the target object.
4. A video generation method according to claim 2, characterized in that: Before inputting the fused reference features, generated image set and target bone point sequence of the target object into the trained video generation model for prediction, it also includes adjusting the dimensions of the spliced semantic embedded splicing reference features and the local embedded splicing reference features to unify the dimensions of the spliced semantic embedded splicing reference features and the semantic embedded splicing reference features.
5. A video generation method according to claim 2, characterized in that: In the process of inputting the fused reference features, generated image set and target bone point sequence of the target object into the trained video generation model for prediction: The fused reference features are used as global features of the video generation model, and are integrated with the generated image set and the target bone point sequence in the video generation model through a cross-attention mechanism.
6. A video generation method according to claim 1, characterized in that: The video generation model at least includes a semantic feature network, a local feature network, a fusion splicing network and a video generation network; The semantic feature network is used to extract semantic features according to the input reference image set, extract semantic embedding reference features corresponding to each single-frame image in the reference image set, and splice all the obtained semantic embedding reference features to obtain semantic embedding splicing reference features; The local feature network is used to extract local features according to the local object reference image set, extract local embedding reference features corresponding to each single frame image in the local object reference image set, and splice all the obtained local embedding reference features to obtain semantic embedding splicing reference features; The fusion splicing network is used to perform feature splicing processing according to the semantic embedding reference features and the local embedding reference features to obtain fusion reference features; The video generation network predicts based on the fused reference features, the generated image set and the corresponding target skeleton point sequence to generate a target action video.
7. A video generation method according to any one of claims 1 to 4, characterized in that: The method further includes pre-training the video generation model, wherein the training includes: Acquire a training sample set, wherein the training sample set includes at least one group of training samples, any group of the training samples includes a training image set, a training reference image set and a local object training image set, wherein the training image set includes at least one single-frame image containing the same training object; the training reference image set includes a plurality of training reference images containing the same training object, each of the training reference images corresponds to a different perspective of the training object; the local object training image set includes a plurality of local object images, each of the plurality of local object images corresponds to the same local object of the training object, and each of the local object images is obtained by extracting from the corresponding training reference image; Constructing a corresponding training skeleton point sequence for each group of training samples; Training the video generation model to be trained according to each group of the training samples and the corresponding training skeleton point sequence in the training sample set; A test sample set is constructed and the trained video generation model is tested by using the test sample set to obtain the trained video generation model.
8. A video generating device, characterized in that: The generating device comprises: A target acquisition module is used to acquire a generated image set of a target object, wherein the generated image set includes at least one single-frame image containing the target object; and to acquire a reference image set of the target object, wherein the reference image set includes a plurality of single-frame images containing the target object from different viewing angles; and to extract a local object reference image corresponding to each single-frame image in the reference image set, and to construct a local object reference image set based on all the local object reference images; and to construct a target bone point sequence of the target object; The video generation module is used to input the generated image set, reference image set, local object reference image set and target skeleton point sequence of the target object into the trained video generation model for prediction to obtain the target action video of the target object.
9. An electronic device, comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement a video generation method according to any one of claims 1 to 7.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, a video generating method according to any one of claims 1 to 7 is implemented.
