WO2025209111A1 - 视频生成模型的训练方法、装置、设备、存储介质和产品 - Google Patents

视频生成模型的训练方法、装置、设备、存储介质和产品

Info

Publication number
WO2025209111A1
WO2025209111A1 PCT/CN2025/081595 CN2025081595W WO2025209111A1 WO 2025209111 A1 WO2025209111 A1 WO 2025209111A1 CN 2025081595 W CN2025081595 W CN 2025081595W WO 2025209111 A1 WO2025209111 A1 WO 2025209111A1
Authority
WO
WIPO (PCT)
Prior art keywords
sample
video
speech
pairs
generation model
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
Application number
PCT/CN2025/081595
Other languages
English (en)
French (fr)
Inventor
杨培基
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology (Shenzhen) Co Ltd
Original Assignee
Tencent Technology (Shenzhen) Co Ltd
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 Tencent Technology (Shenzhen) Co Ltd filed Critical Tencent Technology (Shenzhen) Co Ltd
Publication of WO2025209111A1 publication Critical patent/WO2025209111A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81—Monomedia components thereof
    • H04N21/816—Monomedia components thereof involving special video data, e.g 3D video
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00—Machine learning
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00—Computing arrangements based on biological models
    • G06N3/02—Neural networks
    • G06N3/04—Architecture, e.g. interconnection topology
    • G06N3/044—Recurrent networks, e.g. Hopfield networks
    • G06N3/0442—Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00—Computing arrangements based on biological models
    • G06N3/02—Neural networks
    • G06N3/04—Architecture, e.g. interconnection topology
    • G06N3/0464—Convolutional networks [CNN, ConvNet]
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00—Computing arrangements based on biological models
    • G06N3/02—Neural networks
    • G06N3/08—Learning methods
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00—Animation
    • G06T13/20—Three-dimensional [3D] animation
    • G06T13/205—Three-dimensional [3D] animation driven by audio data
    • G—PHYSICS
    • G10—MUSICAL INSTRUMENTS; ACOUSTICS
    • G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00—Speech recognition
    • G10L15/02—Feature extraction for speech recognition; Selection of recognition unit
    • G—PHYSICS
    • G10—MUSICAL INSTRUMENTS; ACOUSTICS
    • G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00—Speech recognition
    • G10L15/06—Creation of reference templates; Training of speech recognition systems, e.g. adaptation to the characteristics of the speaker's voice
    • G10L15/063—Training
    • G—PHYSICS
    • G10—MUSICAL INSTRUMENTS; ACOUSTICS
    • G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00—Speech recognition
    • G10L15/08—Speech classification or search
    • G10L15/16—Speech classification or search using artificial neural networks
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302—Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307—Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43072—Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of multiple content streams on the same device
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439—Processing of audio elementary streams
    • H04N21/4394—Processing of audio elementary streams involving operations for analysing the audio stream, e.g. detecting features or characteristics in audio streams
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45—Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/466—Learning process for intelligent management, e.g. learning user preferences for recommending movies
    • H04N21/4662—Learning process for intelligent management, e.g. learning user preferences for recommending movies characterized by learning algorithms
    • H04N21/4666—Learning process for intelligent management, e.g. learning user preferences for recommending movies characterized by learning algorithms using neural networks, e.g. processing the feedback provided by the user

Definitions

  • the present application relates to the field of artificial intelligence technology, and in particular to a training method, apparatus, device, storage medium and product for a video generation model.
  • voice-driven 3D (Threee Dimensions) facial technology has been increasingly used in various fields.
  • This technology converts speech into 3D facial expressions that are relevant to the spoken content.
  • This technology has applications in areas such as voice assistants and virtual objects, for example, synchronizing facial expressions with speech.
  • the phoneme-viseme method when generating facial expressions based on speech, the phoneme-viseme method is usually used. For example, a correspondence between phonemes and visemes in speech is established, and facial expressions are generated based on this correspondence.
  • Phonemes are the smallest pronunciation units with distinctive meanings in human language, while visemes are phonemes presented in a visual way, used to depict the mouth posture when pronouncing a word.
  • the embodiments of the present application provide a method, apparatus, device, storage medium, and product for training a video generation model, which can generate facial expressions for virtual objects based on speech that accurately match the speech content.
  • the technical solutions provided by this application are as follows.
  • each first sample pair including a first sample voice and a first sample video corresponding to the first sample voice, wherein the facial expression of the virtual object in the first sample video matches the voice content of the first sample voice;
  • the video generation model is trained based on the predicted video and the first sample video corresponding to the first sample speech of each of the at least two first sample pairs.
  • a training apparatus for a video generation model comprising:
  • An acquisition module is configured to acquire at least two first sample pairs, each first sample pair comprising a first sample voice and a first sample video corresponding to the first sample voice, wherein the facial expression of the virtual object in the first sample video matches the voice content of the first sample voice;
  • a processing module configured to determine, by means of a video generation model, a predicted video corresponding to the first sample speech of each of the at least two first sample pairs based on the first sample speech of each of the at least two first sample pairs, wherein the video generation model is configured to generate a video based on speech;
  • a computer device which includes a processor and a memory, wherein the memory is used to store at least one program, and the at least one program is loaded and executed by the processor to implement the training method of the video generation model in the embodiment of the present application.
  • a computer-readable storage medium in which at least one program is stored.
  • the at least one program is loaded and executed by a processor to implement the training method of the video generation model in the embodiment of the present application.
  • the embodiment of the present application provides a method for training a video generation model, which trains the video generation model based on sample speech and sample videos corresponding to the sample speech, wherein the facial expressions of the virtual object in the sample video match the speech content of the sample speech, and then continuously trains the video generation model with the sample video as the target, so that the video generation model can gradually learn how to more accurately generate facial expressions that accurately match the speech content based on the speech.
  • the video generation model trained in this way can generate a video synchronized with the speech, and in the video, the facial expressions of the virtual object accurately match the speech content, that is, using the trained video generation model, it is possible to generate facial expressions that accurately match the speech content for the virtual object based on the speech.
  • the trained video generation model when applied to a virtual human live broadcast scene, it can generate more natural and accurate facial expressions for the virtual human, improving the user experience.
  • generating facial expressions based on the video generation model can improve the convenience and efficiency of generating facial expressions.
  • FIG1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
  • FIG3 is a flowchart of another method for training a video generation model provided in an embodiment of the present application.
  • FIG4 is a flowchart of another method for training a video generation model provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of an expansion of model training data provided in an embodiment of the present application.
  • FIG7 is a schematic diagram of an application scenario of a video generation model provided in an embodiment of the present application.
  • FIG8 is a flowchart of a virtual human live broadcast scenario provided by an embodiment of the present application.
  • FIG9 is a schematic diagram of a game interface provided in an embodiment of the present application.
  • FIG10 is a schematic diagram of enhancing a sample video frame provided in an embodiment of the present application.
  • FIG11 is a training flowchart of a sample video processing model provided in an embodiment of the present application.
  • FIG12 is a flowchart of obtaining training data provided in an embodiment of the present application.
  • Figure 13 is a schematic diagram of a training device for a video generation model provided in an embodiment of the present application.
  • FIG14 is a block diagram of a terminal provided in an embodiment of the present application.
  • FIG15 is a block diagram of a server provided in an embodiment of the present application.
  • the information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
  • the sample pairs involved in this application were all obtained with full authorization.
  • AI Artificial Intelligence
  • AI refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
  • AI is a comprehensive field of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence.
  • AI studies the design principles and implementation methods of various intelligent machines, enabling them to perceive, reason, and make decisions.
  • AI technology is an ispecialized discipline encompassing a wide range of fields, encompassing both hardware and software technologies.
  • Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating/interaction systems, and mechatronics.
  • Pre-trained models also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI domains.
  • AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning/deep learning.
  • Machine Learning is a multidisciplinary interdisciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithmic complexity theory, and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.
  • Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence.
  • Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning. Pre-trained models are the latest development in deep learning and integrate the above technologies.
  • ASR automatic speech recognition
  • TTS text-to-speech
  • voiceprint recognition Enabling computers to hear, see, speak, and feel is the future direction of human-computer interaction, with speech becoming one of the most promising methods of human-computer interaction.
  • Large model technology is revolutionizing the development of speech technology. For example, pre-trained models based on the Transformer architecture possess strong generalization and versatility, enabling them to effectively handle a wide range of speech processing tasks.
  • Natural Language Processing is an important field in the fields of computer science and artificial intelligence. It studies various theories and methods that can enable effective communication between humans and computers using natural language. Natural language processing involves natural language, which is the language people use in daily life and is closely related to linguistic research. It also involves computer science and mathematics, and is an important technology for model training in the field of artificial intelligence.
  • the pre-trained model is developed from the large language model (Large Language Model) in the field of NLP. After fine-tuning, the large language model can be widely used in downstream tasks.
  • Natural language processing technology generally includes text processing, semantic understanding, machine translation, robot question answering, knowledge graphs and other technologies.
  • the video generation model training method provided in the embodiment of the present application can be executed by a computer device, which can be provided as a server or a terminal.
  • a computer device which can be provided as a server or a terminal.
  • the following is a schematic diagram of the implementation environment of the video generation model training method provided in the embodiment of the present application.
  • the terminal 101 is embedded with a trained video generation model, and the terminal 101 generates a video based on speech through the video generation model. In other embodiments, the terminal 101 generates a video based on speech through the video generation model on the server 102.
  • a video refers to a series of continuous image frames.
  • a video is a playable video obtained by recording a real object.
  • a video is a 3D animation that can be rendered to output a series of continuous image frames and played in sequence. This application does not limit this.
  • FIG. 2 is a flowchart of a training method for a video generation model provided in an embodiment of the present application.
  • the method is executed by a computer device and includes the following steps.
  • the first sample video includes a virtual object
  • the virtual object emits a first sample voice and has a facial expression that matches the voice content of the first sample voice.
  • a virtual object refers to an movable object in a virtual environment, and the movable object can be a virtual character, a virtual animal, an animated character, etc., but is not limited thereto.
  • a virtual object has its own shape and volume in a virtual environment and occupies a part of the space in the virtual environment.
  • a virtual environment refers to an environment provided (or displayed) when an application is running on a terminal device, and the virtual environment can be a two-dimensional virtual environment, a 2.5-dimensional virtual environment, or a three-dimensional virtual environment, etc. Exemplarily, when the virtual environment is a three-dimensional virtual environment, the virtual object is a three-dimensional model created based on animation skeleton technology.
  • matching facial expressions with speech content means that facial expressions match at least one of the pronunciation, tone, speech speed, and emotional state of the speech content.
  • the pronunciation of the speech content matches the lip shape of the facial expression.
  • a serious tone matches a serious facial expression
  • a humorous tone matches a humorous facial expression.
  • the slower the speech speed the smoother the facial expression.
  • the emotional state refers to the emotional state expressed by the speech content, and the emotional state can be determined by at least one of the modal particles, tone, and speech speed in the speech content; for example, if the emotional state is happy, the matching facial expression is happy, and if the emotional state is sad, the matching facial expression is sad.
  • a computer device can render based on a first sample video to display the first sample video on the computer device.
  • the first sample video includes at least two sample video frames, and rendering is performed based on the at least two sample video frames to display the first sample video including the at least two sample video frames.
  • a computer device iteratively trains a video generation model based on at least two first samples for respective predicted videos and first sample videos until a preset requirement is met.
  • Meeting the preset requirement may mean that the loss value between the predicted video and the first sample video converges, or that the loss value reaches a preset threshold, or that the number of iterations reaches a preset number, which are not specifically limited herein.
  • the second sample video includes an object.
  • the second sample video corresponding to the second sample voice may be a video recorded when the object speaks, and the video includes the object's facial expression, and the second sample voice is the voice recorded by the object.
  • the objects in the second sample videos of at least two second sample pairs can be the same object, thereby improving the convenience of obtaining at least two second sample pairs.
  • the objects in the second sample videos of at least two second sample pairs can be different objects, thereby improving the diversity of samples.
  • the second sample voices of at least two second sample pairs can be different, and accordingly, the second sample videos of at least two second sample pairs can be different, thereby improving the diversity of samples.
  • the computer device determines, through a sample video processing model, the processed second sample videos corresponding to at least two second sample pairs based on the respective second sample videos of at least two second sample pairs, wherein the sample video processing model is used to generate a sample video including a virtual object based on a sample video including an object.
  • the second sample video in the second sample pair is processed by the sample video processing model to obtain a processed second sample video.
  • the facial expression of the virtual object in the processed second sample video matches the facial expression of the object in the second sample video before processing. That is, the processed second sample video contains a virtual object, and the virtual object not only corresponds to the object in the second sample video, but also has the same facial expression as the object in the second sample video.
  • the training process of the sample video processing model is shown in the embodiment of FIG4 , and will not be described in detail here.
  • step 302 taking the sample video frame in the second sample video as the first sample video frame as an example (other naming methods may also be used, which is not limited to this), accordingly, the computer device executes step 302, including the following steps:
  • the computer device determines, through the sample video processing model, the processed first sample video frames corresponding to each of the at least two first sample video frames in the second sample video in the second sample pair; and determines the processed second sample videos corresponding to each of the at least two second sample pairs based on the processed first sample video frames corresponding to each of the at least two second sample pairs.
  • This process is that, for any second sample video in a second sample pair, the computer device processes each sample video frame in the second sample video separately through the sample video processing model to obtain a processed sample video frame corresponding to each sample video frame, thereby converting each sample video frame including an object into a sample video frame including a virtual object.
  • the sample video processing model is configured to generate sample video frames including a virtual object based on sample video frames including an object.
  • the virtual object not only corresponds to the object in the sample video frames including the object, but also has the same facial expression as the object.
  • the sample video processing model can generate the facial expression of the virtual object based on the facial expression of the real object, thereby achieving the simulation of the facial expression of the real object by the virtual object.
  • a process in which a computer device determines processed second sample videos corresponding to at least two second sample pairs based on processed first sample video frames corresponding to the at least two second sample pairs includes the following steps:
  • the computer device arranges the processed first sample video frames in ascending order of sampling time based on the sampling time sequence of at least two first sample video frames in the second sample video of the second sample pair, thereby obtaining a processed second sample video. Furthermore, the data format of each processed first sample video frame is a vector, and the data format of the processed second sample video is a matrix. The at least two vectors are arranged in ascending order of sampling time of the at least two first sample video frames, thereby obtaining a processed second sample video.
  • the second sample video includes a real object
  • the computer device processes the sample video frames in the second sample video using the sample video processing model to obtain a processed sample video frame corresponding to each sample video frame, thereby obtaining a processed second sample video.
  • This second sample video includes a 3D virtual object, thereby expanding the training data of the video generation model.
  • the computer device determines at least two first sample pairs based on the second sample voices of the at least two second sample pairs and the processed second sample videos corresponding to the at least two second samples.
  • each first sample pair includes a first sample voice and a first sample video corresponding to the first sample voice, and the facial expression of the virtual object in the first sample video matches the voice content of the first sample voice.
  • This process means that after obtaining the second sample pair, the computer device can enhance the second sample speech in the second sample pair, and use the enhanced second sample speech as the first sample speech to participate in the training process of the video generation model, or use the second sample speech before enhancement (that is, the original second sample speech) as the first sample speech to participate in the training process of the video generation model.
  • the computer device enhances the second sample voices of at least two second sample pairs to obtain at least two enhanced second sample voices, including at least one of the following: the computer device adjusts the pitch of the second sample voices of at least two second sample pairs to obtain at least two enhanced second sample voices; the computer device adds reverberation to the second sample voices of at least two second sample pairs to obtain at least two enhanced second sample voices; the computer device adds noise to the second sample voices of at least two second sample pairs to obtain at least two enhanced second sample voices.
  • adjusting the pitch of a sample speech refers to adjusting at least one of the frequency and volume of the sample speech, such as increasing or decreasing the frequency of the sample speech, increasing or decreasing the volume of the sample speech, etc.
  • a computer device adjusts the pitch of the sample speech using a pitch adjustment device, which is a device used to adjust pitch.
  • Adding reverberation to the sample speech refers to adding an acoustic effect that simulates multiple reflections of sound within a closed or semi-enclosed space. For example, reverberation in at least two different scenarios can be added to the sample speech to further increase the diversity of the sample. The at least two different scenarios can be indoors, outdoors, etc.
  • Adding noise to the sample speech refers to adding different types of chaotic sound signals to the sample speech. For example, at least two different types of noise are added to the sample speech to further increase the diversity of the sample.
  • the different types of noise can be Gaussian noise, white noise, impulse noise, etc.
  • the aforementioned methods for enhancing the sample speech can be freely combined, such as adding at least one of reverberation and noise to the pitch-adjusted sample speech to further increase sample diversity.
  • the aforementioned methods are merely optional implementations of enhancing the sample speech.
  • the computer device can also enhance the sample speech through other optional implementations, which will not be detailed here.
  • the sample is expanded without changing the speech content of the sample speech.
  • the above-mentioned enhancement methods are highly convenient, thereby improving the efficiency of enhancing the sample speech.
  • the process of obtaining at least two first sample pairs is implemented through the above steps 301-303.
  • the sample video in the sample speech-sample video including the object i.e., the second sample pair
  • the sample video processing model to obtain a sample video including the virtual object (i.e., the processed sample video). Since the sample speech is synchronized with the sample video including the object, the sample video including the virtual object synchronized with the sample speech is obtained, and then the parallel data of the sample speech-sample video including the virtual object is obtained.
  • the computer device processes the first sample speech in each first sample pair using a video generation model to obtain a predicted video corresponding to the first sample speech, including the following steps:
  • a represents a speech frame
  • y represents a video frame.
  • T represents the number of samples of the second speech sample. For example, at 16 kHz, the number of samples per second is 16,000.
  • M represents the number of video frames in the predicted video. For example, one second of the predicted video contains 50 video frames.
  • the computer device enhances the second sample speech through the data enhancement module to obtain the enhanced second sample speech, that is, the first sample speech.
  • This process can be expressed by the following formula (1).
  • A′ aug a (A) (1).
  • the feature extraction module in the video generation model is a wav2vec2 module (a speech feature extraction module).
  • the first sample speech is input into the feature extraction module to obtain speech features.
  • This process can be expressed by the following formula (2).
  • H c wav2vec2(A′) (2).
  • H c represents the speech feature
  • M represents the number of video frames in the predicted video
  • the speech feature includes at least two speech sub-features
  • the at least two speech sub-features correspond one-to-one to at least two video frames.
  • wav2vec2(A′) represents the speech feature extracted from A′.
  • extracting speech features through the wav2vec2 module is only an optional implementation method.
  • the computer device can also extract speech features through other models, which will not be repeated here.
  • the attention features in the video generation model can be single-head attention features or multi-head attention features, and can be self-attention features or cross-attention features.
  • the attention module is a multi-layer FFT (Feed Forward Transformer) module.
  • the speech features are input into the attention module to extract new deep features of the speech features and obtain attention features. This process can be expressed by the following formula (3).
  • H d FFT(H c ) (3).
  • Hd represents the attention feature
  • FFT( Hc ) represents the attention feature of the extracted speech feature Hc .
  • the original sample speech (that is, the second sample speech) is first enhanced to obtain an enhanced sample speech (that is, the first sample speech), and the enhanced sample speech is processed by the wav2vec2 module in the video generation model to obtain speech features, and the speech features are processed by the N-layer FFT module in the video generation model to obtain attention features, where N is an integer greater than 1.
  • the attention features are processed by the linear prediction layer in the video generation model to obtain a predicted video.
  • the FFT module includes a multi-head attention unit and a convolution layer, and the speech features are processed by the multi-head attention unit and the convolution layer in turn to obtain attention features.
  • the computer device trains a video generation model based on the predicted video and the first sample video corresponding to the first sample speech of each of the at least two first sample pairs.
  • the computer device determines, for each first sample pair, a loss value between the predicted video of the first sample pair and the first sample video, and adjusts model parameters of the video generation model based on the loss value of each first sample pair.
  • the predicted video includes at least two predicted video frames
  • the first sample video includes at least two sample video frames
  • the at least two predicted video frames correspond one-to-one to the at least two sample video frames
  • the computer device trains the video generation model based on the predicted video and the first sample video of the at least two first samples, including the following steps:
  • the number of the at least two predicted video frames is the same as the number of the at least two sample video frames, and the at least two predicted video frames and the at least two sample video frames correspond one to one according to sampling time, that is, one predicted video frame corresponds to one sample video frame.
  • a loss value is comprehensively determined based on the difference between at least two predicted video frames in the predicted video and at least two sample video frames in the first sample video, so that the loss value is more accurate and comprehensive, and then the model parameters are adjusted based on the loss value, so that the adjustment of the model parameters is more accurate, thereby improving the model training efficiency.
  • the loss value is an L2 loss value
  • the process can be expressed by the following formula (5).
  • L
  • the trained video generation model is used to generate a video based on speech, and the facial expressions of the virtual objects in the video match the speech content of the speech.
  • the method provided by the embodiments of the present application is used in game NPC (Non-Player Character) scenarios.
  • the game object can have a conversation with the virtual object in the game, and the corresponding conversation content is sent to the conversation generation service through the game client to generate a response conversation.
  • the conversation generates speech through the speech synthesis module, and the speech is synthesized by the speech synthesis module, and then sent to the video generation module in the voice-driven facial service (implemented by the same video generation model in this application), and then the video generation module is used to obtain a video synchronized with the speech.
  • the video is rendered by the engine to display the video.
  • the present embodiment utilizes a sample video processing model to expand the parallel data of sample speech and sample video, including objects. This expands the sample pairs used to train the video generation model, reducing the data cost required for training. Furthermore, combined with speech enhancement technology, this improves the model's generalizability when the amount of training data is insufficient.
  • a sample video in a sample video including a sample speech and an object is processed by a sample video processing model to obtain a processed sample video. Since the sample speech is synchronized with the sample video including the object, a sample video including a virtual object that is synchronized with the sample speech is obtained, thereby obtaining parallel data of the sample speech and the sample video including the virtual object.
  • These data are used to train a video generation model for generating videos based on speech, thereby improving the efficiency of obtaining training data for the video generation model, thereby improving the training efficiency of the video generation model, and since the cost of obtaining training data for the video generation model is reduced, the training cost of the video generation model is reduced.
  • FIG. 4 is a flowchart of a training method for a sample video processing model provided in an embodiment of the present application. The method is executed by a computer device and includes the following steps.
  • a computer device obtains at least two third sample pairs, each third sample pair including a second sample video frame and a third sample video frame, an object in the second sample video frame corresponds to a virtual object in the third sample video frame, and the object in the second sample video frame and the virtual object in the third sample video frame have the same facial expression.
  • the computer device enhances at least two fourth sample video frames included in each of the at least two third sample videos to obtain at least two enhanced fourth sample video frames, wherein the facial expression of the subject in each enhanced fourth sample video frame is the same as that in the fourth sample video frame before enhancement; and determines at least two third sample pairs based on the at least two fourth sample video frames included in each of the at least two third sample videos, the sample video frames including the virtual object corresponding to the at least two fourth sample video frames, the at least two enhanced fourth sample video frames, and the sample video frames including the virtual object corresponding to the at least two enhanced fourth sample video frames.
  • the second sample video frame included in each third sample pair is the fourth sample video frame before enhancement or the fourth sample video frame after enhancement, and each enhanced fourth sample video frame has the same sample video frame data as that corresponding to the fourth sample video frame before enhancement.
  • This process means that after the computer device obtains at least two third sample videos, it can enhance the sample video frames in the third sample videos, and use the enhanced sample video frames as the second sample video frames in the third sample pair to participate in the training process of the sample video processing model, or it can use the sample video frames before enhancement (that is, the original sample video frames) as the second sample video frames in the third sample pair to participate in the training process of the sample video processing model.
  • the diversity of samples is increased, and the sample video processing model is trained based on these multiple types of samples, which can improve the generalization of the sample video processing model.
  • the computer device enhances the at least two fourth sample video frames included in each of the at least two third sample videos to obtain at least two enhanced fourth sample video frames, including at least one of the following: the computer device rotates the at least two fourth sample video frames included in each of the at least two third sample videos to obtain at least two enhanced fourth sample video frames; the computer device grayscales the at least two fourth sample video frames included in each of the at least two third sample videos to obtain at least two enhanced fourth sample video frames.
  • the aforementioned methods for enhancing the sample video frames can be freely combined, such as grayscale conversion of the rotated sample video frames to obtain enhanced sample video frames.
  • the aforementioned methods are merely optional implementations of enhancing the sample video frames.
  • the computer device can also enhance the sample video frames using other optional implementations, which will not be detailed here.
  • the sample is expanded without changing the facial expression of the object in the sample video frame, and the above-mentioned enhancement methods are highly convenient, thereby improving the efficiency of enhancing the sample video frame.
  • the computer device processes the second sample video frame in each third sample pair using the sample video processing model to obtain a processed second sample video frame, including the following steps: the computer device processes the second sample video frame in each third sample pair using the feature extraction module in the sample video processing model to obtain video frame features of the second sample video frame, wherein the feature extraction module is used to extract video frame features.
  • the computer device processes the video frame features using the regression module in the sample video processing model to obtain a processed second sample video frame, wherein the regression module is used to generate a processed video frame based on the video frame features.
  • step 402 is described below with reference to formulas (6) to (8) and taking the second sample video frame in the third sample pair as the enhanced fourth sample video frame as an example.
  • the computer device enhances the fourth sample video frame in the third sample video to obtain an enhanced fourth sample video frame, which is also the second sample video frame in the third sample pair.
  • This process can be expressed by the following formula (6).
  • x′ aug img (x) (6).
  • the feature extraction module is a ResNet network.
  • the second sample video frame is input into the feature extraction module to obtain video frame features.
  • This process can be expressed by the following formula (7).
  • h img ResNet(x′) (7).
  • h img represents the video frame feature
  • ResNet(x′) represents the feature of the second sample video frame x′ extracted through the ResNet network.
  • the input video frame of the ResNet network has a preset resolution, such as a preset resolution of 256 ⁇ 256. Therefore, before the second sample video frame is input into the ResNet network, the second sample video frame is cropped into a sample video frame with a resolution of 256 ⁇ 256.
  • the regression module is a fully connected layer, which is used to perform nonlinear transformation on the video frame features to obtain processed sample video frames.
  • This process can be implemented by the following formula (8).
  • y′ Linear(hi img ) (8).
  • y′ represents the processed sample video frame
  • Linear(h img ) represents the nonlinear transformation of the video frame feature h img .
  • the computer device trains a sample video processing model based on the processed second sample video frames corresponding to the at least two third sample pairs and the third sample video frames corresponding to the at least two third sample pairs.
  • the computer device determines, for each third sample pair, a loss value between the processed second sample video frame and the third sample video frame of the third sample pair, and adjusts model parameters of the sample video processing model based on the loss value.
  • the computer device adjusts the model parameters of the sample video processing model based on the loss value of the third sample video frame and the processed second sample video frame of a third sample pair.
  • the processed second sample video frame of the third sample pair used in this iteration is predicted based on the adjusted sample video processing model, and the model parameters of the sample video processing model are adjusted based on the loss value between the processed second sample video frame and the third sample video frame.
  • FIG 11 is a training flow chart of a sample video processing model provided in an embodiment of the present application.
  • the original sample video frame containing the object is first enhanced to obtain an enhanced sample video frame.
  • the enhanced sample video frame is then processed by the ResNet network in the sample video processing model to obtain video frame features.
  • the video frame features are then processed by the regression module in the sample video processing model to obtain a sample video frame containing the virtual object.
  • the computer device can also use the sample speech and the processed sample video as a group of first sample pairs to improve data utilization.
  • execution entity of the training video generation model and the execution entity of the training sample video processing model can be the same or different, and there is no limitation here.
  • FIG13 is a block diagram of a training device for a video generation model according to an embodiment of the present application.
  • the device includes:
  • the training module 1303 is configured to train the video generation model based on the predicted video and the first sample video corresponding to the respective first sample voices of at least two first sample pairs.
  • the acquisition module 1301 is configured to:
  • the first sample speech in each first sample pair is the second sample speech before enhancement or the second sample speech after enhancement, and each second sample speech after enhancement is the same as the second sample video corresponding to the second sample speech before enhancement.
  • the acquisition module 1301 is configured to perform at least one of the following:
  • the training module 1303 is further configured to:
  • Grayscale is performed on the at least two fourth sample video frames included in each of the at least two third sample videos to obtain at least two enhanced fourth sample video frames.
  • model parameters of the video generation model are adjusted.
  • the trained video generation model when applied to a virtual human live broadcast scene, it can generate more natural and accurate facial expressions for the virtual human, improving the user experience.
  • generating facial expressions based on the video generation model can improve the convenience and efficiency of generating facial expressions.
  • the terminal 1400 includes a processor 1401 and a memory 1402 .
  • the processor 1401 may include one or at least two processing cores, such as a quad-core processor or an octa-core processor.
  • the processor 1401 may be implemented in at least one hardware form selected from the group consisting of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array).
  • the processor 1401 may also include a main processor and a coprocessor.
  • the main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state.
  • the processor 1401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen.
  • the processor 1401 may also include an AI (Artificial Intelligence) processor, which is used to handle computing operations related to machine learning.
  • AI Artificial Intelligence
  • the memory 1402 may include one or at least two computer-readable storage media, which may be non-transitory.
  • the memory 1402 may also include a high-speed random access memory and a non-volatile memory, such as one or at least two disk storage devices, flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 1402 is used to store at least one program, which is executed by the processor 1401 to implement the training method of the video generation model provided in the method embodiment of the present application.
  • the peripheral device interface 1403 can be used to connect at least one I/O (Input/Output)-related peripheral device to the processor 1401 and the memory 1402.
  • the processor 1401, the memory 1402, and the peripheral device interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1401, the memory 1402, and the peripheral device interface 1403 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
  • Such wireless communication protocols include, but are not limited to, the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and/or a WiFi (Wireless Fidelity) network.
  • the radio frequency circuit 1404 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
  • Power supply 1408 is used to power various components in terminal 1400.
  • Power supply 1408 can be AC power, DC power, a disposable battery, or a rechargeable battery.
  • the rechargeable battery can be wired or wirelessly rechargeable. A wired rechargeable battery is charged via a wired line, while a wireless rechargeable battery is charged via a wireless coil.
  • the rechargeable battery can also support fast charging technology.
  • Accelerometer 1410 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by terminal 1400.
  • accelerometer 1410 can be used to detect the components of gravity acceleration along the three coordinate axes.
  • Processor 1401 can control display screen 1405 to display the user interface in either a landscape or portrait view based on the gravity acceleration signal collected by accelerometer 1410.
  • Accelerometer 1410 can also be used to collect game or user motion data.
  • the gyroscope sensor 1411 can detect the orientation and rotation angle of the terminal 1400. It can also work with the accelerometer 1410 to collect the user's 3D movements on the terminal 1400. Based on the data collected by the gyroscope sensor 1411, the processor 1401 can implement the following functions: motion sensing (for example, changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
  • the pressure sensor 1412 can be provided on the side frame of the terminal 1400 and/or below the display screen 1405.
  • the processor 1401 can perform left-hand or right-hand recognition or shortcut operations based on the gripping signal collected by the pressure sensor 1412.
  • the processor 1401 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 1405.
  • Operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
  • Optical sensor 1413 is used to detect ambient light intensity.
  • processor 1401 can control the display brightness of display screen 1405 based on the ambient light intensity detected by optical sensor 1413. Specifically, when the ambient light intensity is high, the display brightness of display screen 1405 is increased; when the ambient light intensity is low, the display brightness of display screen 1405 is decreased.
  • processor 1401 can also dynamically adjust the shooting parameters of camera assembly 1406 based on the ambient light intensity detected by optical sensor 1413.
  • Proximity sensor 1414 also known as a distance sensor, is typically located on the front panel of terminal 1400. Proximity sensor 1414 is used to detect the distance between the user and the front of terminal 1400. In one embodiment, when proximity sensor 1414 detects that the distance between the user and the front of terminal 1400 is gradually decreasing, processor 1401 controls display screen 1405 to switch from the screen-on state to the screen-off state. When proximity sensor 1414 detects that the distance between the user and the front of terminal 1400 is gradually increasing, processor 1401 controls display screen 1405 to switch from the screen-off state to the screen-on state.
  • FIG14 does not constitute a limitation on the terminal 1400 , and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
  • the computer program product involved in the embodiments of the present application can be deployed and executed on a computer device, or on at least two computer devices located at one location, or on at least two computer devices distributed at at least two locations and interconnected through a communication network. At least two computer devices distributed at at least two locations and interconnected through a communication network can constitute a blockchain system.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

一种视频生成模型的训练方法、装置、设备、存储介质和产品,属于人工智能技术领域。方法包括:获取至少两个第一样本对,第一样本对包括第一样本语音和第一样本语音对应的第一样本视频,第一样本视频中虚拟对象的面部表情与第一样本语音的语音内容匹配(201);通过视频生成模型,基于至少两个第一样本对各自的第一样本语音,确定至少两个第一样本对各自的第一样本语音所对应的预测视频(202);基于至少两个第一样本对各自对应的预测视频和第一样本视频,训练视频生成模型(203)。通过该方法训练得到的视频生成模型可以基于语音为虚拟对象生成与语音内容精准匹配的面部表情。

Description

视频生成模型的训练方法、装置、设备、存储介质和产品
本申请要求于2024年04月02日提交的申请号为202410395181.6、发明名称为“视频生成模型的训练方法、装置、设备、存储介质和产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,特别涉及一种视频生成模型的训练方法、装置、设备、存储介质和产品。
背景技术
近年来,语音驱动3D(Three Dimensions,三维)面部技术在各个领域的应用越来越广泛。语音驱动3D面部技术是指将语音转换成与语音内容相关的3D面部表情,这项技术可以应用于语音助手、虚拟对象等领域,例如,令虚拟对象的面部表情与语音同步。
相关技术中,在基于语音生成面部表情时,通常采用音视素的方法。例如,建立语音中的音素与视素之间的对应关系,通过该对应关系来生成面部表情。其中,音素是人类语言中具有区别意义的最小发音单位,视素则是以视觉方式呈现出的音素,用于描绘发音时的嘴部姿态。但是音素与视素之间并不是一一对应的关系,如不同的音素对应相同的视素,进而基于不同的语音会生成相同的面部表情,导致面部表情与语音之间的匹配度较低。
发明内容
本申请实施例提供了一种视频生成模型的训练方法、装置、设备、存储介质和产品,能够基于语音为虚拟对象生成与语音内容精准匹配的面部表情。本申请提供的技术方案如下。
一方面,提供了一种视频生成模型的训练方法,由计算机设备执行,所述方法包括:
获取至少两个第一样本对,每个第一样本对包括第一样本语音和第一样本语音对应的第一样本视频,第一样本视频中虚拟对象的面部表情与第一样本语音的语音内容匹配;
通过视频生成模型,基于所述至少两个第一样本对各自的第一样本语音,确定所述至少两个第一样本对各自的第一样本语音所对应的预测视频,所述视频生成模型用于基于语音生成视频;
基于所述至少两个第一样本对各自的第一样本语音所对应的预测视频和第一样本视频,训练所述视频生成模型。
另一方面,提供了一种视频生成模型的训练装置,所述装置包括:
获取模块,用于获取至少两个第一样本对,每个第一样本对包括第一样本语音和第一样本语音对应的第一样本视频,第一样本视频中虚拟对象的面部表情与第一样本语音的语音内容匹配;
处理模块,用于通过视频生成模型,基于所述至少两个第一样本对各自的第一样本语音,确定所述至少两个第一样本对各自的第一样本语音所对应的预测视频,所述视频生成模型用于基于语音生成视频;
训练模块,用于基于所述至少两个第一样本对各自的第一样本语音所对应的预测视频和第一样本视频,训练所述视频生成模型。
另一方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器用于存储至少一段程序,所述至少一段程序由所述处理器加载并执行以实现本申请实施例中的视频生成模型的训练方法。
另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一段程序,所述至少一段程序由处理器加载并执行以实现本申请实施例中的视频生成模型的训练方法。
另一方面,提供了一种计算机程序产品,所述计算机程序产品包括至少一段程序,所述至少一段程序存储在计算机可读存储介质中,计算机设备的处理器从所述计算机可读存储介质读取所述至少一段程序,所述处理器执行所述至少一段程序,使得所述计算机设备执行上述任一实现方式所述的视频生成模型的训练方法。
本申请实施例提供了一种视频生成模型的训练方法,该方法基于样本语音和样本语音对应的样本视频来训练视频生成模型,其中,样本视频中虚拟对象的面部表情与样本语音的语音内容匹配,进而以样本视频为目标来不断训练视频生成模型,使得视频生成模型可以逐渐学习到如何更准确地根据语音生成与语音内容精准匹配的面部表情,通过这种方式训练得到的视频生成模型可以生成与语音同步的视频,并且,在该视频中,虚拟对象的面部表情与语音内容精准匹配,也即是,利用训练得到的视频生成模型,能够基于语音为虚拟对象生成与语音内容精准匹配的面部表情。比如说,将训练得到的视频生成模型应用于虚拟人直播场景时,能够为虚拟人生成更加自然、准确的面部表情,提升用户体验感。另外,基于视频生成模型来生成面部表情,能够提高生成面部表情的便捷性和效率。
附图说明
图1是本申请实施例提供的一种实施环境的示意图。
图2是本申请实施例提供的一种视频生成模型的训练方法的流程图。
图3是本申请实施例提供的另一种视频生成模型的训练方法的流程图。
图4是本申请实施例提供的再一种视频生成模型的训练方法的流程图。
图5是本申请实施例提供的一种模型训练数据的扩充示意图。
图6是本申请实施例提供的一种视频生成模型的训练流程图。
图7是本申请实施例提供的一种视频生成模型的应用场景示意图。
图8是本申请实施例提供的一种虚拟人直播场景的流程图。
图9是本申请实施例提供的一种游戏界面示意图。
图10是本申请实施例提供的一种对样本视频帧进行增强的示意图。
图11是本申请实施例提供的一种样本视频处理模型的训练流程图。
图12是本申请实施例提供的一种训练数据的获取流程图。
图13是本申请实施例提供的一种视频生成模型的训练装置的示意图。
图14是本申请实施例提供的一种终端的框图。
图15是本申请实施例提供的一种服务器的框图。
具体实施方式
需要说明的是,本申请所涉及的信息(包括但不限于用户设备信息、用户个人信息等)、数据(包括但不限于用于分析的数据、存储的数据、展示的数据等)以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。例如,本申请中涉及到的样本对都是在充分授权的情况下获取的。
以下,对本申请涉及的专业术语进行介绍:
人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。换句话说,人工智能是计算机科学的一个综合技术,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器。人工智能也就是研究各种智能机器的设计原理与实现方法,使机器具有感知、推理与决策的功能。人工智能技术是一门综合学科,涉及领域广泛,既有硬件层面的技术也有软件层面的技术。人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、预训练模型技术、操作/交互系统、机电一体化等。其中,预训练模型又称大模型、基础模型,经过微调后可以广泛应用于人工智能各大方向下游任务。人工智能软件技术主要包括计算机视觉技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。
机器学习(Machine Learning,ML)是一门多领域交叉学科,涉及概率论、统计学、逼近论、凸分析、算法复杂度理论等多门学科。专门研究计算机怎样模拟或实现人类的学习行为,以获取新的知识或技能,重新组织已有的知识结构使之不断改善自身的性能。机器学习是人工智能的核心,是使计算机具有智能的根本途径,其应用遍及人工智能的各个领域。机器学习和深度学习通常包括人工神经网络、置信网络、强化学习、迁移学习、归纳学习、示教式学习等技术。预训练模型是深度学习的最新发展成果,融合了以上技术。
语音技术(Speech Technology)的关键技术有自动语音识别技术(ASR,Automatic Speech Recognition)和语音合成技术(TTS,Text To Speech)以及声纹识别技术。让计算机能听、能看、能说、能感觉,是未来人机交互的发展方向,其中语音成为未来被看好的人机交互方式之一。大模型技术为语音技术发展带来变革,例如,沿用Transformer架构的预训练模型具有强大的泛化性、通用性,可以优秀完成各方向的语音处理任务。
自然语言处理(Nature Language Processing,NLP)是计算机科学领域与人工智能领域中的重要方向。它研究能实现人与计算机之间用自然语言进行有效通信的各种理论和方法。自然语言处理涉及自然语言,即人们日常使用的语言,与语言学研究密切;同时涉及计算机科学和数学,人工智能领域模型训练的重要技术,预训练模型,即是从NLP领域的大语言模型(Large Language Model)发展而来。经过微调,大语言模型可以广泛应用于下游任务。自然语言处理技术通常包括文本处理、语义理解、机器翻译、机器人问答、知识图谱等技术。
以下,对本申请涉及的实施环境进行介绍。
本申请实施例提供的视频生成模型的训练方法,能够由计算机设备执行,该计算机设备可以提供为服务器或终端。下面介绍一下本申请实施例提供的视频生成模型的训练方法的实施环境示意图。
参见图1,图1为本申请实施例提供的一种视频生成模型的训练方法的实施环境的示意图,该实施环境包括终端101和服务器102。终端101和服务器102能够通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。在一些实施例中,服务器102用于训练视频生成模型,训练得到的视频生成模型用于基于语音生成视频,视频中虚拟对象的面部表情与语音的语音内容匹配。终端101上安装有应用,该应用用于基于语音生成视频,进而显示视频。在一些实施例中,终端101上嵌入有训练得到的视频生成模型,终端101通过视频生成模型基于语音生成视频。在另一些实施例中,终端101通过服务器102上的视频生成模型来基于语音生成视频。在本申请中,视频是指一系列连续的图像帧,例如,视频是对真实对象进行录制得到的可播放视频,又例如,视频是能够经过渲染输出一系列连续的图像帧并按顺序播放的3D动画,本申请对此不进行限定。
在一些实施例中,终端101为智能手机、平板电脑、笔记本电脑、台式计算机、智能语音交互设备、智能家电、车载终端、飞行器、VR(Virtual Reality,虚拟现实)装置、AR(Augmented Reality,增强现实)装置等,但并不限于此。在一些实施例中,服务器102是独立的服务器也能够是至少两个服务器构成的服务器集群或者分布式系统,还能够是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network内容分发网络)以及大数据和人工智能平台等基础云计算服务的云服务器。在一些实施例中,服务器102主要承担计算工作,终端101承担次要计算工作;或者,服务器102承担次要计算服务,终端101承担主要计算工作;或者,服务器102和终端101二者之间采用分布式计算架构进行协同计算。
参见图2,图2为本申请实施例提供的一种视频生成模型的训练方法的流程图,该方法由计算机设备执行,包括以下步骤。
201、计算机设备获取至少两个第一样本对,每个第一样本对包括第一样本语音和第一样本语音对应的第一样本视频,第一样本视频中虚拟对象的面部表情与第一样本语音的语音内容匹配。
在本申请实施例中,第一样本视频包括虚拟对象,虚拟对象发出第一样本语音且具有与该第一样本语音的语音内容匹配的面部表情。虚拟对象是指在虚拟环境中的可活动对象,该可活动对象可以是虚拟人物、虚拟动物、动漫人物等,不限于此。虚拟对象在虚拟环境中具有自身的形状和体积,占据虚拟环境中的一部分空间。虚拟环境是指应用程序在终端设备上运行时提供(或显示)的环境,虚拟环境可以是二维虚拟环境、2.5维虚拟环境或者三维虚拟环境等。示例性地,当虚拟环境为三维虚拟环境时,虚拟对象是基于动画骨骼技术创建的三维立体模型。
在本申请实施例中,面部表情与语音内容匹配是指,面部表情与语音内容的发音、语气、语速、情绪状态等中的至少一项匹配。例如,语音内容的发音与面部表情的口型匹配。又例如,严肃的语气匹配严肃的面部表情,幽默的语气匹配诙谐的面部表情。再例如,语速越慢,匹配越平缓的面部表情。情绪状态指语音内容所表达的情绪状态,情绪状态可以通过语音内容中的语气词、声调和语速等中的至少一项确定;例如,情绪状态为开心,则匹配的面部表情为开心,情绪状态为伤心,则匹配的面部表情为伤心。
在本申请实施例中,计算机设备能够基于第一样本视频进行渲染以在计算机设备上显示第一样本视频。可选地,第一样本视频包括至少两个样本视频帧,进而基于该至少两个样本视频帧分别进行渲染,显示包括至少两个样本视频帧的第一样本视频。
在一些实施例中,虚拟对象的面部表情由虚拟对象面部的至少两个表情控制器的参数来控制。相应地,第一样本视频包括虚拟对象面部的至少两个表情控制器各自的参数。第一样本视频包括至少两个样本视频帧。例如,第一样本视频的数据形式为矩阵,矩阵中的每个向量分别为一个样本视频帧,每个向量的维数与表情控制器的数量相同,向量中每个维度的元素值分别代表一个表情控制器的参数,换言之,向量中每个维度的元素值所代表的表情控制器的参数共同构成了样本视频帧。在一些实施例中,虚拟对象为3D虚拟对象,则面部表情为3D面部表情,相应地,第一样本视频为3D面部动画视频。
202、计算机设备通过视频生成模型,基于至少两个第一样本对各自的第一样本语音,确定至少两个第一样本对各自的第一样本语音所对应的预测视频,视频生成模型用于基于语音生成视频。
在本申请实施例中,对于每个第一样本对,计算机设备通过视频生成模型对第一样本对中的第一样本语音进行处理,得到第一样本语音对应的预测视频,预测视频包括虚拟对象。视频生成模型的训练目标是根据语音生成视频且视频中虚拟对象的面部表情与语音内容匹配。
203、计算机设备基于至少两个第一样本对各自的第一样本语音所对应的预测视频和第一样本视频,训练视频生成模型。
在本申请实施例中,对于每个第一样本对,基于该第一样本对的预测视频与第一样本视频之间的损失值,来调整视频生成模型的模型参数。
在本申请实施例中,计算机设备基于至少两个第一样本对各自的预测视频和第一样本视频,对视频生成模型进行迭代训练,直到达到预设要求。其中,达到预设要求可以为预测视频与第一样本视频之间的损失值达到收敛,或损失值到达预设阈值,或迭代次数达到预设次数,在此不作具体限定。
本申请实施例提供了一种视频生成模型的训练方法,该方法基于样本语音和样本语音对应的样本视频训练视频生成模型,其中,样本视频中虚拟对象的面部表情与样本语音的语音内容匹配,进而以样本视频为目标来不断训练视频生成模型,使得视频生成模型可以逐渐学习到如何更准确地根据语音生成与语音内容精准匹配的面部表情,通过这种方式训练得到的视频生成模型可以生成与语音同步的视频,并且,该视频中虚拟对象的面部表情与语音内容精准匹配,也即是,利用训练得到的视频生成模型,能够基于语音为虚拟对象生成与语音内容精准匹配的面部表情。比如说,将训练得到的视频生成模型应用于虚拟人直播场景时,能够为虚拟人生成更加自然、准确的面部表情,提升用户体验感。另外,基于视频生成模型来生成面部表情,能够提高生成面部表情的便捷性和效率。
上述图2为视频生成模型的训练方法的基本流程,下面基于图3对视频生成模型的训练方法进行进一步介绍。参见图3,图3为本申请实施例提供的另一种视频生成模型的训练方法的流程图,该方法由计算机设备执行,该方法包括以下步骤。
301、计算机设备获取至少两个第二样本对,每个第二样本对包括第二样本语音和第二样本语音对应的第二样本视频,第二样本视频中对象的面部表情与第二样本语音的语音内容匹配。
在本申请实施例中,第二样本视频包括对象。可选地,第二样本语音对应的第二样本视频可以是该对象发出语音时录制的视频,且该视频包括对象的面部表情,该第二样本语音是录制的该对象发出的语音。
其中,第二样本视频中的对象可以为真实对象,便于获取第二样本视频。需要说明的是,获取对象的第二样本语音和第二样本视频是经过了对象的授权许可的。可选地,在对象使用的终端上显示授权界面,授权界面显示有提示信息、同意控件和不同意控件。提示信息用于提示获取对象的语音和视频,同意控件用于指示对象同意终端获取其语音和视频。响应于对同意控件的触发操作,获取对象的语音和视频。
其中,至少两个第二样本对各自的第二样本视频中的对象可以为同一对象,进而提高获取至少两个第二样本对的便捷性。至少两个第二样本对各自的第二样本视频中的对象可以为不同对象,进而提高样本的多样性。至少两个第二样本对各自的第二样本语音可以不同,相应地,至少两个第二样本对各自的第二样本视频不同,提高了样本的多样性。
302、计算机设备通过样本视频处理模型,基于至少两个第二样本对各自的第二样本视频,确定至少两个第二样本对各自对应的处理后的第二样本视频,样本视频处理模型用于基于包括对象的样本视频生成包括虚拟对象的样本视频。
在本申请实施例中,对于每个第二样本对,通过样本视频处理模型对第二样本对中的第二样本视频进行处理,得到处理后的第二样本视频。处理后的第二样本视频中虚拟对象的面部表情与处理前的第二样本视频中对象的面部表情匹配,也即是,处理后的第二样本视频包含有虚拟对象,且该虚拟对象不仅与第二样本视频中的对象对应,其面部表情还与第二样本视频中对象的面部表情相同。
其中,样本视频处理模型的训练过程参见图4的实施例,在此不再赘述。
在一些实施例中,以第二样本视频中的样本视频帧称为第一样本视频帧为例(也可以采用其他命名方式,对此不进行限定),相应地,计算机设备执行步骤302,包括以下步骤:
计算机设备对于每个第二样本对,通过样本视频处理模型,基于第二样本对中的第二样本视频中至少两个第一样本视频帧,确定至少两个第一样本视频帧各自对应的处理后的第一样本视频帧;基于至少两个第二样本对各自对应的处理后的第一样本视频帧,确定至少两个第二样本对各自对应的处理后的第二样本视频。
这一过程也即是,对于任意一个第二样本对中的第二样本视频,计算机设备通过样本视频处理模型,对该第二样本视频中每个样本视频帧分别进行处理,得到每个样本视频帧对应的处理后的样本视频帧,从而将每个包括对象的样本视频帧转换为包括虚拟对象的样本视频帧。
其中,样本视频处理模型用于基于包括对象的样本视频帧生成包括虚拟对象的样本视频帧,在包含有虚拟对象的样本视频帧中,虚拟对象不仅与包含有对象的样本视频帧中的对象对应,其面部表情还与对象的面部表情相同。比如说,在第二样本视频中的对象为真实对象的情况下,样本视频处理模型能够基于真实对象的面部表情生成虚拟对象的面部表情,实现虚拟对象对真实对象的面部表情的模拟。
在一些实施例中,计算机设备基于至少两个第二样本对各自对应的处理后的第一样本视频帧,确定至少两个第二样本对各自对应的处理后的第二样本视频的过程,包括以下步骤:
计算机设备基于第二样本对的第二样本视频中至少两个第一样本视频帧的采样时间顺序,按照采样时间从小到大的顺序依次排列处理后的第一样本视频帧,得到处理后的第二样本视频。进一步地,每个处理后的第一样本视频帧的数据形式为一个向量,处理后的第二样本视频的数据形式为矩阵,至少两个向量按照至少两个第一样本视频帧的采样时间从小到大的顺序依次排列,得到处理后的第二样本视频。
在本申请实施例中,通过样本视频处理模型对第二样本视频中的每个样本视频帧分别进行处理,得到包含有虚拟对象的样本视频帧,这样实现了精细化处理,使得每个处理后的样本视频帧都是准确的,进而提高了样本视频的准确性。这一过程也即是,通过样本视频处理模型,将包含有对象的第二样本视频转换为包含有虚拟对象的第二样本视频,实现样本扩充。比如说,虚拟对象为3D虚拟对象,第二样本视频中的对象为真实对象,通过样本视频处理模型,能够将包含有真实对象的样本视频转换为包含有3D虚拟对象的样本视频,以将该包含有3D虚拟对象的样本视频用于视频生成模型的训练过程中,实现样本扩充。
例如,参见图5,图5是本申请实施例提供的一种模型训练数据的扩充示意图。其中,第二样本视频包括真实对象,计算机设备通过样本视频处理模型,对第二样本视频中的样本视频帧进行处理,得到每个样本视频帧各自对应的处理后的样本视频帧,进而得到处理后的第二样本视频,使得处理后的第二样本视频包含3D虚拟对象,实现对视频生成模型的训练数据的扩充。
303、计算机设备基于至少两个第二样本对各自的第二样本语音和至少两个第二样本各自对应的处理后的第二样本视频,确定至少两个第一样本对。
在本申请实施例中,每个第一样本对包括第一样本语音和第一样本语音对应的第一样本视频,第一样本视频中虚拟对象的面部表情与第一样本语音的语音内容匹配。
在一些实施例中,计算机设备对第二样本语音进行增强,以扩充样本。其中,计算机设备对至少两个第二样本对各自的第二样本语音分别进行增强,得到至少两条增强后的第二样本语音,每条增强后的第二样本语音与增强前的第二样本语音中的语音内容相同;基于至少两个第二样本对各自的第二样本语音、至少两条增强后的第二样本语音和至少两个第二样本对各自对应的处理后的第二样本视频,确定至少两个第一样本对。其中,对于任意一个第一样本对,该第一样本对中的第一样本语音为增强前的第二样本语音或增强后的第二样本语音,每条增强后的第二样本语音与增强前的第二样本语音对应的第二样本视频相同。
这一过程也即是,计算机设备在获取到第二样本对之后,可以对第二样本对中的第二样本语音进行增强,并将增强后的第二样本语音作为第一样本语音来参与到视频生成模型的训练过程中,也可以将增强前的第二样本语音(也即是原始的第二样本语音)作为第一样本语音来参与到视频生成模型的训练过程中。
在本申请实施例中,通过对每个第二样本对中的第二样本语音进行增强,并将增强后的第二样本语音作为第一样本语音来参与到视频生成模型的训练过程中,增加了样本的多样性,且基于这些多种类型的样本来训练视频生成模型,能够提高视频生成模型的泛化性。
在一些实施例中,上述计算机设备对至少两个第二样本对各自的第二样本语音分别进行增强,得到至少两条增强后的第二样本语音的过程,包括以下至少一项:计算机设备分别调整至少两个第二样本对各自的第二样本语音的音调,得到至少两条增强后的第二样本语音;计算机设备分别在至少两个第二样本对各自的第二样本语音中增加混响,得到至少两条增强后的第二样本语音;计算机设备分别在至少两个第二样本对各自的第二样本语音中增加噪声,得到至少两条增强后的第二样本语音。
其中,音调主要由声音的频率决定,音调随频率的升降而升降;进一步地,音调还与声音的音量有关。因此,调整样本语音的音调指调整样本语音的频率和音量中的至少一项,如增大样本语音的频率、减小样本语音的频率、增大样本语音的音量、减小样本语音的音量等。在一些实施例中,计算机设备通过音调调整设备来调整样本语音的音调,音调调整设备为用于调整音调的设备。
其中,对样本语音增加混响是指,为样本语音添加模拟声音在封闭或半封闭空间内多次反射形成的声学效果。例如,对样本语音增加至少两个不同场景下的混响,以进一步增加样本的多样性。至少两个不同场景可以分别为室内场景、室外场景等。
其中,对样本语音增加噪声是指,为样本语音添加不同类型的杂乱声音信号,例如,对样本语音增加至少两个不同类型的噪声以进一步增加样本的多样性。不同类型的噪声可以分别为高斯噪声、白噪声、脉冲噪声等。
需要说明的是,上述对样本语音进行增强的几种方式可以自由组合,如在调整音调后的样本语音中增加混响和噪声中的至少一项,以进一步增加样本的多样性。上述几种方式仅为对样本语音进行增强的可选地实现方式,计算机设备还可以通过其他可选地实现方式对样本语音进行增强,在此不再赘述。
在本申请实施例中,通过调整样本语音的音调、在样本语音中增加混响或噪声,实现了在不改变样本语音的语音内容的情况下,扩充了样本,且上述几种增强的方式便捷性高,进而提高了对样本语音进行增强的效率。
在本申请实施例中,通过上述步骤301-303实现了获取至少两个第一样本对的过程。在该实施例中,通过样本视频处理模型,对样本语音-包括对象的样本视频(也即第二样本对)中的样本视频进行处理,得到包括虚拟对象的样本视频(也即处理后的样本视频),由于样本语音与包括对象的样本视频同步,也就得到了与样本语音同步的包括虚拟对象的样本视频,进而得到了样本语音-包括虚拟对象的样本视频的平行数据。而通过样本视频处理模型来获取样本语音-包括虚拟对象的样本视频的平行数据,就不再需要动画师逐帧构建样本视频中虚拟对象的面部表情,提高了获取包括虚拟对象的面部表情的样本视频的效率,而这些数据用于训练用于基于语音生成视频的视频生成模型,进而提高了获取视频生成模型的训练数据的效率。
需要说明的是,上述步骤301-303仅为实现获取至少两个第一样本对的可选地实现方式,计算机设备还可以通过其他可选地实现方式实现该过程,在此不再赘述。
304、通过视频生成模型,基于至少两个第一样本对各自的第一样本语音,确定至少两个第一样本对各自的第一样本语音所对应的预测视频,视频生成模型用于基于语音生成视频。
在一些实施例中,上述计算机设备对于每个第一样本对,通过视频生成模型对第一样本对中的第一样本语音进行处理,得到第一样本语音对应的预测视频的过程,包括以下步骤:
计算机设备对于每个第一样本对,通过视频生成模型中的特征提取模块,对第一样本对中的第一样本语音进行处理,得到第一样本语音的语音特征,特征提取模块用于提取语音的特征。通过视频生成模型中的注意力模块,对语音特征进行处理,得到语音特征的注意力特征,注意力模块用于提取注意力特征;通过视频生成模型中的回归模块,对注意力特征进行处理,得到预测视频,回归模块用于基于注意力特征生成预测视频。
下面参考公式(1)至公式(4),以第一样本语音为增强后的第二样本语音为例,对步骤304的实现方式进行举例说明。
示意性地,第二样本语音表示为A={a1,…,aT},预测视频表示为Y={y1,…,yM}。a表示一帧语音信号,y表示一帧视频帧。T表示第二样本语音的采样数,以16kHz为例,1秒的采样数为16000。M表示预测视频包括的视频帧数,如预测视频的1秒包括50帧视频帧。
其中,计算机设备通过数据增强模块对第二样本语音进行增强,得到增强后的第二样本语音,也即得到第一样本语音。该过程可以通过下述公式(1)表示。
A′=auga(A)      (1)。
其中,A′表示增强后的第二样本语音,也即第一样本语音,A表示增强前的第二样本语音,也即原始的第二样本语音。auga(A)表示对第二样本语音A进行增强。
可选地,视频生成模型中的特征提取模块为wav2vec2模块(一种语音特征提取模块)。将第一样本语音输入特征提取模块,得到语音特征。该过程可以通过下述公式(2)表示。
Hc=wav2vec2(A′)      (2)。
其中,Hc表示语音特征,M表示预测视频中的视频帧数,语音特征包括至少两个语音子特征,至少两个语音子特征与至少两个视频帧一一对应,表示与第M个视频帧对应的语音子特征,wav2vec2(A′)表示提取A′的语音特征。
需要说明的是,通过wav2vec2模块提取语音特征仅为一种可选地实施方式,计算机设备还可以通过其他模型来提取语音特征,在此不再赘述。
其中,视频生成模型中的注意力特征可以为单头注意力特征或多头注意力特征,可以为自注意力特征或交叉注意力特征。可选地,注意力模块为多层FFT(Feed Forward Transformer,前馈转换器)模块。将语音特征输入注意力模块,以提取语音特征新的深度特征,得到注意力特征。该过程可以通过下述公式(3)表示。
Hd=FFT(Hc)      (3)。
其中,Hd表示注意力特征,FFT(Hc)表示提取语音特征Hc的注意力特征。
可选地,视频生成模型中的回归模块为全连接层,也即为线性预测层,用于对注意力特征进行非线性变换,得到预测视频。该过程可以通过下述公式(4)表示。
Y′=Linear(Hd)      (4)。
其中,Y′表示预测视频,Linear(Hd)表示对注意力特征Hd进行非线性变换。
例如,参见图6,图6是本申请实施例提供的一种视频生成模型的训练流程图。其中,先对原始的样本语音(也即第二样本语音)进行增强,得到增强后的样本语音(也即第一样本语音),增强后的样本语音经过视频生成模型中wav2vec2模块的处理,得到语音特征,语音特征经过视频生成模型中N层FFT模块的处理,得到注意力特征,N为大于1的整数。注意力特征经过视频生成模型中线性预测层的处理,得到预测视频。其中,FFT模块包括多头注意力单元和卷积层,语音特征依次经过多头注意力单元和卷积层的处理,得到注意力特征。
305、计算机设备基于至少两个第一样本对各自的第一样本语音所对应的预测视频和第一样本视频,训练视频生成模型。
在一些实施例中,计算机设备对于每个第一样本对,确定该第一样本对的预测视频与第一样本视频之间的损失值,基于每个第一样本对的损失值调整视频生成模型的模型参数。
在一些实施例中,预测视频包括至少两个预测视频帧,第一样本视频包括至少两个样本视频帧,至少两个预测视频帧与至少两个样本视频帧一一对应,上述计算机设备基于至少两个第一样本对各自的预测视频和第一样本视频,训练视频生成模型的过程,包括以下步骤:
计算机设备对于每个第一样本对,基于至少两个预测视频帧分别与至少两个样本视频帧之间的差值,确定损失值;基于至少两个第一样本对各自对应的损失值,调整视频生成模型的模型参数。
其中,至少两个预测视频帧的数量与至少两个样本视频帧的数量相同,至少两个预测视频帧与至少两个样本视频帧按照采样时间一一对应,也即一个预测视频帧对应一个样本视频帧。
在本申请实施例中,基于预测视频中的至少两个预测视频帧与第一样本视频中的至少两个样本视频帧之间的差值,来综合确定损失值,使得该损失值更加准确与全面,进而基于该损失值来调整模型参数,使得模型参数的调整更加准确,进而提高模型训练效率。
可选地,计算机设备基于至少两个预测视频帧分别与至少两个样本视频帧之间的差值,确定损失值包括以下步骤:计算机设备确定至少两个差值的均值,得到损失值;或者,计算机设备确定至少两个差值的平方之间的均值,得到损失值,也即得到的该损失值为L2(最小平方误差)损失值。
例如,该损失值为L2损失值,该过程可以通过下述公式(5)表示。
L=||Y-Y′||      (5)。
在公式(5)中,L表示损失值,Y表示第一样本视频,Y′表示预测视频,||Y-Y′||表示对Y和Y′进行最小平方误差的计算。
在本申请实施例中,训练得到的视频生成模型用于基于语音生成视频,视频中虚拟对象的面部表情与语音的语音内容匹配。
本申请实施例提供的视频生成模型可以应用于虚拟人直播、游戏角色制作等场景中。例如,参见图7,图7是本申请实施例提供的一种视频生成模型的应用场景示意图。其中,前置模块用于生成语音,该语音通过语音驱动面部服务中的视频生成模型得到视频,该视频中虚拟对象的面部表情与语音的语音内容匹配。
在一些实施例中,本申请实施例提供的方法应用于虚拟人直播场景中。其中,直播的客户端抓取直播界面上的观众弹幕,通过对话生成服务生成回应的对话,该对话的对话内容经由语音合成服务生成回复的语音,然后经由语音驱动面部服务中的视频生成模块(通过本申请提供的视频生成模型实现),生成与语音同步的视频并显示视频,视频中的虚拟主播就做出与语音内容匹配的面部表情,实现与观众弹幕之间的对话交互。例如,参见图8,图8是本申请实施例提供的一种虚拟人直播场景的流程图。
在另一些实施例中,本申请实施例提供的方法用于游戏NPC(Non-Player Character,非玩家角色)场景。其中,游戏对象可以与游戏中的虚拟对象进行对话,相应的对话内容通过游戏客户端发送到对话生成服务来生成回应的对话,该对话经由语音合成模块生成语音,经由语音合成模块合成语音,然后发送到语音驱动面部服务中的视频生成模块(通过本申请同的视频生成模型实现),进而通过视频生成模块来得到与语音同步的视频,最后通过引擎渲染视频以显示视频,视频中的虚拟对象就做出与语音内容匹配的面部表情,且虚拟对象与游戏对象进行对话。例如,参见图9,图9是本申请实施例提供的一种游戏界面示意图。其中,该游戏界面上显示有虚拟对象,该虚拟对象与游戏对象进行对话,且对话内容显示在该游戏界面上。虚拟对象的面部表情与虚拟对象的语音内容匹配。
本申请实施例通过样本视频处理模型,扩充了样本语音-包括对象的样本视频的平行数据,也即扩充了用于训练视频生成模型的样本对,降低了训练所需的数据成本。同时,结合语音增强技术,增加了在训练数据的数据量不足时模型的泛化性。
在本申请实施例中,通过样本视频处理模型,对样本语音-包括对象的样本视频中的样本视频进行处理,得到处理后的样本视频,由于样本语音与包括对象的样本视频同步,也就得到了与样本语音同步的包括虚拟对象的样本视频,进而得到了样本语音-包括虚拟对象的样本视频的平行数据。而通过样本视频处理模型来获取样本语音-包括虚拟对象的样本视频的平行数据,就不再需要动画师逐帧构建样本视频中虚拟对象的面部表情,提高了获取包括虚拟对象的面部表情的样本视频的效率,而这些数据用于训练用于基于语音生成视频的视频生成模型,进而提高了获取视频生成模型的训练数据的效率,进而可提高视频生成模型的训练效率,且由于降低了获取视频生成模型的训练数据的成本,进而降低了视频生成模型的训练成本。
参见图4,图4是本申请实施例提供的一种样本视频处理模型的训练方法的流程图,该方法由计算机设备执行,该方法包括以下步骤。
401、计算机设备获取至少两个第三样本对,每个第三样本对包括第二样本视频帧和第三样本视频帧,第二样本视频帧中的对象与第三样本视频帧中的虚拟对象对应,且第二样本视频帧中的对象与第三样本视频帧中的虚拟对象面部表情相同。
在本申请实施例中,第三样本对包括两种样本视频帧,其中,将第三样本对中包括对象的样本视频帧称为第二样本视频帧,将第三样本对中包括虚拟对象的样本视频帧称为第三样本视频帧。第三样本对中的第二样本视频帧可以是第二样本视频中的第一样本视频帧,也即是,至少两个第三样本对可以来源于前述至少两个第二样本对。
在一些实施例中,第三样本对中的第二样本视频帧可以是增强后的样本视频帧,也可以是原始的样本视频帧。示意性地,计算机设备获取至少两个第三样本视频,该第三样本视频例如是前述至少两个第二样本视频中的样本视频。相对应地,计算机设备获取至少两个第三样本对的过程,包括以下步骤:
计算机设备对至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行增强,得到至少两个增强后的第四样本视频帧,每个增强后的第四样本视频帧与增强前的第四样本视频帧中对象的面部表情相同;基于至少两个第三样本视频各自包括的至少两个第四样本视频帧、至少两个第四样本视频帧分别对应的包括虚拟对象的样本视频帧、至少两个增强后的第四样本视频帧以及至少两个增强后的第四样本视频帧分别对应的包括虚拟对象的样本视频帧,确定至少两个第三样本对。其中,每个第三样本对包括的第二样本视频帧为增强前的第四样本视频帧或增强后的第四样本视频帧,每个增强后的第四样本视频帧与增强前的第四样本视频帧对应的样本视频帧数据相同。
这一过程也即是,计算机设备在获取到至少两个第三样本视频之后,可以对第三样本视频中的样本视频帧进行增强,并将增强后的样本视频帧作为第三样本对中的第二样本视频帧来参与到样本视频处理模型的训练过程中,也可以将增强前的样本视频帧(也即是原始的样本视频帧)作为第三样本对中的第二样本视频帧来参与到样本视频处理模型的训练过程中。
在本申请实施例中,通过对至少两个第三样本视频各自包括的样本视频帧进行增强,增加了样本的多样性,且基于这些多种类型的样本来训练样本视频处理模型,能够提高样本视频处理模型的泛化性。
在一些实施例中,上述计算机设备对至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行增强,得到至少两个增强后的第四样本视频帧的过程,包括以下至少一项:计算机设对至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行旋转,得到至少两个增强后的第四样本视频帧;计算机设备对至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行灰度化,得到至少两个增强后的第四样本视频帧。
在一些实施例中,对样本视频帧进行旋转指通过变换矩阵对样本视频帧中至少两个像素点的坐标进行变换。其中,将像素点的坐标乘以该变换矩阵,得到像素点变换后的坐标,至少两个像素点变换后的坐标对应的样本视频帧即增强后的样本视频帧。或者,以样本视频帧中的某一点为旋转中心,将样本视频帧中的至少两个像素点都绕该点旋转预设角度。其中,旋转中心和预设角度可以根据需要进行设定并更改,在此不作具体限定。计算机设备可以基于至少两个旋转中心和至少两个预设角度分别对样本视频帧进行旋转,得到至少两个增强后的样本视频帧,以进一步增强样本的多样性。
需要说明的是,上述对样本视频帧进行增强的方式可以自由组合,如对旋转后的样本视频帧进行灰度化,得到增强后的样本视频帧。上述几种方式仅为对样本视频帧进行增强的可选地实现方式,计算机设备还可以通过其他可选地实现方式对样本视频帧进行增强,在此不再赘述。
在本申请实施例中,通过对样本视频帧进行旋转或灰度化,在不改变样本视频帧中对象的面部表情的情况下,扩充了样本,且上述几种增强的方式便捷性高,进而提高了对样本视频帧进行增强的效率。
例如,参见图10,图10是本申请实施例提供的一种对样本视频帧进行增强的示意图。其中,对原始的样本视频帧进行旋转和灰度化,得到增强后的样本视频帧。其中,原始的样本视频帧为未进行灰度化的样本视频帧。
402、计算机设备通过样本视频处理模型,基于至少两个第三样本对各自的第二样本视频帧,确定至少两个第三样本对各自对应的处理后的第二样本视频帧。
在一些实施例中,上述计算机设备对于每个第三样本对,通过样本视频处理模型对第三样本对中的第二样本视频帧进行处理,得到处理后的第二样本视频帧的过程,包括以下步骤:计算机设备对于每个第三样本对,通过样本视频处理模型中的特征提取模块对该第三样本对中的第二样本视频帧进行处理,得到第二样本视频帧的视频帧特征,特征提取模块用于提取视频帧的特征。通过样本视频处理模型中的回归模块对视频帧特征进行处理,得到处理后的第二样本视频帧,回归模块用于基于视频帧特征生成处理后的视频帧。
下面参考公式(6)至公式(8),以第三样本对中的第二样本视频帧为增强后的第四样本视频帧为例,对步骤402的实现方式进行举例说明。
示意性地,第三样本视频表示为X={x1,…,xM},M表示第三样本视频包括的第四样本视频帧的数量。xM表示第M帧第四样本视频帧。
其中,计算机设备通过对第三样本视频中的第四样本视频帧进行增强,得到增强后的第四样本视频帧,也即第三样本对中的第二样本视频帧。该过程可以通过下述公式(6)表示。
x′=augimg(x)      (6)。
其中,x′表示增强后的第四样本视频帧,也即第三样本对中的第二样本视频帧,x表示增强前的第四样本视频帧,augimg(x)表示对第四样本视频帧x进行增强。
可选地,特征提取模块为ResNet网络。将第二样本视频帧输入特征提取模块,得到视频帧特征。该过程可以通过下述公式(7)表示。
himg=ResNet(x′)      (7)。
其中,himg表示视频帧特征,ResNet(x′)表示通过ResNet网络提取第二样本视频帧x′的特征。
在一些实施例中,ResNet网络的输入视频帧具有预设分辨率,如预设分辨率256×256,因此,在第二样本视频帧输入ResNet网络之前,将第二样本视频帧裁切成分辨率为256×256的样本视频帧。
可选地,回归模块为全连接层,用于对视频帧特征进行非线性变换,得到处理后的样本视频帧。该过程可以通过下述公式(8)实现。
y′=Linear(himg)      (8)。
其中,y′表示处理后的样本视频帧,Linear(himg)表示对视频帧特征himg进行非线性变换。
403、计算机设备基于至少两个第三样本对各自对应的处理后的第二样本视频帧和至少两个第三样本对各自的第三样本视频帧,训练样本视频处理模型。
在一些实施例中,计算机设备对于每个第三样本对,确定该第三样本对的处理后的第二样本视频帧与第三样本视频帧之间的损失值,基于该损失值调整样本视频处理模型的模型参数。
其中,计算机设备基于至少两个第三样本对各自的第三样本视频帧与处理后的第二样本视频帧之间的损失值,对样本视频处理模型进行迭代训练。
在一种实现方式中,在每次迭代过程中,计算机设备基于一个第三样本对的第三样本视频帧与处理后的第二样本视频帧的损失值,调整样本视频处理模型的模型参数。
例如,该损失值为L2损失值,该过程可以通过下述公式(9)表示。
L=||y-y′||      (9)。
在公式(9)中,L表示损失值,y表示第三样本视频帧,y′表示处理后的第二样本视频帧。其中,第三样本视频帧和处理后的第二样本视频帧分别为两个向量,二者的维度相同。||y-y′||表示对y和y′进行最小平方误差的计算。计算机设备确定处理后的第二样本视频帧中每个元素分别与第三样本视频帧中所对应元素的差值,确定至少两个差值的平方之间的均值,得到损失值。
在另一种实现方式中,在每次迭代训练过程中,计算机设备基于至少两个第三样本对中的部分第三样本对的损失值来调整样本视频处理模型的模型参数。例如,基于对应于同一样本视频的至少两个第三样本对的损失值来调整样本视频处理模型的模型参数。其中,计算机设备基于这至少两个第三样本对的损失值之间的平均损失值来调整样本视频处理模型的模型参数。或者,计算机设备确定这至少两个第三样本对各自的预测样本视频帧数据与样本视频帧数据之间的差值,确定至少两个差值的平方之间的均值,得到损失值,也即得到的该损失值为L2损失值,基于该损失值调整样本视频处理模型的模型参数。
在下一次迭代过程中,基于调整后的样本视频处理模型预测该次迭代过程中使用的第三样本对的处理后的第二样本视频帧,基于该处理后的第二样本视频帧和第三样本视频帧之间的损失值,调整样本视频处理模型的模型参数。
例如,参见图11,图11是本申请实施例提供的一种样本视频处理模型的训练流程图。其中,先对原始的包含有对象的样本视频帧进行增强,得到增强后的样本视频帧,增强后的样本视频帧经过样本视频处理模型中的ResNet网络的处理,得到视频帧特征,视频帧特征经过样本视频处理模型中回归模块的处理,得到包含有虚拟对象的样本视频帧。
例如,参见图12,图12是本申请实施例提供的一种训练数据的获取流程图。其中,一个对象进行表演,该对象在发出语音的同时做出面部表情。然后通过录音,得到样本语音,通过录像,得到原始样本视频。然后将样本语音与原始样本视频逐帧对齐,得到原始样本视频中的至少两个原始样本视频帧。最后由动画师制作每个原始样本视频帧分别对应的包含有虚拟对象的样本视频帧,得到原始样本视频对应的处理后的样本视频,该处理后的样本视频包含虚拟对象。由于样本语音与原始样本视频逐帧对齐,而原始样本视频与处理后的样本视频逐帧对齐,进而样本语音与处理后的样本视频逐帧对齐。相应地,计算机设备还可以将样本语音与处理后的样本视频作为一组第一样本对,以提高数据的利用率。
在一些实施例中,计算机设备获取至少两个初始样本对,该至少两个初始样本对包括样本语音和包含有对象的样本视频,如至少两个初始样本对包括100条平均时长为4s的样本语音和对应的样本视频。然后随机选取部分初始样本对中的样本视频来制作少量的包含有虚拟对象的样本视频帧,得到至少两个第三样本对。如选取10个样本视频来制作包含有虚拟对象的样本视频帧,由于每个包含有对象的样本视频包括至少两个样本视频帧,进而就可以得到大量的第三样本对。然后基于至少两个第三样本对训练得到样本视频处理模型后,基于该样本视频处理模型对剩余的初始样本对进行处理,得到部分第一样本对。而将之前制作的包含有虚拟对象的样本视频帧与样本语音进行逐帧对齐,也得到部分第一样本对,将这两部分第一样本对均作为视频生成模型的训练数据,实现了数据的重复利用。
需要说明的是,训练视频生成模型的执行主体与训练样本视频处理模型的执行主体可以相同或不同,在此不作限定。
在本申请实施例中,通过上述步骤401-403实现了样本视频处理模型的训练过程。在该实施例中,基于包含有对象的样本视频帧与包含有虚拟对象的样本视频帧来训练样本视频处理模型,使得样本视频处理模型能够基于样本视频帧中真实对象的面部表情自动生成处理后的样本视频帧中虚拟对象的面部表情。因此,在获取样本语音-虚拟样本视频(也即包括虚拟对象的样本视频)的训练样本对时,基于与语音内容同步的真实视频,通过该样本视频处理模型对真实视频进行处理,就能够得到与真实视频对应的虚拟样本视频,由于语音与真实视频同步,进而得到的虚拟样本视频就与语音同步,显然通过该样本视频处理模型就提高了获取语音-虚拟样本视频的训练样本对的效率。
图13是根据本申请实施例提供的一种视频生成模型的训练装置的框图。参见图13,装置包括:
获取模块1301,用于获取至少两个第一样本对,每个第一样本对包括第一样本语音和第一样本语音对应的第一样本视频,第一样本视频中虚拟对象的面部表情与第一样本语音的语音内容匹配;
处理模块1302,用于通过视频生成模型,基于至少两个第一样本对各自的第一样本语音,确定至少两个第一样本对各自的第一样本语音所对应的预测视频,视频生成模型用于基于语音生成视频;
训练模块1303,用于基于至少两个第一样本对各自的第一样本语音所对应的预测视频和第一样本视频,训练所述视频生成模型。
在一些实施例中,获取模块1301,用于:
获取至少两个第二样本对,每个第二样本对包括第二样本语音和第二样本语音对应的第二样本视频,第二样本视频中对象的面部表情与第二样本语音的语音内容匹配;
通过样本视频处理模型,基于至少两个第二样本对各自的第二样本视频,确定至少两个第二样本对各自所对应的处理后的第二样本视频,处理后的第二样本视频中虚拟对象的面部表情与处理前的第二样本视频中对象的面部表情匹配,样本视频处理模型用于基于包括对象的样本视频生成包括虚拟对象的样本视频;
基于至少两个第二样本对各自的第二样本语音和至少两个第二样本对各自对应的处理后的第二样本视频,确定至少两个第一样本对。
在一些实施例中,获取模块1301,用于:
对于每个第二样本对,通过样本视频处理模型,基于第二样本对的第二样本视频中至少两个第一样本视频帧,确定至少两个第一样本视频帧各自对应的处理后的第一样本视频帧;
基于至少两个第二样本对各自对应的处理后的第一样本视频帧,确定至少两个第二样本对各自对应的处理后的第二样本视频。
在一些实施例中,获取模块1301,用于:
对至少两个第二样本对各自的第二样本语音分别进行增强,得到至少两条增强后的第二样本语音,每条增强后的第二样本语音与增强前的第二样本语音中的语音内容相同;
基于至少两个第二样本对各自的第二样本语音、至少两条增强后的第二样本语音以及至少两个第二样本对各自对应的处理后的第二样本视频,确定至少两个第一样本对;
其中,每个第一样本对中的第一样本语音为增强前的第二样本语音或增强后的第二样本语音,每条增强后的第二样本语音与增强前的第二样本语音所对应的第二样本视频相同。
在一些实施例中,获取模块1301,用于执行以下至少一项:
分别调整至少两个第二样本对各自的第二样本语音的音调,得到至少两条增强后的第二样本语音;
分别在至少两个第二样本对各自的第二样本语音中增加混响,得到至少两条增强后的第二样本语音;
分别在至少两个第二样本对各自的第二样本语音中增加噪声,得到至少两条增强后的第二样本语音。
在一些实施例中,训练模块1303,还用于:
获取至少两个第三样本对,每个第三样本对包括第二样本视频帧和第三样本视频帧,第二样本视频帧中的对象与第三样本视频帧中的虚拟对象对应,且第二样本视频帧中的对象与第三样本视频帧中的虚拟对象面部表情相同;
通过样本视频处理模型,基于至少两个第三样本对各自的第二样本视频帧,确定至少两个第三样本对各自对应的处理后的第二样本视频帧;
基于至少两个第三样本对各自对应的处理后的第二样本视频帧和至少两个第三样本对各自的第三样本视频帧,训练样本视频处理模型。
在一些实施例中,获取模块1301,还用于:
对至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行增强,得到至少两个增强后的第四样本视频帧,每个增强后的第四样本视频帧与增强前的第四样本视频帧中对象的面部表情相同;
基于至少两个第三样本视频各自包括的至少两个第四样本视频帧和至少两个增强后的第四样本视频帧,确定至少两个第三样本对;
其中,每个第三样本对中的第二样本视频帧为增强前的第四样本视频帧或增强后的第四样本视频帧,每个增强后的第四样本视频帧与增强前的第四样本视频帧所对应的样本视频帧数据相同。
在一些实施例中,获取模块1301,用于执行以下至少一项:
对至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行旋转,得到至少两个增强后的第四样本视频帧;
对至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行灰度化,得到至少两个增强后的第四样本视频帧。
在一些实施例中,预测视频包括至少两个预测视频帧,第一样本视频包括至少两个样本视频帧,至少两个预测视频帧与所述至少两个样本视频帧一一对应,训练模块1303,用于:
对于每个第一样本对,基于至少两个预测视频帧分别与至少两个样本视频帧之间的差值,确定损失值;
基于至少两个第一样本对各自对应的损失值,调整视频生成模型的模型参数。
本申请实施例提供了一种视频生成模型的训练装置,该装置基于样本语音和样本语音对应的样本视频来训练视频生成模型,其中,样本视频中虚拟对象的面部表情与样本语音的语音内容匹配,进而以样本视频为目标来不断训练视频生成模型,使得视频生成模型可以逐渐学习到如何更准确地根据语音生成与语音内容精准匹配的面部表情,通过这种方式训练得到的视频生成模型可以生成与语音同步的视频,并且,在该视频中,虚拟对象的面部表情与语音内容精准匹配,也即是,利用训练得到的视频生成模型,能够基于语音为虚拟对象生成与语音内容精准匹配的面部表情。比如说,将训练得到的视频生成模型应用于虚拟人直播场景时,能够为虚拟人生成更加自然、准确的面部表情,提升用户体验感。另外,基于视频生成模型来生成面部表情,能够提高生成面部表情的便捷性和效率。
在本申请实施例中,计算机设备可以为终端或者服务器,当计算机设备为终端时,由终端作为执行主体来实施本申请实施例提供的技术方案;当计算机设备为服务器时,由服务器作为执行主体来实施本申请实施例提供的技术方案;或者,通过终端和服务器之间的交互来实施本申请提供的技术方案,本申请实施例对此不作限定。
图14示出了本申请一个示例性实施例提供的终端1400的结构框图。
通常,终端1400包括有:处理器1401和存储器1402。
处理器1401可以包括一个或至少两个处理核心,比如4核心处理器、8核心处理器等。处理器1401可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1401也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1401可以集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1401还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器1402可以包括一个或至少两个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器1402还可包括高速随机存取存储器,以及非易失性存储器,比如一个或至少两个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1402中的非暂态的计算机可读存储介质用于存储至少一段程序,该至少一段程序用于被处理器1401所执行以实现本申请中方法实施例提供的视频生成模型的训练方法。
在一些实施例中,终端1400还可选包括有:外围设备接口1403和至少一个外围设备。处理器1401、存储器1402和外围设备接口1403之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口1403相连。具体地,外围设备包括:射频电路1404、显示屏1405、摄像头组件1406、音频电路1407和电源1408中的至少一种。
外围设备接口1403可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器1401和存储器1402。在一些实施例中,处理器1401、存储器1402和外围设备接口1403被集成在同一芯片或电路板上;在一些其他实施例中,处理器1401、存储器1402和外围设备接口1403中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。
射频电路1404用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路1404通过电磁信号与通信网络以及其他通信设备进行通信。射频电路1404将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路1404包括:天线系统、RF收发器、一个或至少两个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路1404可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:万维网、城域网、内联网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路1404还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。
显示屏1405用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏1405是触摸显示屏时,显示屏1405还具有采集在显示屏1405的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器1401进行处理。此时,显示屏1405还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏1405可以为一个,设置在终端1400的前面板;在另一些实施例中,显示屏1405可以为至少两个,分别设置在终端1400的不同表面或呈折叠设计;在另一些实施例中,显示屏1405可以是柔性显示屏,设置在终端1400的弯曲表面上或折叠面上。甚至,显示屏1405还可以设置成非矩形的不规则图形,也即异形屏。显示屏1405可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。
摄像头组件1406用于采集图像或视频。可选地,摄像头组件1406包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件1406还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。
音频电路1407可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器1401进行处理,或者输入至射频电路1404以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为至少两个,分别设置在终端1400的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器1401或射频电路1404的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路1407还可以包括耳机插孔。
电源1408用于为终端1400中的各个组件进行供电。电源1408可以是交流电、直流电、一次性电池或可充电电池。当电源1408包括可充电电池时,该可充电电池可以是有线充电电池或无线充电电池。有线充电电池是通过有线线路充电的电池,无线充电电池是通过无线线圈充电的电池。该可充电电池还可以用于支持快充技术。
在一些实施例中,终端1400还包括有一个或至少两个传感器1409。该一个或至少两个传感器1409包括但不限于:加速度传感器1410、陀螺仪传感器1411、压力传感器1412、光学传感器1413以及接近传感器1414。
加速度传感器1410可以检测以终端1400建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器1410可以用于检测重力加速度在三个坐标轴上的分量。处理器1401可以根据加速度传感器1410采集的重力加速度信号,控制显示屏1405以横向视图或纵向视图进行用户界面的显示。加速度传感器1410还可以用于游戏或者用户的运动数据的采集。
陀螺仪传感器1411可以检测终端1400的机体方向及转动角度,陀螺仪传感器1411可以与加速度传感器1410协同采集用户对终端1400的3D动作。处理器1401根据陀螺仪传感器1411采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。
压力传感器1412可以设置在终端1400的侧边框和/或显示屏1405的下层。当压力传感器1412设置在终端1400的侧边框时,可以检测用户对终端1400的握持信号,由处理器1401根据压力传感器1412采集的握持信号进行左右手识别或快捷操作。当压力传感器1412设置在显示屏1405的下层时,由处理器1401根据用户对显示屏1405的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。
光学传感器1413用于采集环境光强度。在一个实施例中,处理器1401可以根据光学传感器1413采集的环境光强度,控制显示屏1405的显示亮度。具体地,当环境光强度较高时,调高显示屏1405的显示亮度;当环境光强度较低时,调低显示屏1405的显示亮度。在另一个实施例中,处理器1401还可以根据光学传感器1413采集的环境光强度,动态调整摄像头组件1406的拍摄参数。
接近传感器1414,也称距离传感器,通常设置在终端1400的前面板。接近传感器1414用于采集用户与终端1400的正面之间的距离。在一个实施例中,当接近传感器1414检测到用户与终端1400的正面之间的距离逐渐变小时,由处理器1401控制显示屏1405从亮屏状态切换为息屏状态;当接近传感器1414检测到用户与终端1400的正面之间的距离逐渐变大时,由处理器1401控制显示屏1405从息屏状态切换为亮屏状态。
本领域技术人员可以理解,图14中示出的结构并不构成对终端1400的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
图15是根据本申请实施例提供的一种服务器的结构示意图,该服务器1500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(Central Processing Units,CPU)1501和一个或一个以上的存储器1502,其中,存储器1502用于存储至少一段程序,处理器1501被配置为执行上述至少一段程序,以实现上述各个方法实施例提供的视频生成模型的训练方法。当然,该服务器还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该服务器还可以包括其他用于实现设备功能的部件,在此不做赘述。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储有至少一段程序,至少一段程序由处理器加载并执行,以实现上述任一实现方式的视频生成模型的训练方法。
本申请实施例还提供了一种计算机程序产品,计算机程序产品包括至少一段程序,至少一段程序存储在计算机可读存储介质中,计算机设备的处理器从计算机可读存储介质读取至少一段程序,处理器执行至少一段程序,使得计算机设备执行上述任一实现方式的视频生成模型的训练方法。
在一些实施例中,本申请实施例所涉及的计算机程序产品可被部署在一个计算机设备上执行,或者在位于一个地点的至少两个计算机设备上执行,又或者,在分布在至少两个地点且通过通信网络互连的至少两个计算机设备上执行,分布在至少两个地点且通过通信网络互连的至少两个计算机设备可以组成区块链系统。
上述所有可选技术方案,可以采用任意结合形成本申请的可选实施例,在此不再一一赘述。以上仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (13)

  1. 一种视频生成模型的训练方法,由计算机设备执行,所述方法包括:
    获取至少两个第一样本对,每个第一样本对包括第一样本语音和所述第一样本语音对应的第一样本视频,所述第一样本视频中虚拟对象的面部表情与所述第一样本语音的语音内容匹配;
    通过视频生成模型,基于所述至少两个第一样本对各自的第一样本语音,确定所述至少两个第一样本对各自的第一样本语音所对应的预测视频,所述视频生成模型用于基于语音生成视频;
    基于所述至少两个第一样本对各自的第一样本语音所对应的预测视频和第一样本视频,训练所述视频生成模型。
  2. 根据权利要求1所述的方法,其中,所述获取至少两个第一样本对,包括:
    获取至少两个第二样本对,每个第二样本对包括第二样本语音和所述第二样本语音对应的第二样本视频,所述第二样本视频中对象的面部表情与所述第二样本语音的语音内容匹配;
    通过样本视频处理模型,基于所述至少两个第二样本对各自的第二样本视频,确定所述至少两个第二样本对各自对应的处理后的第二样本视频,处理后的第二样本视频中虚拟对象的面部表情与处理前的第二样本视频中对象的面部表情匹配,所述样本视频处理模型用于基于包括对象的样本视频生成包括虚拟对象的样本视频;
    基于所述至少两个第二样本对各自的第二样本语音和所述至少两个第二样本对各自对应的处理后的第二样本视频,确定所述至少两个第一样本对。
  3. 根据权利要求2所述的方法,其中,所述通过样本视频处理模型,基于所述至少两个第二样本对各自的第二样本视频,确定所述至少两个第二样本对各自对应的处理后的第二样本视频,包括:
    对于每个第二样本对,通过所述样本视频处理模型,基于所述第二样本对的第二样本视频中至少两个第一样本视频帧,确定所述至少两个第一样本视频帧各自对应的处理后的第一样本视频帧;
    基于所述至少两个第二样本对各自对应的处理后的第一样本视频帧,确定所述至少两个第二样本对各自对应的处理后的第二样本视频。
  4. 根据权利要求2或3所述的方法,其中,所述基于所述至少两个第二样本对各自的第二样本语音和所述至少两个第二样本对各自对应的处理后的第二样本视频,确定所述至少两个第一样本对,包括:
    对所述至少两个第二样本对各自的第二样本语音分别进行增强,得到至少两条增强后的第二样本语音,每条增强后的第二样本语音与增强前的第二样本语音中的语音内容相同;
    基于所述至少两个第二样本对各自的第二样本语音、所述至少两条增强后的第二样本语音以及所述至少两个第二样本对各自对应的处理后的第二样本视频,确定所述至少两个第一样本对;
    其中,每个第一样本对中的第一样本语音为增强前的第二样本语音或增强后的第二样本语音,每条增强后的第二样本语音与增强前的第二样本语音所对应的第二样本视频相同。
  5. 根据权利要求4所述的方法,其中,所述对所述至少两个第二样本对各自的第二样本语音分别进行增强,得到至少两条增强后的第二样本语音,包括以下至少一项:
    分别调整所述至少两个第二样本对各自的第二样本语音的音调,得到所述至少两条增强后的第二样本语音;
    分别在所述至少两个第二样本对各自的第二样本语音中增加混响,得到所述至少两条增强后的第二样本语音;
    分别在所述至少两个第二样本对各自的第二样本语音中增加噪声,得到所述至少两条增强后的第二样本语音。
  6. 根据权利要求2至5中任一项所述的方法,其中,所述样本视频处理模型的训练过程,包括:
    获取至少两个第三样本对,每个第三样本对包括第二样本视频帧和第三样本视频帧,所述第二样本视频帧中的对象与所述第三样本视频帧中的虚拟对象对应,且所述第二样本视频帧中的对象与所述第三样本视频帧中的虚拟对象面部表情相同;
    通过所述样本视频处理模型,基于所述至少两个第三样本对各自的第二样本视频帧,确定所述至少两个第三样本对各自对应的处理后的第二样本视频帧;
    基于所述至少两个第三样本对各自对应的处理后的第二样本视频帧和所述至少两个第三样本对各自的第三样本视频帧,训练所述样本视频处理模型。
  7. 根据权利要求6所述的方法,其中,所述获取至少两个第三样本对,包括:
    对至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行增强,得到至少两个增强后的第四样本视频帧,每个增强后的第四样本视频帧与增强前的第四样本视频帧中对象的面部表情相同;
    基于所述至少两个第三样本视频各自包括的至少两个第四样本视频帧和所述至少两个增强后的第四样本视频帧,确定所述至少两个第三样本对;
    其中,每个第三样本对中的第二样本视频帧为增强前的第四样本视频帧或增强后的第四样本视频帧,每个增强后的第四样本视频帧与增强前的第四样本视频帧所对应的样本视频帧数据相同。
  8. 根据权利要求7所述的方法,其中,所述对至少两个第三样本视频各自包括的至少两个第四视频帧分别进行增强,得到至少两个增强后的第四样本视频帧,包括以下至少一项:
    对所述至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行旋转,得到所述至少两个增强后的第四样本视频帧;
    对所述至少两个第三样本视频各自包括的至少两个第四样本视频帧分别进行灰度化,得到所述至少两个增强后的第四样本视频帧。
  9. 根据权利要求1至8中任一项所述的方法,其中,所述预测视频包括至少两个预测视频帧,所述第一样本视频包括至少两个样本视频帧,所述至少两个预测视频帧与所述至少两个样本视频帧一一对应;
    所述基于所述至少两个第一样本对各自的第一样本语音所对应的预测视频和第一样本视频,训练所述视频生成模型,包括:
    对于每个第一样本对,基于所述至少两个预测视频帧分别与所述至少两个样本视频帧之间的差值,确定损失值;
    基于所述至少两个第一样本对各自对应的损失值,调整所述视频生成模型的模型参数。
  10. 一种视频生成模型的训练装置,所述装置包括:
    获取模块,用于获取至少两个第一样本对,每个第一样本对包括第一样本语音和所述第一样本语音对应的第一样本视频,所述第一样本视频中虚拟对象的面部表情与所述第一样本语音的语音内容匹配;
    处理模块,用于通过视频生成模型,基于所述至少两个第一样本对各自的第一样本语音,确定所述至少两个第一样本对各自的第一样本语音所对应的预测视频,所述视频生成模型用于基于语音生成视频;
    训练模块,用于基于所述至少两个第一样本对各自的第一样本语音所对应的预测视频和第一样本视频,训练所述视频生成模型。
  11. 一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器用于存储至少一段程序,所述至少一段程序由所述处理器加载并执行权利要求1至9任一项所述的视频生成模型的训练方法。
  12. 一种计算机可读存储介质,所述计算机可读存储介质用于存储至少一段程序,所述至少一段程序用于执行权利要求1至9任一项所述的视频生成模型的训练方法。
  13. 一种计算机程序产品,所述计算机程序产品包括至少一段程序,所述至少一段程序存储在计算机可读存储介质中,计算机设备的处理器从所述计算机可读存储介质读取所述至少一段程序,所述处理器执行所述至少一段程序,使得所述计算机设备执行权利要求1至9任一项所述的视频生成模型的训练方法。
PCT/CN2025/081595 2024-04-02 2025-03-10 视频生成模型的训练方法、装置、设备、存储介质和产品 Pending WO2025209111A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410395181.6A CN117998166B (zh) 2024-04-02 2024-04-02 视频生成模型的训练方法、装置、设备、存储介质和产品
CN202410395181.6 2024-04-02

Publications (1)

Publication Number Publication Date
WO2025209111A1 true WO2025209111A1 (zh) 2025-10-09

Family

ID=90901444

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/081595 Pending WO2025209111A1 (zh) 2024-04-02 2025-03-10 视频生成模型的训练方法、装置、设备、存储介质和产品

Country Status (2)

Country Link
CN (1) CN117998166B (zh)
WO (1) WO2025209111A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117998166B (zh) * 2024-04-02 2024-07-05 腾讯科技(深圳)有限公司 视频生成模型的训练方法、装置、设备、存储介质和产品
CN118921516B (zh) * 2024-09-30 2025-01-24 电子科技大学(深圳)高等研究院 一种基于隐音素检索的数字人口型多样性增强方法
CN119653204A (zh) * 2024-12-11 2025-03-18 北京有竹居网络技术有限公司 用于视频生成的方法、装置、设备、存储介质和程序产品
CN120451347A (zh) * 2025-07-09 2025-08-08 北京达佳互联信息技术有限公司 数据生成方法、装置、电子设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111968207A (zh) * 2020-09-25 2020-11-20 魔珐(上海)信息科技有限公司 动画生成方法、装置、系统及存储介质
CN111988658A (zh) * 2020-08-28 2020-11-24 网易(杭州)网络有限公司 视频生成方法及装置
CN113633983A (zh) * 2021-08-16 2021-11-12 上海交通大学 虚拟角色表情控制的方法、装置、电子设备及介质
CN115209180A (zh) * 2022-06-02 2022-10-18 阿里巴巴(中国)有限公司 视频生成方法以及装置
US20230308693A1 (en) * 2020-09-25 2023-09-28 Mofa (Shanghai) Information Technology Co., Ltd. Virtual livestreaming method, apparatus, system, and storage medium
CN117998166A (zh) * 2024-04-02 2024-05-07 腾讯科技(深圳)有限公司 视频生成模型的训练方法、装置、设备、存储介质和产品

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111652121B (zh) * 2020-06-01 2023-11-03 腾讯科技(深圳)有限公司 一种表情迁移模型的训练方法、表情迁移的方法及装置
CN112396182B (zh) * 2021-01-19 2021-04-16 腾讯科技(深圳)有限公司 脸部驱动模型的训练和脸部口型动画的生成方法
CN113469292A (zh) * 2021-09-02 2021-10-01 北京世纪好未来教育科技有限公司 视频合成模型的训练方法、合成方法、装置、介质和设备
CN114972912A (zh) * 2022-05-24 2022-08-30 商汤人工智能研究中心(深圳)有限公司 样本生成及模型训练方法、装置、设备、存储介质
CN115546575B (zh) * 2022-06-21 2025-08-22 北京字跳网络技术有限公司 驱动模型的训练方法、驱动方法、装置、可读介质和设备
CN115225829B (zh) * 2022-07-14 2025-01-07 北京京东尚科信息技术有限公司 一种视频生成方法及装置、计算机可读存储介质
CN117011737B (zh) * 2022-07-15 2026-04-28 腾讯科技(深圳)有限公司 一种视频分类方法、装置、电子设备和存储介质
CN116405724A (zh) * 2023-04-07 2023-07-07 平安科技(深圳)有限公司 图像生成方法、系统、电子设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111988658A (zh) * 2020-08-28 2020-11-24 网易(杭州)网络有限公司 视频生成方法及装置
CN111968207A (zh) * 2020-09-25 2020-11-20 魔珐(上海)信息科技有限公司 动画生成方法、装置、系统及存储介质
US20230308693A1 (en) * 2020-09-25 2023-09-28 Mofa (Shanghai) Information Technology Co., Ltd. Virtual livestreaming method, apparatus, system, and storage medium
CN113633983A (zh) * 2021-08-16 2021-11-12 上海交通大学 虚拟角色表情控制的方法、装置、电子设备及介质
CN115209180A (zh) * 2022-06-02 2022-10-18 阿里巴巴(中国)有限公司 视频生成方法以及装置
CN117998166A (zh) * 2024-04-02 2024-05-07 腾讯科技(深圳)有限公司 视频生成模型的训练方法、装置、设备、存储介质和产品

Also Published As

Publication number Publication date
CN117998166A (zh) 2024-05-07
CN117998166B (zh) 2024-07-05

Similar Documents

Publication Publication Date Title
KR102694330B1 (ko) 인공 지능에 기초한 애니메이션 이미지 구동 방법, 및 관련 디바이스
US20220172737A1 (en) Speech signal processing method and speech separation method
EP3968223B1 (en) Method and apparatus for acquiring positions of target, and computer device and storage medium
CN113516990B (zh) 一种语音增强方法、训练神经网络的方法以及相关设备
CN117998166B (zh) 视频生成模型的训练方法、装置、设备、存储介质和产品
CN113763532B (zh) 基于三维虚拟对象的人机交互方法、装置、设备及介质
CN111726536A (zh) 视频生成方法、装置、存储介质及计算机设备
CN115909015A (zh) 一种可形变神经辐射场网络的构建方法和装置
TWI255141B (en) Method and system for real-time interactive video
CN113750523B (zh) 三维虚拟对象的动作生成方法、装置、设备及存储介质
US20230315382A1 (en) Communication assistance program, communication assistance method, communication assistance system, terminal device, and non-verbal expression program
CN111327772B (zh) 进行自动语音应答处理的方法、装置、设备及存储介质
EP4141867A1 (en) Voice signal processing method and related device therefor
CN112742024B (zh) 虚拟对象的控制方法、装置、设备及存储介质
CN115394285B (zh) 语音克隆方法、装置、设备及存储介质
EP4315325B1 (en) Neural networks for changing characteristics of vocals
CN110794964A (zh) 虚拟机器人的交互方法、装置、电子设备及存储介质
CN112750425B (zh) 语音识别方法、装置、计算机设备及计算机可读存储介质
CN115578494B (zh) 中间帧的生成方法、装置、设备及存储介质
US20250085780A1 (en) Emg-based speech detection and communication
CN114462580A (zh) 文本识别模型的训练方法、文本识别方法、装置和设备
CN114328815B (zh) 文本映射模型的处理方法、装置、计算机设备及存储介质
CN119937799A (zh) 一种沉浸式对话方法、智能眼镜及存储介质
CN119694335B (zh) 音频信号分离方法、装置、设备及存储介质
HK40071561B (zh) 图像检测方法、装置、计算机设备及存储介质

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: 25781408

Country of ref document: EP

Kind code of ref document: A1