Video synthesis method, system, storage medium and electronic device
By extracting the features of objects and generating style feature sequences, and combining them with content and style neural networks, the problem of not being able to customize the combination of videos in existing technologies is solved, and intelligent video synthesis effects are achieved.
Patent Information
- Application Number
- CN202410704763.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-06-03
AI Technical Summary
Existing video compositing technology cannot achieve custom combination and splicing of content images and action videos of different objects.
By extracting features from the content images and action videos of the object, a style feature sequence is generated using a variational autoencoder and a CLIP model. This sequence is then combined with a content neural network and a style neural network to generate custom synthetic video frames.
It enables intelligent combination and splicing of content images and action videos of different objects, meeting diverse scenario needs and improving the intelligence level of video synthesis.
Smart Images

Figure CN118283201B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of deep learning, and in particular relates to a video synthesis method, system, storage medium and electronic device. Background Art
[0002] Video synthesis is the process of splicing multiple materials, such as videos, pictures, audio, etc., together to create a complete video work.
[0003] Nowadays, video synthesis is increasingly common, for example, in news, movies and TV series, and even in short videos recorded by people themselves. However, current video synthesis simply splices existing videos and does not involve the re-combination of video content. Summary of the invention
[0004] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a video synthesis method, system, storage medium and electronic device, which can combine and splice content pictures and action videos of different objects to achieve customized video synthesis.
[0005] In a first aspect, the present invention provides a video synthesis method, which includes the following steps: extracting compression features of a content image of a first object; obtaining semantic features of the content image; inputting the compression features and the semantic features into a content neural network to obtain compressed content features; obtaining a skeletal action sequence of a second object in an action video; generating a style feature sequence based on the skeletal action sequence and a noise sequence; inputting the compressed content features, the semantic features and the style feature sequence into a style neural network to obtain an updated style feature sequence; and obtaining a synthesized video frame based on the updated style feature sequence.
[0006] In an implementation of the first aspect, an encoder based on a variational autoencoder extracts compression features of a content picture of a first object; an image encoder based on a CLIP model obtains semantic features of the content picture; and a decoder based on a variational autoencoder obtains a synthetic video frame corresponding to the updated style feature sequence.
[0007] In an implementation of the first aspect, obtaining a skeleton action sequence of a second object in an action video includes the following steps:
[0008] Inputting the action video into a DWPose model, and obtaining the skeletal action of the second object on each frame image of the action video;
[0009] The skeleton action of each frame is generated into an image to obtain the skeleton action sequence.
[0010] In an implementation of the first aspect, generating a style feature sequence based on the skeleton action sequence and the noise sequence comprises the following steps:
[0011] Get Gaussian noise sequence;
[0012] The skeleton action sequence is input into a four-layer two-dimensional convolution module and then element-wise added to the Gaussian noise sequence to generate the style feature sequence.
[0013] In an implementation of the first aspect, inputting the compressed content feature, the semantic feature, and the style feature sequence into a style neural network, and obtaining an updated style feature sequence comprises the following steps:
[0014] 1) Inputting the compressed content feature, the semantic feature and the style feature sequence into a style neural network to obtain noise information;
[0015] 2) subtracting the noise information from each style feature in the style feature sequence to obtain an updated style feature sequence;
[0016] 3) The updated style feature sequence is used to replace the style feature sequence, and steps 1) to 2) are repeated for a preset number of times to obtain a final updated style feature sequence.
[0017] In an implementation of the first aspect, the content neural network and the style neural network have the same structure, both including a main neural network and an additional branch network;
[0018] The main neural network includes three serially connected convolution block structures, a single block structure and three serially connected deconvolution block structures; the convolution block structure includes a connected block structure and a two-dimensional convolution block, and the deconvolution block structure includes a connected two-dimensional deconvolution block and a block structure;
[0019] The additional branch network includes two serially connected convolution block structures, two serially connected block deconvolution structures and a multi-layer perceptron, wherein the block deconvolution structure includes a connected block structure and a two-dimensional deconvolution block;
[0020] The output of the second block structure of the three series-connected convolution block structures is used as the input of the additional branch network, and the outputs of the two series-connected convolution block structures and the outputs of the three series-connected convolution block structures are element-wise added to serve as the input of the single block structure; the output of the multilayer perceptron and the output of the second two-dimensional deconvolution block in the three series-connected deconvolution block structures are element-wise added to serve as the input of the second block structure in the three series-connected deconvolution block structures.
[0021] In an implementation of the first aspect, the block structure includes an attention module and a cross-modal weight module; an output of the attention module and a cross-modal weight coefficient of an output of the cross-modal weight module are element-wise added to obtain an output of the block structure;
[0022] The attention module connects the input of the block structure in series and inputs it into a multilayer perceptron to obtain a Q matrix, a K1 matrix and a V1 matrix of the attention mechanism; the K1 matrix and the V1 matrix are added element by element and input into a multilayer perceptron to obtain a K matrix and a V matrix; the K matrix and the Q matrix are matrix-multiplied to obtain an attention score; the first attention score is matrix-multiplied with the V matrix and input into softmax, and then element-multiplied with the V matrix to obtain an attention feature;
[0023] The cross-modal weight module inputs the attention features into a multi-layer perceptron to obtain the V2 matrix and K2 matrix of the attention mechanism, and inputs the semantic features into a multi-layer perceptron to obtain the Q2 matrix of the attention mechanism; the K2 matrix and the Q2 matrix are matrix-multiplied to obtain a second attention score; the V2 matrix and the second attention score are matrix-multiplied and input into softmax to obtain the cross-modal weight coefficient.
[0024] In a second aspect, the present invention provides a video synthesis system, the system comprising an extraction module, a first acquisition module, a second acquisition module, a third acquisition module, a generation module, a fourth acquisition module and a synthesis module;
[0025] The extraction module is used to extract the compression features of the content image of the first object;
[0026] The first acquisition module is used to acquire the semantic features of the content image;
[0027] The second acquisition module is used to input the compression feature and the semantic feature into the content neural network to obtain the compression content feature;
[0028] The third acquisition module is used to acquire the skeleton action sequence of the second object in the action video;
[0029] The generating module is used to generate a style feature sequence based on the skeleton action sequence and the noise sequence;
[0030] The fourth acquisition module is used to input the compressed content feature, the semantic feature and the style feature sequence into the style neural network to obtain an updated style feature sequence;
[0031] The synthesis module is used to obtain a synthesized video frame based on the updated style feature sequence.
[0032] In a third aspect, the present invention provides an electronic device, the electronic device comprising: a processor and a memory;
[0033] The memory is used to store computer programs;
[0034] The processor is used to execute the computer program stored in the memory so that the electronic device executes the above-mentioned video synthesis method.
[0035] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program implements the above-mentioned video synthesis method when executed by an electronic device.
[0036] As described above, the video synthesis method, system, storage medium and electronic device described in the present invention have the following beneficial effects.
[0037] (1) It is able to combine and splice content images and action videos of different objects to achieve customized video synthesis to meet the needs of different scenarios.
[0038] (2) Highly intelligent and extremely practical. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 Shown is a schematic diagram of a scene of an electronic device in an embodiment of the present invention.
[0040] Figure 2 Shown is a flow chart of a video synthesis method in one embodiment of the present invention.
[0041] Figure 3 FIG. 4 is a schematic diagram showing a framework of a video synthesis method according to an embodiment of the present invention.
[0042] Figure 4 FIG. 4 is a schematic diagram showing the structure of a video synthesis system according to an embodiment of the present invention.
[0043] Figure 5 It is a schematic structural diagram of an electronic device of the present invention in one embodiment. DETAILED DESCRIPTION
[0044] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0045] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0046] The following embodiments of the present invention provide a video synthesis method, which can be applied to Figure 1 The electronic device shown. The electronic device described in the present invention may include a mobile phone 11 with a wireless charging function, a tablet computer 12, a laptop computer 13, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present invention does not impose any restrictions on the specific type of the electronic device.
[0047] For example, the electronic device may be a station (STAION, ST) in a WLAN with a wireless charging function, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with a wireless charging function, a computing device or other processing device, a computer, a laptop computer, a handheld communication device, a handheld computing device, and / or other devices for communicating on a wireless system and a next generation communication system, such as a mobile terminal in a 5G network, a mobile terminal in a future evolved Public Land Mobile Network (PLMN), or a mobile terminal in a future evolved Non-terrestrial Network (NTN).
[0048] For example, the electronic device can communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Satellite Navigation System (BDS), Quasi-Zenith Satellite System (QZSS) and / or Satellite Based Augmentation Systems (SBAS).
[0049] The technical solutions in the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0050] like Figure 2 As shown, in one embodiment, the video synthesis method of the present invention includes steps S1 to S7.
[0051] Step S1: extracting compression features of a content image of a first object.
[0052] Specifically, a first object, such as an image of a person A, is set as a content image, and an encoder based on a variational autoencoder (VAE) extracts a compression feature compressembeddins of the content image of the first object.
[0053] Step S2: Obtain semantic features of the content image.
[0054] Specifically, the picture encoder based on the CLIP model obtains semantic features semantic embeddings of the content picture.
[0055] Step S3: input the compression feature and the semantic feature into a content neural network to obtain a compressed content feature.
[0056] Specifically, the compression feature and the semantic feature are input into a content neural network to obtain corresponding compression content feature content reference embeddings.
[0057] Step S4: Obtain a skeleton action sequence of the second object in the action video.
[0058] Specifically, the video of the second object, such as person B, is set as an action video, and the action video is fixed to 24 frames. The action video is input into the DWPose model, and the pose skeleton of the second object on each frame image of the action video is obtained; the skeleton action of each frame is generated into an image to obtain a poseskeleton sequence.
[0059] Step S5: generating a style feature sequence based on the skeleton action sequence and the noise sequence.
[0060] Specifically, first obtain a Gaussian noise sequence. Then, input the poseskeleton sequence into an action neural network composed of four-layer two-dimensional convolution modules and perform element-wise addition with the Gaussian noise sequence to generate the style feature sequence style embeddings. The four-layer two-dimensional convolution module uses a 4×4 kernel-size, a 2×2 stride, and uses 16, 32, 64, and 128 output channels respectively.
[0061] Step S6: input the compressed content feature, the semantic feature and the style feature sequence into a style neural network to obtain an updated style feature sequence.
[0062] Specifically, in one embodiment, the compressed content feature, the semantic feature and the style feature sequence are input into a style neural network, and obtaining an updated style feature sequence includes the following steps.
[0063] 1) Inputting the compressed content feature, the semantic feature and the style feature sequence into a style neural network to obtain noise information noise.
[0064] 2) subtracting the noise information from each style feature in the style feature sequence to obtain an updated style feature sequence;
[0065] 3) The updated style feature sequence is used to replace the style feature sequence, and steps 1) to 2) are repeated for a preset number of times to obtain a final updated style feature sequence.
[0066] The updated style feature sequence, the compressed content feature and the semantic feature are input into the style neural network again to obtain noise information noise, so as to obtain the updated style feature sequence based on the obtained noise information. This cycle is repeated for a preset number of times to obtain the final updated style feature sequence.
[0067] Step S7: obtaining a synthesized video frame based on the updated style feature sequence.
[0068] Specifically, the decoder based on the variational autoencoder obtains the synthetic video frame corresponding to the updated style feature sequence. The updated style feature sequence is batch-inputted into the decoder of the variational autoencoder to obtain 24 synthetic video frames, and the synthetic video can be obtained from the synthetic video frames. Therefore, the present invention can realize the synthetic video constructed by the image of the first object and the video of the second object, thereby meeting the application requirements of different scenarios.
[0069] The content neural network and style neural network of the present invention will be explained in detail below.
[0070] In one embodiment, the content neural network and the style neural network have the same structure, both including a main neural network and an additional branch network. In actual use, the two only differ in input content.
[0071] The main neural network includes three serially connected convolution block structures, a single block structure block and three serially connected deconvolution block structures; the convolution block structure includes a connected block structure and a two-dimensional convolution block (block+conv2d), and the deconvolution block structure includes a connected two-dimensional deconvolution block and a block structure (transposed conv2d+block). For the content neural network, its input is semantic features semantic embeddings and compressed features compress embeddins. For the style neural network, the input is semantic features semantic embeddings, style feature sequences style embeddings and compressed content features content reference embeddings. The output of the main neural network is used as the output of the content neural network and the style neural network.
[0072] The additional branch network includes two serially connected convolution block structures, two serially connected block deconvolution structures and a multi-layer perceptron, wherein the block deconvolution structure includes a connected block structure and a two-dimensional deconvolution block (block+transposed conv2d).
[0073] The output of the second block structure of the three serially connected convolutional block structures is used as the input of the additional branch network. The outputs of the two serially connected convolutional block structures and the outputs of the three serially connected convolutional block structures are element-wise added and used as the input of the single block structure; the output of the multilayer perceptron and the output of the second two-dimensional deconvolution block in the three serially connected deconvolutional block structures are element-wise added and used as the input of the second block structure in the three serially connected deconvolutional block structures.
[0074] In one embodiment, the block structure includes an attention module and a cross-modal weight module. The output of the attention module is element-wise added to the cross-modal weight coefficient of the output of the cross-modal weight module to obtain the output of the block structure.
[0075] The attention module connects the input of the block structure in series and inputs it into the multilayer perceptron to obtain the Q matrix, K1 matrix and V1 matrix of the attention mechanism; the K1 matrix and the V1 matrix are added element by element and input into the multilayer perceptron to obtain the K matrix and the V matrix; the K matrix and the Q matrix are matrix-multiplied to obtain the attention score; the first attention score is matrix-multiplied with the V matrix and input into the softmax, and then element-multiplied with the V matrix to obtain the attention feature. Specifically, the input feature is set to (24, h, w, d). If it is located in the style neural network, the input feature is the style feature style embeddings; if it is located in the content neural network, the input feature is the compression feature. The other input is the content compression feature content reference embeddings (h, w, d). First, copy the content reference embeddings 23 times to get embeddings of shape (24, h, w, d), then concatenate it with the style embeddings in the dimension of w, and then reshape it to (24 * d, h * 2w), and then multiply them by different multi-layer perceptrons to get the Q matrix, K1 matrix and V1 matrix respectively. After element-wise addition of the K1 matrix and the V1 matrix, they are multiplied by two different multi-layer perceptrons again to get the K matrix and the V matrix. After matrix multiplication of the K matrix and the V matrix, the first attention score attention score1 is obtained, which is matrix multiplied with the V matrix. The output is softmaxed and element-wise multiplied with the V matrix, and finally reshaped to restore it to the shape of (24, h, 2w, d). Here, only the first w features, that is, (24, h, w, d) are taken in the dimension of 2w as the attention feature attention embeddings.
[0076] The cross-modal weight module inputs the attention features into the multi-layer perceptron to obtain the V2 matrix and K2 matrix of the attention mechanism, and inputs the semantic features into the multi-layer perceptron to obtain the Q2 matrix of the attention mechanism; the K2 matrix and the Q2 matrix are matrix-multiplied to obtain the second attention score; the V2 matrix and the second attention score are matrix-multiplied and input into softmax to obtain the cross-modal weight coefficient. Specifically, one input is attention embeddings and the other input is semantic embeddings. First, the attention embeddings are reshaped to (h * w, 24 * d), and then passed through 2 different multi-layer perceptrons to obtain the V2 matrix and K2 matrix. At the same time, the semantic embeddings pass through a multi-layer perceptron to obtain the Q2 matrix. The K2 matrix and the Q2 are matrix multiplied to obtain the second attention score attention score2, with a shape of (h * w, h * w). Then, it is matrix multiplied with the V2 matrix and softmax is performed to obtain the attention weight attentionweight, with a shape of (h * w, 24 * d). Finally, it is reshaped to obtain the cross-modal weight coefficient attention embeddings weight with a shape of (24, h, w, d).
[0077] The protection scope of the video synthesis method described in the embodiment of the present invention is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present invention are included in the protection scope of the present invention.
[0078] An embodiment of the present invention further provides a video synthesis system, which can implement the video synthesis method described in the present invention. However, the implementation device of the video synthesis system described in the present invention includes but is not limited to the structure of the video synthesis system listed in this embodiment. All structural deformations and replacements of the prior art made according to the principles of the present invention are included in the protection scope of the present invention.
[0079] like Figure 4 As shown, in one embodiment, the video synthesis system of the present invention includes an extraction module 41 , a first acquisition module 42 , a second acquisition module 43 , a third acquisition module 44 , a generation module 45 , a fourth acquisition module 46 and a synthesis module 47 .
[0080] The extraction module 41 is used to extract the compression features of the content image of the first object.
[0081] The first acquisition module 42 is used to acquire the semantic features of the content image.
[0082] The second acquisition module 43 is connected to the extraction module 41 and the first acquisition module 42, and is used for inputting the compression feature and the semantic feature into the content neural network to obtain the compression content feature.
[0083] The third acquisition module 44 is used to acquire the skeleton action sequence of the second object in the action video.
[0084] The generating module 45 is connected to the third acquiring module 44 and is used to generate a style feature sequence based on the skeleton action sequence and the noise sequence.
[0085] The fourth acquisition module 46 is connected to the first acquisition module 42, the second acquisition module 43 and the generation module 45, and is used to input the compressed content features, the semantic features and the style feature sequence into the style neural network to obtain an updated style feature sequence.
[0086] The synthesis module 47 is connected to the fourth acquisition module 46 and is used to obtain a synthesized video frame based on the updated style feature sequence.
[0087] Among them, the structures and principles of the extraction module 41, the first acquisition module 42, the second acquisition module 43, the third acquisition module 44, the generation module 45, the fourth acquisition module 46 and the synthesis module 47 correspond one by one to the steps in the above-mentioned video synthesis method, so they are not repeated here.
[0088] In the several embodiments provided by the present invention, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules / units is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules or units, which can be electrical, mechanical or other forms.
[0089] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. For example, the functional modules / units in the various embodiments of the present invention may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0090] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0091] The embodiment of the present invention also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.
[0092] An embodiment of the present invention further provides an electronic device, which includes a processor and a memory.
[0093] The memory is used to store computer programs.
[0094] The memory includes: ROM, RAM, disk, USB flash drive, memory card or CD and other media that can store program codes.
[0095] The processor is connected to the memory and is used to execute the computer program stored in the memory so that the electronic device executes the above-mentioned video synthesis method.
[0096] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can 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.
[0097] like Figure 5 As shown, the electronic device of the present invention is in the form of a general computing device. The components of the electronic device may include but are not limited to: one or more processors or processing units 51, a memory 52, and a bus 53 connecting different system components (including the memory 52 and the processing unit 51).
[0098] Bus 53 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0099] Electronic devices typically include a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, removable and non-removable media.
[0100] The memory 52 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 521 and / or cache memory 522. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 523 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 53 via one or more data medium interfaces. The memory 52 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0101] A program / utility 524 having a set (at least one) of program modules 5241 may be stored, for example, in the memory 52, such program modules 5241 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. The program modules 5241 generally perform the functions and / or methods of the embodiments described herein.
[0102] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, displays, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via input / output (I / O) interface 54. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 55. Figure 5 As shown, the network adapter 55 communicates with other modules of the electronic device via the bus 53. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0103] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A video synthesis method, characterized in that: The method comprises the following steps: Extracting compression features of the content image of the first object; Acquire semantic features of the content image; Inputting the compression feature and the semantic feature into a content neural network to obtain a compression content feature; Obtain a skeleton action sequence of a second object in the action video; Generate a style feature sequence based on the skeleton action sequence and the noise sequence; Inputting the compressed content feature, the semantic feature and the style feature sequence into a style neural network to obtain an updated style feature sequence; Acquire a synthesized video frame based on the updated style feature sequence; The encoder based on the variational autoencoder extracts the compression features of the content picture of the first object; the picture encoder based on the CLIP model obtains the semantic features of the content picture; and the decoder based on the variational autoencoder obtains the synthetic video frame corresponding to the updated style feature sequence.
2. The video synthesis method according to claim 1, characterized in that: Obtaining the skeleton action sequence of the second object in the action video includes the following steps: Inputting the action video into a DWPose model, and obtaining the skeletal action of the second object on each frame image of the action video; The skeleton action of each frame is generated into an image to obtain the skeleton action sequence.
3. The video synthesis method according to claim 1, characterized in that: Generating a style feature sequence based on the skeleton action sequence and the noise sequence comprises the following steps: Get Gaussian noise sequence; The skeleton action sequence is input into a four-layer two-dimensional convolution module and then element-wise added to the Gaussian noise sequence to generate the style feature sequence.
4. The video synthesis method according to claim 1, characterized in that: Inputting the compressed content feature, the semantic feature and the style feature sequence into a style neural network, and obtaining an updated style feature sequence comprises the following steps: 1) inputting the compressed content feature, the semantic feature and the style feature sequence into a style neural network to obtain noise information; 2) subtracting the noise information from each style feature in the style feature sequence to obtain an updated style feature sequence; 3) The updated style feature sequence is used to replace the style feature sequence, and steps 1) to 2) are repeated for a preset number of times to obtain a final updated style feature sequence.
5. The video synthesis method according to claim 1, characterized in that: The content neural network and the style neural network have the same structure, both including a main neural network and an additional branch network; The main neural network includes three serially connected convolution block structures, a single block structure and three serially connected deconvolution block structures; the convolution block structure includes a connected block structure and a two-dimensional convolution block, and the deconvolution block structure includes a connected two-dimensional deconvolution block and a block structure; The additional branch network includes two serially connected convolution block structures, two serially connected block deconvolution structures and a multi-layer perceptron, wherein the block deconvolution structure includes a connected block structure and a two-dimensional deconvolution block; The output of the second block structure of the three series-connected convolution block structures is used as the input of the additional branch network, and the outputs of the two series-connected convolution block structures and the outputs of the three series-connected convolution block structures are element-wise added to serve as the input of the single block structure; the output of the multilayer perceptron and the output of the second two-dimensional deconvolution block in the three series-connected deconvolution block structures are element-wise added to serve as the input of the second block structure in the three series-connected deconvolution block structures.
6. The video synthesis method according to claim 5, characterized in that: The block structure includes an attention module and a cross-modal weight module; the output of the attention module is element-wise added to the cross-modal weight coefficient of the output of the cross-modal weight module to obtain the output of the block structure; The attention module connects the input of the block structure in series and inputs it into a multilayer perceptron to obtain a Q matrix, a K1 matrix and a V1 matrix of the attention mechanism; the K1 matrix and the V1 matrix are added element by element and input into a multilayer perceptron to obtain a K matrix and a V matrix; the K matrix and the Q matrix are matrix-multiplied to obtain a first attention score; the first attention score is matrix-multiplied with the V matrix and input into softmax, and then element-multiplied with the V matrix to obtain an attention feature; The cross-modal weight module inputs the attention feature into a multi-layer perceptron to obtain a V2 matrix and a K2 matrix of the attention mechanism, and inputs the semantic feature into a multi-layer perceptron to obtain a Q2 matrix of the attention mechanism; the K2 matrix and the Q2 matrix are matrix-multiplied to obtain a second attention score; The V2 matrix and the second attention score are matrix multiplied and input into softmax to obtain the cross-modal weight coefficient.
7. A video synthesis system, characterized in that: The system comprises an extraction module, a first acquisition module, a second acquisition module, a third acquisition module, a generation module, a fourth acquisition module and a synthesis module; The extraction module is used to extract the compression features of the content image of the first object; The first acquisition module is used to acquire the semantic features of the content image; The second acquisition module is used to input the compression feature and the semantic feature into the content neural network to obtain the compression content feature; The third acquisition module is used to acquire the skeleton action sequence of the second object in the action video; The generating module is used to generate a style feature sequence based on the skeleton action sequence and the noise sequence; The fourth acquisition module is used to input the compressed content feature, the semantic feature and the style feature sequence into the style neural network to obtain an updated style feature sequence; The synthesis module is used to obtain a synthesized video frame based on the updated style feature sequence; Extracting compressed features of a content image of a first object by an encoder based on a variational autoencoder; The picture encoder based on the CLIP model obtains the semantic features of the content picture; The decoder based on the variational autoencoder obtains a synthetic video frame corresponding to the updated style feature sequence.
8. An electronic device, characterized in that: The electronic device comprises: a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory, so that the electronic device executes the video synthesis method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, the video synthesis method according to any one of claims 1 to 6 is implemented.
