Video processing method and device, electronic equipment and storage medium

By generating noise video frames and combined with reference frame processing, the problem of inter -frame jitter and style unstable in the existing technology in the existing technologies has been solved, and higher video frame coherence is achieved.

CN119359528APending Publication Date: 2025-01-24BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310907796.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-21
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Existing video stylization processing technologies are prone to inter-frame jitter and stylization instability, resulting in low consistency between video frames.

Method used

By obtaining the noise image of the video frame, noise add video frames, and combined with the reference frame to generate stylized video frames, the characteristics of the reference frame are combined to enhance the coherence.

Benefits of technology

It effectively improves the coherence of stylized video frames and reduces the problems of inter-frame jitter and stylization instability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359528A_ABST
    Figure CN119359528A_ABST
Patent Text Reader

Abstract

The invention provides a video processing method and device, electronic equipment and a storage medium. The video processing method comprises the following steps: acquiring a to-be-processed video frame of a to-be-processed video; determining a noise image corresponding to the to-be-processed video frame; obtaining a noise-added video frame based on the to-be-processed video frame and the noise image; generating a stylized video frame corresponding to the to-be-processed video frame based on the noise-added video frame in combination with the reference frame; the reference frame comprises processing intermediate frames corresponding to other to-be-processed video frames except the currently processed video frame, and the processing intermediate frames are intermediate images generated in the generation process of the stylized video frame; a stylized video is generated based on the stylized video frame. Therefore, the stylized video frame corresponding to the to-be-processed video frame is generated by combining the reference frame, so that the generated stylized video frame can fuse the characteristics of the reference frame, and the coherence of the stylized video frame is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a video processing method, device, electronic device and storage medium. Background Art

[0002] Image stylization technology can perform stylized processing (such as comics, animations, or other stylized processing) on ​​pictures or videos provided by users. Related video stylization processing technology usually uses image stylization models to perform stylized processing on the video to be processed frame by frame. However, the stylized video is prone to inter-frame jitter and unstable video frame stylization, and the coherence between frames is low. Summary of the invention

[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, according to one or more embodiments of the present disclosure, a video processing method is provided, including:

[0005] Obtain a video frame to be processed of the video to be processed;

[0006] Determining a noise image corresponding to the video frame to be processed;

[0007] Based on the video frame to be processed and the noise image, a noisy video frame is obtained;

[0008] Based on the noisy video frame, in combination with a reference frame, a stylized video frame corresponding to the video frame to be processed is generated; the reference frame includes a processed intermediate frame corresponding to other video frames to be processed except the currently processed video frame, and the processed intermediate frame is an intermediate image generated in the process of generating the stylized video frame;

[0009] A stylized video is generated based on the stylized video frames.

[0010] In a second aspect, according to one or more embodiments of the present disclosure, a video processing device is provided, including:

[0011] A video frame acquisition unit, used for acquiring a to-be-processed video frame of a to-be-processed video;

[0012] A noise determination unit, used to determine a noise image corresponding to the video frame to be processed;

[0013] A noise adding unit, configured to obtain a noisy video frame based on the video frame to be processed and the noise image;

[0014] A stylized processing unit, configured to generate a stylized video frame corresponding to the video frame to be processed based on the noisy video frame and in combination with a reference frame; the reference frame includes a processed intermediate frame corresponding to other video frames to be processed except the currently processed video frame, and the processed intermediate frame is an intermediate image generated in the process of generating the stylized video frame;

[0015] A video generating unit is used to generate a stylized video based on the stylized video frame.

[0016] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory so that the electronic device executes the method provided according to one or more embodiments of the present disclosure.

[0017] In a fourth aspect, according to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, wherein the non-transitory computer storage medium stores a program code, and when the program code is executed by a computer device, the computer device executes the method provided according to one or more embodiments of the present disclosure.

[0018] According to one or more embodiments of the present disclosure, by determining a noise image corresponding to a video frame to be processed, a noisy video frame is obtained based on the video frame to be processed and the noise image, and based on the noisy video frame combined with a reference frame, a stylized video frame corresponding to the video frame to be processed is generated, so that the generated stylized video frame can integrate features of the reference frame, thereby improving the coherence of the stylized video frame. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0020] Figure 1 A flowchart of a video processing method provided by an embodiment of the present disclosure;

