CN115690637A - Dynamic video generation method, device, apparatus, medium, and program product - Google Patents
Dynamic video generation method, device, apparatus, medium, and program product Download PDFInfo
- Publication number
- CN115690637A CN115690637A CN202110849900.3A CN202110849900A CN115690637A CN 115690637 A CN115690637 A CN 115690637A CN 202110849900 A CN202110849900 A CN 202110849900A CN 115690637 A CN115690637 A CN 115690637A
- Authority
- CN
- China
- Prior art keywords
- image
- time
- time slice
- target
- dynamic video
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Image Analysis (AREA)
Abstract
本公开提供了一种动态视频生成方法、装置、设备、介质和程序产品,其中,该方法包括:获取目标图像;对目标图像进行特征提取,确定目标图像对应的初始图像特征;基于初始图像特征,分别确定初始图像特征对应于多个连续的时间片中每个时间片的时序图像特征;基于每个时间片对应的时序图像特征,生成目标图像对应的动态视频;目标图像中的动态对象在动态视频中的位置存在变化。本公开实施例能够高效率地生成目标图像对应的动态视频。
The present disclosure provides a dynamic video generation method, device, equipment, medium, and program product, wherein the method includes: acquiring a target image; performing feature extraction on the target image to determine initial image features corresponding to the target image; , respectively determine that the initial image features correspond to the time series image features of each time slice in multiple consecutive time slices; based on the time series image features corresponding to each time slice, the dynamic video corresponding to the target image is generated; the dynamic object in the target image is in There is a change in position in the motion video. The embodiments of the present disclosure can efficiently generate a dynamic video corresponding to a target image.
Description
技术领域technical field
本公开涉及图像处理以及视频生成技术领域,具体而言,涉及一种动态视频生成方法、装置、设备、介质和程序产品。The present disclosure relates to the technical fields of image processing and video generation, and in particular, to a dynamic video generation method, device, device, medium and program product.
背景技术Background technique
现有技术中,基于获取的静态的目标图片生成动态视频的方式大多是在确定目标图片中可以进行动态展示的对象之后,然后利用特定的修图软件、剪辑软件等,手动对选定的对象以及目标图像进行特效处理,得到与目标图片对应的多张图像,进而,基于目标图像和得到的多张图像,可以生成目标图片对应的动态视频。In the prior art, most of the methods of generating dynamic videos based on the acquired static target pictures are to determine the objects that can be dynamically displayed in the target pictures, and then use specific image editing software, editing software, etc. to manually edit the selected objects. and performing special effect processing on the target image to obtain multiple images corresponding to the target picture, and then, based on the target image and the obtained multiple images, a dynamic video corresponding to the target picture can be generated.
然而,利用上述方式得到的动态视频的展示效果较差,且由于操作步骤复杂,手动处理方式的效率大大较低,进而,影响了生成动态视频的效率。However, the display effect of the dynamic video obtained by the above method is poor, and due to the complicated operation steps, the efficiency of the manual processing method is greatly low, which in turn affects the efficiency of generating the dynamic video.
发明内容Contents of the invention
本公开实施例至少提供一种动态视频生成方法、装置、设备、介质和程序产品。Embodiments of the present disclosure at least provide a dynamic video generation method, device, device, medium and program product.
第一方面,本公开实施例提供了一种动态视频生成方法,应用于训练好的目标神经网络,包括:In the first aspect, the embodiment of the present disclosure provides a dynamic video generation method applied to a trained target neural network, including:
获取目标图像;Get the target image;
对所述目标图像进行特征提取,确定所述目标图像对应的初始图像特征;performing feature extraction on the target image, and determining initial image features corresponding to the target image;
基于所述初始图像特征,分别确定所述初始图像特征对应于多个连续的时间片中每个时间片的时序图像特征;Based on the initial image features, respectively determine that the initial image features correspond to time-series image features of each time slice in a plurality of consecutive time slices;
基于每个时间片对应的所述时序图像特征,生成所述目标图像对应的动态视频;所述目标图像中的动态对象在所述动态视频中的位置存在变化。。Based on the time-series image features corresponding to each time slice, a dynamic video corresponding to the target image is generated; a position of a dynamic object in the target image in the dynamic video varies. .
在一种可能的实施方式中,所述多个连续的时间片中包括多个时间片组,每个所述时间片组包括第一时间片,和与该第一时间片相邻的、位于该第一时间片之后的第二时间片;In a possible implementation manner, the multiple consecutive time slices include multiple time slice groups, each of the time slice groups includes a first time slice, and adjacent to the first time slice, located in a second time slice after the first time slice;
所述基于所述初始图像特征,分别确定所述初始图像特征对应于多个连续的时间片中每个时间片的时序图像特征,包括:The determining, based on the initial image features, respectively that the initial image features correspond to the temporal image features of each time slice in a plurality of consecutive time slices, includes:
针对所述多个时间片组中的每个时间片组,利用预设的时序特征提取网络,对所述时间片组中的第一时间片所对应的时序图像特征和所述初始图像特征进行特征融合处理,得到所述时间片组中的第二时间片对应的时序图像特征;For each time slice group in the plurality of time slice groups, using a preset time series feature extraction network, the time series image features corresponding to the first time slice in the time slice group and the initial image features are processed Feature fusion processing to obtain the time-series image features corresponding to the second time slice in the time slice group;
其中,在所述第一时间片为所述多个连续的时间片中最早的时间片时,利用预设的时序特征提取网络对所述初始图像特征进行处理,得到所述第一时间片对应的时序图像特征。Wherein, when the first time slice is the earliest time slice among the plurality of consecutive time slices, the initial image features are processed using a preset temporal feature extraction network to obtain the first time slice corresponding to time-series image features.
在一种可能的实施方式中,所述对所述目标图像进行特征提取,确定所述目标图像对应的初始图像特征,包括:In a possible implementation manner, the performing feature extraction on the target image and determining the initial image features corresponding to the target image include:
利用所述目标神经网络中的图像编码器对所述目标图像进行特征提取,确定在目标第一卷积层下提取的所述目标图像的第一图像特征作为所述初始图像特征;其中,所述图像编码器包括多个第一卷积层,所述目标第一卷积层为所述多个第一卷积层中对应的卷积核的数量最小的第一卷积层。Use the image encoder in the target neural network to perform feature extraction on the target image, and determine the first image feature of the target image extracted under the target first convolutional layer as the initial image feature; wherein, the The image encoder includes a plurality of first convolutional layers, and the target first convolutional layer is the first convolutional layer with the smallest number of corresponding convolution kernels among the plurality of first convolutional layers.
在一种可能的实施方式中,所述基于每个时间片对应的所述时序图像特征,生成所述目标图像对应的动态视频,包括:In a possible implementation manner, the generating the dynamic video corresponding to the target image based on the time-series image features corresponding to each time slice includes:
基于每个时间片对应的时序图像特征,分别生成每个时间片对应的衍生图像;其中,不同所述衍生图像中的动态对象的位置不同;Based on the time-series image features corresponding to each time slice, generate derivative images corresponding to each time slice respectively; wherein, the positions of dynamic objects in different derivative images are different;
基于生成的各个衍生图像和所述各个衍生图像分别对应的时间片,生成所述目标图像对应的动态视频。A dynamic video corresponding to the target image is generated based on the generated derivative images and time slices respectively corresponding to the derivative images.
在一种可能的实施方式中,基于一时间片对应的时序图像特征,生成所述时间片对应的衍生图像,包括:In a possible implementation manner, based on a time-series image feature corresponding to a time slice, generating a derivative image corresponding to the time slice includes:
利用所述目标神经网络中的图像解码器,对所述时间片对应的时序图像特征进行解码处理,确定在目标第二卷积层下解码得到的第二图像特征作为目标图像特征;其中,所述图像解码器包括多个第二卷积层,所述目标第二卷积层为所述多个第二卷积层中对应的卷积核的数量最多的第二卷积层;Utilize the image decoder in the target neural network to decode the time-series image features corresponding to the time slices, and determine the second image features decoded under the target second convolutional layer as target image features; wherein, The image decoder includes a plurality of second convolutional layers, and the target second convolutional layer is the second convolutional layer with the largest number of corresponding convolution kernels among the plurality of second convolutional layers;
基于所述目标图像特征,生成所述时间片对应的衍生图像。Based on the features of the target image, a derivative image corresponding to the time slice is generated.
在一种可能的实施方式中,所述方法还包括训练所述目标神经网络的步骤:In a possible implementation manner, the method also includes the step of training the target neural network:
获取样本动态视频;所述样本视频包括多帧样本图像;Obtain a sample dynamic video; the sample video includes multiple frames of sample images;
将所述多帧样本图像中的一帧样本图像输入待训练的所述目标神经网络,利用待训练的所述目标神经网络对该帧样本图像进行处理,确定该帧样本图像对应的预测动态视频;Inputting one frame sample image in the multi-frame sample image into the target neural network to be trained, processing the frame sample image by using the target neural network to be trained, and determining the predicted dynamic video corresponding to the frame sample image ;
基于所述预测动态视频中的每帧预测图像和所述样本视频包括的多帧样本图像,确定待训练的所述目标神经网络对应的预测损失;Determine the prediction loss corresponding to the target neural network to be trained based on each frame of the predicted image in the predicted dynamic video and the multi-frame sample images included in the sample video;
利用所述预测损失对待训练的所述目标神经网络进行迭代训练,直至满足训练截止条件,得到训练好的所述目标神经网络。The target neural network to be trained is iteratively trained by using the prediction loss until the training cut-off condition is met, and the trained target neural network is obtained.
第二方面,本公开实施例还提供一种动态视频生成装置,应用于训练好的目标神经网络,包括:In the second aspect, the embodiment of the present disclosure also provides a dynamic video generation device, which is applied to a trained target neural network, including:
获取模块,用于获取目标图像;An acquisition module, configured to acquire a target image;
第一确定模块,用于对所述目标图像进行特征提取,确定所述目标图像对应的初始图像特征;A first determining module, configured to extract features of the target image, and determine initial image features corresponding to the target image;
第二确定模块,用于基于所述初始图像特征,分别确定所述初始图像特征对应于多个连续的时间片中每个时间片的时序图像特征;The second determination module is configured to determine respectively, based on the initial image features, the time-series image features corresponding to the initial image features corresponding to each time slice in a plurality of consecutive time slices;
生成模块,用于基于每个时间片对应的所述时序图像特征,生成所述目标图像对应的动态视频;所述目标图像中的动态对象在所述动态视频中的位置存在变化。The generating module is configured to generate a dynamic video corresponding to the target image based on the time-series image features corresponding to each time slice; the position of the dynamic object in the target image in the dynamic video changes.
在一种可能的实施方式中,所述多个连续的时间片中包括多个时间片组,每个所述时间片组包括第一时间片,和与该第一时间片相邻的、位于该第一时间片之后的第二时间片;In a possible implementation manner, the multiple consecutive time slices include multiple time slice groups, each of the time slice groups includes a first time slice, and adjacent to the first time slice, located in a second time slice after the first time slice;
所述第二确定模块,用于针对所述多个时间片组中的每个时间片组,利用预设的时序特征提取网络,对所述时间片组中的第一时间片所对应的时序图像特征和所述初始图像特征进行特征融合处理,得到所述时间片组中的第二时间片对应的时序图像特征;The second determination module is configured to, for each time slice group in the plurality of time slice groups, use a preset timing feature extraction network to determine the time sequence corresponding to the first time slice in the time slice group performing feature fusion processing on the image features and the initial image features to obtain time-series image features corresponding to the second time slice in the time slice group;
其中,在所述第一时间片为所述多个连续的时间片中最早的时间片时,利用预设的时序特征提取网络对所述初始图像特征进行处理,得到所述第一时间片对应的时序图像特征。Wherein, when the first time slice is the earliest time slice among the plurality of consecutive time slices, the initial image features are processed using a preset temporal feature extraction network to obtain the first time slice corresponding to time-series image features.
在一种可能的实施方式中,所述第一确定模块,用于利用所述目标神经网络中的图像编码器对所述目标图像进行特征提取,确定在目标第一卷积层下提取的所述目标图像的第一图像特征作为所述初始图像特征;其中,所述图像编码器包括多个第一卷积层,所述目标第一卷积层为所述多个第一卷积层中对应的卷积核的数量最小的第一卷积层。In a possible implementation manner, the first determining module is configured to use the image encoder in the target neural network to perform feature extraction on the target image, and determine the The first image feature of the target image is used as the initial image feature; wherein, the image encoder includes a plurality of first convolutional layers, and the target first convolutional layer is one of the plurality of first convolutional layers Corresponding to the first convolutional layer with the smallest number of convolutional kernels.
在一种可能的实施方式中,所述生成模块,用于基于每个时间片对应的时序图像特征,分别生成每个时间片对应的衍生图像;其中,不同所述衍生图像中的动态对象的位置不同;In a possible implementation manner, the generation module is configured to generate a derivative image corresponding to each time slice based on the time-series image features corresponding to each time slice; The location is different;
基于生成的各个衍生图像和所述各个衍生图像分别对应的时间片,生成所述目标图像对应的动态视频。A dynamic video corresponding to the target image is generated based on the generated derivative images and time slices respectively corresponding to the derivative images.
在一种可能的实施方式中,所述生成模块,用于利用所述目标神经网络中的图像解码器,对所述时间片对应的时序图像特征进行解码处理,确定在目标第二卷积层下解码得到的第二图像特征作为目标图像特征;其中,所述图像解码器包括多个第二卷积层,所述目标第二卷积层为所述多个第二卷积层中对应的卷积核的数量最多的第二卷积层;In a possible implementation manner, the generation module is configured to use the image decoder in the target neural network to decode the time-series image features corresponding to the time slice, and determine the The second image feature obtained by decoding is used as the target image feature; wherein, the image decoder includes a plurality of second convolutional layers, and the target second convolutional layer is a corresponding one of the plurality of second convolutional layers The second convolution layer with the largest number of convolution kernels;
基于所述目标图像特征,生成所述时间片对应的衍生图像。Based on the features of the target image, a derivative image corresponding to the time slice is generated.
在一种可能的实施方式中,所述装置还包括训练模块:In a possible implementation manner, the device also includes a training module:
所述训练模块,用于按照以下步骤训练所述目标神经网络:The training module is used to train the target neural network according to the following steps:
获取样本动态视频;所述样本视频包括多帧样本图像;Obtain a sample dynamic video; the sample video includes multiple frames of sample images;
将所述多帧样本图像中的一帧样本图像输入待训练的所述目标神经网络,利用待训练的所述目标神经网络对该帧样本图像进行处理,确定该帧样本图像对应的预测动态视频;Inputting one frame sample image in the multi-frame sample image into the target neural network to be trained, processing the frame sample image by using the target neural network to be trained, and determining the predicted dynamic video corresponding to the frame sample image ;
基于所述预测动态视频中的每帧预测图像和所述样本视频包括的多帧样本图像,确定待训练的所述目标神经网络对应的预测损失;Determine the prediction loss corresponding to the target neural network to be trained based on each frame of the predicted image in the predicted dynamic video and the multi-frame sample images included in the sample video;
利用所述预测损失对待训练的所述目标神经网络进行迭代训练,直至满足训练截止条件,得到训练好的所述目标神经网络。The target neural network to be trained is iteratively trained by using the prediction loss until the training cut-off condition is met, and the trained target neural network is obtained.
第三方面,本公开可选实现方式还提供一种计算机设备,处理器、存储器,所述存储器存储有所述处理器可执行的机器可读指令,所述处理器用于执行所述存储器中存储的机器可读指令,所述机器可读指令被所述处理器执行时,所述机器可读指令被所述处理器执行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。In a third aspect, an optional implementation manner of the present disclosure further provides a computer device, a processor, and a memory, the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the instructions stored in the memory. machine-readable instructions, when the machine-readable instructions are executed by the processor, when the machine-readable instructions are executed by the processor, the above-mentioned first aspect is executed, or any possible implementation of the first aspect steps in the method.
第四方面,本公开可选实现方式还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被运行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。In a fourth aspect, an optional implementation manner of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the above-mentioned first aspect, or any one of the first aspects in the first aspect, may be executed. Steps in one possible implementation.
第五方面,本公开可选实现方式还提供一种计算机程序产品,包括计算机指令,该计算机指令被处理器执行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。In the fifth aspect, an optional implementation manner of the present disclosure further provides a computer program product, including computer instructions, which execute the above-mentioned first aspect when the computer instructions are executed by a processor, or any of the possible implementation manners of the first aspect. step.
关于上述动态视频生成装置、计算机设备、计算机可读存储介质以及计算机程序产品的效果描述参见上述动态视频生成方法的说明,这里不再赘述。For the effect description of the above-mentioned dynamic video generation device, computer equipment, computer-readable storage medium and computer program product, please refer to the description of the above-mentioned dynamic video generation method, which will not be repeated here.
本公开实施例提供的动态视频生成方法、装置、设备、介质和程序产品,利用训练好的目标神经网络对目标图像进行特征提取,首先可以准确地提取出能够反映目标图像的图像特征的初始图像特征,目标图像中的动态对象在不同的时间片所对应的图像特征存在时序上的关联,因此,再利用目标神经网络对确定的初始图像特征进行特征处理,能够准确地确定出始图像特征对应于多个连续的时间片中每个时间片的时序图像特征,也即可以得到动态对象对应于不同的时间片的图像特征。进而,利用时序图像特征,可以准确地得到目标图像中的动态对象对应于不同的时间片的图像,从而,得到动态视频。通过利用训练好的目标神经网络对目标图像进行处理,能够自动生成动态视频,相比手动处理的方式而言,极大地提高了动态视频的生成效率,并且,训练好的目标神经网络经过多轮训练具有可靠的输出精度,提高了得到的动态视频的准确性,进一步地提升了动态视频的展示效果。The dynamic video generation method, device, equipment, medium, and program product provided by the embodiments of the present disclosure use the trained target neural network to extract the features of the target image, and first can accurately extract the initial image that can reflect the image features of the target image feature, the image features corresponding to the dynamic objects in the target image in different time slices have temporal correlations, therefore, using the target neural network to perform feature processing on the determined initial image features, it is possible to accurately determine the initial image feature correspondence Based on the temporal image features of each time slice in multiple consecutive time slices, that is, the image features of dynamic objects corresponding to different time slices can be obtained. Furthermore, by using the time-series image features, images in which dynamic objects in the target image correspond to different time slices can be accurately obtained, thereby obtaining dynamic videos. By using the trained target neural network to process the target image, the dynamic video can be automatically generated. Compared with the manual processing method, the generation efficiency of the dynamic video is greatly improved, and the trained target neural network has undergone multiple rounds The training has a reliable output accuracy, which improves the accuracy of the obtained dynamic video and further improves the display effect of the dynamic video.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments will be described in detail below together with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. The accompanying drawings here are incorporated into the specification and constitute a part of the specification. The drawings show the embodiments consistent with the present disclosure, and are used together with the description to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those skilled in the art, they can also make From these drawings other related drawings are obtained.
图1示出了本公开实施例所提供的一种应用于训练好的目标神经网络的动态视频生成方法的流程图;FIG. 1 shows a flowchart of a dynamic video generation method applied to a trained target neural network provided by an embodiment of the present disclosure;
图2示出了本公开实施例所提供的一种LSTM网络的架构示意图;FIG. 2 shows a schematic diagram of the architecture of an LSTM network provided by an embodiment of the present disclosure;
图3示出了本公开实施例所提供的一种生成目标图像对应的动态视频的示意图;FIG. 3 shows a schematic diagram of generating a dynamic video corresponding to a target image provided by an embodiment of the present disclosure;
图4示出了本公开实施例所提供的一种利用目标神经网络,生成目标图像对应的动态视频的示意图;FIG. 4 shows a schematic diagram of using a target neural network to generate a dynamic video corresponding to a target image provided by an embodiment of the present disclosure;
图5示出了本公开实施例所提供的一种动态视频生成装置的示意图;Fig. 5 shows a schematic diagram of a dynamic video generation device provided by an embodiment of the present disclosure;
图6示出了本公开实施例所提供的一种计算机设备结构示意图。Fig. 6 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only It is a part of the embodiments of the present disclosure, but not all of them. The components of the disclosed embodiments generally described and illustrated herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort shall fall within the protection scope of the present disclosure.
另外,本公开实施例中的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。In addition, the terms "first", "second" and the like in the description and claims in the embodiments of the present disclosure and the above drawings are used to distinguish similar objects, and not necessarily used to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein.
在本文中提及的“多个或者若干个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。"Plural or several" mentioned herein means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship.
经研究发现,现有技术中,基于获取的静态的目标图片生成动态视频的方式大多是在确定目标图片中可以进行动态展示的对象之后,然后利用特定的修图软件、剪辑软件等,手动对选定的对象以及目标图像进行特效处理,得到与目标图片对应的多张图像,进而,基于目标图像和得到的多张图像,可以生成目标图片对应的动态视频。After research, it is found that in the prior art, most of the methods of generating dynamic videos based on the acquired static target pictures are to determine the objects that can be dynamically displayed in the target pictures, and then use specific picture editing software, editing software, etc. to manually edit the video. The selected object and the target image are processed with special effects to obtain multiple images corresponding to the target picture, and then, based on the target image and the obtained multiple images, a dynamic video corresponding to the target picture can be generated.
然而,利用上述方式得到的动态视频的展示效果较差,且由于操作步骤复杂,手动处理方式的效率大大较低,进而,影响了生成动态视频的效率。However, the display effect of the dynamic video obtained by the above method is poor, and due to the complicated operation steps, the efficiency of the manual processing method is greatly low, which in turn affects the efficiency of generating the dynamic video.
基于上述研究,本公开提供了一种动态视频生成方法、装置、设备、介质和程序产品,利用训练好的目标神经网络对目标图像进行特征提取,首先可以准确地提取出能够反映目标图像的图像特征的初始图像特征,目标图像中的动态对象在不同的时间片所对应的图像特征存在时序上的关联,因此,再利用目标神经网络对确定的初始图像特征进行特征处理,能够准确地确定出始图像特征对应于多个连续的时间片中每个时间片的时序图像特征,也即可以得到动态对象对应于不同的时间片的图像特征。进而,利用时序图像特征,可以准确地得到目标图像中的动态对象对应于不同的时间片的图像,从而,得到动态视频。通过利用训练好的目标神经网络对目标图像进行处理,能够自动生成动态视频,相比手动处理的方式而言,极大地提高了动态视频的生成效率,并且,训练好的目标神经网络经过多轮训练具有可靠的输出精度,提高了得到的动态视频的准确性,进一步地提升了动态视频的展示效果。Based on the above research, the present disclosure provides a dynamic video generation method, device, equipment, medium and program product, which uses the trained target neural network to extract features of the target image, and firstly can accurately extract an image that can reflect the target image The initial image features of the features, and the image features corresponding to the dynamic objects in different time slices in the target image have temporal correlations. Therefore, the target neural network is used to perform feature processing on the determined initial image features to accurately determine The original image feature corresponds to the sequential image feature of each time slice in multiple consecutive time slices, that is, the image features of the dynamic object corresponding to different time slices can be obtained. Furthermore, by using the time-series image features, images in which dynamic objects in the target image correspond to different time slices can be accurately obtained, thereby obtaining dynamic videos. By using the trained target neural network to process the target image, the dynamic video can be automatically generated. Compared with the manual processing method, the generation efficiency of the dynamic video is greatly improved, and the trained target neural network has undergone multiple rounds The training has a reliable output accuracy, which improves the accuracy of the obtained dynamic video and further improves the display effect of the dynamic video.
针对以上方案所存在的缺陷,均是发明人在经过实践并仔细研究后得出的结果,因此,上述问题的发现过程以及下文中本公开针对上述问题所提出的解决方案,都应该是发明人在本公开过程中对本公开做出的贡献。The defects in the above solutions are all the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure below for the above problems should be the result of the inventor Contributions made to this disclosure during the course of this disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
需要说明的是,本公开实施例中所提到的特定名词包括:It should be noted that the specific nouns mentioned in the embodiments of the present disclosure include:
LSTM,Long Short Term Memory,长短期记忆网络,是一种具有记忆长短期信息的能力的神经网络。LSTM, Long Short Term Memory, long short-term memory network, is a neural network with the ability to memorize long-term and short-term information.
自动编码神经网络:一种自动编码机器学习模型,具有强大的特征抽取和表示能力,包含数据的压缩算法,其中,数据的压缩和解压缩函数是数据相关的、有损的、从样本中自动学习的。Autoencoding neural network: an autoencoding machine learning model with powerful feature extraction and representation capabilities, including data compression algorithms, where the data compression and decompression functions are data-dependent, lossy, and automatically learned from samples of.
为便于对本实施例进行理解,首先对本公开实施例所公开的一种动态视频生成方法进行详细介绍,本公开实施例所提供的动态视频生成方法的执行主体一般为具有一定计算能力的计算机设备,在一些可能的实现方式中,该动态视频生成方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In order to facilitate the understanding of this embodiment, a dynamic video generation method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the dynamic video generation method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities. In some possible implementation manners, the method for generating a dynamic video may be implemented by a processor invoking computer-readable instructions stored in a memory.
下面以执行主体为训练好的目标神经网络为例对本公开实施例提供的动态视频生成方法加以说明。The dynamic video generation method provided by the embodiments of the present disclosure will be described below by taking the trained target neural network as an example.
如图1所示,为本公开实施例提供的一种应用于训练好的目标神经网络的动态视频生成方法的流程图,可以包括以下步骤:As shown in FIG. 1, a flow chart of a dynamic video generation method applied to a trained target neural network provided by an embodiment of the present disclosure may include the following steps:
S101:获取目标图像。S101: Acquire a target image.
这里,目标图像为拍摄完成的一张静止图像,可以包含至少一个可进行动态处理的动态对象的图像,其中,可动态处理的动态对象可以是在目标图像中为静止的对象、但在现实世界中可进行移动的对象,例如,海水、头发、风车等等。Here, the target image is a still image that has been shot, and may contain at least one image of a dynamic object that can be dynamically processed, wherein the dynamic object that can be dynamically processed may be a static object in the target image, but in the real world Objects that can be moved in , such as sea water, hair, windmills, etc.
示例性的,目标图像可以是目标人物图像、目标动物图像、风景图像等等,可进行动态处理的动态对象可以为目标人物图像中的人物头发、图像背景中海水等,目标动物图像中的动物毛发等,风景图像中的树枝、云朵等。Exemplarily, the target image can be a target person image, a target animal image, a landscape image, etc., and the dynamic object that can be dynamically processed can be the hair of a person in the target person image, sea water in the image background, etc., and the animal in the target animal image Hair, etc., tree branches, clouds, etc. in landscape images.
具体实施时,当用户存在生成目标图像对应的动态视频的需求时,可以将目标图像直接输入预先训练好的目标神经网络,从而,目标神经网络可以获取到待处理的目标图像。During specific implementation, when the user needs to generate a dynamic video corresponding to the target image, the target image can be directly input into the pre-trained target neural network, so that the target neural network can obtain the target image to be processed.
在具体应用时,预先训练好的目标神经网络可以部署在各种图像处理APP(Application,应用程序)中,例如,美颜APP,或者,也可以部署在各种计算机程序产品中,比如,部署在线图像处理平台中。关于目标神经网络的具体存在形式,本公开实施例不进行限定。In a specific application, the pre-trained target neural network can be deployed in various image processing APPs (Application, application programs), for example, beauty APP, or can also be deployed in various computer program products, for example, deployment In the online image processing platform. The embodiment of the present disclosure does not limit the specific existence form of the target neural network.
以目标神经网络部署在美颜APP为例,当用户存在生成动态视频的需求时,可以直接将目标图像输入到美颜APP中,从而,美颜APP中的目标神经网络可以获取到待处理的目标图像。Taking the deployment of the target neural network in the Beauty APP as an example, when the user needs to generate dynamic videos, he can directly input the target image into the Beauty APP, so that the target neural network in the Beauty APP can obtain the data to be processed. target image.
S102:对目标图像进行特征提取,确定目标图像对应的初始图像特征。S102: Perform feature extraction on the target image, and determine initial image features corresponding to the target image.
这里,初始图像特征用于表征目标图像所对应的图像特征,具体的,初始图像特征可以包括图像的目标图像颜色特征、纹理特征、形状特征和空间关系特征,颜色特征可以为目标图像中的像素点的颜色值。Here, the initial image features are used to characterize the image features corresponding to the target image. Specifically, the initial image features may include target image color features, texture features, shape features and spatial relationship features of the image, and the color features may be pixels in the target image The color value of the point.
具体实施时,目标神经网络在获取到目标图像之后,可以利用网络中的卷积层和池化层对目标图像进行连续多次的卷积处理,每次卷积都得到目标图像对应的一个特征图,每次卷积都可以提取到尺寸、数据量均不相同的特征图。进而,可以将得到的最小(尺寸与数据量均最小的)的特征图作为目标图像对应的初始图像特征,或者,可以将连续多次卷积中的最后一次卷积所得到特征图作为目标图像对应的初始图像特征。其中,初始图像特征可以是一个特征向量,例如,可以为1×1024的特征向量。In specific implementation, after the target neural network acquires the target image, it can use the convolutional layer and pooling layer in the network to perform multiple consecutive convolutions on the target image, and each convolution can obtain a feature corresponding to the target image Each convolution can extract feature maps with different sizes and data volumes. Furthermore, the feature map obtained with the smallest size and data volume can be used as the initial image feature corresponding to the target image, or the feature map obtained by the last convolution in consecutive multiple convolutions can be used as the target image Corresponding initial image features. Wherein, the initial image feature may be a feature vector, for example, may be a 1×1024 feature vector.
S103:基于初始图像特征,分别确定初始图像特征对应于多个连续的时间片中每个时间片的时序图像特征。S103: Based on the initial image features, respectively determine that the initial image features correspond to time-series image features of each time slice in a plurality of consecutive time slices.
这里,时序图像特征为包括时序信息的图像特征,即为初始图像特征对应在不同的时间片下的图像特征。多个连续的时间片可以是预先设置在目标神经网络中的特定的时间片,每两个时间片对应的时间之间的时间间隔可以相同,也可以不同,可以根据开发需要进行设置,时间片的数量也可以根据开发需要进行设置,这里均不进行限定。针对获取的任一初始图像特征,都可以按照设置的多个时间片,确定初始图像特征对应于每个时间片的时序图像特征。Here, the time-series image feature is an image feature including time-series information, that is, an image feature corresponding to an initial image feature under different time slices. Multiple consecutive time slices can be specific time slices preset in the target neural network. The time interval between the times corresponding to each two time slices can be the same or different, and can be set according to development needs. Time slices The number of can also be set according to development needs, which are not limited here. For any acquired initial image feature, according to the set multiple time slices, it may be determined that the initial image feature corresponds to time-series image features of each time slice.
多个连续的时间片中的第一个时间片可以是初始图像特征对应的时间片。或者,初始图像特征对应的时间片可以多个连续的时间片中的任一个时间片,这样,在获取初始图像特征之后,可以确定在初始图像特征对应的时间片之前的时间片的时序图像特征,以及在初始图像特征对应的时间片之后的时间片的时序图像特征。The first time slice in the multiple consecutive time slices may be the time slice corresponding to the initial image feature. Or, the time slice corresponding to the initial image feature can be any one of a plurality of consecutive time slices, so that after the initial image feature is acquired, the temporal image feature of the time slice before the time slice corresponding to the initial image feature can be determined , and the temporal image features of the time slice after the time slice corresponding to the initial image feature.
具体实施时,针对每个时间片,目标神经网络在确定初始图像特征之后,可以先对初始图像特征进行解析,确定目标图像中的每个动态对象对应于初始图像特征中的对象图像特征,然后可以确定初始图像特征对应的时间片,以该时间片作为基础,对该时间片对应的初始图像特征中的每个对象图像特征和/或初始图像特征执行特征复制、特征融合、特征拼接中的一种特征处理操作,从而得到动态对象在该时间片下对应的时序图像特征,也即得到初始图像特征在该时间片下对应的时序图像特征。During specific implementation, for each time slice, after the target neural network determines the initial image features, it can first analyze the initial image features to determine that each dynamic object in the target image corresponds to the object image features in the initial image features, and then The time slice corresponding to the initial image feature can be determined, and based on the time slice, each object image feature and/or initial image feature in the initial image feature corresponding to the time slice is performed in feature replication, feature fusion, and feature splicing. A feature processing operation to obtain the time-series image features corresponding to the dynamic object under the time slice, that is, to obtain the time-series image features corresponding to the initial image features under the time slice.
进而,基于上述步骤,可以得到初始图像特征对应于多个连续的时间片中每个时间片的时序图像特征。Furthermore, based on the above steps, it is possible to obtain time-series image features whose initial image features correspond to each time slice in a plurality of consecutive time slices.
此外,目标神经网络能够识别的动态对象的种类由训练样本决定,例如,目标神经网络能够识别的动态对象的种类包括type1、type2和type3,目标图像中包括的动态对象的种类为type1、type3和type4,则最终目标神经网络能够在目标图像中识别出的动态对象的种类为type1和type3,且最终输出的动态视频中可以位置发生变化的对象为type1对应的动态对象和type3对应的动态对象。In addition, the types of dynamic objects that can be recognized by the target neural network are determined by the training samples. For example, the types of dynamic objects that can be recognized by the target neural network include type1, type2, and type3, and the types of dynamic objects included in the target image are type1, type3, and type4, the final target neural network can recognize the types of dynamic objects in the target image as type1 and type3, and the objects that can change positions in the final output dynamic video are the dynamic objects corresponding to type1 and the dynamic objects corresponding to type3.
S104:基于每个时间片对应的时序图像特征,生成目标图像对应的动态视频,目标图像中的动态对象在动态视频中的位置存在变化。S104: Based on the time-series image features corresponding to each time slice, generate a dynamic video corresponding to the target image, where the position of the dynamic object in the target image changes in the dynamic video.
这里,动态视频中包括多张与目标图像相关的衍生图像以及目标图像,每张图像中包括的对象一致,只是每张图像中包括的动态对象的位置存在差异,因此,目标图像中的动态对象在得到的动态视频中的位置将存在变化。Here, the dynamic video includes multiple derivative images related to the target image and the target image. The objects included in each image are the same, but the positions of the dynamic objects included in each image are different. Therefore, the dynamic objects in the target image There will be variations in position in the resulting motion video.
以目标图像为人物H全身图,动态对象为人物H的长发为例,生成的动态视频中人物H的长发的位置将会发生变化,在展示动态视频时,将会呈现长发随风摆动的效果。Taking the target image as the full body image of character H, and the dynamic object as the long hair of character H as an example, the position of the long hair of character H in the generated dynamic video will change, and when the dynamic video is displayed, the long hair will appear swing effect.
具体实施时,目标神经网络可以利用卷积层,分别对每个时间片对应的时序图像特征进行反卷积,得到每个时序图像特征对应的衍生图像,进而,可以确定生成的每个衍生图像以及目标图像对应的图像顺序,并根据该图像顺序生成目标图像对应的动态视频。During specific implementation, the target neural network can use the convolutional layer to deconvolute the time-series image features corresponding to each time slice to obtain the derivative image corresponding to each time-series image feature, and then determine the generated derivative image and the image sequence corresponding to the target image, and generate a dynamic video corresponding to the target image according to the image sequence.
这样,利用训练好的目标神经网络对目标图像进行特征提取,首先可以准确地提取出能够反映目标图像的图像特征的初始图像特征,目标图像中的动态对象在不同的时间片所对应的图像特征存在时序上的关联,因此,再利用目标神经网络对确定的初始图像特征进行特征处理,能够准确地确定出始图像特征对应于多个连续的时间片中每个时间片的时序图像特征,也即可以得到动态对象对应于不同的时间片的图像特征。进而,利用时序图像特征,可以准确地得到目标图像中的动态对象对应于不同的时间片的图像,从而,得到动态视频。通过利用训练好的目标神经网络对目标图像进行处理,能够自动生成动态视频,相比手动处理的方式而言,极大地提高了动态视频的生成效率,并且,训练好的目标神经网络经过多轮训练具有可靠的输出精度,提高了得到的动态视频的准确性,进一步地提升了动态视频的展示效果。In this way, using the trained target neural network to perform feature extraction on the target image, first, the initial image features that can reflect the image features of the target image can be accurately extracted, and the image features corresponding to the dynamic objects in the target image in different time slices There is a time-series correlation. Therefore, using the target neural network to perform feature processing on the determined initial image features, it can be accurately determined that the initial image features correspond to the time-series image features of each time slice in multiple consecutive time slices. That is, image features of dynamic objects corresponding to different time slices can be obtained. Furthermore, by using the time-series image features, images in which dynamic objects in the target image correspond to different time slices can be accurately obtained, thereby obtaining dynamic videos. By using the trained target neural network to process the target image, the dynamic video can be automatically generated. Compared with the manual processing method, the generation efficiency of the dynamic video is greatly improved, and the trained target neural network has undergone multiple rounds The training has a reliable output accuracy, which improves the accuracy of the obtained dynamic video and further improves the display effect of the dynamic video.
在一种实施例中,多个连续的时间片中包括多个时间片组,每个时间片组包括第一时间片,和与该第一时间片相邻的、位于该第一时间片之后的第二时间片。In one embodiment, multiple consecutive time slices include multiple time slice groups, each time slice group includes a first time slice, and adjacent to the first time slice, located after the first time slice the second time slice of .
这里,一个时间片可以对应于多个时间片组,多个连续的时间片中的每个时间片在一个时间片组可以为第一时间片,而在另一个时间片组中可以为第二时间片。每个时间片为第一时间片还是第二时间片,可以根据其所在的时间片组中的另一个时间片和该时间片之间的相对关系确定。Here, one time slice can correspond to multiple time slice groups, and each time slice in a plurality of consecutive time slices can be the first time slice in one time slice group, and can be the second time slice in another time slice group. time slice. Whether each time slice is the first time slice or the second time slice can be determined according to the relative relationship between another time slice in the time slice group where it is located and the time slice.
例如,C时间片与B时间片相连、且位于B时间片之后,B时间片与A时间片相连、且位于A时间片之后,时间片组包括前一个时间片组1和后一个时间片组2,时间片组1包括A时间片和B时间片,时间片组2包括B时间片和C时间片,则B时间片在时间片组1中为第二时间片,在时间片组2中为第一时间片。For example, time slice C is connected to time slice B and located after time slice B, time slice B is connected to time slice A and located after time slice A, and the time slice group includes the previous
多个时间片组可以为连续的多个时间片组,其中,前一个时间片组中包括的第二时间片可以为后一个时间片组中包括的两个时间片中的第一时间片。具体实施时,时间片组的数量可以由时间片的数量决定,例如,若时间片的数量为5,则时间片组的数量可以为4,若时间片的数量为15,则时间片组的数量可以为14。The multiple time slice groups may be multiple consecutive time slice groups, wherein the second time slice included in the previous time slice group may be the first time slice among the two time slices included in the subsequent time slice group. During specific implementation, the number of time slice groups can be determined by the number of time slices. For example, if the number of time slices is 5, the number of time slice groups can be 4; if the number of time slices is 15, the number of time slice groups Quantity can be 14.
针对S103,可以按照下述步骤实施:For S103, it can be implemented according to the following steps:
针对多个时间片组中的每个时间片组,利用预设的时序特征提取网络,对时间片组中的第一时间片所对应的时序图像特征和初始图像特征进行特征融合处理,得到时间片组中的第二时间片对应的时序图像特征;For each time slice group in multiple time slice groups, use the preset time series feature extraction network to perform feature fusion processing on the time series image features and initial image features corresponding to the first time slice in the time slice group to obtain the time Time series image features corresponding to the second time slice in the slice group;
其中,在第一时间片为所述多个连续的时间片中最早的时间片时,利用预设的时序特征提取网络对初始图像特征进行处理,得到第一时间片对应的时序图像特征。Wherein, when the first time slice is the earliest time slice among the plurality of consecutive time slices, the initial image features are processed using a preset time-series feature extraction network to obtain the time-series image features corresponding to the first time slice.
这里,预设的时序特征提取网络可以是预先设置在目标神经网络中的,具体的,时序特征提取网络可以是LSTM网络。如图2所示,为本公开实施例所提供的一种LSTM网络的架构示意图。Here, the preset time series feature extraction network may be preset in the target neural network, specifically, the time series feature extraction network may be an LSTM network. As shown in FIG. 2 , it is a schematic structural diagram of an LSTM network provided by an embodiment of the present disclosure.
针对多个时间片组中的每个时间片组,可以直接将该时间片组中的第一时间片所对应的时序图像特征和初始图像特征输入到LSTM网络中,然后可以利用LSTM网络,对时序图像特征和初始图像特征进行融合处理,进而,LSTM网络可以输出该时间片组中第二时间片对应的时序图像特征。在图2中,ht-1可以表示任一时间片组中的第一时间片所对应的时序图像特征,Xt表示初始图像特征,ht表示第二时间片对应的时序图像特征。For each time slice group in multiple time slice groups, the temporal image features and initial image features corresponding to the first time slice in the time slice group can be directly input into the LSTM network, and then the LSTM network can be used to The time series image features and the initial image features are fused, and then the LSTM network can output the time series image features corresponding to the second time slice in the time slice group. In FIG. 2, h t-1 can represent the time-series image feature corresponding to the first time slice in any time slice group, X t represents the initial image feature, and h t represents the time-series image feature corresponding to the second time slice.
进而,可以确定与上述时间片组相邻的下一个时间片组中的第二时间片对应的时序图像特征,具体的,与上述时间片组相邻的下一个时间片组中的第一时间片对应的时序图像特征可以是上述时间片组中刚刚确定的第二时间片对应的时序图像特征,进而,LSTM网络可以利用该时序图像特征和初始图像特征,确定与上述时间片组相邻的下一个时间片组中的第二时间片对应的时序图像特征。在图2中,ht可以表示计算与上述时间片组相邻的下一个时间片组中的第二时间片对应的时序图像特征时,输入的第一时间片对应的时序图像特征,Xt+1表示初始图像特征,ht+1表示新确定的第二时间片对应的时序图像特征。Furthermore, the temporal image features corresponding to the second time slice in the next time slice group adjacent to the above time slice group can be determined, specifically, the first time sequence in the next time slice group adjacent to the above time slice group The time-series image feature corresponding to the slice can be the time-series image feature corresponding to the second time slice just determined in the above-mentioned time-slice group, and then, the LSTM network can use the time-series image feature and the initial image feature to determine the time-series image feature adjacent to the above-mentioned time-slice group Time-series image features corresponding to the second time slice in the next time slice group. In Fig. 2, h t can represent the time-series image feature corresponding to the first time slice input when calculating the time-series image feature corresponding to the second time slice in the next time-slice group adjacent to the above-mentioned time-slice group, X t +1 represents the initial image feature, and h t+1 represents the time-series image feature corresponding to the newly determined second time slice.
这样,基于图2所示的LSTM网络的架构,可以确定每个时间片组中的第一时间片和第二时间片对应的时序图像特征。In this way, based on the architecture of the LSTM network shown in FIG. 2 , the temporal image features corresponding to the first time slice and the second time slice in each time slice group can be determined.
其中,针对多个连续的时间片中最早的时间片,可以直接将初始图像特征输入到LSTM网络中,之后,LSTM网络可以直接对初始图像特征进行处理,确定最早的时间片对应的时序图像特征,并且,每个时间片组中的第一时间片一定为时间较早的时间片,所以最早的时间片一定为其对应的时间片组中的第一时间片。进而,基于该第一时间片,可以确定其对应的时间片组中的第二时间片对应的时序图像特征。Among them, for the earliest time slice among multiple consecutive time slices, the initial image features can be directly input into the LSTM network, and then the LSTM network can directly process the initial image features to determine the temporal image features corresponding to the earliest time slice , and the first time slice in each time slice group must be an earlier time slice, so the earliest time slice must be the first time slice in its corresponding time slice group. Furthermore, based on the first time slice, the time-series image features corresponding to the second time slice in the corresponding time slice group may be determined.
在图2中,Xt-1表示初始图像特征,ht-1可以表示计算最早的时间片对应的时序图像特征时,输出的最早的时间片对应的时序图像特征。In Figure 2, X t-1 represents the initial image feature, and h t-1 can represent the time-series image feature corresponding to the earliest time slice output when calculating the time-series image feature corresponding to the earliest time slice.
在一种可能的实施方式中,针对S102,可以利用目标神经网络中的图像编码器对目标图像进行特征提取,确定在目标第一卷积层下提取的目标图像的第一图像特征作为初始图像特征;其中,图像编码器包括多个第一卷积层,目标第一卷积层为多个第一卷积层中对应的卷积核的数量最小的第一卷积层。In a possible implementation manner, for S102, the image encoder in the target neural network can be used to perform feature extraction on the target image, and the first image feature of the target image extracted under the target first convolutional layer can be determined as the initial image Features; wherein the image encoder includes a plurality of first convolutional layers, and the target first convolutional layer is the first convolutional layer with the smallest number of corresponding convolution kernels among the plurality of first convolutional layers.
这里,目标神经网络中还可以包括图像编码器,该图像编码器可以是由自动编码神经网络构成的,图像编码器包括预先设置的多个第一卷积层,每个第一卷积层中包括的卷积核的数量不同,卷积核的大小也不同,且每个第一卷积层中的卷积核的大小和该第一卷积层中的卷积核的数量呈正相关,一个第一卷积层中的卷积核的数量越多,该第一卷积层中的卷积核越大,否则,卷积核的数量越少,卷积核越小。Here, the target neural network may also include an image encoder, which may be composed of an automatic encoding neural network. The image encoder includes a plurality of preset first convolutional layers, and each first convolutional layer The number of convolution kernels included is different, the size of the convolution kernel is also different, and the size of the convolution kernel in each first convolution layer is positively correlated with the number of convolution kernels in the first convolution layer, a The larger the number of convolution kernels in the first convolution layer, the larger the convolution kernels in the first convolution layer; otherwise, the smaller the number of convolution kernels, the smaller the convolution kernels.
在一种实施方式中,一个第一卷积层可以对应于一个卷积神经网络,图像编码器中包括多个卷积神经网络。In an implementation manner, one first convolutional layer may correspond to one convolutional neural network, and the image encoder includes multiple convolutional neural networks.
目标第一卷积层为多个第一卷积层中对应的卷积核的数量最小的、且卷积核最小的第一卷积层。The target first convolutional layer is the first convolutional layer with the smallest number of corresponding convolution kernels and the smallest convolution kernel among the plurality of first convolutional layers.
每个第一卷积层具有一定的卷积顺序,其中,图像编码器在获取目标图像之后,卷积核的数量最多的第一卷积层将对目标图像对应的图像数据进行卷积操作,提取出目标图像在该第一卷积层下对应的第一图像特征,具体的,第一图像特征可以为特征图,进而,卷积核的数量第二多的第一卷积层将对该第一卷积层对应的第一图像特征的图像数据进行卷积操作,得到卷积核的数量第二多的第一卷积层对应的第一图像特征,之后,卷积核的数量第三多的第一卷积层,将对卷积核的数量第二多的第一卷积层对应的第一图像特征进行卷积操作,得到卷积核的数量第三多的第一卷积层对应的第一图像特征,依次类推,直至确定出卷积核的数量最少的第一卷积层对应的第一图像特征,将该第一图像特征作为在目标第一卷积层下提取的目标图像的初始图像特征。这里,卷积核的数量最少的第一卷积层对应的第一图像特征可以为特征向量。Each first convolutional layer has a certain convolution order, wherein, after the image encoder acquires the target image, the first convolutional layer with the largest number of convolution kernels will perform a convolution operation on the image data corresponding to the target image, Extract the first image feature corresponding to the target image under the first convolutional layer, specifically, the first image feature can be a feature map, and then, the first convolutional layer with the second largest number of convolution kernels will Convolve the image data of the first image feature corresponding to the first convolution layer to obtain the first image feature corresponding to the first convolution layer with the second largest number of convolution kernels. After that, the number of convolution kernels is the third The first convolutional layer with the largest number of convolutional kernels will perform a convolution operation on the first image feature corresponding to the first convolutional layer with the second largest number of convolutional kernels to obtain the first convolutional layer with the third largest number of convolutional kernels The corresponding first image feature, and so on, until the first image feature corresponding to the first convolutional layer with the least number of convolution kernels is determined, and the first image feature is used as the target extracted under the target first convolutional layer The initial image features of the image. Here, the first image feature corresponding to the first convolution layer with the least number of convolution kernels may be a feature vector.
或者,在另一种实施例中,在得到在目标第一卷积层下提取的目标图像的第一图像特征之后,可以对该第一图像特征对应的图像数据执行用于调整数据维度的reshape操作,将该第一图像特征对应的图像数据转化为特征向量,进而,将该特征向量作为初始图像特征。Or, in another embodiment, after obtaining the first image feature of the target image extracted under the target first convolutional layer, reshape for adjusting the data dimension can be performed on the image data corresponding to the first image feature The operation is to convert the image data corresponding to the first image feature into a feature vector, and then use the feature vector as an initial image feature.
在一种可能的实施例中,针对S104,可以按照以下步骤执行:In a possible embodiment, for S104, the following steps may be followed:
步骤一、基于每个时间片对应的时序图像特征,分别生成每个时间片对应的衍生图像。Step 1: Generate derivative images corresponding to each time slice based on the time-series image features corresponding to each time slice.
其中,不同衍生图像中的动态对象的位置不同。Wherein, the positions of the dynamic objects in different derived images are different.
这里,每个时间片对应于一个衍生图像,衍生图像中包括的对象与目标图像相同,而每一张衍生图像中包括的动态对象的位置不同,这样,基于多张衍生图像,可以生成包含变化的动态对象的动态视频。Here, each time slice corresponds to a derived image, and the objects included in the derived image are the same as the target image, but the positions of the dynamic objects included in each derived image are different. In this way, based on multiple derived images, it is possible to generate Dynamic video of dynamic objects.
具体实施时,在确定每个时间片对应的时序图像特征之后,针对每个时间片,目标神经可以对该时序图像特征进行多次反卷积操作,在反卷积次数达到目标次数的情况下,将生成的特征图作为该时间片对应的衍生图像。During specific implementation, after determining the time-series image features corresponding to each time slice, the target nerve can perform multiple deconvolution operations on the time-series image features for each time slice, and when the number of deconvolutions reaches the target number of times , and use the generated feature map as the derivative image corresponding to the time slice.
进而,可以得到每个时间片对应的衍生图像。Furthermore, a derived image corresponding to each time slice can be obtained.
在另外一种实施方式中,针对该步骤一,在确定每个时间片分别对应的时序图像特征之后,可以将处于同一时间片组中的时间片对应的时序图像特征进行进一步地融合,利用融合后的时序图像特征,生成每个时间片组分别对应的衍生图像。In another embodiment, for
或者,还可以将具有相邻关系的多个时间片对应的时序图像特征进行进一步地融合,得到融合后的时序图像特征,在利用融合后的时序图像特征,生成该时序图像特征对应的衍生图像。Alternatively, the time-series image features corresponding to multiple time slices with adjacent relationships can be further fused to obtain the fused time-series image features, and the derived images corresponding to the time-series image features can be generated by using the fused time-series image features .
这样,生成的衍生图像的个数与时间片的数量可以不匹配,具体生成的衍生图像的数量可以由开发人员根据需求进行设置,这里不进行限定。In this way, the number of generated derivative images may not match the number of time slices, and the specific number of generated derivative images may be set by the developer according to requirements, which is not limited here.
步骤二、基于生成的各个衍生图像和各个衍生图像分别对应的时间片,生成目标图像对应的动态视频。Step 2: Based on the generated derived images and the time slices corresponding to the derived images, a dynamic video corresponding to the target image is generated.
本步骤中,在确定各个衍生图像之后,可以基于各个衍生图像对应的时间片所对应的时间序,以及目标图像对应的时间,确定各个图像对应的时间的先后顺序,进而,可以按照确定的先后顺序,生成目标图像对应的动态视频。其中,动态视频中的每个图像的时间顺序与确定的先后顺序一致。In this step, after each derivative image is determined, the order of time corresponding to each image can be determined based on the time sequence corresponding to the time slice corresponding to each derivative image and the time corresponding to the target image. Sequentially, a dynamic video corresponding to the target image is generated. Wherein, the time sequence of each image in the dynamic video is consistent with the determined sequence.
如图3所示,为本公开实施例所提供的一种生成目标图像对应的动态视频的示意图。As shown in FIG. 3 , it is a schematic diagram of generating a dynamic video corresponding to a target image provided by an embodiment of the present disclosure.
在一种实施例中,针对任一时间片对应的时序图像特征,生成该时间片对应的衍生图像的过程可以包括以下两个步骤:In one embodiment, for the time-series image features corresponding to any time slice, the process of generating the derivative image corresponding to the time slice may include the following two steps:
步骤S1:利用目标神经网络中的图像解码器,对时间片对应的时序图像特征进行解码处理,确定在目标第二卷积层下解码得到的第二图像特征作为目标图像特征。Step S1: Use the image decoder in the target neural network to decode the time-series image features corresponding to the time slices, and determine the second image features decoded under the target second convolutional layer as the target image features.
其中,图像解码器包括多个第二卷积层,目标第二卷积层为多个第二卷积层中对应的卷积核的数量最多的第二卷积层。Wherein, the image decoder includes multiple second convolutional layers, and the target second convolutional layer is the second convolutional layer with the largest number of corresponding convolution kernels among the multiple second convolutional layers.
这里,目标神经网络中还可以包括图像解码器,该图像解码器也可以是由自动编码神经网络构成的,图像解码器包括预先设置的多个第二卷积层,每个第二卷积层中包括的卷积核的数量不同,卷积核的大小也不同,且每个第二卷积层中的卷积核的大小和该第二卷积层中的卷积核的数量呈正相关,一个第二卷积层中的卷积核的数量越多,该第二卷积层中的卷积核越大,否则,卷积核的数量越少,卷积核越小。Here, the target neural network may also include an image decoder, which may also be composed of an auto-encoding neural network. The image decoder includes a plurality of preset second convolutional layers, each second convolutional layer The number of convolution kernels included in is different, the size of the convolution kernel is also different, and the size of the convolution kernel in each second convolution layer is positively correlated with the number of convolution kernels in the second convolution layer, The larger the number of convolution kernels in a second convolution layer, the larger the convolution kernel in the second convolution layer; otherwise, the smaller the number of convolution kernels, the smaller the convolution kernel.
另外,一个第二卷积层也可以对应于卷积神经网络,该卷积神经网络为反卷积神经网络。In addition, a second convolutional layer may also correspond to a convolutional neural network, which is a deconvolutional neural network.
目标第二卷积层为多个第二卷积层中对应的卷积核的数量最多的、且卷积核最多的第一卷积层。The target second convolutional layer is the first convolutional layer with the largest number of corresponding convolution kernels and the largest number of convolution kernels among the plurality of second convolutional layers.
每个第二卷积层具有一定的卷积顺序。具体实施时,LSTM网络在输出该时间片对应的时序图像特征之后,图像解码器可以获取到该时序图像特征,之后,卷积核的数量最少的第二卷积层将对该时序图像特征进行解码处理,也即,进行反卷积操作,得到该时序图像特征在该第二卷积层下的第二图像特征,具体的,第二图像特征也可以为特征图。Each second convolutional layer has a certain convolution order. During specific implementation, after the LSTM network outputs the time-series image features corresponding to the time slice, the image decoder can obtain the time-series image features, and then the second convolutional layer with the least number of convolution kernels will perform the time-series image features Decoding processing, that is, performing a deconvolution operation to obtain a second image feature of the time-series image feature under the second convolution layer, specifically, the second image feature may also be a feature map.
这里,在另一种实施方式中,在LSTM网络输出的时间片对应的时序图像特征为时序特征向量的情况下,可以先对该时序图像特征执行用于调整数据维度的reshape操作,将该时序特征向量调整为初始的特征图,然后,图像解码器可以利用卷积核的数量最少的第二卷积层对初始的特征图进行解码处理,得到第二图像特征。Here, in another embodiment, in the case where the time-series image feature corresponding to the time slice output by the LSTM network is a time-series feature vector, the reshape operation for adjusting the data dimension can be performed on the time-series image feature first, and the time-series The feature vector is adjusted to the initial feature map, and then the image decoder can use the second convolution layer with the least number of convolution kernels to decode the initial feature map to obtain the second image feature.
再或者,图像解码器也可以直接对时序特征向量进行解码处理,得到第二图像特征,这里不再赘述。Alternatively, the image decoder may also directly decode the time-series feature vector to obtain the second image feature, which will not be repeated here.
然后,卷积核的数量第二少的第二卷积层将对卷积核的数量最少的第二卷积层输出的第二图像特征进行反卷积处理,得到在该第二卷积层下的第二图像特征,然后,卷积核的数量第三少的第二卷积层将对卷积核的数量第二少的第二卷积层输出的第二图像特征进行反卷积处理,得到在卷积核的数量第三少的第二卷积层下的第二图像特征,依次类推,直至确定出卷积核的数量最多的第二卷积层对应的第二图像特征,将该第二图像特征作为在目标第二卷积层下解码得到的目标图像特征。Then, the second convolution layer with the second least number of convolution kernels will perform deconvolution processing on the second image features output by the second convolution layer with the smallest number of convolution kernels to obtain Then, the second convolutional layer with the third least number of convolution kernels will deconvolute the second image features output by the second convolutional layer with the second smallest number of convolution kernels , to obtain the second image feature under the second convolution layer with the third least number of convolution kernels, and so on, until the second image feature corresponding to the second convolution layer with the largest number of convolution kernels is determined, and The second image feature is used as a target image feature decoded under the target second convolutional layer.
这样,利用图像解码器,可以确定每个时间片对应的目标图像特征。In this way, by using the image decoder, the target image feature corresponding to each time slice can be determined.
步骤S2、基于目标图像特征,生成时间片对应的衍生图像。Step S2, based on the characteristics of the target image, generate a derivative image corresponding to the time slice.
这里,在目标图像特征为特征图的情况下,可以直接将该目标图像特征作为该时间片对应的衍生图像。进而,可以得到每个时间片对应的衍生图像。Here, when the feature of the target image is a feature map, the feature of the target image can be directly used as the derived image corresponding to the time slice. Furthermore, a derived image corresponding to each time slice can be obtained.
如图4所示,为本公开实施例所提供的一种利用目标神经网络,生成目标图像对应的动态视频的示意图。其中,L1、L2、L3、L4、LN分别表示不同的时间片,且L1对应的时间片早于L2对应的时间片,L2对应的时间片早于L3对应的时间片,L3对应的时间片早于L4对应的时间片,L4对应的时间片早于LN对应的时间片。As shown in FIG. 4 , it is a schematic diagram of using a target neural network to generate a dynamic video corresponding to a target image provided by an embodiment of the present disclosure. Among them, L1, L2, L3, L4, and LN respectively represent different time slices, and the time slice corresponding to L1 is earlier than the time slice corresponding to L2, the time slice corresponding to L2 is earlier than the time slice corresponding to L3, and the time slice corresponding to L3 is earlier than the time slice corresponding to L3. It is earlier than the time slice corresponding to L4, and the time slice corresponding to L4 is earlier than the time slice corresponding to LN.
另外,由于本公开实例所提供的动态视频生成为利用训练好的目标神经网络执行的,所以本公开实施例还提供了一种训练目标神经网络的方法,可以包括以下步骤:In addition, since the dynamic video generation provided by the disclosed example is executed by using the trained target neural network, the embodiment of the present disclosure also provides a method for training the target neural network, which may include the following steps:
T1:获取样本动态视频;T1: Obtain sample dynamic video;
其中,样本视频包括多帧样本图像。Wherein, the sample video includes multiple frames of sample images.
这样,样本动态视频可以是包括动态对象的短视频,样本视频包括多帧样本图像,每帧样本图像中包括相同的动态对象为静态对象,每帧样本图像中包括的静态对象的位置相同,动态对象的位置不同。In this way, the sample dynamic video can be a short video including dynamic objects, the sample video includes multiple frames of sample images, and each frame of sample images includes the same dynamic objects as static objects, and the positions of the static objects included in each frame of sample images are the same, and the dynamic Objects are positioned differently.
T2:将多帧样本图像中的一帧样本图像输入待训练的目标神经网络,利用待训练的目标神经网络对该帧样本图像进行处理,确定该帧样本图像对应的预测动态视频。T2: Input one frame of sample images among the multiple frames of sample images into the target neural network to be trained, process the frame of sample images by using the target neural network to be trained, and determine the predicted dynamic video corresponding to the frame of sample images.
这里,可以选取多帧样本图像中的任一帧样本图像作为输入的样本图像,这样,通过选取具有不同的时间顺序的样本图像对目标神经网络进行训练,可以使训练好的目标神经网络既可以预测输入的样本图像对应的时间片以前的图像,还可以预测输入的样本图像对应的时间片以后的图像,提高了训练好的目标神经网络的适应性和灵活性。Here, any frame of sample images in the multi-frame sample images can be selected as the input sample image, so that by selecting sample images with different time sequences to train the target neural network, the trained target neural network can be The image before the time slice corresponding to the input sample image can be predicted, and the image after the time slice corresponding to the input sample image can also be predicted, which improves the adaptability and flexibility of the trained target neural network.
具体实施时,可以将选取的任一帧样本图像输入待训练的目标神经网络,待训练的目标神经网络将对其进行处理,输出与该帧样本图像对应的=预测动态视频。During specific implementation, any selected frame sample image can be input into the target neural network to be trained, and the target neural network to be trained will process it and output = predicted dynamic video corresponding to the frame sample image.
T3:基于预测动态视频中的每帧预测图像和样本视频包括的多帧样本图像,确定待训练的目标神经网络对应的预测损失。T3: Determine the prediction loss corresponding to the target neural network to be trained based on each frame of the predicted image in the predicted dynamic video and the multi-frame sample images included in the sample video.
本步骤中,可以从多帧样本图像确定出与预测动态视频中的每帧预测图像相匹配的样本图像,然后,可以确定出每帧预测图像和其匹配的样本图像之间的子预测损失,并基于每帧预测图像对应的子预测损失,确定待训练的目标神经网络对应的预测损失。In this step, a sample image matching each frame of the predicted image in the predicted dynamic video can be determined from the multi-frame sample images, and then the sub-prediction loss between each frame of the predicted image and its matched sample image can be determined, And based on the sub-prediction loss corresponding to each frame of prediction image, the prediction loss corresponding to the target neural network to be trained is determined.
具体的,可以基于确定的每个子预测损失,确定子预测损失对应的均方差,将确定的均方差作为预测损失。Specifically, based on each determined sub-prediction loss, the mean square error corresponding to the sub-prediction loss may be determined, and the determined mean square error may be used as the prediction loss.
T4:利用预测损失对待训练的目标神经网络进行迭代训练,直至满足训练截止条件,得到训练好的目标神经网络。T4: Use the prediction loss to perform iterative training on the target neural network to be trained until the training cut-off condition is met, and the trained target neural network is obtained.
这里,训练截止条件可以为迭代训练的次数达到目标次数,或训练得到的目标神经网络预测精度满足预设精度中的至少一个。Here, the training cut-off condition may be that the number of iteration training reaches the target number, or at least one of the prediction accuracy of the target neural network obtained from training meets the preset accuracy.
具体实施时,可以直接利用预测损失对待训练的目标神经网络进行迭代训练,在确定满足训练截止条件的情况下,将训练得到的目标神经网络作为训练好的目标神经网络。In specific implementation, the target neural network to be trained can be directly used for iterative training by using the prediction loss, and the trained target neural network can be used as the trained target neural network when it is determined that the training cut-off condition is met.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
基于同一发明构思,本公开实施例中还提供了与动态视频生成方法对应的动态视频生成装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述动态视频生成方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiments of the present disclosure also provide a dynamic video generation device corresponding to the dynamic video generation method. Since the problem-solving principle of the device in the embodiments of the present disclosure is similar to that of the above-mentioned dynamic video generation method in the embodiments of the present disclosure, therefore For the implementation of the device, reference may be made to the implementation of the method, and repeated descriptions will not be repeated.
如图5所示,为本公开实施例提供的一种动态视频生成装置的示意图,包括:As shown in Figure 5, it is a schematic diagram of a dynamic video generation device provided by an embodiment of the present disclosure, including:
获取模块501,用于获取目标图像;An
第一确定模块502,用于对所述目标图像进行特征提取,确定所述目标图像对应的初始图像特征;The first determining
第二确定模块503,用于基于所述初始图像特征,分别确定所述初始图像特征对应于多个连续的时间片中每个时间片的时序图像特征;The
生成模块504,用于基于每个时间片对应的所述时序图像特征,生成所述目标图像对应的动态视频;所述目标图像中的动态对象在所述动态视频中的位置存在变化。The
在一种可能的实施方式中,所述多个连续的时间片中包括多个时间片组,每个所述时间片组包括第一时间片,和与该第一时间片相邻的、位于该第一时间片之后的第二时间片;In a possible implementation manner, the multiple consecutive time slices include multiple time slice groups, each of the time slice groups includes a first time slice, and adjacent to the first time slice, located in a second time slice after the first time slice;
所述第二确定模块503,用于针对所述多个时间片组中的每个时间片组,利用预设的时序特征提取网络,对所述时间片组中的第一时间片所对应的时序图像特征和所述初始图像特征进行特征融合处理,得到所述时间片组中的第二时间片对应的时序图像特征;The
其中,在所述第一时间片为所述多个连续的时间片中最早的时间片时,利用预设的时序特征提取网络对所述初始图像特征进行处理,得到所述第一时间片对应的时序图像特征。Wherein, when the first time slice is the earliest time slice among the plurality of consecutive time slices, the initial image features are processed using a preset temporal feature extraction network to obtain the first time slice corresponding to time-series image features.
在一种可能的实施方式中,所述第一确定模块502,用于利用所述目标神经网络中的图像编码器对所述目标图像进行特征提取,确定在目标第一卷积层下提取的所述目标图像的第一图像特征作为所述初始图像特征;其中,所述图像编码器包括多个第一卷积层,所述目标第一卷积层为所述多个第一卷积层中对应的卷积核的数量最小的第一卷积层。In a possible implementation manner, the
在一种可能的实施方式中,所述生成模块504,用于基于每个时间片对应的时序图像特征,分别生成每个时间片对应的衍生图像;其中,不同所述衍生图像中的动态对象的位置不同;In a possible implementation manner, the
基于生成的各个衍生图像和所述各个衍生图像分别对应的时间片,生成所述目标图像对应的动态视频。A dynamic video corresponding to the target image is generated based on the generated derivative images and time slices respectively corresponding to the derivative images.
在一种可能的实施方式中,所述生成模块504,用于利用所述目标神经网络中的图像解码器,对所述时间片对应的时序图像特征进行解码处理,确定在目标第二卷积层下解码得到的第二图像特征作为目标图像特征;其中,所述图像解码器包括多个第二卷积层,所述目标第二卷积层为所述多个第二卷积层中对应的卷积核的数量最多的第二卷积层;In a possible implementation manner, the
基于所述目标图像特征,生成所述时间片对应的衍生图像。Based on the features of the target image, a derivative image corresponding to the time slice is generated.
在一种可能的实施方式中,所述装置还包括训练模块505:In a possible implementation manner, the device further includes a training module 505:
所述训练模块505,用于按照以下步骤训练所述目标神经网络:The
获取样本动态视频;所述样本视频包括多帧样本图像;Obtain a sample dynamic video; the sample video includes multiple frames of sample images;
将所述多帧样本图像中的一帧样本图像输入待训练的所述目标神经网络,利用待训练的所述目标神经网络对该帧样本图像进行处理,确定该帧样本图像对应的预测动态视频;Inputting one frame sample image in the multi-frame sample image into the target neural network to be trained, processing the frame sample image by using the target neural network to be trained, and determining the predicted dynamic video corresponding to the frame sample image ;
基于所述预测动态视频中的每帧预测图像和所述样本视频包括的多帧样本图像,确定待训练的所述目标神经网络对应的预测损失;Determine the prediction loss corresponding to the target neural network to be trained based on each frame of the predicted image in the predicted dynamic video and the multi-frame sample images included in the sample video;
利用所述预测损失对待训练的所述目标神经网络进行迭代训练,直至满足训练截止条件,得到训练好的所述目标神经网络。The target neural network to be trained is iteratively trained by using the prediction loss until the training cut-off condition is met, and the trained target neural network is obtained.
关于装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。For the description of the processing flow of each module in the device and the interaction flow between the modules, reference may be made to the relevant description in the above method embodiment, and details will not be described here.
本公开实施例还提供了一种计算机设备,如图6所示,为本公开实施例提供的一种计算机设备结构示意图,包括:An embodiment of the present disclosure also provides a computer device, as shown in FIG. 6 , which is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure, including:
处理器61和存储器62;所述存储器62存储有处理器61可执行的机器可读指令,处理器61用于执行存储器62中存储的机器可读指令,所述机器可读指令被处理器61执行时,处理器61执行下述步骤:S101:获取目标图像;S102:对目标图像进行特征提取,确定目标图像对应的初始图像特征;S103:基于初始图像特征,分别确定初始图像特征对应于多个连续的时间片中每个时间片的时序图像特征以及S104:基于每个时间片对应的时序图像特征,生成目标图像对应的动态视频;目标图像中的动态对象在动态视频中的位置存在变化。
上述存储器62包括内存621和外部存储器622;这里的内存621也称内存储器,用于暂时存放处理器61中的运算数据,以及与硬盘等外部存储器622交换的数据,处理器61通过内存621与外部存储器622进行数据交换。Above-mentioned
上述指令的具体执行过程可以参考本公开实施例中所述的动态视频生成方法的步骤,此处不再赘述。For the specific execution process of the above instructions, reference may be made to the steps of the dynamic video generation method described in the embodiments of the present disclosure, which will not be repeated here.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的动态视频生成方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of the dynamic video generation method described in the foregoing method embodiments are executed. Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
本公开实施例所提供的动态视频生成方法的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行上述方法实施例中所述的动态视频生成方法的步骤,具体可参见上述方法实施例,在此不再赘述。The computer program product of the dynamic video generation method provided by the embodiments of the present disclosure includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the dynamic video generation method described in the above method embodiments For details, please refer to the above-mentioned method embodiments, and details are not repeated here.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be specifically realized by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium. In another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. wait.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiment, and details are not repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods may be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined. Or some features can be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-OnlyMemory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on this understanding, the technical solution of the present disclosure is essentially 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, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, and other media that can store program codes.
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that: the above-mentioned embodiments are only specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than limit them, and the protection scope of the present disclosure is not limited thereto, although referring to the aforementioned The embodiments have described the present disclosure in detail, and those skilled in the art should understand that any person familiar with the technical field can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present disclosure Changes can be easily imagined, or equivalent replacements can be made to some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in this disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be defined by the protection scope of the claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110849900.3A CN115690637A (en) | 2021-07-27 | 2021-07-27 | Dynamic video generation method, device, apparatus, medium, and program product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110849900.3A CN115690637A (en) | 2021-07-27 | 2021-07-27 | Dynamic video generation method, device, apparatus, medium, and program product |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115690637A true CN115690637A (en) | 2023-02-03 |
Family
ID=85059106
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110849900.3A Pending CN115690637A (en) | 2021-07-27 | 2021-07-27 | Dynamic video generation method, device, apparatus, medium, and program product |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115690637A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118972669A (en) * | 2024-07-03 | 2024-11-15 | 阿里巴巴达摩院(杭州)科技有限公司 | Object generation method, 4D object generation method and video generation method |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004334694A (en) * | 2003-05-09 | 2004-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Video generation method, apparatus, program, and recording medium recording the program |
| CN104967893A (en) * | 2014-07-10 | 2015-10-07 | 腾讯科技(北京)有限公司 | Video generation method and apparatus for portable electronic equipment |
| CN108900788A (en) * | 2018-07-12 | 2018-11-27 | 北京市商汤科技开发有限公司 | Video generation method, video-generating device, electronic device and storage medium |
| CN111047088A (en) * | 2019-12-09 | 2020-04-21 | 上海眼控科技股份有限公司 | Prediction image acquisition method and device, computer equipment and storage medium |
| CN112419455A (en) * | 2020-12-11 | 2021-02-26 | 中山大学 | Human body skeleton sequence information-based character action video generation method, system and storage medium |
-
2021
- 2021-07-27 CN CN202110849900.3A patent/CN115690637A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004334694A (en) * | 2003-05-09 | 2004-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Video generation method, apparatus, program, and recording medium recording the program |
| CN104967893A (en) * | 2014-07-10 | 2015-10-07 | 腾讯科技(北京)有限公司 | Video generation method and apparatus for portable electronic equipment |
| CN108900788A (en) * | 2018-07-12 | 2018-11-27 | 北京市商汤科技开发有限公司 | Video generation method, video-generating device, electronic device and storage medium |
| CN111047088A (en) * | 2019-12-09 | 2020-04-21 | 上海眼控科技股份有限公司 | Prediction image acquisition method and device, computer equipment and storage medium |
| CN112419455A (en) * | 2020-12-11 | 2021-02-26 | 中山大学 | Human body skeleton sequence information-based character action video generation method, system and storage medium |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118972669A (en) * | 2024-07-03 | 2024-11-15 | 阿里巴巴达摩院(杭州)科技有限公司 | Object generation method, 4D object generation method and video generation method |
| CN118972669B (en) * | 2024-07-03 | 2025-05-27 | 阿里巴巴达摩院(杭州)科技有限公司 | Object generation method, 4D object generation method and video generation method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11605156B2 (en) | Iterative image inpainting with confidence feedback | |
| US12026857B2 (en) | Automatically removing moving objects from video streams | |
| US20240169479A1 (en) | Video generation with latent diffusion models | |
| US12248796B2 (en) | Modifying digital images utilizing a language guided image editing model | |
| US10593021B1 (en) | Motion deblurring using neural network architectures | |
| US20240169701A1 (en) | Affordance-based reposing of an object in a scene | |
| CN118632070B (en) | Video generation method, device, electronic device, storage medium and program product | |
| US12198231B2 (en) | Generating differentiable procedural materials | |
| CN108734653A (en) | Image style conversion method and device | |
| CN111833360B (en) | Image processing method, device, equipment and computer readable storage medium | |
| KR20210058320A (en) | Method for generation 3d model using single input image and apparatus using the same | |
| CN115049558B (en) | Model training, face image processing method and device, electronic device and readable storage medium | |
| CN116189265B (en) | Sketch face recognition method, device and equipment based on lightweight semantic transducer model | |
| CN107547803B (en) | Video segmentation result edge optimization processing method and device and computing equipment | |
| CN118570054B (en) | Training method, related device and medium for image generation model | |
| CN118035493B (en) | Image generation method, device, equipment, storage medium and program product | |
| CN114581316A (en) | Image reconstruction method, electronic device, storage medium, and program product | |
| CN115115540A (en) | Method and device for unsupervised low-light image enhancement based on illumination information guidance | |
| Wen et al. | SVBRDF Recovery from a single image with highlights using a pre‐trained generative adversarial network | |
| CN110874575A (en) | A face image processing method and related equipment | |
| US12626429B2 (en) | Joint framework for object-centered shadow detection, removal, and synthesis | |
| CN111325068A (en) | Video description method and device based on convolutional neural network | |
| CN119540574A (en) | Image generation method, model determination method and image generation system | |
| US20260080578A1 (en) | Generative portrait shadow removal | |
| WO2026005851A1 (en) | Creating virtual three-dimensional spaces using generative models |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |
