WO2023241298A1 - 一种视频生成方法、装置、存储介质及电子设备 - Google Patents

一种视频生成方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2023241298A1
WO2023241298A1 PCT/CN2023/094868 CN2023094868W WO2023241298A1 WO 2023241298 A1 WO2023241298 A1 WO 2023241298A1 CN 2023094868 W CN2023094868 W CN 2023094868W WO 2023241298 A1 WO2023241298 A1 WO 2023241298A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
frames
preselected
dimension
target
Prior art date
Application number
PCT/CN2023/094868
Other languages
English (en)
French (fr)
Inventor
杨红庄
甄海洋
王超
周维
王磊
王进
Original Assignee
虹软科技股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 虹软科技股份有限公司 filed Critical 虹软科技股份有限公司
Publication of WO2023241298A1 publication Critical patent/WO2023241298A1/zh

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/06Transformation of speech into a non-audible representation, e.g. speech visualisation or speech processing for tactile aids
    • G10L21/10Transforming into visible information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • This article relates to video generation technology, especially a video generation method, device, storage medium and electronic equipment.
  • the method of generating videos driven by speech has been widely used in various fields.
  • Existing technologies usually use unfiltered single static frames as input frames to generate videos driven by speech.
  • the speech driver has many requirements for the input frame.
  • the input frame needs to have clear image quality, centered face, and neutral expression. It is difficult to meet the requirements of the speech driver based only on unfiltered single static frames.
  • the frame selection dimension determine the target frame from the sequence of frames to be selected
  • determining the target frame from the frame sequence to be selected according to the frame selection dimension includes:
  • the frame selection dimension obtain a preselected frame that satisfies the frame selection condition from the sequence of frames to be selected, where the preselected frame is one frame or multiple frames;
  • the preselected frame is one frame
  • the preselected frame is the target frame
  • the multiple preselected frames are fused to obtain the target frame
  • the frame selection condition includes at least one of a first frame selection condition and a second frame selection condition.
  • the fusion includes at least one of a first fusion or a second fusion.
  • the first preselected frame is one or more frames.
  • the first preselected frame when the first preselected frame is a frame, the first preselected frame is the target frame;
  • first preselected frames are multiple frames
  • a first fusion is performed on the multiple first preselected frames to obtain the target frame.
  • obtaining preselected frames that meet the frame selection conditions from the sequence of frames to be selected includes:
  • the second preselected frame is one or more frames.
  • the second preselected frame when the second preselected frame is a frame, the second preselected frame is the target frame;
  • a second fusion is performed on the multiple second preselected frames to obtain the target frame.
  • the second frame selection condition is that the second dimension value or the second dimension comprehensive value is the lowest or the highest.
  • the second preselected frame is one or more frames.
  • the second frame selection condition is that the second dimension value or the second dimension comprehensive value is the lowest or the highest.
  • the second frame selection condition is that the second dimension value is within the second frame selection range.
  • speech driving is performed on the target frame to obtain the target video, including:
  • the corresponding driving expression coefficient is generated through the trained speech driving model
  • Consecutive driving frames constitute the target video.
  • a frame selection unit configured to determine the target frame from the frame sequence to be selected based on the frame selection dimension
  • Embodiments of the present application also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program is executed by a processor, the steps of any one of the above video generating methods are implemented.
  • An embodiment of the present application also provides an electronic device, which may include:
  • Memory used to store executable instructions for the processor
  • the processor is configured to perform any of the above video generation methods by executing executable instructions.
  • target frames that meet the requirements of voice driving are obtained, which improves the effect of subsequent voice driving; at the same time, the problem of missing facial details that may be caused by changes in expression coefficients during the voice driving process is solved, so that the generated video More vivid and natural.
  • Figure 1 is a flow chart of a video generation method according to an embodiment of the present application.
  • Figure 2 is a flow chart for determining a target frame from a sequence of candidate frames according to an embodiment of the present application
  • Figure 3 is a flowchart of determining a target frame from a sequence of candidate frames according to another embodiment of the present application
  • Figure 4a is a schematic diagram of eye feature points according to an embodiment of the present application.
  • Figure 4b is a schematic diagram of mouth feature points according to an embodiment of the present application.
  • Figure 5 is a flow chart for determining a target frame from a sequence of candidate frames according to yet another embodiment of the present application
  • Figure 6 is a flow chart for voice driving the target frame and obtaining the target video according to an embodiment of the present application
  • Figure 7 is a flow chart of a video generation method in a video call according to an embodiment of the present application.
  • Figure 8 is a block diagram of a video generation device according to an embodiment of the present application.
  • the sequence of frames to be selected may include: at least one of real-time video cache frames and pre-stored frames pre-shot by the user.
  • the sequence of frames to be selected includes no less than two frames to be selected, wherein the pre-stored frames pre-shot by the user may be the pre-stored frames pre-shot by the user.
  • the system prompts you to capture frames based on different frame selection dimensions;
  • the frame to be selected needs to contain face information
  • the frame selection dimension may include at least one of the first frame selection dimension and the second frame selection dimension, where the first frame selection dimension may be the picture dimension, including face position, face At least one of orientation, human body posture, and light.
  • the second selected frame dimension can be at least one of image quality dimensions and facial features dimensions.
  • the image quality dimensions can include blur, shadow, noise, etc.
  • the facial features dimensions can include eye dimensions. , at least one of the mouth dimensions;
  • the frame selection dimensions can be preset or automatically generated according to the needs of the speech-driven model
  • S1021 According to the frame selection dimension, obtain a preselected frame that satisfies the frame selection condition from the sequence of frames to be selected, where the preselected frame is one frame or multiple frames;
  • the frame selection conditions are the conditions that need to be met to meet the requirements of the speech-driven model for the target frame
  • the frame selection condition may include at least one of a first frame selection condition and a second frame selection condition
  • the above-mentioned fusion includes at least one of first fusion or second fusion;
  • S103 Based on the current speech signal, perform speech driving on the target frame to generate the target video.
  • a target frame that meets the voice driving requirements can be obtained, thereby improving the effect of subsequent voice driving.
  • the first selected frame dimension is the picture dimension, which may include at least one of face position, face orientation, human posture, and light;
  • the first dimension value may include at least one of a face position value, a face orientation value, a human posture value, and a light value;
  • the horizontal and vertical coordinate ratio bbox_center_u/v is the face position value
  • the relative relationship value T val of the human body joint point is the human body posture value
  • a method for calculating light values includes:
  • the under-exposure brightness threshold and over-exposure brightness threshold can be preset according to needs, or can be automatically generated by the system;
  • the first frame selection condition is that the first dimension value is within the first frame selection range
  • the first frame selection range may include at least one of a face position range, a face orientation range, a human posture range, and a light range;
  • the face position range is, TMin u/v ⁇ bbox_center_u/v ⁇ TMax u/v ;
  • the face orientation range is, roll ⁇ T roll , yaw ⁇ T yaw , pitch ⁇ T pitch ;
  • T val is the human body posture value
  • is the human body posture threshold
  • the normal human body joint points and the human body posture threshold can be preset according to the needs, or can be automatically generated by the system;
  • the light range is,
  • the underexposure ratio and overexposure ratio are light values, and the overexposure threshold and underexposure threshold can be preset according to needs, or can be automatically generated by the system;
  • the first preselected frame may be one frame or multiple frames
  • this frame is the target frame
  • the homography matrix is obtained through projective transformation.
  • the homography matrix has 8 degrees of freedom.
  • the homography matrix can be obtained with at least 4 pairs of reference points and matching points. response matrix;
  • the pixel correspondence between the reference frame and the matching frame is obtained through matrix transformation and pixel interpolation;
  • the target frame after the first fusion has higher spatial resolution, more obvious information expression and lower noise;
  • a target frame that meets the voice driving requirements can be obtained, which improves the effect of subsequent voice driving.
  • S301 Calculate the second dimension value of each frame in the sequence of frames to be selected according to the second selected frame dimension
  • the second dimension value may include at least one of a blur value and a facial features dimension value (eye dimension value, mouth dimension value);
  • This application does not limit the method of calculating the blur value. You can also choose other methods to calculate the blur value. In other methods, the lower the blur value, the blurr the frame, and the higher the blur value, the clearer the frame;
  • the relationship between the mouth dimension value calculated using the above method and the mouth is that the lower the mouth_val, the higher the degree of mouth closure;
  • This application does not limit the method of calculating the mouth dimension value. You can also choose other methods to calculate the mouth dimension value. In other methods, the lower the mouth dimension value, the lower the degree of mouth closure, and the higher the mouth dimension value. The higher the degree of mouth closure;
  • the frame selection conditions include at least one of clear image quality, eyes open, and mouth closed;
  • the method includes:
  • the second frame selection condition is the lowest or highest second dimension value or second dimension comprehensive value
  • the method includes:
  • the frame with the lowest blur value in the sequence of candidate frames is obtained as the second preselected frame
  • the frame with the lowest blur value and the frame with the lowest mouth dimension value in the sequence of frames to be selected are obtained as the second preselected frame, and the blur
  • the frame with the lowest degree value and the frame with the lowest mouth dimension value can be the same frame or different frames;
  • the frame with the lowest eye dimension value and the frame with the lowest mouth dimension value in the sequence of frames to be selected are obtained as the second preselected frame.
  • the frame with the lowest eye dimension value and the frame with the lowest mouth dimension value can be the same frame, or they can be different frames;
  • the second selected frame dimension includes blur, eye dimension, and mouth dimension
  • the frame with the lowest dimension value is the second preselected frame.
  • the frame with the lowest blur value, the frame with the lowest eye dimension value, and the frame with the lowest mouth dimension value can be the same frame or different frames;
  • the second frame selection dimension contains a variety of frame selection conditions, and different evaluation indicators often have different dimensions and Dimensional unit, this situation will affect the results of the analysis.
  • this application introduces the second dimension comprehensive value
  • the method includes:
  • the second dimension comprehensive value may be a weighted value of the second dimension value
  • the second preselected frame may be one frame or multiple frames
  • the second fusion includes:
  • facial features are fused on multiple second preselected frames to obtain the target frame;
  • a target frame that meets the voice driving requirements can be obtained, which improves the effect of subsequent voice driving.
  • S402 includes:
  • the second selected frame range may include at least one of the blur range and the facial features range, and the facial features range may include at least one of the eye range and the mouth range;
  • the facial features range is: facial features dimension value > facial features threshold;
  • the blur threshold and facial features threshold can be preset according to needs, or can be automatically generated by the system;
  • the third preselected frame is the frame with the lowest or highest second dimension value or second dimension comprehensive value in the sequence of frames to be selected;
  • the frame selection range includes a blur range and a facial features range. If the blur value of the first preselected frame is not within the fuzziness range, but the facial features dimension value is within the facial features range, then the first preselected frame will If the two-dimensional value is not within the range of the second selected frame, obtain the frame with the lowest or highest blur value in the sequence of frames to be selected, and this frame is the third preselected frame;
  • S4027 Determine whether the second dimension value of the pre-selected fusion frame is within the second selected frame range
  • Embodiments of the present application provide a method of voice driving the target frame to obtain the target video based on the current voice signal. As shown in Figure 6, the method includes:
  • step S5012 may include:
  • 1D convolution network training can be performed on speech signal samples and expression coefficient samples; speech signal samples can also be converted into 2D images, and 2D convolution network training can be performed on speech signal samples and expression coefficient samples;
  • LSTM Long short-term memory (Long short-term memory) network is used for auxiliary training;
  • Transform network can also be used for training;
  • step S503 may include:
  • step S5033 includes:
  • the foreground mask map extract the outline of the foreground area in the target frame
  • Delaunay triangulation is performed on the foreground area of the target frame to obtain the character 3D grid B s in the projection space;
  • the projection matrix P is obtained, the face deformation source grid is transformed into the projection space, and the 3D face model F s is obtained;
  • the barycenter coordinates of the pixel corresponding to the grid M′ t during rasterization can be obtained.
  • a point p on the surface of M s can be obtained.
  • the coordinate keyframe is obtained
  • the key frame is obtained through the image warp algorithm of the least squares algorithm
  • S504 Based on the candidate frame sequence and the target frame, perform expression matching on the key frames to obtain the driving frame;
  • step S504 includes:
  • S5042 Based on the facial expression coefficient, obtain the face model corresponding to each frame in the sequence of frames to be selected;
  • S5043 Calculate the mouth deviation of the face model and the face driver model corresponding to each frame in the sequence of frames to be selected;
  • using the rendering frame to render the key frame includes: extracting the structural information z geo and the style information z style of the mouth in the key frame, and at the same time, extracting the real style information of the mouth in the rendering frame by real style information and structural information z geo to obtain driving frames with real mouth texture and tooth structure;
  • step S504 includes:
  • S5047 Input the eye opening range and the target frame into the cGAN network, and output the eye image corresponding to the eye opening range;
  • the problem of missing mouth details (for example, the inside of the cavity, teeth) that may be caused by changes in expression coefficients is solved, making the generated video more vivid and natural.
  • the embodiment of the present application provides a video generation method in a video call, as shown in Figure 7.
  • the method includes:
  • S601 Monitor real-time network bandwidth for video calls
  • S602 Determine whether the real-time network bandwidth is less than the network threshold
  • Network thresholds can be preset according to needs or automatically generated by the system
  • the video generation methods include:
  • S604 Determine the target frame from the sequence of frames to be selected according to the frame selection dimension
  • the user can still have a natural and smooth video call when the network bandwidth is insufficient.
  • the embodiment of the present application provides a video generation device 10, as shown in Figure 8.
  • the device includes:
  • the collection unit 100 is configured to obtain a sequence of candidate frames
  • Embodiments of the present application also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program is executed by a processor, the steps of the video generation method of the previous embodiment are implemented.
  • Embodiments of the present application also provide an electronic device, including a processor and a memory.
  • the memory is used to store executable instructions of the processor; wherein the processor is configured to execute the video generation as in the previous embodiment by executing the executable instructions. method.
  • the disclosed technical content can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units may be a logical functional division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the units or modules may be in electrical 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 they may be distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or contributes to the existing technology, or all or 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 to make a A computer device (which may be a personal computer, a server or a network device, etc.) executes all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code. .
  • the solution provided by the embodiment of the present application can be applied to the field of video generation.
  • the sequence of candidate frames is obtained; the target frame is determined from the sequence of candidate frames according to the frame selection dimension; and the target frame is determined based on the current speech signal.
  • the frame is voice driven to obtain the target video, in which the frame selection dimension includes at least one of the first frame selection dimension and the second frame selection dimension, and the target frame that meets the voice drive requirements is obtained, which improves the technical effect of subsequent voice drive; at the same time , which solves the problem of missing facial details that may be caused by changes in expression coefficients during the voice-driven process, making the generated video more vivid and natural.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Acoustics & Sound (AREA)
  • Computational Linguistics (AREA)
  • Quality & Reliability (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Image Analysis (AREA)

Abstract

一种视频生成方法、装置及电子设备,该方法包括:获取待选帧序列(S101);根据选帧维度,从待选帧序列中确定目标帧(S102);基于当前语音信号,对目标帧进行语音驱动,获取目标视频,其中,选帧维度包括第一选帧维度、第二选帧维度中至少一项(S103)。该方法通过筛选得到满足语音驱动要求的目标帧,提升了后续语音驱动的效果;同时,解决了语音驱动的过程中表情系数变化可能造成的面部细节缺失的问题,使生成的视频更加生动、自然。

Description

一种视频生成方法、装置、存储介质及电子设备
本申请要求于2022年6月16日递交的中国专利申请第202210688868.X号的优先权,在此全文引用上述中国专利申请公开的内容以作为本申请的一部分。
技术领域
本文涉及视频生成技术,尤指一种视频生成方法、装置、存储介质及电子设备。
背景技术
通过语音驱动生成视频的方法在各领域中的已有广泛应用。现有技术通常以未经筛选的单帧静态帧作为输入帧,通过语音驱动生成视频。然而,语音驱动对输入帧有诸多要求,例如,需要输入帧的画质清晰、人脸居中、表情中性,仅基于未经筛选的单帧静态帧,难以满足语音驱动的要求。
发明内容
与相关技术相比,本申请记载的技术方案,得到满足语音驱动要求的目标帧,提升了后续语音驱动的效果;同时,解决了语音驱动的过程中表情系数变化可能造成的面部细节缺失的问题,使生成的视频更加生动、自然。
为了达到本申请实施例目的,本申请实施例提供了一种视频生成方法,所述方法可以包括:
获取待选帧序列;
根据选帧维度,从待选帧序列中确定目标帧;
基于当前语音信号,对目标帧进行语音驱动,获取目标视频;
其中,选帧维度包括第一选帧维度、第二选帧维度中至少一项。
在本申请的示例性实施例中,根据选帧维度,从待选帧序列中确定目标帧,包括:
根据选帧维度,从待选帧序列中获取满足选帧条件的预选帧,其中,预选帧为一帧或多帧;
当预选帧为一帧时,预选帧为目标帧;
当预选帧为多帧时,对多帧预选帧进行融合,得到目标帧;
其中,选帧条件包括第一选帧条件、第二选帧条件中至少一项。
在本申请的示例性实施例中,融合包括第一融合或第二融合中至少一项。
在本申请的示例性实施例中,根据选帧维度,从待选帧序列中获取满足选帧条件的预选帧,包括:
根据第一选帧维度,计算待选帧序列中每一帧的第一维度值;从待选帧序列中获取第一维度值满足第一选帧条件的第一预选帧;
其中,第一预选帧为一帧或多帧。
在本申请的示例性实施例中,第一选帧条件为第一维度值在第一选帧范围内。
在本申请的示例性实施例中,当第一预选帧为一帧时,第一预选帧为目标帧;
当第一预选帧为多帧时,对多帧第一预选帧进行第一融合,得到目标帧。
在本申请的示例性实施例中,根据选帧维度,从待选帧序列中获取满足选帧条件的预选帧,包括:
根据第二选帧维度,计算待选帧序列中每一帧的第二维度值;
从待选帧序列中获取第二维度值满足第二选帧条件的第二预选帧;
其中,第二预选帧为一帧或多帧。
在本申请的示例性实施例中,当第二预选帧为一帧时,第二预选帧为目标帧;
当第二预选帧为多帧时,对多帧第二预选帧进行第二融合得到目标帧。
在本申请的示例性实施例中,第二选帧条件为第二维度值或第二维度综合值最低或最高。
在本申请的示例性实施例中,根据选帧维度,从待选帧序列中获取满足选帧条件的预选帧,包括:
根据第二选帧维度,计算第一预选帧中每一帧的第二维度值;
从第一预选帧中获取第二维度值满足第二选帧条件的第二预选帧;
其中,第二预选帧为一帧或多帧。
在本申请的示例性实施例中,当第二预选帧为一帧时,第二预选帧为目标帧;
当第二预选帧为多帧时,对多帧第二预选帧进行第二融合得到目标帧。
在本申请的示例性实施例中,当第一预选帧为多帧时,第二选帧条件为第二维度值或第二维度综合值最低或最高。
在本申请的示例性实施例中,当第一预选帧为一帧时,第二选帧条件为第二维度值在第二选帧范围内。
在本申请的示例性实施例中,基于当前语音信号,对目标帧进行语音驱动,获取目标视频,包括:
根据当前语音信号,通过训练后的语音驱动模型生成对应的驱动表情系数;
对目标帧与驱动表情系数进行匹配,生成关键帧;
基于待选帧序列和目标帧,对关键帧进行表情匹配,得到驱动帧;
连续的驱动帧构成目标视频。
本申请实施例还提供了一种视频生成装置,可以包括:
采集单元,配置为获取待选帧序列;
选帧单元,配置为根据选帧维度,从待选帧序列中确定目标帧;
驱动单元,配置为基于当前语音信号,对目标帧进行语音驱动,获取目标视频。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述任意一项所述的视频生成方法的步骤。
本申请实施例还提供了一种电子设备,可以包括:
处理器;以及
存储器,用于存储处理器的可执行指令;
其中,处理器配置为经由执行可执行指令来执行上述任意一项的视频生成方法。
通过上述本申请实施例方案,得到满足语音驱动要求的目标帧,提升了后续语音驱动的效果;同时,解决了语音驱动的过程中表情系数变化可能造成的面部细节缺失的问题,使生成的视频更加生动、自然。
本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的其他优点可通过在说明书以及附图中所描述的方案来实现和获得。
附图说明
附图用来提供对本申请技术方案的理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本申请的技术方案,并不构成对本申请技术方案的限制。
图1为根据本申请实施例的视频生成方法的流程图;
图2为根据本申请实施例的从待选帧序列中确定目标帧的流程图;
图3为根据本申请另一实施例的从待选帧序列中确定目标帧的流程图;
图4a为根据本申请实施例的眼部特征点示意图;
图4b为根据本申请实施例的嘴部特征点示意图;
图5为根据本申请又一实施例的从待选帧序列中确定目标帧的流程图;
图6为根据本申请实施例的对目标帧进行语音驱动,获取目标视频的流程图;
图7为根据本申请实施例的视频通话中的视频生成方法的流程图;
图8为根据本申请实施例的视频生成装置的框图。
具体实施方式
本申请描述了多个实施例,但是该描述是示例性的,而不是限制性的,并且对于本领域的普通技术人员来说显而易见的是,在本申请所描述的实施例包含的范围内可以有更多的实施例和实现方案。尽管在附图中示出了许多可能的特征组合,并在具体实施方式中进行了讨论,但是所公开的特征的许多其它组合方式也是可能的。除非特意加以限制的情况以外,任何实施例的任何特征或元件可以与任何其它实施例中的任何其他特征或元件结合使用,或可以替代任何其它实施例中的任何其他特征或元件。
本申请包括并设想了与本领域普通技术人员已知的特征和元件的组合。本申请已经公开的实施例、特征和元件也可以与任何常规特征或元件组合,以形成由权利要求限定的独特的发明方案。任何实施例的任何特征或元件也可以与来自其它发明方案的特征或元件组合,以形成另一个由权利要求限定的独特的发明方案。因此,应当理解,在本申请中示出和/或讨论的任何特征可以单独地或以任何适当的组合来实现。因此,除了根据所附权利要求及其等同替换所做的限制以外,实施例不受其它限制。此外, 可以在所附权利要求的保护范围内进行各种修改和改变。
此外,在描述具有代表性的实施例时,说明书可能已经将方法和/或过程呈现为特定的步骤序列。然而,在该方法或过程不依赖于本文所述步骤的特定顺序的程度上,该方法或过程不应限于所述的特定顺序的步骤。如本领域普通技术人员将理解的,其它的步骤顺序也是可能的。因此,说明书中阐述的步骤的特定顺序不应被解释为对权利要求的限制。此外,针对该方法和/或过程的权利要求不应限于按照所写顺序执行它们的步骤,本领域技术人员可以容易地理解,这些顺序可以变化,并且仍然保持在本申请实施例的精神和范围内。
本申请实施例提供了一种视频生成方法,如图1所示,所述方法包括:
S101:获取待选帧序列;
待选帧序列可以包括:实时视频缓存帧、用户预拍摄的预存帧中的至少一项,待选帧序列包括不少于两帧待选帧,其中,用户预拍摄的预存帧可以为用户根据系统提示拍摄的基于不同选帧维度的帧;
待选帧需要包含人脸信息;
S102:根据选帧维度,获取待选帧序列中的目标帧;
基于语音驱动模型对目标帧的需求,选帧维度可以包括第一选帧维度、第二选帧维度中至少一项,其中,第一选帧维度可以是画面维度,包括人脸位置、人脸朝向、人体姿态、光线中至少一项,第二选帧维度可以是画质维度、五官维度中至少一项,画质维度可以包括模糊度、阴影、噪声等等,五官维度可以包括眼部维度、嘴部维度中至少一项;
选帧维度可以预先设定,也可以根据语音驱动模型的需求自动生成;
语音驱动模型对目标帧的需求可以包括画面需求、画质需求、五官需求中至少一项,其中,画面需求包括人脸位置居中、人脸朝向向前、人体姿态中立、光线适中中至少一项,画质需求可以包括:图像清晰,五官需求可以包括眼部张开、嘴部闭合中至少一项;
目标帧为待选帧序列中满足全部选帧条件的一帧或多帧;
具体地,步骤S102可以包括:
S1021:根据选帧维度,从待选帧序列中获取满足选帧条件的预选帧,其中,预选帧为一帧或多帧;
选帧条件为符合语音驱动模型对目标帧的需求所需要满足的条件;
选帧条件可以包括第一选帧条件、第二选帧条件中至少一项;
S1022:判断预选帧是否为一帧;
S1023:当预选帧为一帧时,该一帧预选帧为目标帧;
S1024:当预选帧为多帧时,对多帧预选帧进行融合,得到目标帧;
上述融合包括第一融合或第二融合中至少一项;
S103:基于当前语音信号,对目标帧进行语音驱动,生成目标视频。
通过本实施例中的方法,可以得到满足语音驱动要求的目标帧,提升后续语音驱动的效果。
本申请实施例提供了一种从待选帧序列中获取满足选帧条件的预选帧的方法,如图2所示,该方法包括:
S201:根据第一选帧维度,计算待选帧序列中每一帧的第一维度值;
在本实施例中,第一选帧维度为画面维度,可以包括人脸位置、人脸朝向、人体姿态、光线中至少一项;
相应地,第一维度值可以包括人脸位置值、人脸朝向值、人体姿态值、光线值中至少一项;
在一示例性实施例中,计算人脸位置值的方法包括:
基于人脸特征点,获取待选帧中的人脸包围框所对应的中心点bbox_center,计算中心点bbox_center在待选帧中的横纵坐标比bbox_center_u/v,该横纵坐标比bbox_center_u/v即为人脸位置值;
在一示例性实施例中,计算人脸朝向值的方法包括:
基于人脸特征点,获取待选帧的人脸朝向角(roll,yaw,pitch),该人脸朝向角(roll,yaw,pitch)即为人脸朝向值;
在一示例性实施例中,计算人体姿态值的方法包括:
通过比较正姿人体关节点与待选帧人体关节点,得到人体关节点相对关系值Tval,该人体关节点相对关系值Tval即为人体姿态值;
在一示例性实施例中,计算光线值的方法包括:
统计小于欠曝亮度阈值、大于过曝亮度阈值的像素占比,得到欠曝比和过曝比,该欠曝比和过曝比即为光线值;
其中,欠曝亮度阈值、过曝亮度阈值可以根据需求预先设定,也可以由系统自动生成;
通过统计待选帧像素的亮度分布获取待选帧暗部比例,该比例即为光线值;
S202:从待选帧序列中获取第一维度值满足第一选帧条件的第一预选帧;
其中,第一选帧条件为第一维度值在第一选帧范围内;
与第一维度对应,第一选帧范围可以包括人脸位置范围、人脸朝向范围、人体姿态范围、光线范围中至少一项;
在一示例性实施例中,人脸位置范围为,
TMinu/v<bbox_center_u/v<TMaxu/v
其中,bbox_center_u/v为人脸位置值,TMinu/v为横纵坐标比最小阈值,TMaxu/v为横纵坐标比最大阈值,TMinu/v和TMaxu/v可以根据需求预先设定,也可以由系统自动生成;
人脸位置值在人脸位置范围内的帧满足人脸位置居中的需求;
在一示例性实施例中,人脸朝向范围为,
roll<Troll,yaw<Tyaw,pitch<Tpitch
其中,(roll,yaw,pitch)为人脸朝向值,(Troll,Tyaw,Tpitch)为人脸朝向阈值,(Troll,Tyaw,Tpitch)可以根据需求预先设定,也可以由系统自动生成;
人脸朝向值在人脸朝向范围内的帧满足人脸朝向向前的需求;
在一示例性实施例中,人体姿态范围为,
Tval<∈;
其中,Tval为人体姿态值,∈为人体姿态阈值,正姿人体关节点和人体姿态阈值可以根据需求预先设定,也可以由系统自动生成;
人体姿态值在人体姿态范围内的帧满足人体姿态中立的需求;
在一示例性实施例中,光线范围为,
过曝比≤过曝阈值,欠曝比≤欠曝阈值;
其中,欠曝比和过曝比为光线值,过曝阈值和欠曝阈值可以根据需求预先设定,也可以由系统自动生成;
光线值在光线范围内的帧满足光线适中的需求;
第一预选帧可以为一帧或多帧;
若待选帧序列中不存在满足第一选帧条件的帧,提示用户根据第一选帧条件拍摄或上传图像至待选帧序列,直至待选帧序列中存在满足第一选帧条件的帧,该帧为目标帧;
S203:判断第一预选帧是否为一帧;
S204:当第一预选帧为一帧时,该一帧第一预选帧为目标帧;
S205:当第一预选帧为多帧时,对多帧第一预选帧进行第一融合,得到目标帧;
具体地,第一融合包括:
以多帧第一预选帧中任一帧为参考帧,其他帧为匹配帧;
获取参考帧的Harris角点,记为参考点;
计算参考点的特征描述子;
获取匹配帧的匹配范围,其中,匹配范围可以为以匹配帧中与参考帧的参考点对应的点为圆心、匹配距离为半径得到的圆的范围,可选地,匹配距离为5-15像素;
计算匹配范围内的点的特征描述子,选取与参考帧中参考点的特征描述子最相近的点作为匹配点;
基于参考帧的参考点和匹配帧的匹配点,通过射影变换得到单应矩阵,可选地,单应矩阵有8个自由度,此时,由最少4对参考点和匹配点就可以得到单应矩阵;
基于单应矩阵,通过矩阵变换和像素插值得到参考帧与匹配帧的像素对应关系;
将参考帧与匹配帧的像素对应相减,得到像素差值的绝对值;
比较像素差值的绝对值与像素噪声阈值,得到像素权重;
根据像素权重,对参考帧与匹配帧中对应的像素进行加权平均,得到目标帧;
通过第一融合,不仅可以将多帧第一预选帧融合为一帧目标帧,且经过第一融合的目标帧具有更高的空间分辨率,更明显的信息表现和更低的噪声;
通过本实施例中的方法,可以得到满足语音驱动要求的目标帧,提升了后续语音驱动的效果。
本申请实施例提供了一种从待选帧序列中获取满足选帧条件的预选帧的方法,如图3所示,该方法包括:
S301:根据第二选帧维度,计算待选帧序列中每一帧的第二维度值;
在本实施例中,第二选帧维度为画质维度或五官维度中至少一项,画质维度可以包括模糊度,五官维度可以包括眼部维度、嘴部维度中至少一项;
相应地,第二维度值可以包括模糊度值、五官维度值(眼部维度值、嘴部维度值)中至少一项;
在一示例性实施例中,计算模糊度值的方法可以包括:
对待选帧序列中的每一帧进行高斯模糊,得到其高斯模糊图像;
对待选帧序列中的每一帧及其高斯模糊图像进行水平梯度计算及垂直梯度计算,得到它们的水平梯度值及垂直梯度值;
基于上述水平梯度值及垂直梯度值,计算待选帧序列中的每一帧及其高斯模糊图像的水平梯度差及垂直梯度差;
对上述水平梯度差及垂直梯度差求和,得到模糊度值;
采用上述方法计算的模糊度值与帧的清晰之间的关系为模糊度值越高,帧越模糊,模糊度值越低,帧越清晰;
本申请不限制计算模糊度值的方法,也可以选择其他方法计算模糊度值,在其他方法中,可能模糊度值越低,帧越模糊,模糊度值越高,帧越清晰;
在一示例性实施例中,如图4a所示,计算眼部维度值的方法可以为:
eye_val=1-len(pt42-pt48)/len(pt39-pt45)
其中,pt42,pt48,pt39,pt45为基于人脸特征点获取的眼部特征点,len(pt42-pt48)为pt42和pt48之间的距离,len(pt39-pt45)为pt39和pt45之间的距离;
采用上述方法计算的眼部维度值与眼部之间的关系为eye_val越低,眼部张开程度越高;
本申请不限制计算眼部维度值的方法,也可以选择其他方法计算眼部维度值,在其他方法中,可能眼部维度值越低,眼部张开程度越低,眼部维度值越高,眼部张开程度越高;
在一示例性实施例中,如图4b所示,计算嘴部维度值的方法可以包括:
mouth_val=len(pt89-pt93)/len(pt87-pt91)
其中,pt89,pt93,pt87,pt91为基于人脸特征点获取的嘴部特征点,len(pt89-pt93)为pt89和pt93之间的距离,len(pt87-pt91)为pt87和pt91之间的距离;
采用上述方法计算的嘴部维度值与嘴部之间的关系为mouth_val越低,嘴部闭合程度越高;
本申请不限制计算嘴部维度值的方法,也可以选择其他方法计算嘴部维度值,在其他方法中,可能嘴部维度值越低,嘴部闭合程度越低,嘴部维度值越高,嘴部闭合程度越高;
与第二选帧维度对应,选帧条件包括画质清晰、眼部张开、嘴部闭合中至少一项;
当第一预选帧为多帧时,该方法包括:
S302:从待选帧序列中获取第二维度值满足第二选帧条件的第二预选帧;
当第一预选帧为多帧时,第二选帧条件为第二维度值或第二维度综合值最低或最高;
当第二选帧条件为第二维度值最低或最高时;
具体地,该方法包括:
S3021:获取待选帧序列中第二维度值最低或最高的帧为第二预选帧;
在一示例性实施例中,当第二选帧维度包括模糊度时,获取待选帧序列中模糊度值最低的帧为第二预选帧;
在一示例性实施例中,当第二选帧维度包括眼部维度时,获取待选帧序列中眼部维度值最低的帧为第二预选帧;
在一示例性实施例中,当第二选帧维度包括嘴部维度时,获取待选帧序列中嘴部维度值最低的帧为第二预选帧;
在一示例性实施例中,当第二选帧维度包括模糊度和眼部维度时,获取待选帧序列中模糊度值最低的帧和眼部维度值最低的帧为第二预选帧,模糊度值最低的帧和眼部维度值最低的帧可以为同一帧,也可以为不同帧;
在一示例性实施例中,当第二选帧维度包括模糊度和嘴部维度时,获取待选帧序列中模糊度值最低的帧和嘴部维度值最低的帧为第二预选帧,模糊度值最低的帧和嘴部维度值最低的帧可以为同一帧,也可以为不同帧;
在一示例性实施例中,当第二选帧维度包括眼部维度和嘴部维度时,获取待选帧序列中眼部维度值最低的帧和嘴部维度值最低的帧为第二预选帧,眼部维度值最低的帧和嘴部维度值最低的帧可以为同一帧,也可以为不同帧;
在一示例性实施例中,当第二选帧维度包括模糊度、眼部维度和嘴部维度时,获取待选帧序列中模糊度值最低的帧、眼部维度值最低的帧和嘴部维度值最低的帧为第二预选帧,模糊度值最低的帧、眼部维度值最低的帧和嘴部维度值最低的帧可以为同一帧,也可以为不同帧;
在一些实施例中,可能模糊度值越高,帧越清晰,眼部维度值越高,眼部张开程度越高,嘴部维度值越高,嘴部闭合程度越高,此时,获取待选帧序列中模糊度值最高的帧、眼部维度值最高的帧、嘴部维度值最高的帧中至少一项为第二预选帧;
由于第二选帧维度包含的多种选帧条件,且不同评价指标往往具有不同的量纲和 量纲单位,这样的情况会影响到分析的结果,为了消除指标之间的量纲影响,本申请引入了第二维度综合值;
当第二选帧条件为第二维度综合值最低或最高时;
具体地,该方法包括:
S3022:计算待选帧序列中每一帧的第二维度综合值;
第二维度综合值可以是第二维度值的加权值;
S3023:获取待选帧序列中第二维度综合值最低或最高的帧为第二预选帧;
在一示例性实施例中,当第二选帧维度包括模糊度、眼部维度和嘴部维度时,计算待选帧序列中每一帧的第二维度的加权值,得到第二维度综合值,获取待选帧序列中第二维度综合值最低或最高的帧为第二预选帧;
第二预选帧可以为一帧或多帧;
S303:判断第二预选帧是否为一帧;
S304:当第二预选帧为一帧时,该一帧第二预选帧为目标帧;
S305:当第二预选帧为多帧时,对多帧第二预选帧进行第二融合得到目标帧;
具体地,第二融合包括:
基于人脸特征点,获取多帧第二预选帧的人脸偏差值;
比较人脸偏差值与融合阈值;
当人脸偏差值小于融合阈值时,基于人脸特征点,获取最优融合边界;
根据最优融合边界,对多帧第二预选帧进行五官融合,得到目标帧;
当人脸偏差值不小于融合阈值时,通过仿射变换获取多帧第二预选帧的五官对应关系;
基于上述五官对应关系对多帧第二预选帧进行五官融合,得到目标帧;
其中,融合阈值可以根据需求预先设定,也可以由系统自动生成;
通过本实施例中的方法,可以得到满足语音驱动要求的目标帧,提升了后续语音驱动的效果。
本申请实施例提供了一种根据选帧维度,从待选帧序列中获取满足选帧条件的预选帧的方法,如图5所示,该方法包括:
S401:根据第二选帧维度,计算第一预选帧中每一帧的第二维度值;
第一预选帧可以为一帧或多帧;
S402:从第一预选帧中获取第二维度值满足第二选帧条件的第二预选帧;
具体地,S402包括:
S4021:判断第一预选帧是否为多帧;
当第一预选帧为多帧时,第二选帧条件为第二维度值或第二维度综合值最低或最高;
S4022:从多帧第一预选帧中获取第二维度值或第二维度综合值最低或最高帧为第二预选帧;
当第一预选帧为一帧时,第二选帧条件为第二维度值在第二选帧范围内;
S4023:判断第一预选帧的第二维度值是否在第二选帧范围内;
第二选帧范围可以包括模糊度范围、五官范围中至少一项,五官范围可以包括眼部范围、嘴部范围中至少一项;
在一示例性实施例中,模糊度范围为:模糊度值<模糊度阈值;
在一示例性实施例中,模糊度范围为:模糊度值>模糊度阈值;
在一示例性实施例中,五官范围为:五官维度值<五官阈值;
在一示例性实施例中,五官范围为:五官维度值>五官阈值;
五官阈值可以包括眼部阈值、嘴部阈值中至少一项;
模糊度阈值和五官阈值可以根据需求预先设定,也可以由系统自动生成;
S4024:当第一预选帧的第二维度值在第二选帧范围内时,第一预选帧为第二预选帧;
在一示例性实施例中,选帧范围包括模糊度范围与五官范围,若第一预选帧的模糊度值在模糊度范围内,且五官维度值在五官范围内,则第一预选帧满足第二选帧条 件,第一预选帧为第二预选帧;
S4025:当第一预选帧的第二维度值不在第二选帧范围内时,从待选帧序列中获取第三预选帧;
第三预选帧为待选帧序列中第二维度值或第二维度综合值最低或最高的帧;
在一示例性实施例中,选帧范围包括模糊度范围与五官范围,若第一预选帧的模糊度值不在模糊度范围内,但五官维度值在五官范围内,则第一预选帧的第二维度值不在第二选帧范围内,获取待选帧序列中模糊度值最低或最高的帧,该帧为第三预选帧;
在一示例性实施例中,选帧范围包括模糊度范围与五官范围,若第一预选帧的模糊度值不在模糊度范围内,且五官维度值不在五官范围内,则第一预选帧的第二维度值不在第二选帧范围内,获取待选帧序列中模糊度值最低或最高的帧和五官维度值最低或最高的帧,或者获取待选帧序列中模糊度值和五官维度值的综合值最低或最高的帧,该帧为第三预选帧;
第三预选帧可以为一帧或多帧;
S4026:对第一预选帧与第三预选帧进行融合,得到预选融合帧;
S4027:判断预选融合帧的第二维度值是否在第二选帧范围内;
若预选融合帧的第二维度值在第二选帧范围内,预选融合帧为第二预选帧;
若预选融合帧的第二维度值不在第二选帧范围内,提示用户根据第二选帧条件拍摄或上传图像,将该图像作为第三预选帧与第一预选帧进行融合,直至得到的预选融合帧的第二维度值在第二选帧范围内,得到第二预选帧;
融合包括第一融合、第二融合中至少一项;
S403:判断第二预选帧是否为一帧;
S404:当第二预选帧为一帧时,该一帧第二预选帧为目标帧;
S405:当第二预选帧为多帧时,对多帧第二预选帧进行第二融合得到目标帧;
通过本实施例中的方法,可以得到满足语音驱动模型要求的目标帧,提升了后续语音驱动的效果。
本申请实施例提供了一种基于当前语音信号,对目标帧进行语音驱动,获取目标视频的方法,如图6所示,该方法包括:
S501:训练语音驱动模型;
具体地,步骤S501包括:
S5011:获取训练素材;
训练素材需要包括语音信息及其对应的表情系数信息;
训练素材可以是视频素材,其需要包含语音信息和图像信息,其中,图像信息需要包括人脸的表情信息;
视频素材可以是提前录制的视频,也可以是网上爬取的视频;
S5012:采集训练素材中的语音信号样本及其对应的表情系数样本;
语音信号样本是时序信号,其可以是语音信号,也可以是语音信号的频谱特征,例如,梅尔普特征;
当训练素材是视频素材时,具体地,步骤S5012可以包括:
根据训练素材的帧率,提取训练素材中的语音信号样本及其对应的表情信息;
基于表情信息,获取语音信号样本对应的表情系数;
对表情系数进行滤波综合,得到表情系数样本;
S5013:基于语音信号样本和表情系数样本,训练语音驱动模型;
具体地,可以对语音信号样本和表情系数样本进行1D卷积网络训练;也可以将语音信号样本转换成2D图像,对语音信号样本和表情系数样本进行2D卷积网络训练;还可以用LSTM(长短期记忆,Long short-term memory)网络进行辅助训练;还可以使用Transform网络进行训练;
损失函数Loss可以直接利用表情系数样本进行计算,也可以将表情系数样本恢复成网格进行Loss训练;
S502:根据当前语音信号,通过训练后的语音驱动模型生成对应的驱动表情系数;
S503:对目标帧与连续驱动表情系数进行匹配,生成关键帧;
具体地,步骤S503可以包括:
S5031:对目标帧进行预处理;
预处理包括:前景人物分割、人物深度估计和3D人脸重建,前景人物分割得到前景掩膜图,人物深度估计得到人物深度图,3D人脸重建得到3D人脸模型;
S5032:根据驱动表情系数,得到人脸驱动模型;
S5033:基于目标帧与人脸驱动模型,得到关键帧;
具体地,步骤S5033包括:
根据前景掩膜图,提取目标帧中前景区域的轮廓;
根据人物深度图,对目标帧中人物对应深度进行采样;
以前景区域的轮廓为边界,对目标帧的前景区域进行Delaunay三角化,得到投影空间的人物3D网格Bs
移除人物3D网格Bs上的人脸区域,得到网格B′S
基于人脸3D重建,得到投影矩阵P,将人脸变形源网格变换至投影空间,得到3D人脸模型Fs
合并3D人脸模型Fs与网格B′S合并,并通过三角化链接两者边界的接缝部分,得到变形源网格Ms
将人脸驱动模型通过投影矩阵P变换到投影空间,得到投影空间中的人脸驱动模型Ft
将人脸驱动模型Ft中所有的顶点位置应用到变形源网格Ms中3D人脸模型Fs的对应顶点上,得到人脸网格Mt
令人脸网格Mt中的非人脸区域Ut=Mt/Ft,其在变形源网格Ms上对应为Us=Ms/Fs
分别取Fs、Ft的边界则Us、Ut的内边界分别为外边界分别为其中
基于优化网格加权Laplace能量的方式调整Ut中顶点位置,使Ft在人脸区域平滑 连续的过渡,在此,对应顶点的位置相同,将其作为固定锚点,而 对应顶点的位置不同,将其作为移动锚点;
计算Us的顶点到的测地距离d,以1/d2为系数估计该点权重,迭代优化得到平滑非人脸区域网格U′t,并有平滑变形目标网格M′t=U′t∩Ft
对于M′t渲染到图像空间中得到的目标像素,可以得到该像素在光栅化时对应到网格M′t上的重心坐标,将该坐标应用到Ms,可以得到Ms表面上一点p′s
将点p′s投影到预处理后的目标帧上,得到对应的源像素;
通过对目标像素坐标与源像素坐标在图像空间中的偏移量进行反向插值,得到坐标关键帧;
基于坐标关键帧,通过最小二乘算法的图像warp算法,得到关键帧;
S504:基于待选帧序列和目标帧,对关键帧进行表情匹配,得到驱动帧;
当表情匹配包括嘴部匹配时,步骤S504包括:
S5041:获取待选帧序列中每一帧的人脸表情系数;
S5042:基于人脸表情系数,得到待选帧序列中每一帧对应的人脸模型;
S5043:计算待选帧序列中每一帧对应的人脸模型和人脸驱动模型的嘴部偏差;
S5044:获取嘴部偏差最小人脸模型对应的帧,作为渲染帧;
S5045:利用渲染帧对关键帧进行渲染,得到驱动帧;
在一示例性实施例中,利用渲染帧对关键帧进行渲染,包括:提取关键帧中嘴部的结构信息zgeo和风格信息zstyle,同时,提取渲染帧中嘴部的真实风格信息由真实风格信息和结构信息zgeo得到具有真实嘴部纹理质感和牙齿结构的驱动帧;
当表情匹配包括眼部匹配时,步骤S504包括:
S5046:基于驱动表情系数,得到眼部张开幅度;
S5047:将眼部张开幅度与目标帧输入cGAN网络,输出眼部张开幅度对应的眼部图像;
S5048:将眼部图像与对关键帧进行匹配,得到驱动帧;
S505:连续的驱动帧构成目标视频;
通过本实施例中的方法,解决了表情系数变化可能造成的嘴部细节(例如,空腔内部、牙齿)缺失的问题,使生成的视频更加生动、自然。
本申请实施例提供了一种视频通话中的视频生成方法,如图7所示,该方法包括:
S601:监控视频通话的实时网络带宽;
S602:判断实时网络带宽是否小于网络阈值;
网络阈值可以根据需求预先设定,也可以由系统自动生成;
当实时网络带宽小于网络阈值时,视频通话发生卡顿,视频生成方法包括:
S603:获取待选帧序列;
待选帧序列可以包括:卡顿前的视频缓存帧、用户预拍摄的预存帧中的至少一项,待选帧序列包括不少于两帧待选帧;
S604:根据选帧维度,从待选帧序列中确定目标帧;
S605:基于当前语音信号,对目标帧进行语音驱动,获取目标视频;
当前语音信号为视频发生卡顿后用户的语音信号;
S606:将视频通话的画面切换至目标视频;
S607:当实时网络带宽不小于网络阈值时,切换回视频通话;
通过本实施例中的方法,使用户在网络带宽不足时,视频通话的画面依然自然、流畅。
本申请实施例提供了一种视频生成装置10,如图8所示,该装置包括:
采集单元100,配置为获取待选帧序列;
选帧单元200,配置为根据选帧维度,从待选帧序列中确定目标帧;
驱动单元300,配置为基于当前语音信号,对目标帧进行语音驱动,获取目标视 步。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如前任一实施例的视频生成方法的步骤。
本申请实施例还提供了一种电子设备,包括处理器以及存储器,存储器用于存储处理器的可执行指令;其中,处理器配置为经由执行可执行指令来执行如前任一实施例的视频生成方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一 台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。
工业实用性
本申请实施例提供的方案可应用于视频生成领域,在本申请实施例中,采用获取待选帧序列;根据选帧维度,从待选帧序列中确定目标帧;基于当前语音信号,对目标帧进行语音驱动,获取目标视频,其中,选帧维度包括第一选帧维度、第二选帧维度中至少一项,得到满足语音驱动要求的目标帧,提升了后续语音驱动的技术效果;同时,解决了语音驱动的过程中表情系数变化可能造成的面部细节缺失的问题,使生成的视频更加生动、自然。

Claims (17)

  1. 一种视频生成方法,包括:
    获取待选帧序列;
    根据选帧维度,从所述待选帧序列中确定目标帧;
    基于当前语音信号,对所述目标帧进行语音驱动,获取目标视频,其中,所述选帧维度包括第一选帧维度、第二选帧维度中至少一项。
  2. 根据权利要求1所述的视频生成方法,其中,所述根据选帧维度,从所述待选帧序列中确定目标帧,包括:
    根据所述选帧维度,从所述待选帧序列中获取满足选帧条件的预选帧,其中,所述预选帧为一帧或多帧;
    当所述预选帧为一帧时,所述预选帧为所述目标帧;
    当所述预选帧为多帧时,对所述多帧预选帧进行融合,得到所述目标帧,其中,所述选帧条件包括第一选帧条件、第二选帧条件中至少一项。
  3. 根据权利要求2所述的视频生成方法,其中,所述融合包括第一融合或第二融合中至少一项。
  4. 根据权利要求3所述的视频生成方法,其中,所述根据所述选帧维度,从所述待选帧序列中获取满足选帧条件的预选帧,包括:
    根据所述第一选帧维度,计算所述待选帧序列中每一帧的第一维度值;
    从所述待选帧序列中获取所述第一维度值满足所述第一选帧条件的第一预选帧,其中,所述第一预选帧为一帧或多帧。
  5. 根据权利要求2所述的视频生成方法,其中,
    所述第一选帧条件为所述第一维度值在第一选帧范围内。
  6. 根据权利要求4所述的视频生成方法,其中,
    当所述第一预选帧为一帧时,所述第一预选帧为所述目标帧;
    当所述第一预选帧为多帧时,对多帧所述第一预选帧进行第一融合,得到所述目标帧。
  7. 根据权利要求3所述的视频生成方法,其中,所述根据所述选帧维度,从所述待选帧序列中获取满足选帧条件的预选帧,包括:
    根据所述第二选帧维度,计算所述待选帧序列中每一帧的第二维度值;
    从所述待选帧序列中获取所述第二维度值满足所述第二选帧条件的第二预选帧,其中,所述第二预选帧为一帧或多帧。
  8. 根据权利要求7所述的视频生成方法,其中,
    当所述第二预选帧为一帧时,所述第二预选帧为所述目标帧;
    当所述第二预选帧为多帧时,对所述多帧第二预选帧进行第二融合得到所述目标帧。
  9. 根据权利要求2所述的视频生成方法,其中,
    所述第二选帧条件为所述第二维度值或第二维度综合值最低或最高。
  10. 根据权利要求4所述的视频生成方法,其中,所述根据所述选帧维度,从所述待选帧序列中获取满足选帧条件的预选帧,包括:
    根据所述第二选帧维度,计算所述第一预选帧中每一帧的第二维度值;
    从所述第一预选帧中获取所述第二维度值满足所述第二选帧条件的第二预选帧,其中,所述第二预选帧为一帧或多帧。
  11. 根据权利要求10所述的视频生成方法,其中,
    当所述第二预选帧为一帧时,所述第二预选帧为所述目标帧;
    当所述第二预选帧为多帧时,对所述多帧第二预选帧进行第二融合得到所述目标帧。
  12. 根据权利要求10所述的视频生成方法,其中,
    当所述第一预选帧为多帧时,所述第二选帧条件为所述第二维度值或所述第二维度综合值最低或最高。
  13. 根据权利要求10所述的视频生成方法,其中,
    当所述第一预选帧为一帧时,所述第二选帧条件为第二维度值在第二选帧范围内。
  14. 根据权利要求1所述的视频生成方法,其中,所述基于当前语音信号,对所述目标帧进行语音驱动,获取目标视频,包括:
    根据当前语音信号,通过训练后的语音驱动模型生成对应的驱动表情系数;
    对所述目标帧与所述驱动表情系数进行匹配,生成关键帧;
    基于所述待选帧序列和所述目标帧,对所述关键帧进行表情匹配,得到驱动帧;
    连续的所述驱动帧构成所述目标视频。
  15. 一种视频生成装置,包括:
    采集单元,配置为获取待选帧序列;
    选帧单元,配置为根据选帧维度,从所述待选帧序列中确定目标帧;
    驱动单元,配置为基于当前语音信号,对所述目标帧进行语音驱动,获取目标视频
  16. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至14中任一项所述方法的步骤。
  17. 一种电子设备,包括:
    处理器;以及
    存储器,配置为存储所述处理器的可执行指令;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1至14中任意一项所述的视频生成方法。
PCT/CN2023/094868 2022-06-16 2023-05-17 一种视频生成方法、装置、存储介质及电子设备 WO2023241298A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210688868.XA CN115116468A (zh) 2022-06-16 2022-06-16 一种视频生成方法、装置、存储介质及电子设备
CN202210688868.X 2022-06-16

Publications (1)

Publication Number Publication Date
WO2023241298A1 true WO2023241298A1 (zh) 2023-12-21

Family

ID=83328086

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/094868 WO2023241298A1 (zh) 2022-06-16 2023-05-17 一种视频生成方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN115116468A (zh)
WO (1) WO2023241298A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115116468A (zh) * 2022-06-16 2022-09-27 虹软科技股份有限公司 一种视频生成方法、装置、存储介质及电子设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993025A (zh) * 2017-12-29 2019-07-09 中移(杭州)信息技术有限公司 一种关键帧提取方法及设备
CN110390263A (zh) * 2019-06-17 2019-10-29 宁波江丰智能科技有限公司 一种视频图像处理方法及系统
CN112215927A (zh) * 2020-09-18 2021-01-12 腾讯科技(深圳)有限公司 人脸视频的合成方法、装置、设备及介质
US20210201550A1 (en) * 2020-07-14 2021-07-01 Beijing Baidu Netcom Science And Technology Co., Ltd. Method, apparatus, device and storage medium for animation interaction
CN113507627A (zh) * 2021-07-08 2021-10-15 北京的卢深视科技有限公司 视频生成方法、装置、电子设备及存储介质
WO2021232690A1 (zh) * 2020-05-18 2021-11-25 北京达佳互联信息技术有限公司 一种视频生成方法、装置、电子设备及存储介质
CN114202604A (zh) * 2021-11-30 2022-03-18 长城信息股份有限公司 一种语音驱动目标人视频生成方法、装置及存储介质
CN115116468A (zh) * 2022-06-16 2022-09-27 虹软科技股份有限公司 一种视频生成方法、装置、存储介质及电子设备

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993025A (zh) * 2017-12-29 2019-07-09 中移(杭州)信息技术有限公司 一种关键帧提取方法及设备
CN110390263A (zh) * 2019-06-17 2019-10-29 宁波江丰智能科技有限公司 一种视频图像处理方法及系统
WO2021232690A1 (zh) * 2020-05-18 2021-11-25 北京达佳互联信息技术有限公司 一种视频生成方法、装置、电子设备及存储介质
US20210201550A1 (en) * 2020-07-14 2021-07-01 Beijing Baidu Netcom Science And Technology Co., Ltd. Method, apparatus, device and storage medium for animation interaction
CN112215927A (zh) * 2020-09-18 2021-01-12 腾讯科技(深圳)有限公司 人脸视频的合成方法、装置、设备及介质
CN113507627A (zh) * 2021-07-08 2021-10-15 北京的卢深视科技有限公司 视频生成方法、装置、电子设备及存储介质
CN114202604A (zh) * 2021-11-30 2022-03-18 长城信息股份有限公司 一种语音驱动目标人视频生成方法、装置及存储介质
CN115116468A (zh) * 2022-06-16 2022-09-27 虹软科技股份有限公司 一种视频生成方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN115116468A (zh) 2022-09-27

Similar Documents

Publication Publication Date Title
CN109285215B (zh) 一种人体三维模型重建方法、装置和存储介质
US11189084B2 (en) Systems and methods for executing improved iterative optimization processes to personify blendshape rigs
CN111598998B (zh) 三维虚拟模型重建方法、装置、计算机设备和存储介质
CN108921782B (zh) 一种图像处理方法、装置及存储介质
US20210279956A1 (en) Semantic deep face models
WO2022001509A1 (zh) 图像优化方法、装置、计算机存储介质以及电子设备
Patwardhan et al. Video inpainting under constrained camera motion
CN110363116B (zh) 基于gld-gan的不规则人脸矫正方法、系统及介质
CN109462747B (zh) 基于生成对抗网络的dibr系统空洞填充方法
WO2022156626A1 (zh) 一种图像的视线矫正方法、装置、电子设备、计算机可读存储介质及计算机程序产品
JP2000511316A (ja) 制御点の自動位置決めのための画像/制御点位置結合の基本成分解析
KR20110014067A (ko) 스테레오 컨텐트의 변환 방법 및 시스템
WO2023241298A1 (zh) 一种视频生成方法、装置、存储介质及电子设备
WO2023066173A1 (zh) 图像处理方法、装置及存储介质、电子设备
CN114782864B (zh) 一种信息处理方法、装置、计算机设备及存储介质
CN113343878A (zh) 基于生成对抗网络的高保真人脸隐私保护方法和系统
CA3173542A1 (en) Techniques for re-aging faces in images and video frames
WO2020087434A1 (zh) 一种人脸图像清晰度评价方法及装置
Chen et al. Sound to visual: Hierarchical cross-modal talking face video generation
JP2002245455A (ja) 多変量空間処理方法および装置
US6931145B1 (en) Method and apparatus for measuring motion of an object surface by multi-resolution analysis using a mesh model
CN116630599A (zh) 一种生成牙齿正畸后预测照片的方法
CN110298229B (zh) 视频图像处理方法及装置
Koumparoulis et al. Audio-assisted image inpainting for talking faces
EP3809372B1 (en) Method of real-time generation of 3d imaging

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23822868

Country of ref document: EP

Kind code of ref document: A1