[0021] Figure 2 A schematic diagram of a portion of the structure of a stylized image processing model provided by an embodiment of the present disclosure;

[0022] Figure 3 A schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure;

[0023] Figure 4 The figure is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0025] It should be understood that the steps described in the embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0026] As used herein, the term "including" and its variations are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The term "responsive to" and related terms refer to a signal or event being affected to a certain extent by another signal or event, but not necessarily completely or directly. If event x occurs "responsive to" event y, x may be directly or indirectly responsive to y. For example, the occurrence of y may ultimately lead to the occurrence of x, but there may be other intermediate events and / or conditions. In other cases, y may not necessarily lead to the occurrence of x, and x may occur even if y has not yet occurred. In addition, the term "responsive to" may also mean "at least partially responsive to".

[0027] The term "determine" broadly covers a variety of actions, which may include obtaining, calculating, computing, processing, deriving, investigating, searching (e.g., searching in a table, database, or other data structure), ascertaining, and similar actions, and may also include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory) and similar actions, as well as parsing, selecting, choosing, establishing, and similar actions, etc. The relevant definitions of other terms will be given in the following description. The relevant definitions of other terms will be given in the following description.

[0028] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the provisions of relevant laws and regulations.

[0029] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, and usage scenarios of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. For example, in response to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information, so that the user can autonomously choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0030] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information is sent to the user in a manner such as a pop-up window, in which the prompt information can be presented in text form. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0031] It is understandable that the images generated by the methods provided in the embodiments of the present disclosure should be processed in accordance with the provisions of relevant laws and regulations. For example, technical measures should be taken in accordance with regulations to add a logo that does not affect user use, or a prominent logo should be placed in a reasonable location or area in accordance with regulations to inform the public of the depth synthesis situation.

[0032] It is understandable that the above-mentioned notification and process of obtaining user authorization, as well as the processing of images, are merely illustrative and do not constitute a limitation on the implementation method of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation method of the present disclosure.

[0033] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0034] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0035] For the purposes of this disclosure, the phrase "A and / or B" means (A), (B), or (A and B).

[0036] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0037] For the purpose of reference and clarity, the technical terms appearing in the embodiments of the present invention are explained as follows:

[0038] Diffusion Models: Diffusion model is a generative model whose basic working principle is to gradually apply random noise to the data in the forward diffusion stage, and then construct the required data samples from the noise in the reverse diffusion stage.

[0039] refer to Figure 1 , Figure 1 A flowchart of a video processing method 100 provided in an embodiment of the present disclosure is shown. The method 100 includes steps S110 to S150.

[0040] Step S110: obtaining a to-be-processed video frame of the to-be-processed video.

[0041] In some embodiments, all video frames of the video to be processed may be used as the video frames to be processed for stylization processing, or some video frames of the video to be processed may be extracted as the video frames to be processed, which is not limited in the present disclosure.

[0042] Step S120: Determine the noise image corresponding to the video frame to be processed.

[0043] Step S130: obtaining a noisy video frame based on the to-be-processed video frame and the noisy image.

[0044] In some embodiments, the noise image may be random noise. For example, random noise may be gradually applied to the video frame to be processed through a non-stylized image processing model until the video frame to be processed is destroyed into Gaussian noise, i.e., a noisy video frame. Subsequently, the noisy video frame may be denoised through a stylized image processing model to obtain a stylized image.

[0045] In some embodiments, the noisy video frame includes an inverse noise image of the video frame to be processed. The inverse noise image can be restored to obtain the video frame to be processed through the inverse diffusion process of the non-stylized diffusion model. In this embodiment, the video frame to be processed is regarded as an image output result obtained by an inverse diffusion process, and then the inverse diffusion process needs to be solved to obtain the image output result. The noise is the inverse noise image required. Since the inverse noise image corresponding to the video frame to be processed in this embodiment can be restored to obtain the corresponding original video frame, the inverse noise image retains the spatial structure of the original video frame. In this way, the stylized video frames obtained by subsequent stylization processing based on each inverse noise image also retain the spatial structure of the original video frame accordingly, thereby further improving the coherence between the stylized video frames. In a specific embodiment, noise predicted based on the video frame can be applied to the video frame to be processed, and a certain number of steps can be iterated in this way to obtain the inverse noise image. Since the applied noise is predicted based on the video frame, compared with adding random noise, the inverse noise image can retain the spatial structure of the original video, thereby improving the coherence between the stylized video frames.

[0046] In some embodiments, random noise may also be superimposed on the video frame to be processed and input into a non-stylized image processing model to obtain a non-stylized video frame, and loss correction iteration of the non-stylized image processing model may be performed based on the video frame to be processed and the non-stylized video frame. When the similarity between the non-stylized video frame and the video frame to be processed is less than a certain threshold, the random noise of this iteration may be used as the noise image.

[0047] Step S140: generating a stylized video frame corresponding to the video frame to be processed based on the noisy video frame and in combination with the reference frame.

[0048] In some embodiments, the reference frame may include processing intermediate frames corresponding to other video frames to be processed except the currently processed video frame. The processing intermediate frame is an intermediate product, such as an image, vector or feature, in the process of generating a corresponding stylized video frame from a noisy video frame corresponding to the video frame to be processed. Exemplarily, in the process of stylized image processing model processing, the output result obtained after a video frame to be processed passes through a convolution layer once can be used as a reference frame of the same-level processing intermediate frames of other video frames to be processed, so as to constrain the same-level processing intermediate frames of the other video frames to be processed; similarly, the processing intermediate frame of the video frame to be processed can also be constrained by the same-level processing intermediate frames (i.e., reference frames) of other video frames to be processed.

[0049] In some embodiments, when a stylized video frame corresponding to a video frame to be processed is generated in combination with a reference frame, the portion of the reference frame whose similarity with the currently processed video frame meets a preset condition (for example, the similarity is greater than a preset threshold) can be used to constrain the currently processed video frame.

[0050] In some embodiments, a self-attention mechanism can be used to constrain the generation of stylized video frames based on reference frames, wherein the key features and value features of the self-attention mechanism are determined based on the reference frames, and the query features of the self-attention mechanism are determined based on the processed intermediate frames of the first video frame to be processed. In related technologies, the self-attention mechanism is mainly used in tasks such as reading comprehension, summary, machine translation, and language models.

[0051] In some embodiments, the self-attention mechanism can be implemented in the self-attention layer of the image processing model and / or the self-attention layer of the control network of the image processing model. Commonly used Wensheng graph models (such as stable diffusion models) and their control networks (such as ControlNet) are generally provided with self-attention layers for coupling image information and semantic information. The self-attention mechanism in this example can be built and executed on the existing self-attention layer of the image processing model without additional training, thereby realizing a plug-and-play coherence maintenance method.

[0052] Step S150: Generate a stylized video based on the stylized video frame corresponding to the video frame to be processed.

[0053] In some embodiments, the obtained stylized video frames may be spliced ​​based on the timestamps of the video frames to be processed to finally obtain a stylized video.

[0054] According to one or more embodiments of the present disclosure, by determining a noise image corresponding to a video frame to be processed, a noisy video frame is obtained based on the video frame to be processed and the noise image, and based on the noisy video frame combined with a reference frame, a stylized video frame corresponding to the video frame to be processed is generated, so that the generated stylized video frame can integrate features of the reference frame, thereby improving the coherence of the stylized video frame.

[0055] In some embodiments, step S140 includes:

[0056] Step A1: input the noisy video frames in parallel into a stylized image processing model corresponding to the number thereof for denoising, so as to obtain the stylized video frames; during the denoising process, denoise the video frames to be processed in combination with reference frames.

[0057] In this embodiment, the noisy video frames corresponding to the multiple video frames to be processed can be combined with the reference frames corresponding to the multiple video frames to be processed to generate multiple stylized video frames corresponding to the multiple video frames to be processed in parallel. On the one hand, by stylizing the video frames in parallel, the video processing efficiency is significantly improved compared with stylizing frame by frame; on the other hand, when stylizing the video frames in parallel, the processed intermediate frames of the other video frames to be processed can also be used as reference frames to constrain the currently processed video frames, which can ensure the coherence of the stylized video frames.

[0058] In a specific embodiment, step A1 includes:

[0059] Step a11: obtaining the image feature of the I-th frame based on the K-th image processing layer of the I-th stylized image processing model, where I is a positive integer greater than or equal to 1;

[0060] Step a12: performing attention calculation based on the image features of the first frame and the reference frame to obtain an attention constrained video frame;

[0061] Step a13: input the attention constrained video frame into the K+1th image processing layer for image processing; K is a positive integer greater than 1.

[0062] The image processing layer may be a convolutional layer, but the present disclosure is not limited thereto.

[0063] It should be noted that the stylized image processing models corresponding to the number of noisy video frames used in parallel processing can be independent image processing models or sub-models or sub-processing modules in the same image processing model, and the present disclosure does not limit this.

[0064] In some embodiments, the reference frame includes the Kth image processing layer of the 1st stylized image processing model to obtain the 1st frame image features, the Kth image processing layer of the I-1st stylized image processing model to obtain the I-1st frame image features and / or the Kth image processing layer of the Ith stylized image processing model to obtain the Ith frame image features.

[0065] refer to Figure 2 , the stylized image processing model includes a plurality of alternating convolutional layers and self-attention layers, such as convolutional layers 21, 23 and self-attention layers 22, 24. The stylized image processing model can perform stylized processing on a plurality of video frames 1-N in parallel and synchronously. It should be noted that the video frames 1-N may specifically be noisy video frames corresponding to the video frames to be processed, or images, vectors or features generated by other processing of the noisy video frames (such as processing intermediate frames). For example, other processing modules may be provided before the convolutional layer 21, and the present disclosure does not limit this. When processing the I frame in the self-attention layer 22 ( Figure 2 Not shown, 1≤I≤N), the image features of the Ith frame output by the convolution layer 21 are used as the query features of the current frame being processed to provide the self-attention mechanism, and the image features of the 1st frame, the I-1th frame and the Ith frame output by the convolution layer 21 are used as reference frames to provide the key features and value features of the self-attention mechanism, and self-attention calculation is performed, so that the image features of the Ith frame output by the self-attention layer 22 can fuse the relevant image features of the 1st frame, the I-1th frame and the Ith frame, and the image features of the Ith frame output by the self-attention layer 22 will be input to the convolution layer 23 for re-convolution, and so on. All or part of the frames in the video frames 1-N can be processed as described above, and optionally, if multiple iterative processes are required, the stylized image processing model can be used to process the intermediate frames of the video frames 1-N in each iterative stage in parallel multiple times, which will not be repeated here. In some embodiments, the influence of different types of reference frames on the aforementioned self-attention mechanism can be adjusted by weights. For example, in the above example, the weights of the 1st frame, the I-1th frame and the Ith frame are 1, 2 and 1 respectively.

[0066] It should be noted that, in the stylized image processing model, a convolution layer or other processing modules may be provided after the self-attention layer 24, and the present disclosure does not limit this.

[0067] In this embodiment, the parallel processing process of each video frame to be processed is combined with the processing intermediate frames of other video frames to be processed for stylization constraints, thereby forming a mesh processing structure, which can improve the video processing efficiency while ensuring the continuity of each stylized video frame.

[0068] In some embodiments, the reference frame includes the processed intermediate frame of the currently processed video frame to be processed, the processed intermediate frame of the target video frame in the video to be processed, and the processed intermediate frame of the adjacent video frame of the currently processed video frame to be processed. Among them, the target video frame can be a specific frame or multiple frames in the video to be processed, for example, the target video frame can include the first frame, the last frame or the video frame in the middle period of the video. In this way, during the stylization process of the video frame to be processed, the reference frames used will all include the specific target video frame, which means that each video frame to be processed must be aligned with the target video frame during the stylization process, so that the target video frame is equivalent to the anchor point of the entire video frame during the stylization process, ensuring that the stylization of the entire video can be unified. The adjacent video frame of the currently processed video frame can be the previous frame and / or the next frame of the currently processed video frame, so that the coherence between the previous and next frames in the stylized video can be ensured. The influence of different types of reference frames in the constraint process can be adjusted by weight. In some embodiments, the effect weight of the processed intermediate frame of the target video frame is the highest. For example, in the reference frame, the contribution weights of the processed intermediate frame of the currently processed video frame, the processed intermediate frame of the target video frame in the to-be-processed video, and the processed intermediate frame of the adjacent video frame of the currently processed video frame are 1, 2, and 1, respectively.

[0069] In some embodiments, the denoised video frame obtained by the denoising process in step M may be determined based on the following steps (M is a positive integer greater than or equal to 1):

[0070] Step B1: obtaining a first noise based on the denoised video frame obtained by the denoising process in step M-1, the stylized description feature and the reference frame;

[0071] Step B2: obtaining a second noise based on the denoised video frame obtained by the denoising process in step M-1 and the reference frame, and not based on the stylized description feature;

[0072] Step B3: obtaining a third noise based on the denoised video frame obtained by the denoising process in step M-1 and not based on the reference frame and the stylized description feature;

[0073] Step B4: obtaining the target noise based on the first noise, the second noise and the third noise;

[0074] Step B5: Based on the denoised video frame obtained by the denoising process in the M-1th step and the target noise, the denoised video frame obtained by the denoising process in the Mth step is obtained.

[0075] In some embodiments, the stylized description feature may be determined based on a prompt word (Prompt) input by the user, or may be a predetermined semantics corresponding to the stylized image processing model. For example, the stylized description feature corresponding to the stylized image processing model for the cyberpunk style may include "cyberpunk", but the present disclosure is not limited thereto.

[0076] In some embodiments, the target noise may be obtained by performing weighted calculation based on the first noise, the second noise, and the third noise.

[0077] In this embodiment, by obtaining the target noise based on the first, second, and third noises generated under different conditions, the influence of the stylized description feature constraints and the reference frame constraints on the noise prediction results can be enhanced, and the influence of the non-stylized description feature constraints and the reference frame constraints on the noise prediction results can be suppressed.

[0078] In some embodiments, when M=1, the denoised video frame obtained by the denoising process in the M-1th step may be a noisy video frame.

[0079] In a specific implementation, a stylized video frame corresponding to the video frame to be processed may be generated based on the following steps:

[0080] Step C1: The noisy video frame corresponding to the video frame to be processed is used as the initial value x of the noisy image T , set the initial value of the diffusion step number (number of loop iterations) of the diffusion model to T, and the diffusion step value decreases with the number of iterations (under this setting, the diffusion step number with a value of T-1 can be regarded as the next step of the diffusion step number with a value of T);

[0081] Step C2: Based on the first noise prediction value μ θ (x t ,t,c), the second noise prediction value and the third noise prediction value Predict the target noise at the current diffusion stage

[0082] in, It represents the noise predictor without combining the reference frame with the noisy image x t , diffusion step value t, empty text As input, we get the prediction noise; represents the noise predictor in combination with the reference frame (such as the self-attention mechanism based on the reference frame described in the above embodiment), taking the noisy image x t , diffusion step value t, empty text The prediction noise obtained as input; μ θ (x t,t,c) represents the noise predictor in combination with the reference frame, taking the noisy image x t , diffusion step value t, and stylized description feature c are used as inputs to obtain predicted noise. When generating target noise based on the first, second, and third noise prediction values, the first, second, and third noise prediction values ​​may correspond to corresponding weights W1, W2, and W3, respectively. The values ​​of W1, W2, and W3 may change or remain unchanged during each iteration, but the present disclosure does not limit this. In some embodiments, W1 may be a positive number, and W2 and W3 may be negative numbers.

[0083] Step C3: Use the noisy image x t Remove the target noise predicted in step C2 So we get the noisy image x t-1 ;

[0084] Step C4: Repeat the above steps C2 and C3 until an image x0 is obtained, which can be used as a stylized video frame.

[0085] Among them, when the empty text When the noise predictor is input, it means that the prediction of the noise predictor is not based on the stylized description feature; when the stylized description feature c is input into the noise predictor, it means that the prediction of the noise predictor is based on the stylized description feature.

[0086] In some embodiments, the empty text may be text with empty content, or text with content irrelevant to the stylized description feature, for example, text that can serve as a counterexample of the stylized description feature.

[0087] In some embodiments, the noise predictor may be implemented based on a U-Net model, but the present disclosure is not limited thereto.

[0088] Accordingly, refer to Figure 3 According to an embodiment of the present disclosure, a video processing device 300 is provided, including:

[0089] The video frame acquisition unit 301 is used to acquire a to-be-processed video frame of the to-be-processed video;

[0090] A noise determination unit 302, configured to determine a noise image corresponding to the video frame to be processed;

[0091] A noise adding unit 303, configured to obtain a noisy video frame based on the video frame to be processed and the noise image;

[0092] The stylized processing unit 304 is configured to generate a stylized video frame corresponding to the video frame to be processed based on the noisy video frame and in combination with a reference frame; the reference frame includes a processed intermediate frame corresponding to other video frames to be processed except the currently processed video frame, and the processed intermediate frame is an intermediate image generated in the process of generating the stylized video frame;

[0093] The video generating unit 305 is configured to generate a stylized video based on the stylized video frame.

[0094] In some embodiments, the stylized processing unit is used to input the noisy video frames in parallel into a stylized image processing model corresponding to the number thereof for denoising, so as to obtain the stylized video frames; during the denoising process, the video frames to be processed are denoised in combination with reference frames.

[0095] In some embodiments, the stylization processing unit includes:

[0096] An image processing unit, configured to obtain an image feature of an I-th frame based on a K-th image processing layer of an I-th stylized image processing model, where I is a positive integer greater than or equal to 1;

[0097] An attention unit is used to perform attention calculation based on the image features of the I-th frame and the reference frame to obtain an attention-constrained video frame, and input the attention-constrained video frame into the K+1-th image processing layer for image processing; K is a positive integer greater than 1.

[0098] In some embodiments, the reference frame includes the 1st frame image features obtained by the Kth image processing layer of the 1st stylized image processing model, the I-1st frame image features obtained by the Kth image processing layer of the I-1st stylized image processing model and / or the Ith frame image features obtained by the Kth image processing layer of the Ith stylized image processing model.

[0099] In some embodiments, the denoised video frame obtained by the denoising process in step M is determined based on the following steps:

[0100] Based on the denoised video frame obtained by the denoising process in step M-1, the stylized description feature and the reference frame, a first noise is obtained;

[0101] Based on the denoised video frame obtained by the denoising process in the M-1th step and the reference frame, and not based on the stylized description feature, obtaining a second noise;

[0102] Obtaining a third noise based on the denoised video frame obtained by the denoising process in the M-1th step and not based on the reference frame and the stylized description feature;

[0103] Obtaining a target noise based on the first noise, the second noise, and the third noise;

[0104] Based on the denoised video frame obtained by the denoising process in the M-1th step and the target noise, the denoised video frame obtained by the denoising process in the Mth step is obtained; wherein M is a positive integer greater than or equal to 1.

[0105] In some embodiments, obtaining the target noise based on the first noise, the second noise, and the third noise includes:

[0106] The target noise is obtained by performing weighted calculation based on the first noise, the second noise and the third noise.

[0107] In some embodiments, the noise determination unit is used to superimpose random noise on the video frame to be processed, input the non-stylized image processing model to obtain a non-stylized video frame, perform loss correction iteration of the non-stylized image processing model based on the video frame to be processed and the non-stylized video frame, and when the similarity between the non-stylized video frame and the video frame to be processed is less than a certain threshold, use the random noise of this iteration as the noise image.

[0108] For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, and the modules described as separation modules may or may not be separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present embodiment. Those of ordinary skill in the art can understand and implement without paying creative work.

[0109] Accordingly, according to one or more embodiments of the present disclosure, there is provided an electronic device, including:

[0110] at least one memory and at least one processor;

[0111] The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to enable the electronic device to execute the video processing method provided according to one or more embodiments of the present disclosure.

[0112] Accordingly, according to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, which stores program code, and the program code can be executed by a computer device to enable the computer device to perform the video processing method provided according to one or more embodiments of the present disclosure.

[0113] Reference below Figure 4, which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 800 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0114] like Figure 4 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0115] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0116] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0117] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0118] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0119] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0120] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method of the present disclosure.

[0121] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0122] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0123] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0124] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0125] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0126] According to one or more embodiments of the present disclosure, a video processing method is provided, including:

[0127] Obtain a video frame to be processed of the video to be processed;

[0128] Determining a noise image corresponding to the video frame to be processed;

[0129] Based on the video frame to be processed and the noise image, a noisy video frame is obtained;

[0130] Based on the noisy video frame, in combination with a reference frame, a stylized video frame corresponding to the video frame to be processed is generated; the reference frame includes a processed intermediate frame corresponding to other video frames to be processed except the currently processed video frame, and the processed intermediate frame is an intermediate image generated in the process of generating the stylized video frame;

[0131] A stylized video is generated based on the stylized video frames.

[0132] According to one or more embodiments of the present disclosure, generating a stylized video frame corresponding to the video frame to be processed based on the noisy video frame and in combination with a reference frame includes:

[0133] Inputting the noisy video frames in parallel into a stylized image processing model corresponding to the number thereof for denoising, thereby obtaining the stylized video frames;

[0134] In the denoising process, the video frame to be processed is denoised in combination with a reference frame.

[0135] According to one or more embodiments of the present disclosure, in the denoising process, denoising the video frame to be processed is performed in combination with a reference frame, including:

[0136] Obtaining an I-th frame image feature based on the K-th image processing layer of the I-th stylized image processing model, where I is a positive integer greater than or equal to 1;

[0137] Performing attention calculation based on the image features of the first frame and the reference frame to obtain an attention constrained video frame;

[0138] The attention constrained video frame is input into the K+1th image processing layer for image processing; wherein K is a positive integer greater than 1.

[0139] According to one or more embodiments of the present disclosure, the reference frame includes the 1st frame image features obtained by the Kth image processing layer of the 1st stylized image processing model, the I-1st frame image features obtained by the Kth image processing layer of the I-1st stylized image processing model and / or the Ith frame image features obtained by the Kth image processing layer of the Ith stylized image processing model.

[0140] According to one or more embodiments of the present disclosure, the denoised video frame obtained by the denoising process in step M is determined based on the following steps:

[0141] Based on the denoised video frame obtained by the denoising process in step M-1, the stylized description feature and the reference frame, a first noise is obtained;

[0142] Based on the denoised video frame obtained by the denoising process in the M-1th step and the reference frame, and not based on the stylized description feature, obtaining a second noise;

[0143] Obtaining a third noise based on the denoised video frame obtained by the denoising process in the M-1th step and not based on the reference frame and the stylized description feature;

[0144] Obtaining a target noise based on the first noise, the second noise, and the third noise;

[0145] Based on the denoised video frame obtained by the denoising process in the M-1th step and the target noise, the denoised video frame obtained by the denoising process in the Mth step is obtained; wherein M is a positive integer greater than or equal to 1.

[0146] According to one or more embodiments of the present disclosure, obtaining the target noise based on the first noise, the second noise, and the third noise includes:

[0147] The target noise is obtained by performing weighted calculation based on the first noise, the second noise and the third noise.

[0148] According to one or more embodiments of the present disclosure, the determining the initial noise image corresponding to the video frame to be processed includes:

[0149] Superimposing random noise on the video frame to be processed, and inputting the result into a non-stylized image processing model to obtain a non-stylized video frame;

[0150] Performing loss correction iteration of a non-stylized image processing model based on the video frame to be processed and the non-stylized video frame;

[0151] When the similarity between the non-stylized video frame and the to-be-processed video frame is less than a certain threshold, the random noise of this iteration is used as the noise image.

[0152] According to one or more embodiments of the present disclosure, generating a stylized video based on the stylized video frame includes:

[0153] Based on the timestamps of the video frames to be processed, the stylized video frames are spliced ​​to obtain a stylized video.

[0154] According to one or more embodiments of the present disclosure, a video processing device is provided, including:

[0155] A video frame acquisition unit, used for acquiring a to-be-processed video frame of a to-be-processed video;

[0156] A noise determination unit, used to determine a noise image corresponding to the video frame to be processed;

[0157] A noise adding unit, configured to obtain a noisy video frame based on the video frame to be processed and the noise image;

[0158] A stylized processing unit, configured to generate a stylized video frame corresponding to the video frame to be processed based on the noisy video frame and in combination with a reference frame; the reference frame includes a processed intermediate frame corresponding to other video frames to be processed except the currently processed video frame, and the processed intermediate frame is an intermediate image generated in the process of generating the stylized video frame;

[0159] A video generating unit is used to generate a stylized video based on the stylized video frame.

[0160] According to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory so that the electronic device executes the video processing method provided according to one or more embodiments of the present disclosure.

[0161] According to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, wherein the non-transitory computer storage medium stores program code, and when the program code is executed by a computer device, the computer device executes a video processing method provided according to one or more embodiments of the present disclosure.

[0162] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0163] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0164] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A video processing method, characterized in that: include: Obtain a video frame to be processed of the video to be processed; Determining a noise image corresponding to the video frame to be processed; Based on the video frame to be processed and the noise image, a noisy video frame is obtained; Based on the noisy video frame, in combination with a reference frame, a stylized video frame corresponding to the video frame to be processed is generated; the reference frame includes a processed intermediate frame corresponding to other video frames to be processed except the currently processed video frame, and the processed intermediate frame is an intermediate image generated in the process of generating the stylized video frame; A stylized video is generated based on the stylized video frames.

2. The method according to claim 1, characterized in that Based on the noisy video frame and in combination with a reference frame, a stylized video frame corresponding to the video frame to be processed is generated, including: Inputting the noisy video frames in parallel into a stylized image processing model corresponding to the number thereof for denoising, thereby obtaining the stylized video frames; In the denoising process, the video frame to be processed is denoised in combination with a reference frame.

3. The method according to claim 2, characterized in that In the denoising process, denoising the video frame to be processed is performed in combination with a reference frame, including: Obtaining an I-th frame image feature based on the K-th image processing layer of the I-th stylized image processing model, where I is a positive integer greater than or equal to 1; Performing attention calculation based on the image features of the first frame and the reference frame to obtain an attention constrained video frame; The attention constrained video frame is input into the K+1th image processing layer for image processing; wherein K is a positive integer greater than 1.

4. The method according to claim 3, characterized in that The reference frame includes the 1st frame image features obtained by the Kth image processing layer of the 1st stylized image processing model, the I-1th frame image features obtained by the Kth image processing layer of the I-1st stylized image processing model and / or the Ith frame image features obtained by the Kth image processing layer of the Ith stylized image processing model.

5. The method according to claim 3, characterized in that: Determine the denoised video frame obtained by the denoising process in step M based on the following steps: Obtaining a first noise based on the denoised video frame obtained by the denoising process in step M-1, the stylized description feature and the reference frame; Obtaining a second noise based on the denoised video frame obtained by the denoising process in the M-1th step and the reference frame, and not based on the stylized description feature; Obtaining a third noise based on the denoised video frame obtained by the denoising process in the M-1th step and not based on the reference frame and the stylized description feature; Obtaining a target noise based on the first noise, the second noise, and the third noise; Based on the denoised video frame obtained by the denoising process in the M-1th step and the target noise, a denoised video frame obtained by the denoising process in the Mth step is obtained; Wherein, M is a positive integer greater than or equal to 1.

6. The method according to claim 1, characterized in that The obtaining the target noise based on the first noise, the second noise and the third noise includes: The target noise is obtained by performing weighted calculation based on the first noise, the second noise and the third noise.

7. The method according to claim 1, characterized in that The determining the initial noise image corresponding to the video frame to be processed includes: Superimposing random noise on the video frame to be processed, and inputting the result into a non-stylized image processing model to obtain a non-stylized video frame; Performing loss correction iteration of a non-stylized image processing model based on the to-be-processed video frame and the non-stylized video frame; When the similarity between the non-stylized video frame and the to-be-processed video frame is less than a certain threshold, the random noise of this iteration is used as the noise image.

8. The method according to claim 1, characterized in that Generating a stylized video based on the stylized video frame includes: Based on the timestamps of the video frames to be processed, the stylized video frames are spliced ​​to obtain a stylized video.

9. A video processing device, characterized in that: include: A video frame acquisition unit, used for acquiring a to-be-processed video frame of a to-be-processed video; A noise determination unit, used to determine a noise image corresponding to the video frame to be processed; A noise adding unit, configured to obtain a noisy video frame based on the video frame to be processed and the noise image; A stylized processing unit, configured to generate a stylized video frame corresponding to the video frame to be processed based on the noisy video frame and in combination with a reference frame; the reference frame includes a processed intermediate frame corresponding to other video frames to be processed except the currently processed video frame, and the processed intermediate frame is an intermediate image generated in the process of generating the stylized video frame; A video generating unit is used to generate a stylized video based on the stylized video frame.

10. An electronic device, characterized in that: include: at least one memory and at least one processor; The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to enable the electronic device to execute the method according to any one of claims 1 to 8.

11. A non-transitory computer storage medium, characterized in that The non-transitory computer storage medium stores a program code, and when the program code is executed by a computer device, the computer device executes the method according to any one of claims 1 to 8.