WO2024046144A1 - Video processing method and related device thereof - Google Patents

Video processing method and related device thereof Download PDF

Info

Publication number
WO2024046144A1
WO2024046144A1 PCT/CN2023/113745 CN2023113745W WO2024046144A1 WO 2024046144 A1 WO2024046144 A1 WO 2024046144A1 CN 2023113745 W CN2023113745 W CN 2023113745W WO 2024046144 A1 WO2024046144 A1 WO 2024046144A1
Authority
WO
WIPO (PCT)
Prior art keywords
video frame
current video
super
resolution
feature
Prior art date
Application number
PCT/CN2023/113745
Other languages
French (fr)
Chinese (zh)
Inventor
郭佳明
邹学益
刘毅
张恒胜
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024046144A1 publication Critical patent/WO2024046144A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/44Processing 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/44008Processing 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/44Processing 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/4402Processing 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 reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing 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 reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4

Definitions

  • This application relates to artificial intelligence (AI) technology, and in particular to a video processing method and related equipment.
  • AI artificial intelligence
  • the current video frame and the reference video frame of the current video frame are input to the neural network model, so that the neural network model performs super-resolution reconstruction (also called super-resolution) of the current video frame based on the reference video frame, and obtains the current video frame after super-resolution.
  • super-resolution reconstruction also called super-resolution
  • the neural network model only uses the reference video frame itself as the reference benchmark, and the factors considered are relatively single.
  • the current video frame after super-resolution output by the neural network model is not of high quality (cannot have ideal resolution), so that the image quality of the entire video stream after super-resolution is still not good enough, resulting in poor user experience.
  • Embodiments of the present application provide a video processing method and related equipment, which have a good super-resolution effect on video frames in the video stream, so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • a first aspect of the embodiments of the present application provides a video processing method, which method includes:
  • the current video frame and the motion vector used in the decoding process of the current video frame can be obtained first.
  • the motion vector used in the decoding process of the current video frame can be used to transform the feature information of the reference video frame to obtain the transformed reference video frame.
  • the feature information that is, the feature information of the reference video frame aligned to the current video frame. It should be noted that the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. Regarding the super-resolution process of the target model on the reference video frame, please refer to the subsequent super-resolution of the current video frame by the target model. The relevant description of the sub-process will not be expanded upon here.
  • the transformed feature information and the current video frame can be input to the target model (for example, a trained recurrent neural network model), so that the current video frame can be processed by the target model based on the transformed feature information.
  • the target model for example, a trained recurrent neural network model
  • Super-resolution reconstruction to obtain the current video frame after super-resolution.
  • the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed Feature information, wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • transforming the feature information of the reference video frame based on the motion vector to obtain the transformed feature information includes: calculating the motion vector and the feature information of the reference video frame through a warping algorithm to obtain the transformed feature information.
  • Feature information The foregoing
  • the motion vector used in the decoding process of the current video frame and the feature information of the reference video frame can be calculated through a warping algorithm (for example, bilinear difference method, bicubic difference method, etc.), so as to Accurately obtain the transformed feature information.
  • the current video frame is super-resolved based on the transformed feature information through the target model, and obtaining the current video frame after super-resolution includes: performing feature extraction on the current video frame through the target model to obtain the current video The first feature of the frame; fuse the transformed feature information and the first feature through the target model to obtain the second feature of the current video frame; perform feature extraction on the second feature through the target model to obtain the third feature of the current video frame , the third feature is used as the current video frame after super-resolution.
  • the target model can first perform feature extraction on the current video frame, thereby obtaining the first feature of the current video frame.
  • the target model After obtaining the first feature of the current video frame, the target model can fuse the transformed feature information and the first feature of the current video frame, thereby obtaining the second feature of the current video frame. After obtaining the second feature of the current video frame, the target model can continue to perform feature extraction on the second feature of the current video frame, thereby obtaining the third feature of the current video frame.
  • the target model can directly use the third feature as the current super-resolved feature. video frames and output them externally.
  • the method further includes: fusing the third feature and the current video frame through the target model to obtain the super-resolved current video frame.
  • the target model can fuse the third feature of the current video frame and the current video frame, thereby obtaining and outputting the super-resolved current video frame.
  • the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the target model can obtain the feature information of the current video frame through the following multiple methods: After obtaining the third feature of the current video frame, the target model can directly use the third feature of the current video frame as the feature of the current video frame. information and output it to the outside for use in the super-resolution process of the next video frame; after obtaining the current video frame after super-resolution, the target model can directly use the current video frame after super-resolution as the feature information of the current video frame and output it to the outside. For use in the super-resolution process of the next video frame.
  • the method further includes: extracting features of the third feature or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
  • the target model can also obtain the feature information of the current video frame in the following multiple ways: After obtaining the third feature of the current video frame, the target model can continue to perform feature extraction on the third feature of the current video frame, thereby obtaining the feature information of the current video frame. Feature information; after obtaining the current video frame after super-resolution, the target model can continue to extract features of the current video frame after super-resolution, thereby obtaining the feature information of the current video frame.
  • the current video frame contains N image blocks
  • obtaining the motion vector used in the decoding process of the current video frame includes: obtaining the decoding of M image blocks in the current video frame from the compressed video stream.
  • the motion vector used in the process N ⁇ 2, N>M ⁇ 1; based on the motion vector used in the decoding process of M image blocks, calculate the motion vector used in the decoding process of N-M image blocks, or,
  • the preset value is determined as the motion vector used in the decoding process of N-M image blocks.
  • the compressed video stream only provides the motion vectors corresponding to these M image blocks. Since the compressed video stream does not provide the motion vectors corresponding to the remaining N-M image blocks of the current video frame, the following is used. There are several ways to calculate the motion vectors corresponding to these N-M image blocks: use the preset value directly as the motion vector corresponding to these N-M image blocks; calculate the motion vectors corresponding to M image blocks to obtain the corresponding motion vectors of these N-M image blocks. motion vector. After calculating the motion vectors corresponding to the N-M image blocks, the motion vectors corresponding to the M image blocks derived from the compressed video stream can be used as the motion used in the decoding process of the M image blocks in the current video frame.
  • a second aspect of the embodiment of the present application provides a video processing method, which method includes:
  • the current video frame and the residual information used in the decoding process of the current video frame can be obtained first.
  • the characteristic information of the reference video frame can also be obtained, and the current video frame, the residual information used in the decoding process of the current video frame, and The characteristic information of the reference video frame is input to the target model, so that the target model super-resolves the current video frame based on the characteristic information of the reference video frame and the residual information used in the decoding process of the current video frame, and obtains the super-resolved The current video frame.
  • the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame.
  • the super-resolution process of the target model on the reference video frame please refer to the subsequent target model. The relevant description of the super-resolution process of the current video frame will not be expanded here.
  • the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame.
  • the current video frame is super-resolved through the target model based on the feature information and residual information of the reference video frame.
  • the current video frame obtained after super-resolution includes: super-resolving the current video frame through the target model. Feature extraction is used to obtain the first feature of the current video frame; the feature information of the reference video frame and the first feature are fused through the target model to obtain the second feature of the current video frame; the second feature is extracted through the target model to obtain The third feature of the current video frame; the target model performs feature extraction on the third feature based on the residual information to obtain the fourth feature of the current video frame, and the fourth feature is used as the current video frame after super-resolution.
  • the target model can first perform feature extraction on the current video frame, thereby obtaining The first feature of the current video frame. After obtaining the first feature of the current video frame, the target model fuses the feature information of the reference video frame and the first feature of the current video frame, thereby obtaining the second feature of the current video frame. After obtaining the second feature of the current video frame, the target model can continue to perform feature extraction on the second feature of the current video frame, thereby obtaining the third feature of the current video frame.
  • the target model can continue to perform feature extraction on the third feature of the current video frame based on the residual information used in the decoding process of the current video frame, thereby obtaining the fourth feature of the current video frame.
  • the target model can use the fourth feature as the current video frame after super-resolution and output it externally.
  • the residual information includes the residual information used in the decoding process of N image blocks in the current video frame
  • the target model is used to extract the third feature based on the residual information to obtain the current video
  • the fourth feature of the frame includes: using the target model to determine P image blocks whose residual information is greater than the preset residual threshold among the N image blocks, N ⁇ 2, N>P ⁇ 1; using the target model to determine the third Among the features, features corresponding to the P image blocks are extracted to obtain the fourth feature of the current video frame.
  • the current video frame can be divided into N image blocks, so the residual information used in the decoding process of the current video frame includes the residual information used in the decoding process of N image blocks in the current video frame. .
  • the target model can sequentially compare the residual information used in the decoding process of each image block with the preset threshold, thereby determining P items whose residual information is greater than the preset residual threshold.
  • Image block After obtaining P image blocks whose residual information is greater than the preset residual threshold, the target model can perform feature extraction on the part of the third feature of the current video frame corresponding to the P image blocks, and the third feature is equal to The other part of the features corresponding to the remaining N-P image blocks remains unchanged, thereby obtaining the fourth feature of the current video frame.
  • the method further includes: fusing the fourth feature and the current video frame through the target model to obtain the super-resolved current video frame.
  • the target model can fuse the fourth feature of the current video frame and the current video frame to obtain the super-resolved current video frame.
  • the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the target model can obtain the feature information of the current video frame through the following multiple methods: After obtaining the third feature of the current video frame, the target model can directly use the third feature of the current video frame as the feature of the current video frame. information and output it to the outside for use in the super-resolution process of the next video frame; after obtaining the fourth feature of the current video frame, the target model can directly use the fourth feature of the current video frame as the feature information of the current video frame and output it to the outside.
  • the target model can directly use the current video frame after super-resolution as the feature information of the current video frame and output it for the next video.
  • the super-resolution process of the frame is used.
  • the method further includes: performing feature extraction on the third feature, the fourth feature or the current video frame after super-resolution through the target model to obtain the feature information of the current video frame.
  • the target model can also obtain the feature information of the current video frame through the following multiple methods: after obtaining the third feature of the current video frame, the target model can continue to extract features of the third feature of the current video frame, thereby Obtain the feature information of the current video frame; after obtaining the fourth feature of the current video frame, the target model can continue to perform feature extraction on the fourth feature of the current video frame, thereby obtaining the feature information of the current video frame; obtain the current video after super-resolution After the frame, the target The standard model can continue to extract features of the current video frame after super-resolution, thereby obtaining the feature information of the current video frame.
  • the third aspect of the embodiment of the present application provides a model training method, which method includes: obtaining the current video frame and the motion vector used in the decoding process of the current video frame; based on the motion vector, the reference video frame of the current video frame is Transform the feature information to obtain the transformed feature information.
  • the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained; the current video frame is super-resolved by the model to be trained based on the transformed feature information.
  • the current video frame after super-resolution is obtained; based on the current video frame after super-resolution and the current video frame after real super-resolution, the target loss is obtained, and the target loss is used to indicate the current video frame after super-resolution and the real video frame after super-resolution
  • the difference between the current video frames; the parameters of the model to be trained are updated based on the target loss until the model training conditions are met and the target model is obtained.
  • the target model trained by the above method has the ability to super-resolve video frames. Specifically, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed feature information, where , the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • transforming the feature information of the reference video frame based on the motion vector to obtain the transformed feature information includes: calculating the motion vector and the feature information of the reference video frame through a warping algorithm to obtain the transformed feature information. Feature information.
  • the current video frame is super-resolved based on the transformed feature information through the model to be trained, and obtaining the current video frame after the super-resolution includes: performing feature extraction on the current video frame through the model to be trained, and obtaining The first feature of the current video frame; fuse the transformed feature information and the first feature through the model to be trained to obtain the second feature of the current video frame; perform feature extraction on the second feature through the model to be trained to obtain the current video frame
  • the third feature is the current video frame after super-resolution.
  • the method further includes: fusing the third feature and the current video frame through a model to be trained to obtain the super-resolved current video frame.
  • the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the method further includes: extracting features of the third feature or the current video frame after super-resolution through the model to be trained, to obtain feature information of the current video frame.
  • the current video frame contains N image blocks
  • obtaining the motion vector used in the decoding process of the current video frame includes: obtaining the decoding of M image blocks in the current video frame from the compressed video stream.
  • the motion vector used in the process N ⁇ 2, N>M ⁇ 1; based on the motion vector used in the decoding process of M image blocks, calculate the motion vector used in the decoding process of N-M image blocks, or,
  • the preset value is determined as the motion vector used in the decoding process of N-M image blocks.
  • the fourth aspect of the embodiment of the present application provides a model training method.
  • the method includes: obtaining the current video frame and the residual information used in the decoding process of the current video frame; using the model to be trained based on the characteristics of the reference video frame information and residual information, perform super-resolution on the current video frame, and obtain the current video frame after super-resolution.
  • the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the model to be trained; based on the current super-resolution
  • the video frame and the current video frame after the real super-resolution are used to obtain the target loss.
  • the target loss is used to indicate the difference between the current video frame after the super-resolution and the current video frame after the real super-resolution; the parameters of the training model are to be treated based on the target loss. Update until the model training conditions are met and the target model is obtained.
  • the target model trained by the above method has the ability to super-resolve video frames. Specifically, obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-score the current video frame based on the feature information and residual information of the reference video frame, and obtain the super-score
  • the current video frame, the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the target model.
  • the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame.
  • the target model not only considers the information of the reference video frame itself, but also considers the difference in pixel values between the reference video frame and the current video frame.
  • the factors considered are relatively comprehensive. Therefore, the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving the user experience.
  • the current video frame is super-resolved based on the feature information and residual information of the reference video frame through the model to be trained, and the current video frame obtained after super-scoring includes: Feature extraction is performed on the frame to obtain the first feature of the current video frame; the feature information of the reference video frame and the first feature are fused through the model to be trained to obtain the second feature of the current video frame; the second feature is processed through the model to be trained Feature extraction is used to obtain the third feature of the current video frame; the model to be trained performs feature extraction on the third feature based on the residual information to obtain the fourth feature of the current video frame, and the fourth feature is used as the current video frame after super-resolution.
  • the residual information includes the residual information used in the decoding process of N image blocks in the current video frame, and the model to be trained extracts the third feature based on the residual information to obtain the current
  • the fourth feature of the video frame includes: using the model to be trained, P image blocks whose residual information is greater than the preset residual threshold are determined among the N image blocks, N ⁇ 2, N>P ⁇ 1; Feature extraction is performed on the features corresponding to the P image blocks in the third feature to obtain the fourth feature of the current video frame.
  • the method further includes: fusing the fourth feature and the current video frame through the model to be trained to obtain the super-resolved current video frame.
  • the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the method further includes: performing feature extraction on the third feature, the fourth feature or the current video frame after super-resolution through the model to be trained, to obtain the feature information of the current video frame.
  • the fifth aspect of the embodiment of the present application provides a video processing device.
  • the device includes: an acquisition module, used to acquire the current video frame and the motion vector used in the decoding process of the current video frame; a transformation module, used based on The motion vector transforms the feature information of the reference video frame of the current video frame to obtain the transformed feature information.
  • the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model; the super-resolution module is used to pass The target model performs super-resolution on the current video frame based on the transformed feature information to obtain the current video frame after super-resolution.
  • the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed Feature information, wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • the transformation module is used to calculate the motion vector and the feature information of the reference video frame through a warping algorithm to obtain transformed feature information.
  • the super-resolution module is used to: extract features of the current video frame through the target model to obtain the first feature of the current video frame; perform feature extraction on the transformed feature information and the first feature through the target model. Through fusion, the second feature of the current video frame is obtained; the second feature is extracted through the target model to obtain the third feature of the current video frame, and the third feature is used as the current video frame after super-resolution.
  • the super-resolution module is also used to fuse the third feature and the current video frame through the target model to obtain the current video frame after super-resolution.
  • the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the super-resolution module is also used to extract features of the third feature or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
  • the acquisition module is used to acquire the motion vectors used in the decoding process of M image blocks in the current video frame from the compressed video stream, N ⁇ 2, N>M ⁇ 1; based on The motion vector used in the decoding process of M image blocks, the motion vector used in the decoding process of NM image blocks is calculated, or the preset value is determined as the motion vector used in the decoding process of NM image blocks. .
  • the sixth aspect of the embodiment of the present application provides a video processing device.
  • the device includes: an acquisition module, used to acquire the current video frame and residual information used in the decoding process of the current video frame; a super-resolution module, The target model performs super-resolution on the current video frame based on the feature information and residual information of the reference video frame, and obtains the current video frame after super-resolution.
  • the feature information of the reference video frame is used in the super-resolution processing of the reference video frame by the target model. Get in.
  • the current video frame and the residual information used in the decoding process of the current video frame are obtained; the current video frame is super-resolved through the target model based on the feature information and residual information of the reference video frame, The current video frame after super-resolution is obtained, and the feature information of the reference video frame is obtained during the super-resolution processing of the reference video frame by the target model.
  • the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame.
  • the super-resolution module is used to: extract features of the current video frame through the target model to obtain the first feature of the current video frame; extract feature information and the first feature of the reference video frame through the target model Perform fusion to obtain the second feature of the current video frame; perform feature extraction on the second feature through the target model to obtain the third feature of the current video frame; perform feature extraction on the third feature based on the residual information through the target model to obtain the current video
  • the fourth feature of the frame is used as the current video frame after super-resolution.
  • the residual information includes the residual information used in the decoding process of N image blocks in the current video frame.
  • the super-resolution module is used to: determine in the N image blocks through the target model P image blocks whose residual information is greater than the preset residual threshold, N ⁇ 2, N>P ⁇ 1; use the target model to extract features corresponding to the P image blocks in the third feature to obtain the current video frame The fourth characteristic.
  • the super-resolution module is also used to fuse the fourth feature and the current video frame through the target model to obtain the current video frame after super-resolution.
  • the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the super-resolution module is also used to extract features of the third feature, the fourth feature or the current video frame after super-resolution through the target model, and obtain the feature information of the current video frame.
  • the seventh aspect of the embodiment of the present application provides a model training device.
  • the device includes: a first acquisition module, used to acquire the current video frame and the motion vector used in the decoding process of the current video frame; a transformation module, using The feature information of the reference video frame of the current video frame is transformed based on the motion vector to obtain the transformed feature information.
  • the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained; the super-resolution module , used to super-resolve the current video frame based on the transformed feature information through the model to be trained, and obtain the current video frame after super-resolution; the second acquisition module is used to perform super-resolution based on the current video frame after super-resolution and the real super-resolution of the current video frame to obtain the target loss.
  • the target loss is used to indicate the difference between the current video frame after super-resolution and the current video frame after real super-resolution; the update module is used to update the parameters of the model to be trained based on the target loss. , until the model training conditions are met and the target model is obtained.
  • the target model trained by the above device has the ability to super-resolve video frames. Specifically, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed feature information, where , the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • the transformation module is used to calculate the motion vector and the feature information of the reference video frame through a warping algorithm to obtain transformed feature information.
  • the super-resolution module is used to: extract features of the current video frame through the model to be trained, and obtain the current The first feature of the previous video frame; the transformed feature information and the first feature are fused through the model to be trained to obtain the second feature of the current video frame; the second feature is extracted through the model to be trained to obtain the current video frame The third feature is the current video frame after super-resolution.
  • the super-resolution module is also used to fuse the third feature and the current video frame through the model to be trained to obtain the current video frame after super-resolution.
  • the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the super-resolution module is also used to extract the third feature or the current video frame after super-resolution through the model to be trained, so as to obtain the feature information of the current video frame.
  • the acquisition module is used to acquire the motion vectors used in the decoding process of M image blocks in the current video frame from the compressed video stream, N ⁇ 2, N>M ⁇ 1; based on The motion vector used in the decoding process of M image blocks, the motion vector used in the decoding process of N-M image blocks is calculated, or the preset value is determined as the motion vector used in the decoding process of N-M image blocks. .
  • the eighth aspect of the embodiment of the present application provides a model training device, which includes: a first acquisition module, used to acquire the current video frame and residual information used in the decoding process of the current video frame; a super-resolution module , used to super-score the current video frame based on the feature information and residual information of the reference video frame through the model to be trained, and obtain the current video frame after the super-score.
  • the feature information of the reference video frame is used in the model to be trained to compare the reference video frame.
  • the second acquisition module is used to obtain the target loss based on the current video frame after super-resolution and the current video frame after the real super-resolution, and the target loss is used to indicate the current video frame after super-resolution and the real The difference between the current video frames after super-resolution;
  • the update module is used to update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
  • the target model trained by the above device has the ability to super-resolve video frames. Specifically, obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-score the current video frame based on the feature information and residual information of the reference video frame, and obtain the super-score
  • the current video frame, the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the target model.
  • the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame.
  • the super-resolution module is used to: extract features of the current video frame through the target model to obtain the first feature of the current video frame; extract feature information and the first feature of the reference video frame through the target model Perform fusion to obtain the second feature of the current video frame; perform feature extraction on the second feature through the target model to obtain the third feature of the current video frame; perform feature extraction on the third feature based on the residual information through the target model to obtain the current video
  • the fourth feature of the frame is used as the current video frame after super-resolution.
  • the residual information includes the residual information used in the decoding process of N image blocks in the current video frame.
  • the super-resolution module is used to: determine in the N image blocks through the target model P image blocks whose residual information is greater than the preset residual threshold, N ⁇ 2, N>P ⁇ 1; use the target model to extract features corresponding to the P image blocks in the third feature to obtain the current video frame The fourth characteristic.
  • the super-resolution module is also used to fuse the fourth feature and the current video frame through the target model to obtain the current video frame after super-resolution.
  • the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the super-resolution module is also used to extract features of the third feature, the fourth feature or the current video frame after super-resolution through the target model, and obtain the feature information of the current video frame.
  • a ninth aspect of the embodiment of the present application provides a video processing device, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code.
  • the video processing device executes the first step aspect, any possible implementation manner in the first aspect, the second aspect, or the method described in any possible implementation manner in the second aspect.
  • a tenth aspect of the embodiment of the present application provides a model training device, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code.
  • the model training device executes the third step Any one of the aspect and the third aspect Possible implementation manners, the fourth aspect, or the method described in any possible implementation manner of the fourth aspect.
  • An eleventh aspect of the embodiments of the present application provides a circuit system.
  • the circuit system includes a processing circuit configured to perform any of the possible implementations of the first aspect and the second aspect. , any possible implementation manner in the second aspect, the third aspect, any possible implementation manner in the third aspect, the fourth aspect, or the method described in any possible implementation manner in the fourth aspect.
  • a twelfth aspect of the embodiments of the present application provides a chip system.
  • the chip system includes a processor for calling a computer program or computer instructions stored in a memory, so that the processor executes the first aspect as described in the first aspect.
  • any possible implementation manner of the second aspect, any possible implementation manner of the second aspect, the third aspect, any possible implementation manner of the third aspect, the fourth aspect or any of the fourth aspects Any possible implementation method.
  • the processor is coupled to the memory through an interface.
  • the chip system further includes a memory, and computer programs or computer instructions are stored in the memory.
  • a thirteenth aspect of the embodiments of the present application provides a computer storage medium.
  • the computer storage medium stores a computer program.
  • the program When executed by a computer, the program causes the computer to implement any one of the first aspect and the first aspect.
  • Possible implementation methods, the second aspect, any one possible implementation method of the second aspect, the third aspect, any one possible implementation method of the third aspect, the fourth aspect or any one possible implementation method of the fourth aspect The method described in the implementation.
  • a fourteenth aspect of the embodiments of the present application provides a computer program product.
  • the computer program product stores instructions. When executed by a computer, the instructions make it possible for the computer to implement any one of the first aspect and the first aspect.
  • the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed features.
  • Information wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • Figure 1 is a structural schematic diagram of the main framework of artificial intelligence
  • Figure 2a is a schematic structural diagram of a video processing system provided by an embodiment of the present application.
  • Figure 2b is another structural schematic diagram of the video processing system provided by the embodiment of the present application.
  • Figure 2c is a schematic diagram of video processing related equipment provided by the embodiment of the present application.
  • Figure 3 is a schematic diagram of the architecture of the system 100 provided by the embodiment of the present application.
  • Figure 4 is a schematic flow chart of the video processing method provided by the embodiment of the present application.
  • Figure 5 is a schematic structural diagram of the target model provided by the embodiment of the present application.
  • Figure 6 is another schematic flowchart of a video processing method provided by an embodiment of the present application.
  • Figure 7 is another structural schematic diagram of the target model provided by the embodiment of the present application.
  • Figure 8 is a schematic flow chart of the model training method provided by the embodiment of the present application.
  • Figure 9 is another schematic flow chart of the model training method provided by the embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a video processing device provided by an embodiment of the present application.
  • Figure 11 is another structural schematic diagram of a video processing device provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of the model training device provided by the embodiment of the present application.
  • Figure 13 is another structural schematic diagram of the model training device provided by the embodiment of the present application.
  • Figure 14 is a schematic structural diagram of an execution device provided by an embodiment of the present application.
  • Figure 15 is a schematic structural diagram of the training equipment provided by the embodiment of the present application.
  • Figure 16 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • Embodiments of the present application provide a video processing method and related equipment, which have a good super-resolution effect on video frames in the video stream, so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • the naming or numbering of steps in this application does not mean that the steps in the method flow must be executed in the time/logical sequence indicated by the naming or numbering.
  • the process steps that have been named or numbered can be implemented according to the purpose to be achieved. The order of execution can be changed for technical purposes, as long as the same or similar technical effect can be achieved.
  • the division of units presented in this application is a logical division. In actual applications, there may be other divisions. For example, multiple units may be combined or integrated into another system, or some features may be ignored. , or not executed.
  • the coupling or direct coupling or communication connection between the units shown or discussed may be through some interfaces, and the indirect coupling or communication connection between units may be electrical or other similar forms. There are no restrictions in the application.
  • the units or subunits described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed into multiple circuit units, and some or all of them may be selected according to actual needs. unit to achieve the purpose of this application plan.
  • the current video frame in the video stream to be super-resolved (which can be any video frame in the video stream to be super-resolved)
  • the reference video frame (for example, the previous video frame and/or the subsequent video frame of the current video frame, etc.) is input to the neural network model, so that the neural network model super-resolves the current video frame based on the reference video frame, and obtains super-resolution The divided current video frame.
  • the neural network model can also be used to perform the same operations on the remaining video frames as the current video frame, so each video frame after super-resolution can be obtained , that is, the entire video stream after super-resolution.
  • the neural network model only uses the reference video frame itself as the reference benchmark, and the factors considered are relatively single.
  • the current video frame output by the model after super-resolution is not of high quality (it cannot have the ideal resolution), so that the image quality of the entire video stream after super-resolution is still not good enough (cannot have ideal quality and resolution), resulting in poor user experience.
  • the neural network model needs to perform a series of processing on all image blocks contained in the entire current video frame one by one, which requires a large amount of calculation, resulting in the aforementioned neural network model-based Video processing methods are difficult to apply to small devices with limited computing power (for example, smartphones, smart watches, etc.).
  • AI technology is a technical discipline that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence. AI technology obtains the best results by perceiving the environment, acquiring knowledge and using knowledge.
  • artificial intelligence technology is a branch of computer science that attempts to understand the nature of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence.
  • Using artificial intelligence for data processing is a common application method of artificial intelligence.
  • Figure 1 is a structural schematic diagram of the main framework of artificial intelligence.
  • the following is from the “intelligent information chain” (horizontal axis) and “IT value chain” (vertical axis)
  • the above artificial intelligence theme framework is elaborated on in two dimensions.
  • the "intelligent information chain” reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. During this process, the data It has gone through the condensation process of "data-information-knowledge-wisdom".
  • the "IT value chain” reflects the value that artificial intelligence brings to the information technology industry, from the underlying infrastructure of human intelligence and information (providing and processing technology implementation) to the systematic industrial ecological process.
  • Infrastructure provides computing power support for artificial intelligence systems, enables communication with the external world, and supports it through basic platforms.
  • computing power is provided by smart chips (hardware acceleration chips such as CPU, NPU, GPU, ASIC, FPGA, etc.);
  • the basic platform includes distributed computing framework and network and other related platform guarantees and support, which can include cloud storage and Computing, interconnection networks, etc.
  • sensors communicate with the outside world to obtain data, which are provided to smart chips in the distributed computing system provided by the basic platform for calculation.
  • Data from the upper layer of the infrastructure is used to represent data sources in the field of artificial intelligence.
  • the data involves graphics, images, voice, and text, as well as IoT data of traditional devices, including business data of existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
  • Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
  • machine learning and deep learning can perform symbolic and formal intelligent information modeling, extraction, preprocessing, training, etc. on data.
  • Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formal information to perform machine thinking and problem solving based on reasoning control strategies. Typical functions are search and matching.
  • Decision-making refers to the process of decision-making after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.
  • some general capabilities can be formed based on the results of further data processing, such as algorithms or a general system, such as translation, text analysis, computer vision processing, speech recognition, and image processing. identification, etc.
  • Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Its application fields mainly include: intelligent terminals, intelligent transportation, Smart healthcare, autonomous driving, smart cities, etc.
  • FIG. 2a is a schematic structural diagram of a video processing system provided by an embodiment of the present application.
  • the video processing system includes user equipment and data processing equipment.
  • user equipment includes smart terminals such as mobile phones, personal computers, or information processing centers.
  • the user equipment is the initiator of video processing. As the initiator of the video processing request, the user usually initiates the request through the user equipment.
  • the above-mentioned data processing equipment may be a cloud server, a network server, an application server, a management server, and other equipment or servers with data processing functions.
  • the data processing device receives the video processing request from the smart terminal through the interactive interface, and then performs information processing in the form of machine learning, deep learning, search, reasoning, decision-making, etc. through the memory that stores the data and the processor that processes the data.
  • the memory in the data processing device can be a general term, including local storage and a database that stores historical data.
  • the database can be on the data processing device or on other network servers.
  • the user equipment can receive the user's instructions. For example, the user equipment can obtain the compressed video stream input/selected by the user, and then initiate a request to the data processing equipment, so that the data processing equipment can obtain the information obtained by the user equipment.
  • a video processing application is executed on the compressed video stream to obtain a processed video stream.
  • the user equipment can obtain the compressed video stream selected by the user and initiate a processing request for the compressed video stream to the data processing device.
  • the data processing device first obtains the compressed video stream (low-quality, low-resolution video stream) and decodes the compressed video stream to restore the video stream to be super-resolved (which can also be called a decompressed video stream.
  • the data processing device can perform super-resolution processing on the video to be super-resolved, thereby obtaining a super-resolution video stream (a high-quality, high-resolution video stream), and return the super-resolution video stream to the user device. For users to view and use.
  • the data processing device can execute the video processing method according to the embodiment of the present application.
  • Figure 2b is another structural schematic diagram of a video processing system provided by an embodiment of the present application.
  • the user equipment directly serves as a data processing equipment.
  • the user equipment can directly obtain input from the user and directly perform processing by the hardware of the user equipment itself. Processing, the specific process is similar to Figure 2a, please refer to the above description, and will not be repeated here.
  • the user equipment can receive the user's instructions. For example, the user equipment can obtain the compressed video stream selected by the user, and then the user equipment itself obtains the compressed video stream (low-quality, low-resolution video stream). ), and decodes the compressed video stream to restore the video stream to be super-resolved (which can also be called a decompressed video stream, which is still a low-quality, low-resolution video stream, but with a larger number of video frames). Then, the user equipment can perform super-resolution processing on the video to be super-resolved, thereby obtaining a post-super-resolution video stream (a high-quality, high-resolution video stream) for the user to watch and use.
  • the user equipment can obtain the compressed video stream selected by the user, and then the user equipment itself obtains the compressed video stream (low-quality, low-resolution video stream). ), and decodes the compressed video stream to restore the video stream to be super-resolved (which can also be called a decompressed video stream, which is
  • the user equipment itself can execute the video processing method according to the embodiment of the present application.
  • Figure 2c is a schematic diagram of video processing related equipment provided by the embodiment of the present application.
  • the user equipment in Figure 2a and Figure 2b can be the local device 301 or the local device 302 in Figure 2c
  • the data processing device in Figure 2a can be the execution device 210 in Figure 2c
  • the data storage system 250 can To store the data to be processed by the execution device 210, the data storage system 250 can be integrated on the execution device 210, or can be set up on the cloud or other network servers.
  • the processors in Figure 2a and Figure 2b can perform data training/machine learning/deep learning through neural network models or other models (for example, support vector machine-based models), and use the data to finally train or learn the model to execute on the video Video processing applications to obtain corresponding processing results.
  • neural network models or other models for example, support vector machine-based models
  • Figure 3 is a schematic diagram of the architecture of the system 100 provided by the embodiment of the present application.
  • the execution device 110 is configured with an input/output (I/O) interface 112 for data interaction with external devices.
  • the user Data can be input to the I/O interface 112 through the client device 140.
  • the input data may include: various to-be-scheduled tasks, callable resources, and other parameters.
  • the execution device 110 When the execution device 110 preprocesses the input data, or when the calculation module 111 of the execution device 110 performs calculation and other related processing (such as implementing the function of the neural network in this application), the execution device 110 can call the data storage system 150
  • the data, codes, etc. in the system can be used for corresponding processing, and the data, instructions, etc. obtained by corresponding processing can also be stored in the data storage system 150 .
  • the I/O interface 112 returns the processing results to the client device 140, thereby providing them to the user.
  • the training device 120 can generate corresponding target models/rules based on different training data for different goals or different tasks, and the corresponding target models/rules can be used to achieve the above goals or complete the above tasks. , thereby providing users with the desired results.
  • the training data may be stored in the database 130 and come from training samples collected by the data collection device 160 .
  • the user can manually enter the input data, and the manual setting can be operated through the interface provided by the I/O interface 112 .
  • the client device 140 can automatically send input data to the I/O interface 112. If requiring the client device 140 to automatically send input data requires the user's authorization, the user can set corresponding permissions in the client device 140.
  • the user can view the results output by the execution device 110 on the client device 140, and the specific presentation form may be display, sound, action, etc.
  • the client device 140 can also be used as a data collection end to collect the input data of the input I/O interface 112 and the output results of the output I/O interface 112 as new sample data, and store them in the database 130 .
  • the I/O interface 112 directly uses the input data input to the I/O interface 112 and the output result of the output I/O interface 112 as a new sample as shown in the figure.
  • the data is stored in database 130.
  • Figure 3 is only a schematic diagram of a system architecture provided by an embodiment of the present application.
  • the positional relationship between the devices, devices, modules, etc. shown in the figure does not constitute any limitation.
  • the data The storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 can also be placed in the execution device 110.
  • the neural network can be trained according to the training device 120.
  • An embodiment of the present application also provides a chip, which includes a neural network processor NPU.
  • the chip can be disposed in the execution device 110 as shown in FIG. 3 to complete the calculation work of the calculation module 111.
  • the chip can also be installed in the training device 120 as shown in Figure 3 to complete the training work of the training device 120 and output the target model/rules.
  • Neural network processor NPU is mounted on the main central processing unit (CPU) (host CPU) as a co-processor, and the main CPU allocates tasks.
  • the core part of the NPU is the arithmetic circuit.
  • the controller controls the arithmetic circuit to extract the data in the memory (weight memory or input memory) and perform operations.
  • the computing circuit includes multiple processing units (PE).
  • the arithmetic circuit is a two-dimensional systolic array.
  • the arithmetic circuit may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition.
  • the arithmetic circuit is a general-purpose matrix processor.
  • the arithmetic circuit fetches the corresponding data of matrix B from the weight memory and caches it on each PE in the arithmetic circuit.
  • the operation circuit takes matrix A data and matrix B from the input memory to perform matrix operations, and the partial result or final result of the obtained matrix is stored in the accumulator (accumulator).
  • the vector calculation unit can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc.
  • the vector computing unit can be used for network calculations in non-convolutional/non-FC layers in neural networks, such as pooling, batch normalization, local response normalization, etc.
  • the vector computation unit can store the processed output vector into a unified buffer.
  • the vector calculation unit may apply a nonlinear function to the output of the arithmetic circuit, such as a vector of accumulated values, to generate activation values.
  • the vector computation unit generates normalized values, merged values, or both.
  • the processed output vector can be used as an activation input to an arithmetic circuit, such as for use in a subsequent layer in a neural network.
  • Unified memory is used to store input data and output data.
  • the weight data directly transfers the input data in the external memory to the input memory and/or the unified memory through the storage unit access controller (direct memory access controller, DMAC), stores the weight data in the external memory into the weight memory, and stores the weight data in the unified memory.
  • the data is stored in external memory.
  • the bus interface unit (BIU) is used to realize the interaction between the main CPU, DMAC and instruction memory through the bus.
  • the instruction fetch buffer connected to the controller is used to store instructions used by the controller
  • the controller is used to call instructions cached in the memory to control the working process of the computing accelerator.
  • the unified memory, input memory, weight memory and instruction memory are all on-chip memories, and the external memory is the memory outside the NPU.
  • the external memory can be double data rate synchronous dynamic random access memory (double data). rate synchronous dynamic random accessmemory (DDR SDRAM), high bandwidth memory (high bandwidth memory (HBM)) or other readable and writable memory.
  • DDR SDRAM rate synchronous dynamic random access memory
  • HBM high bandwidth memory
  • the neural network can be composed of neural units.
  • the neural unit can refer to an arithmetic unit that takes xs and intercept 1 as input.
  • the output of the arithmetic unit can be:
  • s 1, 2,...n, n is a natural number greater than 1
  • Ws is the weight of xs
  • b is the bias of the neural unit.
  • f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer.
  • the activation function can be a sigmoid function.
  • a neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit.
  • the input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field.
  • the local receptive field can be an area composed of several neural units.
  • W is a weight vector, and each value in this vector represents the weight value of a neuron in this layer of neural network.
  • This vector W determines the spatial transformation from the input space to the output space described above, that is, the weight W of each layer controls how to transform the space.
  • the purpose of training a neural network is to finally obtain the weight matrix of all layers of the trained neural network (a weight matrix formed by the vector W of many layers). Therefore, the training process of neural network is essentially to learn how to control spatial transformation, and more specifically, to learn the weight matrix.
  • weight vector (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the neural network). For example, if the predicted value of the network is high, adjust the weight vector to make it predict lower Some, constant adjustments are made until the neural network can predict the truly desired target value. Therefore, it is necessary to define in advance "how to compare the difference between the predicted value and the target value". This is the loss function (loss function) or objective function (objective function), which is used to measure the difference between the predicted value and the target value. Important equations. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference. Then the training of the neural network becomes a process of reducing this loss as much as possible.
  • the neural network can use the error back propagation (BP) algorithm to modify the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, forward propagation of the input signal until the output will produce an error loss, and the parameters in the initial neural network model are updated by backpropagating the error loss information, so that the error loss converges.
  • the backpropagation algorithm is a backpropagation movement dominated by error loss, aiming to obtain the optimal parameters of the neural network model, such as the weight matrix.
  • the model training method provided by the embodiment of the present application involves the processing of data sequences, and can be specifically applied to methods such as data training, machine learning, and deep learning.
  • the training data for example, the current video in the model training method provided by the embodiment of the present application) frames, etc.
  • the video processing method provided by the embodiment of the present application can use the above-trained neural network to input input data (for example, the current video frame in the video processing method provided by the embodiment of the present application, etc.) into the trained neural network.
  • model training method and video processing method provided in the embodiments of this application are inventions based on the same concept, and can also be understood as two parts of a system, or two stages of an overall process: such as model training phase and model application phase.
  • Figure 4 is a schematic flow chart of a video processing method provided by an embodiment of the present application. As shown in Figure 4, the method includes:
  • the compressed video stream can be decoded to obtain a video stream to be super-resolved.
  • the compressed video stream at least contains the first video frame, the motion vector and residual information corresponding to the second video frame, the motion vector and residual information corresponding to the third video frame, ..., the motion vector and residual information corresponding to the last video frame.
  • the first video frame can be used as the reference video frame of the second video frame, motion compensation is performed on the first video frame based on the motion vector corresponding to the second video frame, and the intermediate video frame is obtained, and then the intermediate video frame is The residual information corresponding to the second video frame is superimposed to obtain the second video frame.
  • the decoding of the second video frame is completed.
  • the second video frame can be used as the reference video frame of the third video frame, and motion compensation is performed on the second video frame based on the motion vector corresponding to the third video frame to obtain an intermediate video frame, and then in the intermediate video frame The residual information corresponding to the third video frame is superimposed to obtain the third video frame.
  • the decoding of the third video frame is completed.
  • the decoding of the fourth video frame can also be completed,..., the decoding of the last video frame is equivalent to obtaining the first video frame, the second video frame, the third video frame,... , the last video frame and multiple video frames constitute the video stream to be super-resolved.
  • any video frame among multiple video frames included in the video stream to be super-resolved will be schematically introduced below, and this video frame will be called the current video frame.
  • the current video frame After decoding to obtain the current video frame based on the reference video frame of the current video frame (for example, the previous video frame of the current video frame), the motion vector corresponding to the current video frame, and the residual information corresponding to the current video frame, the current video frame can also be obtained based on The motion vector corresponding to the current video frame is used to obtain the motion vector used in the decoding process of the current video frame.
  • the motion vector used in the decoding process of the current video frame can be obtained in the following way:
  • the motion vector corresponding to the video frame contains the motion vector corresponding to the N image blocks.
  • the difference between the position of the block in the reference video frame and the position of the i-th image block in the current video frame that is, the movement and change of the position of the i-th image block from the reference video frame to the current video frame.
  • the motion quantities corresponding to the N image blocks derived from the compressed video stream can be directly used as the motion vectors used in the decoding process of the N image blocks in the current video frame, that is, in the decoding process of the current video frame The motion vector used.
  • M is less than or equal to N, and M is a positive integer greater than or equal to 1
  • the motion vector corresponding to the current video frame provided by the compressed video stream only contains the motion vectors corresponding to these M image blocks.
  • the motion vectors corresponding to the N-M image blocks are calculated in the following multiple ways:
  • the motion vectors corresponding to the M image blocks derived from the compressed video stream can be used as the motion vectors used in the decoding process of the M image blocks in the current video frame.
  • the calculated motion vectors corresponding to the N-M image blocks as the motion vectors used in the decoding process of the N-M image blocks in the current video frame, which is equivalent to obtaining the motion vector used in the decoding process of the current video frame. motion vector.
  • the reference video frame of the current video frame is the previous video frame of the current video frame.
  • the reference video frame can also be the next video frame of the current video frame, or , the reference video frame can also be the first two video frames of the current video frame, the reference video frame can also be the last two video frames of the current video frame, etc., and there is no limit here.
  • the feature information of the reference video frame is in the target model of the reference video frame. Obtained during the super score process.
  • the motion vector used in the decoding process of the current video frame can be used to obtain the feature information of the reference video frame (which can also be called the hidden information of the reference video frame). Containing state (hidden state)) is transformed to obtain the transformed feature information of the reference video frame, that is, the feature information of the reference video frame aligned to the current video frame.
  • the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. That is to say, during the super-resolution process of the target model on the reference video frame, the feature information of the reference video frame is obtained. This can be either the intermediate output of the process, the final output, or the reference video frame itself.
  • the super-resolution process of the target model on the reference video frame please refer to the relevant description of the subsequent super-resolution process of the current video frame by the target model, which will not be discussed here.
  • the feature information of the reference video frame can be transformed in the following manner to obtain the transformed feature information:
  • the motion vector used in the decoding process of the current video frame and the feature information of the reference video frame can be calculated through the warp algorithm to obtain the transformed feature information.
  • the calculation process is as shown in the following formula:
  • MV t is the motion vector used in the decoding process of the current video frame
  • h t-1 is the feature information of the reference video frame
  • It is the transformed feature information of the reference video frame
  • Warp() is the warping algorithm.
  • the transformed feature information and the current video frame can be input to the target model (for example, a trained recurrent neural network model), so that the current video frame can be processed by the target model based on the transformed feature information.
  • the target model for example, a trained recurrent neural network model
  • Super-resolution reconstruction to obtain the current video frame after super-resolution.
  • the target model can perform super-resolution on the current video frame in the following ways, thereby obtaining the current video frame after super-resolution:
  • the target model After inputting the transformed feature information and the current video frame to the target model, the target model can first perform feature extraction (for example, convolution processing, etc.) on the current video frame to obtain the first feature of the current video frame.
  • feature extraction for example, convolution processing, etc.
  • Figure 5 Figure 5 is a schematic structural diagram of the target model provided by the embodiment of the present application
  • the t-th video frame LR t is The current video frame
  • the t-1th video frame is the reference video frame of the tth video frame LR t .
  • the transformed implicit state of the t-th video frame LR t and the t-1th video frame (obtained by transforming the hidden state h t- 1 of the t-1th video frame using the motion vector MV t used in the decoding process of the t-th video frame)
  • the target model can first Preliminary feature extraction is performed on the video frame LR t to obtain the preliminary feature f t 1 of the t-th video frame (ie, the aforementioned first feature).
  • the target model After obtaining the first feature of the current video frame, the target model can fuse the transformed feature information and the first feature of the current video frame (for example, splicing processing, etc.) to obtain the second feature of the current video frame. . Still as in the above example, after obtaining the preliminary feature f t 1 of the t-th video frame, the target model can combine the preliminary feature f t 1 of the t-th video frame and the transformed hidden state of the t-1 video frame. Perform splicing (cascade) to obtain the fusion feature f t 2 of the t-th video frame (i.e., the aforementioned second feature).
  • the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the second feature of the current video frame, thereby obtaining the third feature of the current video frame. Still as in the above example, after obtaining the fusion feature f t 2 of the t-th video frame, the target model can continue to perform feature extraction on the fusion feature f t 2 of the t-th video frame to obtain further features f t of the t-th video frame. 3 .
  • feature extraction for example, convolution processing, etc.
  • the target model can fuse the third feature of the current video frame and the current video frame (for example, addition processing, etc.), thereby obtaining and outputting the super-resolved current Video frames. Still as in the above example, after obtaining the further feature f t 3 of the t-th video frame, the target model can add the further feature f t 3 of the t-th video frame and the t-th video frame LR t to obtain and output The t-th video frame SR t after super-resolution.
  • the target model can obtain the feature information (hidden state) of the current video frame in a variety of ways:
  • the target model can directly use the third feature of the current video frame as the feature information of the current video frame, and output it externally for use in the super-resolution process of the next video frame. Still as in the above example, after obtaining the further features f t 3 of the t-th video frame, the target model can use it as the hidden state h t of the t-th video frame and output the hidden state h t of the t-th video frame. .
  • the target model After obtaining the current video frame after super-resolution, the target model can directly use the current video frame after super-resolution as the feature information of the current video frame, and output it to the outside for use in the super-resolution process of the next video frame. Still as in the above example, get the t-th video frame SR t after super-resolution Afterwards, the target model can use it as the hidden state h t of the t-th video frame, and output the hidden state h t of the t-th video frame.
  • the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the third feature of the current video frame, thereby obtaining feature information of the current video frame. Still as in the above example, after obtaining the further feature f t 3 of the t-th video frame, the target model can perform feature extraction on the further feature f t 3 of the t-th video frame, thereby obtaining and outputting the implicit feature of the t-th video frame. State h t .
  • the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the current video frame after super-resolution, thereby obtaining the feature information of the current video frame. Still as in the above example, after obtaining the t-th video frame SR t after super-resolution, the target model can perform feature extraction on the t-th video frame SR t after super-resolution, thereby obtaining and outputting the implicit information of the t-th video frame. State h t .
  • the target model may not fuse the third feature with the current video frame, but directly use the third feature as the super-resolved current video frame. Still as in the above example, after obtaining the further features f t 3 of the t-th video frame, the target model can directly use it as the t-th video frame SR t after super-resolution, and output the t-th video frame SR after super-resolution. t .
  • the super-resolution processing for the current video frame is completed.
  • the same operations as those performed on the current video frame can also be performed, so that the video stream after super-resolution can be obtained.
  • the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed features.
  • Information wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • Figure 6 is another schematic flowchart of a video processing method provided by an embodiment of the present application. As shown in Figure 6, the method includes:
  • the compressed video stream can be decoded to obtain a video stream to be super-resolved.
  • the compressed video stream at least contains the first video frame, the motion vector and residual information corresponding to the second video frame, the motion vector and residual information corresponding to the third video frame, ..., the motion vector and residual information corresponding to the last video frame.
  • the first video frame can be used as the reference video frame of the second video frame, motion compensation is performed on the first video frame based on the motion vector corresponding to the second video frame, and the intermediate video frame is obtained, and then the intermediate video frame is The residual information corresponding to the second video frame is superimposed to obtain the second video frame.
  • the decoding of the second video frame is completed.
  • the second video frame can be used as the reference video frame of the third video frame, and motion compensation is performed on the second video frame based on the motion vector corresponding to the third video frame to obtain an intermediate video frame, and then in the intermediate video frame The residual information corresponding to the third video frame is superimposed to obtain the third video frame.
  • the decoding of the third video frame is completed.
  • the decoding of the fourth video frame can also be completed,..., the decoding of the last video frame is equivalent to obtaining the first video frame, the second video frame, the third video frame,... , the last video frame and multiple video frames constitute the video stream to be super-resolved.
  • any video frame among multiple video frames included in the video stream to be super-resolved will be schematically introduced below, and this video frame will be called the current video frame.
  • the current video frame After decoding to obtain the current video frame based on the reference video frame of the current video frame (for example, the previous video frame of the current video frame), the motion vector corresponding to the current video frame, and the residual information corresponding to the current video frame, the current video frame can also be obtained based on The motion vector corresponding to the current video frame is used to obtain the motion vector used in the decoding process of the current video frame.
  • the residual information corresponding to the current video frame provided by the compressed video stream can be used as the residual information used in the decoding process of the current video frame.
  • Super-resolution is performed on the current video frame to obtain the current video frame after super-resolution.
  • the feature information of the reference video frame is obtained during the super-resolution processing of the reference video frame by the target model.
  • the feature information of the reference video frame (also called the hidden state of the reference video frame) can also be obtained, and the current The video frame, the residual information used in the decoding process of the current video frame, and the feature information of the reference video frame are input to the target model, so that the target model is based on the feature information of the reference video frame and the feature information used in the decoding process of the current video frame. Residual information, perform super-resolution on the current video frame, and obtain the current video frame after super-resolution.
  • the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. That is to say, during the super-resolution process of the target model on the reference video frame, the feature information of the reference video frame is obtained. This can be either the intermediate output of the process, the final output, or the reference video frame itself.
  • the super-resolution process of the target model on the reference video frame please refer to the relevant description of the subsequent super-resolution process of the current video frame by the target model, which will not be discussed here.
  • the target model can perform super-resolution on the current video frame in the following ways, thereby obtaining the current video frame after super-resolution:
  • the target model After inputting the current video frame, the residual information used in the decoding process of the current video frame, and the feature information of the reference video frame into the target model, the target model can first perform feature extraction (for example, convolution) on the current video frame Processing, etc.) to obtain the first feature of the current video frame.
  • feature extraction for example, convolution
  • Figure 7 Figure 7 is another structural schematic diagram of the target model provided by the embodiment of the present application
  • the compressed video stream is decoded
  • multiple video frames can be obtained, wherein the t-th video frame LR t is the current video frame, and the t-1th video frame is the reference video frame of the t-th video frame LR t .
  • the target model After inputting the t-th video frame LR t , the residual information Res t used in the decoding process of the current video frame, and the hidden state h t-1 of the t-1th video frame into the target model, the target model can first Preliminary feature extraction is performed on the t-th video frame LR t , and the preliminary feature f t 1 of the t-th video frame is obtained (ie, the aforementioned first feature).
  • the target model After obtaining the first feature of the current video frame, the target model fuses the feature information of the reference video frame and the first feature of the current video frame (for example, splicing processing, etc.) to obtain the second feature of the current video frame. . Still as in the above example, after obtaining the preliminary feature f t 1 of the t-th video frame, the target model can combine the preliminary feature f t 1 of the t-th video frame and the hidden state h t-1 of the t-1th video frame Perform splicing (cascade) to obtain the fusion feature f t 2 of the t-th video frame (i.e., the aforementioned second feature).
  • the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the second feature of the current video frame, thereby obtaining the third feature of the current video frame. Still as in the above example, after obtaining the fusion feature f t 2 of the t-th video frame, the target model can continue to perform feature extraction on the fusion feature f t 2 of the t-th video frame to obtain further features f t of the t-th video frame. 3 .
  • feature extraction for example, convolution processing, etc.
  • the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the third feature of the current video frame based on the residual information used in the decoding process of the current video frame. etc.), thereby obtaining the fourth feature of the current video frame.
  • feature extraction for example, convolution processing, etc.
  • further features f t 3 of the t-th video frame are obtained.
  • the target model can use the residual information Res t used in the decoding process of the current video frame to obtain further features f t 3 of the t-th video frame.
  • Feature extraction is performed to obtain further features f t 4 of the t-th video frame.
  • the target model can fuse the fourth feature of the current video frame and the current video frame (for example, addition processing, etc.) to obtain the super-resolved current video frame. Still as in the above example, after obtaining the further feature f t 4 of the t-th video frame, the target model can add the further feature f t 4 of the t-th video frame and the t-th video frame LR t to obtain And output the t-th video frame SR t after super-resolution.
  • the target model can obtain the fourth feature of the current video frame in the following way:
  • the target model can sequentially compare the residual information used in the decoding process of each image block with the preset threshold (the size of the threshold can be determined according to the actual (requirements are set, there are no restrictions here) are compared to determine P image blocks whose residual information is greater than the preset residual threshold (P is less than N, and P is a positive integer greater than or equal to 1).
  • the target model After obtaining P image blocks whose residual information is greater than the preset residual threshold, the target model can perform feature extraction on the part of the third feature of the current video frame corresponding to the P image blocks, and the third The other part of the features corresponding to the remaining N-P image blocks remains unchanged, thereby obtaining the fourth feature of the current video frame.
  • the target model can obtain the feature information (hidden state) of the current video frame in a variety of ways:
  • the target model can directly use the third feature of the current video frame as the feature information of the current video frame, and output it externally for use in the super-resolution process of the next video frame. Still as in the above example, after obtaining the further features f t 3 of the t-th video frame, the target model can use it as the hidden state h t of the t-th video frame and output the hidden state h t of the t-th video frame. .
  • the target model After obtaining the fourth feature of the current video frame, the target model can directly use the fourth feature of the current video frame as the feature information of the current video frame, and output it externally for use in the super-resolution process of the next video frame. Still as in the above example, after obtaining the further features f t 4 of the t-th video frame, the target model can use it as the hidden state h t of the t-th video frame and output the hidden state h of the t-th video frame. t .
  • the target model After obtaining the current video frame after super-resolution, the target model can directly use the current video frame after super-resolution as the feature information of the current video frame, and output it to the outside for use in the super-resolution process of the next video frame. Still as in the above example, after obtaining the super-resolved t-th video frame SR t , the target model can use it as the hidden state h t of the t-th video frame and output the hidden state h t of the t-th video frame. .
  • the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the third feature of the current video frame, thereby obtaining feature information of the current video frame. Still as in the above example, after obtaining the further feature f t 3 of the t-th video frame, the target model can perform feature extraction on the further feature f t 3 of the t-th video frame, thereby obtaining and outputting the implicit feature of the t-th video frame. State h t .
  • the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the fourth feature of the current video frame, thereby obtaining feature information of the current video frame. Still as in the above example, after obtaining the further feature f t 4 of the t-th video frame, the target model can perform feature extraction on the further feature f t 4 of the t-th video frame, thereby obtaining and outputting the further feature f t 4 of the t-th video frame.
  • Hidden state h t Hidden state h t .
  • the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the current video frame after super-resolution, thereby obtaining the feature information of the current video frame. Still as in the above example, after obtaining the t-th video frame SR t after super-resolution, the target model can perform feature extraction on the t-th video frame SR t after super-resolution, thereby obtaining and outputting the implicit information of the t-th video frame. State h t .
  • the target model may not fuse the fourth feature with the current video frame, but directly use the fourth feature as the super-resolved current video frame. Still as in the above example, after obtaining the further features f t 4 of the t-th video frame, the target model can directly use it as the t-th video frame SR t after super-resolution, and output the t-th video frame after super-resolution SR t .
  • the super-resolution processing for the current video frame is completed.
  • the same operations as those performed on the current video frame can also be performed, so that the video stream after super-resolution can be obtained.
  • the current video frame and the residual information used in the decoding process of the current video frame are obtained; the current video frame is super-resolved through the target model based on the feature information and residual information of the reference video frame, and we obtain The feature information of the current video frame after super-resolution and the reference video frame is obtained through the super-resolution processing of the reference video frame by the target model.
  • the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame.
  • the neural network model only needs to perform all processing on some image blocks contained in the current video frame, and does not need to perform all processing on the other part of the image blocks included in the current video frame.
  • the processing can reduce the amount of calculation required, so the video processing method based on the target model can be applied to small devices with limited computing power.
  • Figure 8 is a schematic flow chart of the model training method provided by the embodiment of the present application. As shown in Figure 8, the method includes:
  • a batch of training data can be obtained first.
  • the batch of training data includes the current video frame and the motion used in the decoding process of the current video frame.
  • Vector the current video frame after the real super-resolution (that is, the real super-resolution result of the current video frame) is known.
  • the current video frame contains N image blocks
  • obtaining the motion vector used in the decoding process of the current video frame includes: obtaining the decoding of M image blocks in the current video frame from the compressed video stream.
  • the motion vector used in the process N ⁇ 2, N>M ⁇ 1; based on the motion vector used in the decoding process of M image blocks, calculate the motion vector used in the decoding process of N-M image blocks, or,
  • the preset value is determined as the motion vector used in the decoding process of N-M image blocks.
  • the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained.
  • the motion vector used in the decoding process of the current video frame can be used to obtain the feature information of the reference video frame (which can also be called the hidden information of the reference video frame). Containing state (hidden state)) is transformed to obtain the transformed feature information of the reference video frame, that is, the feature information of the reference video frame aligned to the current video frame.
  • the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained. That is to say, during the super-resolution process of the reference video frame by the model to be trained, the reference video frame Feature information can be either an intermediate output or a final output of the process.
  • the super-resolution process of the model to be trained on the reference video frame please refer to the relevant description of the subsequent super-resolution process of the model to be trained on the current video frame, which will not be discussed here.
  • transforming the feature information of the reference video frame based on the motion vector to obtain the transformed feature information includes: calculating the motion vector and the feature information of the reference video frame through a warping algorithm to obtain the transformed feature information. Feature information.
  • the transformed feature information and the current video frame can be input to the model to be trained, so that the model to be trained can perform super-resolution reconstruction of the current video frame based on the transformed feature information, and obtain the super-resolution the current video frame.
  • the current video frame is super-resolved based on the transformed feature information through the model to be trained, and obtaining the current video frame after the super-resolution includes: performing feature extraction on the current video frame through the model to be trained, and obtaining The first feature of the current video frame; fuse the transformed feature information and the first feature through the model to be trained to obtain the second feature of the current video frame; perform feature extraction on the second feature through the model to be trained to obtain the current video frame
  • the third feature is the current video frame after super-resolution.
  • the method further includes: fusing the third feature and the current video frame through the model to be trained to obtain the super-resolved current video frame.
  • the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the method further includes: extracting features of the third feature or the current video frame after super-resolution through the model to be trained, to obtain feature information of the current video frame.
  • the target loss is used to indicate the difference between the current video frame after super-resolution and the current video frame after real super-resolution.
  • the current video frame after super-resolution and the current video frame after real super-resolution can be calculated through the preset loss function to obtain the target loss.
  • the target loss is used to indicate the result after super-resolution. The difference between the current video frame and the current video frame after real super-resolution.
  • the parameters of the model to be trained can be updated based on the target loss, and the next batch of training data can be used to continue training the model to be trained after the updated parameters until the model training conditions are met (for example, the target loss reaches convergence, etc. ), the target model in the embodiment shown in Figure 4 is obtained.
  • the target model trained in the embodiment of this application has the ability to super-resolve video frames. Specifically, after obtaining the current video frame to and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed feature information, where the feature information of the reference video frame is in Obtained from the super-resolution process of the target model on the reference video frame. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • Figure 9 is another schematic flowchart of a model training method provided by an embodiment of the present application. As shown in Figure 9, the method includes:
  • a batch of training data can be obtained first.
  • the batch of training data includes the current video frame and the residuals used in the decoding process of the current video frame. Poor information. It should be noted that the current video frame after the real super-resolution (that is, the real super-resolution result of the current video frame) is known.
  • the feature information of the reference video frame (also called the hidden state of the reference video frame) can also be obtained, and the current The video frame, the residual information used in the decoding process of the current video frame, and the feature information of the reference video frame are input to the model to be trained, so that the model to be trained is based on the feature information of the reference video frame and the information used in the decoding process of the current video frame.
  • the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained. That is to say, during the super-resolution process of the reference video frame by the model to be trained, the reference video frame Feature information can be either an intermediate output or a final output of the process.
  • the super-resolution process of the model to be trained on the reference video frame please refer to the relevant description of the subsequent super-resolution process of the model to be trained on the current video frame, which will not be discussed here.
  • the current video frame is super-resolved based on the feature information and residual information of the reference video frame through the model to be trained, and the current video frame obtained after super-scoring includes: Feature extraction is performed on the frame to obtain the first feature of the current video frame; the feature information of the reference video frame and the first feature are fused through the model to be trained to obtain the second feature of the current video frame; the second feature is processed through the model to be trained Feature extraction is used to obtain the third feature of the current video frame; the model to be trained performs feature extraction on the third feature based on the residual information to obtain the fourth feature of the current video frame, and the fourth feature is used as the current video frame after super-resolution.
  • the residual information includes the residual information used in the decoding process of N image blocks in the current video frame, and the model to be trained extracts the third feature based on the residual information to obtain the current
  • the fourth feature of the video frame includes: using the model to be trained, P image blocks whose residual information is greater than the preset residual threshold are determined among the N image blocks, N ⁇ 2, N>P ⁇ 1; Feature extraction is performed on the features corresponding to the P image blocks in the third feature to obtain the fourth feature of the current video frame.
  • the method further includes: fusing the fourth feature and the current video frame through the model to be trained to obtain the super-resolved current video frame.
  • the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the method further includes: performing feature extraction on the third feature, the fourth feature or the current video frame after super-resolution through the model to be trained, to obtain the feature information of the current video frame.
  • the target loss is used to indicate the difference between the current video frame after super-resolution and the current video frame after real super-resolution.
  • the current video frame after super-resolution and the current video frame after real super-resolution can be calculated through the preset loss function to obtain the target loss.
  • the target loss is used to indicate the result after super-resolution. The difference between the current video frame and the current video frame after real super-resolution.
  • the parameters of the model to be trained can be updated based on the target loss, and the next batch of training data can be used to continue training the model to be trained after the updated parameters until the model training conditions are met (for example, the target loss reaches convergence, etc. ), the target model in the embodiment shown in Figure 6 is obtained.
  • the target model trained in the embodiment of this application has the ability to super-resolve video frames. Specifically, obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-score the current video frame based on the feature information and residual information of the reference video frame, and obtain the super-score
  • the current video frame, the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the target model.
  • the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame.
  • Figure 10 is a schematic structural diagram of a video processing device provided by an embodiment of the present application. As shown in Figure 10, the device includes:
  • the acquisition module 1001 is used to acquire the current video frame and the motion vector used in the decoding process of the current video frame;
  • the transformation module 1002 is used to transform the feature information of the reference video frame of the current video frame based on the motion vector to obtain the transformed feature information.
  • the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model;
  • the super-resolution module 1003 is used to perform super-resolution on the current video frame based on the transformed feature information through the target model to obtain the super-resolved current video frame.
  • the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed features.
  • Information wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • the transformation module 1002 is configured to calculate the feature information of the motion vector and the reference video frame through a warping algorithm to obtain transformed feature information.
  • the super-resolution module 1003 is used to: perform feature extraction on the current video frame through the target model to obtain the first feature of the current video frame; and extract the transformed feature information and the first feature through the target model. Fusion is performed to obtain the second feature of the current video frame; feature extraction is performed on the second feature through the target model to obtain the third feature of the current video frame, and the third feature is used as the current video frame after super-resolution.
  • the super-resolution module 1003 is also used to fuse the third feature and the current video frame through the target model to obtain the current video frame after super-resolution.
  • the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the super-resolution module 1003 is also used to extract features of the third feature or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
  • the acquisition module 1001 is used to acquire the motion vectors used in the decoding process of M image blocks in the current video frame from the compressed video stream, N ⁇ 2, N>M ⁇ 1; Based on the motion vectors used in the decoding process of the M image blocks, calculate the motion vectors used in the decoding process of the N-M image blocks, or determine the preset value as the motion used in the decoding process of the N-M image blocks. Vector.
  • FIG 11 is another structural schematic diagram of a video processing device provided by an embodiment of the present application. As shown in Figure 11, the device includes:
  • the acquisition module 1101 is used to acquire the current video frame and the residual information used in the decoding process of the current video frame;
  • the super-resolution module 1102 is used to perform super-resolution on the current video frame based on the feature information and residual information of the reference video frame through the target model to obtain the current video frame after super-resolution.
  • the feature information of the reference video frame is compared with the reference in the target model. Obtained from super-resolution processing of video frames.
  • the current video frame and the residual information used in the decoding process of the current video frame are obtained; the current video frame is super-resolved through the target model based on the feature information and residual information of the reference video frame, and we obtain The feature information of the current video frame after super-resolution and the reference video frame is obtained during the super-resolution processing of the reference video frame by the target model.
  • the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame.
  • the super-resolution module 1102 is used to: perform feature extraction on the current video frame through the target model to obtain the first feature of the current video frame; and extract the feature information of the reference video frame and the first feature through the target model.
  • the features are fused to obtain the second feature of the current video frame; the second feature is extracted through the target model to obtain the third feature of the current video frame; the third feature is extracted based on the residual information through the target model to obtain the current.
  • the fourth feature of the video frame, the fourth feature is used as the current video frame after super-resolution.
  • the residual information includes the residual information used in the decoding process of N image blocks in the current video frame
  • the super-resolution module 1102 is used to: use the target model in the N image blocks, Determine P image blocks whose residual information is greater than the preset residual threshold, N ⁇ 2, N>P ⁇ 1; use the target model to extract features corresponding to the P image blocks in the third feature to obtain the current video The fourth characteristic of the frame.
  • the super-resolution module 1102 is also used to fuse the fourth feature and the current video frame through the target model to obtain the current video frame after super-resolution.
  • the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the super-resolution module 1102 is also used to perform feature extraction on the third feature, the fourth feature, or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
  • Figure 12 is a schematic structural diagram of a model training device provided by an embodiment of the present application. As shown in Figure 12, the device includes:
  • the first acquisition module 1201 is used to acquire the current video frame and the motion vector used in the decoding process of the current video frame;
  • the transformation module 1202 is used to transform the feature information of the reference video frame of the current video frame based on the motion vector to obtain the transformed feature information.
  • the feature information of the reference video frame is used in the super-resolution process of the reference video frame by the model to be trained. get;
  • the super-resolution module 1203 is used to perform super-resolution on the current video frame based on the transformed feature information through the model to be trained, and obtain the current video frame after super-resolution;
  • the second acquisition module 1204 is used to obtain the target loss based on the current video frame after super-resolution and the current video frame after real super-resolution.
  • the target loss is used to indicate the current video frame after super-resolution and the current video after real super-resolution. Differences between frames;
  • the update module 1205 is used to update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
  • the target model trained in the embodiment of this application has the ability to super-resolve video frames. Specifically, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed feature information, where , the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame.
  • the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
  • the transformation module 1202 is configured to calculate the motion vector and the feature information of the reference video frame through a warping algorithm to obtain transformed feature information.
  • the super-resolution module 1203 is used to extract features of the current video frame through the model to be trained, and obtain to the first feature of the current video frame; fuse the transformed feature information and the first feature through the model to be trained to obtain the second feature of the current video frame; extract the second feature through the model to be trained to obtain the current video
  • the third feature of the frame is used as the current video frame after super-resolution.
  • the super-resolution module 1203 is also used to fuse the third feature and the current video frame through the model to be trained to obtain the current video frame after super-resolution.
  • the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the super-resolution module 1203 is also used to extract features of the third feature or the current video frame after super-resolution through the model to be trained, to obtain feature information of the current video frame.
  • the acquisition module 1201 is used to acquire the motion vectors used in the decoding process of M image blocks in the current video frame from the compressed video stream, N ⁇ 2, N>M ⁇ 1; Calculate the motion vectors used in the decoding process of N-M image blocks based on the motion vectors used in the decoding process of the M image blocks, or determine the preset value as the motion used in the decoding process of the N-M image blocks Vector.
  • Figure 13 is another structural schematic diagram of a model training device provided by an embodiment of the present application. As shown in Figure 13, the device includes:
  • the first acquisition module 1301 is used to acquire the current video frame and the residual information used in the decoding process of the current video frame;
  • the super-resolution module 1302 is used to perform super-resolution on the current video frame based on the feature information and residual information of the reference video frame through the model to be trained, and obtain the current video frame after super-resolution.
  • the feature information of the reference video frame is used in the model to be trained. Obtained from super-resolution processing of reference video frames;
  • the second acquisition module 1303 is used to obtain the target loss based on the current video frame after super-resolution and the current video frame after real super-resolution.
  • the target loss is used to indicate the current video frame after super-resolution and the current video after real super-resolution. Differences between frames;
  • the update module 1304 is used to update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
  • the target model trained in the embodiment of this application has the ability to super-resolve video frames. Specifically, obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-score the current video frame based on the feature information and residual information of the reference video frame, and obtain the super-score
  • the current video frame, the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the target model.
  • the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame.
  • the super-resolution module 1302 is used to: perform feature extraction on the current video frame through the target model to obtain the first feature of the current video frame; and perform feature information on the reference video frame and the first feature on the reference video frame through the target model.
  • the features are fused to obtain the second feature of the current video frame; the second feature is extracted through the target model to obtain the third feature of the current video frame; the third feature is extracted based on the residual information through the target model to obtain the current.
  • the fourth feature of the video frame, the fourth feature is used as the current video frame after super-resolution.
  • the residual information includes the residual information used in the decoding process of N image blocks in the current video frame.
  • the super-resolution module 1302 is used to: use the target model in the N image blocks, Determine P image blocks whose residual information is greater than the preset residual threshold, N ⁇ 2, N>P ⁇ 1; use the target model to extract features corresponding to the P image blocks in the third feature to obtain the current video The fourth characteristic of the frame.
  • the super-resolution module 1302 is also used to fuse the fourth feature and the current video frame through the target model to obtain the current video frame after super-resolution.
  • the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  • the super-resolution module 1302 is also used to perform feature extraction on the third feature, the fourth feature, or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
  • FIG. 14 is a schematic structural diagram of the execution device provided by the embodiment of the present application.
  • the execution device 1400 can be embodied as a mobile phone, a tablet, a laptop, a smart wearable device, a server, etc., and is not limited here.
  • the video processing device described in the corresponding embodiment of FIG. 10 or FIG. 11 may be deployed on the execution device 1400 to implement the video processing function in the corresponding embodiment of FIG. 4 or FIG. 6 .
  • the execution device 1400 includes: a receiver 1401, a transmitter 1402, a processor 1403 and a memory 1404 (the number of processors 1403 in the execution device 1400 can be one or more, one processor is taken as an example in Figure 14) , wherein the processor 1403 may include an application processor 14031 and a communication processor 14032.
  • the receiver 1401, the transmitter 1402, the processor 1403, and the memory 1404 may be connected by a bus or other means.
  • Memory 1404 may include read-only memory and random access memory and provides instructions and data to processor 1403 .
  • a portion of memory 1404 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 1404 stores processor and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, where the operating instructions may include various operating instructions for implementing various operations.
  • the processor 1403 controls the execution of operations of the device.
  • various components of the execution device are coupled together through a bus system.
  • the bus system may also include a power bus, a control bus, a status signal bus, etc.
  • various buses are called bus systems in the figure.
  • the methods disclosed in the above embodiments of the present application can be applied to the processor 1403 or implemented by the processor 1403.
  • the processor 1403 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 1403 .
  • the above-mentioned processor 1403 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, and can further include an application specific integrated circuit (ASIC), a field programmable Gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • the processor 1403 can implement or execute each method, step and logical block diagram disclosed in the embodiment of this application.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the memory 1404.
  • the processor 1403 reads the information in the memory 1404 and completes the steps of the above method in combination with its hardware.
  • the receiver 1401 may be configured to receive input numeric or character information and generate signal inputs related to performing relevant settings and functional controls of the device.
  • the transmitter 1402 can be used to output numeric or character information through the first interface; the transmitter 1402 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 1402 can also include a display device such as a display screen .
  • the processor 1403 is used to recommend items for information associated with the user through the first model in the corresponding embodiment of FIG. 4 or the target model in the corresponding embodiment of FIG. 9 .
  • FIG. 15 is a schematic structural diagram of the training device provided by the embodiment of the present application.
  • the training device 1500 is implemented by one or more servers.
  • the training device 1500 can vary greatly due to different configurations or performance, and can include one or more central processing units (CPU) 1514 (eg, one or more processors) and memory 1532, one or more storage media 1530 (eg, one or more mass storage devices) storing applications 1542 or data 1544.
  • the memory 1532 and the storage medium 1530 may be short-term storage or persistent storage.
  • the program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the training device.
  • the central processor 1514 may be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the training device 1500 .
  • the training device 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558; or, one or more operating systems 1541, such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
  • operating systems 1541 such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
  • the training device can execute the model training method in the embodiment corresponding to FIG. 8 or FIG. 9 .
  • Embodiments of the present application also relate to a computer storage medium.
  • the computer-readable storage medium stores a program for performing signal processing.
  • the program When the program is run on a computer, it causes the computer to perform the steps performed by the aforementioned execution device, or, The computer is caused to perform the steps performed by the aforementioned training device.
  • Embodiments of the present application also relate to a computer program product that stores instructions that, when executed by a computer, cause the computer to perform the steps performed by the foregoing execution device, or cause the computer to perform the steps performed by the foregoing training device. A step of.
  • the execution device, training device or terminal device provided by the embodiment of the present application may specifically be a chip.
  • the chip includes: a processing unit and a communication unit.
  • the processing unit may be, for example, a processor.
  • the communication unit may be, for example, an input/output interface. Pins or circuits, etc.
  • the processing unit can execute the computer execution instructions stored in the storage unit, so that the chip in the execution device executes the data processing method described in the above embodiment, or so that the chip in the training device executes the data processing method described in the above embodiment.
  • the storage unit is a storage unit within the chip, such as a register, cache, etc.
  • the storage unit may also be a storage unit located outside the chip in the wireless access device, such as Read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM), etc.
  • ROM Read-only memory
  • RAM random access memory
  • Figure 16 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • the chip can be represented as a neural network processor NPU 1600.
  • the NPU 1600 serves as a co-processor and is mounted to the host CPU (Host CPU). ), tasks are allocated by the Host CPU.
  • the core part of the NPU is the arithmetic circuit 1603.
  • the arithmetic circuit 1603 is controlled by the controller 1604 to extract the matrix data in the memory and perform multiplication operations.
  • the computing circuit 1603 includes multiple processing units (Process Engine, PE).
  • arithmetic circuit 1603 is a two-dimensional systolic array.
  • the arithmetic circuit 1603 may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition.
  • arithmetic circuit 1603 is a general-purpose matrix processor.
  • the arithmetic circuit obtains the corresponding data of matrix B from the weight memory 1602 and caches it on each PE in the arithmetic circuit.
  • the operation circuit takes matrix A data and matrix B from the input memory 1601 to perform matrix operations, and the partial result or final result of the matrix is stored in an accumulator (accumulator) 1608 .
  • the unified memory 1606 is used to store input data and output data.
  • the weight data directly passes through the storage unit access controller (Direct Memory Access Controller, DMAC) 1605, and the DMAC is transferred to the weight memory 1602.
  • Input data is also transferred to unified memory 1606 via DMAC.
  • DMAC Direct Memory Access Controller
  • BIU is the Bus Interface Unit, that is, the bus interface unit 1613, which is used for the interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1609.
  • IFB Instruction Fetch Buffer
  • the bus interface unit 1613 (Bus Interface Unit, BIU for short) is used to fetch the memory 1609 to obtain instructions from the external memory, and is also used for the storage unit access controller 1605 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
  • BIU Bus Interface Unit
  • DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 1606 or the weight data to the weight memory 1602 or the input data to the input memory 1601 .
  • the vector calculation unit 1607 includes multiple arithmetic processing units, and if necessary, further processes the output of the arithmetic circuit 1603, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional/fully connected layer network calculations in neural networks, such as Batch Normalization, pixel-level summation, upsampling of predicted label planes, etc.
  • vector calculation unit 1607 can store the processed output vectors to unified memory 1606 .
  • the vector calculation unit 1607 can apply a linear function; or a nonlinear function to the output of the operation circuit 1603, such as linear interpolation on the prediction label plane extracted by the convolution layer, or a vector of accumulated values, to generate an activation value.
  • vector calculation unit 1607 generates normalized values, pixel-wise summed values, or both.
  • the processed output vector can be used as an activation input to the arithmetic circuit 1603, such as for use in a subsequent layer in a neural network.
  • the instruction fetch buffer 1609 connected to the controller 1604 is used to store instructions used by the controller 1604;
  • the unified memory 1606, the input memory 1601, the weight memory 1602 and the fetch memory 1609 are all On-Chip memories. External memory is private to the NPU hardware architecture.
  • the processor mentioned in any of the above places can be a general central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above programs.
  • the device embodiments described above are only illustrative.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physically separate.
  • the physical unit can be located in one place, or it can be distributed across multiple network units. You can select some or all of the modules according to actual needs to implement The purpose of this embodiment is achieved.
  • the connection relationship between modules indicates that there are communication connections between them, which can be specifically implemented as one or more communication buses or signal lines.
  • the present application can be implemented by software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memories, Special components, etc. to achieve. In general, all functions performed by computer programs can be easily implemented with corresponding hardware. Moreover, the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. circuit etc. However, for this application, software program implementation is a better implementation in most cases. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to the existing technology.
  • the computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to cause a computer device (which can be a personal computer, training device, or network device, etc.) to execute the steps described in various embodiments of the present application. method.
  • a computer device which can be a personal computer, training device, or network device, etc.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, the computer instructions may be transferred from a website, computer, training device, or data
  • the center transmits to another website site, computer, training equipment or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • wired such as coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless such as infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that a computer can store, or a data storage device such as a training device or a data center integrated with one or more available media.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (Solid State Disk, SSD)), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

According to the video processing method and the related equipment thereof, which have a good super-resolution effect on a video frame in a video stream, and can enable the whole video stream subjected to super-resolution to have good image quality, thereby improving user experience. The method of the present application comprises: obtaining a current video frame and a motion vector used in the decoding process of the current video frame; and transforming feature information of a reference video frame of the current video frame on the basis of the motion vector to obtain transformed feature information, wherein the feature information of the reference video frame is obtained in the super-resolution process of a target model on the reference video frame; and performing super-resolution on the current video frame by means of the target model on the basis of the transformed feature information to obtain the current video frame subjected to super-resolution.

Description

一种视频处理方法及其相关设备A video processing method and related equipment
本申请要求于2022年08月30日提交中国专利局、申请号为202211049719.5、发明名称为“一种视频处理方法及其相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the China Patent Office on August 30, 2022, with the application number 202211049719.5 and the invention title "A video processing method and related equipment", the entire content of which is incorporated herein by reference. Applying.
技术领域Technical field
本申请涉及人工智能(artificial intelligence,AI)技术,尤其涉及一种视频处理方法及其相关设备。This application relates to artificial intelligence (AI) technology, and in particular to a video processing method and related equipment.
背景技术Background technique
随着技术的飞速发展,视频已经成为了最重要的信息传播载体。为了增强视频的画质,可以通过能够实现超分辨率(super resolution,SR)重建功能的神经网络模型,来提高视频流中各个视频帧的分辨率,从而提供高质量、高分辨率的视频供用户观看。With the rapid development of technology, video has become the most important carrier of information dissemination. In order to enhance the image quality of the video, the resolution of each video frame in the video stream can be improved through a neural network model that can achieve super-resolution (SR) reconstruction function, thereby providing high-quality, high-resolution video supply. Users watch.
目前,在待超分的视频流中,若需要提高当前视频帧的分辨率,可将当前视频帧以及当前视频帧的参考视频帧(例如,当前视频帧的前一视频帧和/或后一视频帧等等)输入至神经网络模型,以使得神经网络模型基于参考视频帧对当前视频帧进行超分辨率重建(也可以称为超分),得到超分后的当前视频帧。Currently, in the video stream to be super-resolved, if the resolution of the current video frame needs to be improved, the current video frame and the reference video frame of the current video frame (for example, the previous video frame and/or the subsequent video frame of the current video frame can be video frames, etc.) are input to the neural network model, so that the neural network model performs super-resolution reconstruction (also called super-resolution) of the current video frame based on the reference video frame, and obtains the current video frame after super-resolution.
可见,在针对当前视频帧的超分过程中,神经网络模型仅以参考视频帧自身为参考基准,所考虑的因素较为单一,神经网络模型输出的超分后的当前视频帧不够优质(无法具备理想的分辨率),以致于超分后的整个视频流的画质依旧不够良好,导致用户体验不佳。It can be seen that in the super-resolution process of the current video frame, the neural network model only uses the reference video frame itself as the reference benchmark, and the factors considered are relatively single. The current video frame after super-resolution output by the neural network model is not of high quality (cannot have ideal resolution), so that the image quality of the entire video stream after super-resolution is still not good enough, resulting in poor user experience.
发明内容Contents of the invention
本申请实施例提供了一种视频处理方法及其相关设备,对视频流中的视频帧具有良好的超分效果,可以使得超分后的整个视频流具备良好的画质,进而提高用户体验。Embodiments of the present application provide a video processing method and related equipment, which have a good super-resolution effect on video frames in the video stream, so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
本申请实施例的第一方面提供了一种视频处理方法,该方法包括:A first aspect of the embodiments of the present application provides a video processing method, which method includes:
当需要对已解码的当前视频帧进行超分辨率重建时,可先获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量。When it is necessary to perform super-resolution reconstruction on the decoded current video frame, the current video frame and the motion vector used in the decoding process of the current video frame can be obtained first.
得到当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可利用当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换,得到参考视频帧的变换后的特征信息,也就是参考视频帧对齐至当前视频帧的特征信息。需要说明的是,参考视频帧的特征信息是在目标模型对参考视频帧的超分过程中得到的,关于目标模型对参考视频帧的超分过程,可参考后续目标模型对当前视频帧的超分过程的相关说明部分,此处先不展开。After obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the motion vector used in the decoding process of the current video frame can be used to transform the feature information of the reference video frame to obtain the transformed reference video frame. The feature information, that is, the feature information of the reference video frame aligned to the current video frame. It should be noted that the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. Regarding the super-resolution process of the target model on the reference video frame, please refer to the subsequent super-resolution of the current video frame by the target model. The relevant description of the sub-process will not be expanded upon here.
得到变换后的特征信息后,可将变换后的特征信息以及当前视频帧输入至目标模型(例如,已训练的循环神经网络模型),以通过目标模型基于变换后的特征信息对当前视频帧进行超分辨率重建,得到超分后的当前视频帧。After obtaining the transformed feature information, the transformed feature information and the current video frame can be input to the target model (for example, a trained recurrent neural network model), so that the current video frame can be processed by the target model based on the transformed feature information. Super-resolution reconstruction to obtain the current video frame after super-resolution.
从上述方法可以看出:在获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。It can be seen from the above method that after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed Feature information, wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
在一种可能实现的方式中,基于运动矢量对参考视频帧的特征信息进行变换,得到变换后的特征信息包括:通过扭曲算法对运动矢量以及参考视频帧的特征信息进行计算,得到变换后的特征信息。前述 实现方式中,可通过扭曲算法(例如,双线性差值法、双三次差值法等等)对当前视频帧的解码过程中所使用的运动矢量以及参考视频帧的特征信息进行计算,从而准确得到变换后的特征信息。In one possible implementation method, transforming the feature information of the reference video frame based on the motion vector to obtain the transformed feature information includes: calculating the motion vector and the feature information of the reference video frame through a warping algorithm to obtain the transformed feature information. Feature information. The foregoing In the implementation, the motion vector used in the decoding process of the current video frame and the feature information of the reference video frame can be calculated through a warping algorithm (for example, bilinear difference method, bicubic difference method, etc.), so as to Accurately obtain the transformed feature information.
在一种可能实现的方式中,通过目标模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧包括:通过目标模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过目标模型对变换后的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过目标模型对第二特征进行特征提取,得到当前视频帧的第三特征,第三特征作为超分后的当前视频帧。前述实现方式中,将变换后的特征信息以及当前视频帧输入至目标模型后,目标模型可先对当前视频帧进行特征提取,从而得到当前视频帧的第一特征。得到当前视频帧的第一特征后,目标模型可对变换后的特征信息以及当前视频帧的第一特征进行融合,从而得到当前视频帧的第二特征。得到当前视频帧的第二特征后,目标模型可继续对当前视频帧的第二特征进行特征提取,从而得到当前视频帧的第三特征,目标模型可将第三特征直接作为超分后的当前视频帧,并对外输出。In one possible implementation method, the current video frame is super-resolved based on the transformed feature information through the target model, and obtaining the current video frame after super-resolution includes: performing feature extraction on the current video frame through the target model to obtain the current video The first feature of the frame; fuse the transformed feature information and the first feature through the target model to obtain the second feature of the current video frame; perform feature extraction on the second feature through the target model to obtain the third feature of the current video frame , the third feature is used as the current video frame after super-resolution. In the aforementioned implementation manner, after the transformed feature information and the current video frame are input to the target model, the target model can first perform feature extraction on the current video frame, thereby obtaining the first feature of the current video frame. After obtaining the first feature of the current video frame, the target model can fuse the transformed feature information and the first feature of the current video frame, thereby obtaining the second feature of the current video frame. After obtaining the second feature of the current video frame, the target model can continue to perform feature extraction on the second feature of the current video frame, thereby obtaining the third feature of the current video frame. The target model can directly use the third feature as the current super-resolved feature. video frames and output them externally.
在一种可能实现的方式中,该方法还包括:通过目标模型对第三特征以及当前视频帧进行融合,得到超分后的当前视频帧。前述实现方式中,得到当前视频帧的第三特征后,目标模型可对当前视频帧的第三特征以及当前视频帧进行融合,从而得到并对外输出超分后的当前视频帧。In a possible implementation manner, the method further includes: fusing the third feature and the current video frame through the target model to obtain the super-resolved current video frame. In the foregoing implementation, after obtaining the third feature of the current video frame, the target model can fuse the third feature of the current video frame and the current video frame, thereby obtaining and outputting the super-resolved current video frame.
在一种可能实现的方式中,第三特征或超分后的当前视频帧作为当前视频帧的特征信息。前述实现方式中,目标模型可通过以下多种方式来获取当前视频帧的特征信息:得到当前视频帧的第三特征后,目标模型可直接将当前视频帧的第三特征作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用;得到超分后的当前视频帧后,目标模型可直接将超分后的当前视频帧作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用。In one possible implementation manner, the third feature or the current video frame after super-resolution is used as the feature information of the current video frame. In the aforementioned implementation, the target model can obtain the feature information of the current video frame through the following multiple methods: After obtaining the third feature of the current video frame, the target model can directly use the third feature of the current video frame as the feature of the current video frame. information and output it to the outside for use in the super-resolution process of the next video frame; after obtaining the current video frame after super-resolution, the target model can directly use the current video frame after super-resolution as the feature information of the current video frame and output it to the outside. For use in the super-resolution process of the next video frame.
在一种可能实现的方式中,该方法还包括:通过目标模型对第三特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。目标模型还可通过以下多种方式来获取当前视频帧的特征信息:得到当前视频帧的第三特征后,目标模型可继续对当前视频帧的第三特征进行特征提取,从而得到当前视频帧的特征信息;得到超分后的当前视频帧后,目标模型可继续对超分后的当前视频帧进行特征提取,从而得到当前视频帧的特征信息。In a possible implementation manner, the method further includes: extracting features of the third feature or the current video frame after super-resolution through the target model to obtain feature information of the current video frame. The target model can also obtain the feature information of the current video frame in the following multiple ways: After obtaining the third feature of the current video frame, the target model can continue to perform feature extraction on the third feature of the current video frame, thereby obtaining the feature information of the current video frame. Feature information; after obtaining the current video frame after super-resolution, the target model can continue to extract features of the current video frame after super-resolution, thereby obtaining the feature information of the current video frame.
在一种可能实现的方式中,当前视频帧包含N个图像块,获取当前视频帧的解码过程中所使用的运动矢量包括:从压缩视频流中,获取当前视频帧中M个图像块的解码过程中所使用的运动矢量,N≥2,N>M≥1;基于M个图像块的解码过程中所使用的运动矢量,计算N-M个图像块的解码过程中所使用的运动矢量,或,将预设值确定为N-M个图像块的解码过程中所使用的运动矢量。前述实现方式中,若当前视频帧包含的N个图像块中,仅有M个图像块出现在当前视频帧的参考视频帧中,也就是说,当前视频帧和参考视频帧的内容仅部分相同,还有部分不相同,此时,压缩视频流仅提供这M个图像块对应的运动矢量,由于压缩视频流并未提供当前视频帧的其余N-M个图像块对应的运动矢量,故通过以下多种方式来计算这N-M个图像块对应的运动矢量:将预设值直接作为这N-M个图像块对应的运动矢量;对M个图像块对应的运动矢量进行计算,从而得到这N-M个图像块对应的运动矢量。在计算得到这N-M个图像块对应的运动矢量后,可将来源于压缩视频流的这M个图像块对应的运动运量作为当前视频帧中这M个图像块的解码过程中所使用的运动矢量,并将计算得到的这N-M个图像块对应的运动矢量作为当前视频帧中这N-M个图像块的解码过程中所使用的运动矢量,也就相当于得到了当前视频帧的解码过程中所使用的运动矢量。In a possible implementation manner, the current video frame contains N image blocks, and obtaining the motion vector used in the decoding process of the current video frame includes: obtaining the decoding of M image blocks in the current video frame from the compressed video stream. The motion vector used in the process, N≥2, N>M≥1; based on the motion vector used in the decoding process of M image blocks, calculate the motion vector used in the decoding process of N-M image blocks, or, The preset value is determined as the motion vector used in the decoding process of N-M image blocks. In the aforementioned implementation, if among the N image blocks contained in the current video frame, only M image blocks appear in the reference video frame of the current video frame, that is to say, the contents of the current video frame and the reference video frame are only partially the same. , there are some differences. At this time, the compressed video stream only provides the motion vectors corresponding to these M image blocks. Since the compressed video stream does not provide the motion vectors corresponding to the remaining N-M image blocks of the current video frame, the following is used. There are several ways to calculate the motion vectors corresponding to these N-M image blocks: use the preset value directly as the motion vector corresponding to these N-M image blocks; calculate the motion vectors corresponding to M image blocks to obtain the corresponding motion vectors of these N-M image blocks. motion vector. After calculating the motion vectors corresponding to the N-M image blocks, the motion vectors corresponding to the M image blocks derived from the compressed video stream can be used as the motion used in the decoding process of the M image blocks in the current video frame. vector, and use the calculated motion vectors corresponding to the N-M image blocks as the motion vectors used in the decoding process of the N-M image blocks in the current video frame, which is equivalent to obtaining the motion vectors used in the decoding process of the current video frame. The motion vector to use.
本申请实施例的第二方面提供了一种视频处理方法,该方法包括:A second aspect of the embodiment of the present application provides a video processing method, which method includes:
当需要对已解码的当前视频帧进行超分辨率重建时,可先获取当前视频帧以及当前视频帧的解码过程中所使用的残差信息。When it is necessary to perform super-resolution reconstruction on the decoded current video frame, the current video frame and the residual information used in the decoding process of the current video frame can be obtained first.
得到当前视频帧以及当前视频帧的解码过程中所使用的残差信息后,还可获取参考视频帧的特征信息,并将当前视频帧、当前视频帧的解码过程中所使用的残差信息以及参考视频帧的特征信息输入至目标模型,以使得目标模型基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息,对当前视频帧进行超分,得到超分后的当前视频帧。需要说明的是,参考视频帧的特征信息是在目标模型对参考视频帧的超分过程中得到的,关于目标模型对参考视频帧的超分过程,可参考后续目标模型对 当前视频帧的超分过程的相关说明部分,此处先不展开。After obtaining the current video frame and the residual information used in the decoding process of the current video frame, the characteristic information of the reference video frame can also be obtained, and the current video frame, the residual information used in the decoding process of the current video frame, and The characteristic information of the reference video frame is input to the target model, so that the target model super-resolves the current video frame based on the characteristic information of the reference video frame and the residual information used in the decoding process of the current video frame, and obtains the super-resolved The current video frame. It should be noted that the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. For the super-resolution process of the target model on the reference video frame, please refer to the subsequent target model. The relevant description of the super-resolution process of the current video frame will not be expanded here.
从上述方法可以看出:获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。前述过程中,目标模型可基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息对当前视频帧进行超分,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间像素值的差异关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。It can be seen from the above method: obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-resolve the current video frame based on the feature information and residual information of the reference video frame, The current video frame after super-resolution is obtained, and the feature information of the reference video frame is obtained during the super-resolution processing of the reference video frame by the target model. In the aforementioned process, the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame. It can be seen that during the super-resolution process of the current video frame by the target model , not only the information of the reference video frame itself is considered, but also the difference in pixel values between the reference video frame and the current video frame is considered. The factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is High enough quality (with a relatively ideal resolution) so that the entire video stream after super-resolution has good image quality, thus improving the user experience.
在一种可能实现的方式中,通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧包括:通过目标模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过目标模型对参考视频帧的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过目标模型对第二特征进行特征提取,得到当前视频帧的第三特征;通过目标模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征,第四特征作为超分后的当前视频帧。前述实现方式中,将当前视频帧、当前视频帧的解码过程中所使用的残差信息以及参考视频帧的特征信息输入至目标模型后,目标模型可先对当前视频帧进行特征提取,从而得到当前视频帧的第一特征。得到当前视频帧的第一特征后,目标模型对参考视频帧的特征信息以及当前视频帧的第一特征进行融合,从而得到当前视频帧的第二特征。得到当前视频帧的第二特征后,通过目标模型可继续对当前视频帧的第二特征进行特征提取,从而得到当前视频帧的第三特征。得到当前视频帧的第三特征后,目标模型可基于当前视频帧的解码过程中所使用的残差信息,继续对当前视频帧的第三特征进行特征提取,从而得到当前视频帧的第四特征,目标模型可将第四特征作为超分后的当前视频帧,并对外输出。In one possible implementation method, the current video frame is super-resolved through the target model based on the feature information and residual information of the reference video frame. The current video frame obtained after super-resolution includes: super-resolving the current video frame through the target model. Feature extraction is used to obtain the first feature of the current video frame; the feature information of the reference video frame and the first feature are fused through the target model to obtain the second feature of the current video frame; the second feature is extracted through the target model to obtain The third feature of the current video frame; the target model performs feature extraction on the third feature based on the residual information to obtain the fourth feature of the current video frame, and the fourth feature is used as the current video frame after super-resolution. In the aforementioned implementation, after the current video frame, the residual information used in the decoding process of the current video frame, and the feature information of the reference video frame are input to the target model, the target model can first perform feature extraction on the current video frame, thereby obtaining The first feature of the current video frame. After obtaining the first feature of the current video frame, the target model fuses the feature information of the reference video frame and the first feature of the current video frame, thereby obtaining the second feature of the current video frame. After obtaining the second feature of the current video frame, the target model can continue to perform feature extraction on the second feature of the current video frame, thereby obtaining the third feature of the current video frame. After obtaining the third feature of the current video frame, the target model can continue to perform feature extraction on the third feature of the current video frame based on the residual information used in the decoding process of the current video frame, thereby obtaining the fourth feature of the current video frame. , the target model can use the fourth feature as the current video frame after super-resolution and output it externally.
在一种可能实现的方式中,残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息,通过目标模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征包括:通过目标模型在N个图像块中,确定残差信息大于预置的残差阈值的P个图像块,N≥2,N>P≥1;通过目标模型对第三特征中与P个图像块对应的特征进行特征提取,得到当前视频帧的第四特征。前述实现方式中,设当前视频帧可划分为N个图像块,故当前视频帧的解码过程中所使用的残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息。在这N个图像块中,目标模型可依次将每个图像块的解码过程中所使用的残差信息与预置的阈值进行比较,从而确定残差信息大于预置的残差阈值的P个图像块。得到残差信息大于预置的残差阈值的P个图像块后,目标模型可对当前视频帧的第三特征中与P个图像块对应的这一部分特征进行特征提取,而第三特征中与其余N-P个图像快对应的另一部分特征则保持不变,从而得到当前视频帧的第四特征。In one possible implementation, the residual information includes the residual information used in the decoding process of N image blocks in the current video frame, and the target model is used to extract the third feature based on the residual information to obtain the current video The fourth feature of the frame includes: using the target model to determine P image blocks whose residual information is greater than the preset residual threshold among the N image blocks, N≥2, N>P≥1; using the target model to determine the third Among the features, features corresponding to the P image blocks are extracted to obtain the fourth feature of the current video frame. In the aforementioned implementation, it is assumed that the current video frame can be divided into N image blocks, so the residual information used in the decoding process of the current video frame includes the residual information used in the decoding process of N image blocks in the current video frame. . Among these N image blocks, the target model can sequentially compare the residual information used in the decoding process of each image block with the preset threshold, thereby determining P items whose residual information is greater than the preset residual threshold. Image block. After obtaining P image blocks whose residual information is greater than the preset residual threshold, the target model can perform feature extraction on the part of the third feature of the current video frame corresponding to the P image blocks, and the third feature is equal to The other part of the features corresponding to the remaining N-P image blocks remains unchanged, thereby obtaining the fourth feature of the current video frame.
在一种可能实现的方式中,该方法还包括:通过目标模型对第四特征以及当前视频帧进行融合,得到超分后的当前视频帧。前述实现方式中,得到当前视频帧的第四特征后,目标模型可对当前视频帧的第四特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the method further includes: fusing the fourth feature and the current video frame through the target model to obtain the super-resolved current video frame. In the foregoing implementation, after obtaining the fourth feature of the current video frame, the target model can fuse the fourth feature of the current video frame and the current video frame to obtain the super-resolved current video frame.
在一种可能实现的方式中,第三特征、第四特征或超分后的当前视频帧作为当前视频帧的特征信息。前述实现方式中,目标模型可通过以下多种方式来获取当前视频帧的特征信息:得到当前视频帧的第三特征后,目标模型可直接将当前视频帧的第三特征作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用;得到当前视频帧的第四特征后,目标模型可直接将当前视频帧的第四特征作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用;得到超分后的当前视频帧后,目标模型可直接将超分后的当前视频帧作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用。In a possible implementation manner, the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame. In the aforementioned implementation, the target model can obtain the feature information of the current video frame through the following multiple methods: After obtaining the third feature of the current video frame, the target model can directly use the third feature of the current video frame as the feature of the current video frame. information and output it to the outside for use in the super-resolution process of the next video frame; after obtaining the fourth feature of the current video frame, the target model can directly use the fourth feature of the current video frame as the feature information of the current video frame and output it to the outside. It can be used for the super-resolution process of the next video frame; after obtaining the current video frame after super-resolution, the target model can directly use the current video frame after super-resolution as the feature information of the current video frame and output it for the next video. The super-resolution process of the frame is used.
在一种可能实现的方式中,该方法还包括:通过目标模型对第三特征、第四特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。前述实现方式中,目标模型还可通过以下多种方式来获取当前视频帧的特征信息:得到当前视频帧的第三特征后,目标模型可继续对当前视频帧的第三特征进行特征提取,从而得到当前视频帧的特征信息;得到当前视频帧的第四特征后,目标模型可继续对当前视频帧的第四特征进行特征提取,从而得到当前视频帧的特征信息;得到超分后的当前视频帧后,目 标模型可继续对超分后的当前视频帧进行特征提取,从而得到当前视频帧的特征信息。In a possible implementation manner, the method further includes: performing feature extraction on the third feature, the fourth feature or the current video frame after super-resolution through the target model to obtain the feature information of the current video frame. In the aforementioned implementation, the target model can also obtain the feature information of the current video frame through the following multiple methods: after obtaining the third feature of the current video frame, the target model can continue to extract features of the third feature of the current video frame, thereby Obtain the feature information of the current video frame; after obtaining the fourth feature of the current video frame, the target model can continue to perform feature extraction on the fourth feature of the current video frame, thereby obtaining the feature information of the current video frame; obtain the current video after super-resolution After the frame, the target The standard model can continue to extract features of the current video frame after super-resolution, thereby obtaining the feature information of the current video frame.
本申请实施例的第三方面提供了一种模型训练方法,该方法包括:获取当前视频帧,以及当前视频帧的解码过程中所使用的运动矢量;基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,得到变换后的特征信息,参考视频帧的特征信息在待训练模型对参考视频帧的超分过程中得到;通过待训练模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧;基于超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;基于目标损失对待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。The third aspect of the embodiment of the present application provides a model training method, which method includes: obtaining the current video frame and the motion vector used in the decoding process of the current video frame; based on the motion vector, the reference video frame of the current video frame is Transform the feature information to obtain the transformed feature information. The feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained; the current video frame is super-resolved by the model to be trained based on the transformed feature information. score, the current video frame after super-resolution is obtained; based on the current video frame after super-resolution and the current video frame after real super-resolution, the target loss is obtained, and the target loss is used to indicate the current video frame after super-resolution and the real video frame after super-resolution The difference between the current video frames; the parameters of the model to be trained are updated based on the target loss until the model training conditions are met and the target model is obtained.
上述方法训练得到的目标模型,具备对视频帧进行超分的能力。具体地,在获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。The target model trained by the above method has the ability to super-resolve video frames. Specifically, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed feature information, where , the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
在一种可能实现的方式中,基于运动矢量对参考视频帧的特征信息进行变换,得到变换后的特征信息包括:通过扭曲算法对运动矢量以及参考视频帧的特征信息进行计算,得到变换后的特征信息。In one possible implementation method, transforming the feature information of the reference video frame based on the motion vector to obtain the transformed feature information includes: calculating the motion vector and the feature information of the reference video frame through a warping algorithm to obtain the transformed feature information. Feature information.
在一种可能实现的方式中,通过待训练模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧包括:通过待训练模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过待训练模型对变换后的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过待训练模型对第二特征进行特征提取,得到当前视频帧的第三特征,第三特征作为超分后的当前视频帧。In one possible implementation method, the current video frame is super-resolved based on the transformed feature information through the model to be trained, and obtaining the current video frame after the super-resolution includes: performing feature extraction on the current video frame through the model to be trained, and obtaining The first feature of the current video frame; fuse the transformed feature information and the first feature through the model to be trained to obtain the second feature of the current video frame; perform feature extraction on the second feature through the model to be trained to obtain the current video frame The third feature is the current video frame after super-resolution.
在一种可能实现的方式中,该方法还包括:通过待训练模型对第三特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the method further includes: fusing the third feature and the current video frame through a model to be trained to obtain the super-resolved current video frame.
在一种可能实现的方式中,第三特征或超分后的当前视频帧作为当前视频帧的特征信息。In one possible implementation manner, the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,该方法还包括:通过待训练模型对第三特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In a possible implementation manner, the method further includes: extracting features of the third feature or the current video frame after super-resolution through the model to be trained, to obtain feature information of the current video frame.
在一种可能实现的方式中,当前视频帧包含N个图像块,获取当前视频帧的解码过程中所使用的运动矢量包括:从压缩视频流中,获取当前视频帧中M个图像块的解码过程中所使用的运动矢量,N≥2,N>M≥1;基于M个图像块的解码过程中所使用的运动矢量,计算N-M个图像块的解码过程中所使用的运动矢量,或,将预设值确定为N-M个图像块的解码过程中所使用的运动矢量。In a possible implementation manner, the current video frame contains N image blocks, and obtaining the motion vector used in the decoding process of the current video frame includes: obtaining the decoding of M image blocks in the current video frame from the compressed video stream. The motion vector used in the process, N≥2, N>M≥1; based on the motion vector used in the decoding process of M image blocks, calculate the motion vector used in the decoding process of N-M image blocks, or, The preset value is determined as the motion vector used in the decoding process of N-M image blocks.
本申请实施例的第四方面提供了一种模型训练方法,该方法包括:获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过待训练模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在待训练模型对参考视频帧的超分处理中得到;基于超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;基于目标损失对待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。The fourth aspect of the embodiment of the present application provides a model training method. The method includes: obtaining the current video frame and the residual information used in the decoding process of the current video frame; using the model to be trained based on the characteristics of the reference video frame information and residual information, perform super-resolution on the current video frame, and obtain the current video frame after super-resolution. The feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the model to be trained; based on the current super-resolution The video frame and the current video frame after the real super-resolution are used to obtain the target loss. The target loss is used to indicate the difference between the current video frame after the super-resolution and the current video frame after the real super-resolution; the parameters of the training model are to be treated based on the target loss. Update until the model training conditions are met and the target model is obtained.
上述方法训练得到的目标模型,具备对视频帧进行超分的能力。具体地,获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。前述过程中,目标模型可基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息对当前视频帧进行超分,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间像素值的差异关系,所考虑的因素较为全面, 故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。The target model trained by the above method has the ability to super-resolve video frames. Specifically, obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-score the current video frame based on the feature information and residual information of the reference video frame, and obtain the super-score The current video frame, the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the target model. In the aforementioned process, the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame. It can be seen that during the super-resolution process of the current video frame by the target model , not only considers the information of the reference video frame itself, but also considers the difference in pixel values between the reference video frame and the current video frame. The factors considered are relatively comprehensive. Therefore, the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving the user experience.
在一种可能实现的方式中,通过待训练模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧包括:通过待训练模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过待训练模型对参考视频帧的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过待训练模型对第二特征进行特征提取,得到当前视频帧的第三特征;通过待训练模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征,第四特征作为超分后的当前视频帧。In one possible implementation method, the current video frame is super-resolved based on the feature information and residual information of the reference video frame through the model to be trained, and the current video frame obtained after super-scoring includes: Feature extraction is performed on the frame to obtain the first feature of the current video frame; the feature information of the reference video frame and the first feature are fused through the model to be trained to obtain the second feature of the current video frame; the second feature is processed through the model to be trained Feature extraction is used to obtain the third feature of the current video frame; the model to be trained performs feature extraction on the third feature based on the residual information to obtain the fourth feature of the current video frame, and the fourth feature is used as the current video frame after super-resolution.
在一种可能实现的方式中,残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息,通过待训练模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征包括:通过待训练模型在N个图像块中,确定残差信息大于预置的残差阈值的P个图像块,N≥2,N>P≥1;通过待训练模型对第三特征中与P个图像块对应的特征进行特征提取,得到当前视频帧的第四特征。In one possible implementation, the residual information includes the residual information used in the decoding process of N image blocks in the current video frame, and the model to be trained extracts the third feature based on the residual information to obtain the current The fourth feature of the video frame includes: using the model to be trained, P image blocks whose residual information is greater than the preset residual threshold are determined among the N image blocks, N≥2, N>P≥1; Feature extraction is performed on the features corresponding to the P image blocks in the third feature to obtain the fourth feature of the current video frame.
在一种可能实现的方式中,该方法还包括:通过待训练模型对第四特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the method further includes: fusing the fourth feature and the current video frame through the model to be trained to obtain the super-resolved current video frame.
在一种可能实现的方式中,第三特征、第四特征或超分后的当前视频帧作为当前视频帧的特征信息。In a possible implementation manner, the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,该方法还包括:通过待训练模型对第三特征、第四特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In a possible implementation manner, the method further includes: performing feature extraction on the third feature, the fourth feature or the current video frame after super-resolution through the model to be trained, to obtain the feature information of the current video frame.
本申请实施例的第五方面提供了一种视频处理装置,该装置包括:获取模块,用于获取当前视频帧,以及当前视频帧的解码过程中所使用的运动矢量;变换模块,用于基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,得到变换后的特征信息,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到;超分模块,用于通过目标模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧。The fifth aspect of the embodiment of the present application provides a video processing device. The device includes: an acquisition module, used to acquire the current video frame and the motion vector used in the decoding process of the current video frame; a transformation module, used based on The motion vector transforms the feature information of the reference video frame of the current video frame to obtain the transformed feature information. The feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model; the super-resolution module is used to pass The target model performs super-resolution on the current video frame based on the transformed feature information to obtain the current video frame after super-resolution.
从上述装置可以看出:在获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。It can be seen from the above device that after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed Feature information, wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
在一种可能实现的方式中,变换模块,用于通过扭曲算法对运动矢量以及参考视频帧的特征信息进行计算,得到变换后的特征信息。In one possible implementation manner, the transformation module is used to calculate the motion vector and the feature information of the reference video frame through a warping algorithm to obtain transformed feature information.
在一种可能实现的方式中,超分模块,用于:通过目标模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过目标模型对变换后的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过目标模型对第二特征进行特征提取,得到当前视频帧的第三特征,第三特征作为超分后的当前视频帧。In one possible implementation method, the super-resolution module is used to: extract features of the current video frame through the target model to obtain the first feature of the current video frame; perform feature extraction on the transformed feature information and the first feature through the target model. Through fusion, the second feature of the current video frame is obtained; the second feature is extracted through the target model to obtain the third feature of the current video frame, and the third feature is used as the current video frame after super-resolution.
在一种可能实现的方式中,超分模块,还用于通过目标模型对第三特征以及当前视频帧进行融合,得到超分后的当前视频帧。In one possible implementation manner, the super-resolution module is also used to fuse the third feature and the current video frame through the target model to obtain the current video frame after super-resolution.
在一种可能实现的方式中,第三特征或超分后的当前视频帧作为当前视频帧的特征信息。In one possible implementation manner, the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,超分模块,还用于通过目标模型对第三特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In one possible implementation manner, the super-resolution module is also used to extract features of the third feature or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
在一种可能实现的方式中,获取模块,用于从压缩视频流中,获取当前视频帧中M个图像块的解码过程中所使用的运动矢量,N≥2,N>M≥1;基于M个图像块的解码过程中所使用的运动矢量,计算N-M个图像块的解码过程中所使用的运动矢量,或,将预设值确定为N-M个图像块的解码过程中所使用的运动矢量。 In a possible implementation manner, the acquisition module is used to acquire the motion vectors used in the decoding process of M image blocks in the current video frame from the compressed video stream, N≥2, N>M≥1; based on The motion vector used in the decoding process of M image blocks, the motion vector used in the decoding process of NM image blocks is calculated, or the preset value is determined as the motion vector used in the decoding process of NM image blocks. .
本申请实施例的第六方面提供了一种视频处理装置,该装置包括:获取模块,用于获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;超分模块,用于通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。The sixth aspect of the embodiment of the present application provides a video processing device. The device includes: an acquisition module, used to acquire the current video frame and residual information used in the decoding process of the current video frame; a super-resolution module, The target model performs super-resolution on the current video frame based on the feature information and residual information of the reference video frame, and obtains the current video frame after super-resolution. The feature information of the reference video frame is used in the super-resolution processing of the reference video frame by the target model. Get in.
从上述装置可以看出:获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。前述过程中,目标模型可基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息对当前视频帧进行超分,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间像素值的差异关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。It can be seen from the above device that: the current video frame and the residual information used in the decoding process of the current video frame are obtained; the current video frame is super-resolved through the target model based on the feature information and residual information of the reference video frame, The current video frame after super-resolution is obtained, and the feature information of the reference video frame is obtained during the super-resolution processing of the reference video frame by the target model. In the aforementioned process, the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame. It can be seen that during the super-resolution process of the current video frame by the target model , not only the information of the reference video frame itself is considered, but also the difference in pixel values between the reference video frame and the current video frame is considered. The factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is High enough quality (with a relatively ideal resolution) so that the entire video stream after super-resolution has good image quality, thus improving the user experience.
在一种可能实现的方式中,超分模块,用于:通过目标模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过目标模型对参考视频帧的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过目标模型对第二特征进行特征提取,得到当前视频帧的第三特征;通过目标模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征,第四特征作为超分后的当前视频帧。In one possible implementation method, the super-resolution module is used to: extract features of the current video frame through the target model to obtain the first feature of the current video frame; extract feature information and the first feature of the reference video frame through the target model Perform fusion to obtain the second feature of the current video frame; perform feature extraction on the second feature through the target model to obtain the third feature of the current video frame; perform feature extraction on the third feature based on the residual information through the target model to obtain the current video The fourth feature of the frame is used as the current video frame after super-resolution.
在一种可能实现的方式中,残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息,超分模块,用于:通过目标模型在N个图像块中,确定残差信息大于预置的残差阈值的P个图像块,N≥2,N>P≥1;通过目标模型对第三特征中与P个图像块对应的特征进行特征提取,得到当前视频帧的第四特征。In one possible implementation, the residual information includes the residual information used in the decoding process of N image blocks in the current video frame. The super-resolution module is used to: determine in the N image blocks through the target model P image blocks whose residual information is greater than the preset residual threshold, N≥2, N>P≥1; use the target model to extract features corresponding to the P image blocks in the third feature to obtain the current video frame The fourth characteristic.
在一种可能实现的方式中,超分模块,还用于通过目标模型对第四特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the super-resolution module is also used to fuse the fourth feature and the current video frame through the target model to obtain the current video frame after super-resolution.
在一种可能实现的方式中,第三特征、第四特征或超分后的当前视频帧作为当前视频帧的特征信息。In a possible implementation manner, the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,超分模块,还用于通过目标模型对第三特征、第四特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In a possible implementation manner, the super-resolution module is also used to extract features of the third feature, the fourth feature or the current video frame after super-resolution through the target model, and obtain the feature information of the current video frame.
本申请实施例的第七方面提供了一种模型训练装置,该装置包括:第一获取模块,用于获取当前视频帧,以及当前视频帧的解码过程中所使用的运动矢量;变换模块,用于基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换处理,得到变换后的特征信息,参考视频帧的特征信息在待训练模型对参考视频帧的超分过程中得到;超分模块,用于通过待训练模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧;第二获取模块,用于基于超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;更新模块,用于基于目标损失对待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。The seventh aspect of the embodiment of the present application provides a model training device. The device includes: a first acquisition module, used to acquire the current video frame and the motion vector used in the decoding process of the current video frame; a transformation module, using The feature information of the reference video frame of the current video frame is transformed based on the motion vector to obtain the transformed feature information. The feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained; the super-resolution module , used to super-resolve the current video frame based on the transformed feature information through the model to be trained, and obtain the current video frame after super-resolution; the second acquisition module is used to perform super-resolution based on the current video frame after super-resolution and the real super-resolution of the current video frame to obtain the target loss. The target loss is used to indicate the difference between the current video frame after super-resolution and the current video frame after real super-resolution; the update module is used to update the parameters of the model to be trained based on the target loss. , until the model training conditions are met and the target model is obtained.
上述装置训练得到的目标模型,具备对视频帧进行超分的能力。具体地,在获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。The target model trained by the above device has the ability to super-resolve video frames. Specifically, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed feature information, where , the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
在一种可能实现的方式中,变换模块,用于通过扭曲算法对运动矢量以及参考视频帧的特征信息进行计算,得到变换后的特征信息。In one possible implementation manner, the transformation module is used to calculate the motion vector and the feature information of the reference video frame through a warping algorithm to obtain transformed feature information.
在一种可能实现的方式中,超分模块,用于:通过待训练模型对当前视频帧进行特征提取,得到当 前视频帧的第一特征;通过待训练模型对变换后的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过待训练模型对第二特征进行特征提取,得到当前视频帧的第三特征,第三特征作为超分后的当前视频帧。In one possible implementation, the super-resolution module is used to: extract features of the current video frame through the model to be trained, and obtain the current The first feature of the previous video frame; the transformed feature information and the first feature are fused through the model to be trained to obtain the second feature of the current video frame; the second feature is extracted through the model to be trained to obtain the current video frame The third feature is the current video frame after super-resolution.
在一种可能实现的方式中,超分模块,还用于通过待训练模型对第三特征以及当前视频帧进行融合,得到超分后的当前视频帧。In one possible implementation manner, the super-resolution module is also used to fuse the third feature and the current video frame through the model to be trained to obtain the current video frame after super-resolution.
在一种可能实现的方式中,第三特征或超分后的当前视频帧作为当前视频帧的特征信息。In one possible implementation manner, the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,超分模块,还用于通过待训练模型对第三特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In a possible implementation manner, the super-resolution module is also used to extract the third feature or the current video frame after super-resolution through the model to be trained, so as to obtain the feature information of the current video frame.
在一种可能实现的方式中,获取模块,用于从压缩视频流中,获取当前视频帧中M个图像块的解码过程中所使用的运动矢量,N≥2,N>M≥1;基于M个图像块的解码过程中所使用的运动矢量,计算N-M个图像块的解码过程中所使用的运动矢量,或,将预设值确定为N-M个图像块的解码过程中所使用的运动矢量。In a possible implementation manner, the acquisition module is used to acquire the motion vectors used in the decoding process of M image blocks in the current video frame from the compressed video stream, N≥2, N>M≥1; based on The motion vector used in the decoding process of M image blocks, the motion vector used in the decoding process of N-M image blocks is calculated, or the preset value is determined as the motion vector used in the decoding process of N-M image blocks. .
本申请实施例的第八方面提供了一种模型训练装置,该装置包括:第一获取模块,用于获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;超分模块,用于通过待训练模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在待训练模型对参考视频帧的超分处理中得到;第二获取模块,用于基于超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;更新模块,用于基于目标损失对待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。The eighth aspect of the embodiment of the present application provides a model training device, which includes: a first acquisition module, used to acquire the current video frame and residual information used in the decoding process of the current video frame; a super-resolution module , used to super-score the current video frame based on the feature information and residual information of the reference video frame through the model to be trained, and obtain the current video frame after the super-score. The feature information of the reference video frame is used in the model to be trained to compare the reference video frame. Obtained from the super-resolution processing; the second acquisition module is used to obtain the target loss based on the current video frame after super-resolution and the current video frame after the real super-resolution, and the target loss is used to indicate the current video frame after super-resolution and the real The difference between the current video frames after super-resolution; the update module is used to update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
上述装置训练得到的目标模型,具备对视频帧进行超分的能力。具体地,获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。前述过程中,目标模型可基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息对当前视频帧进行超分,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间像素值的差异关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。The target model trained by the above device has the ability to super-resolve video frames. Specifically, obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-score the current video frame based on the feature information and residual information of the reference video frame, and obtain the super-score The current video frame, the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the target model. In the aforementioned process, the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame. It can be seen that during the super-resolution process of the current video frame by the target model , not only the information of the reference video frame itself is considered, but also the difference in pixel values between the reference video frame and the current video frame is considered. The factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is High enough quality (with a relatively ideal resolution) so that the entire video stream after super-resolution has good image quality, thus improving the user experience.
在一种可能实现的方式中,超分模块,用于:通过目标模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过目标模型对参考视频帧的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过目标模型对第二特征进行特征提取,得到当前视频帧的第三特征;通过目标模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征,第四特征作为超分后的当前视频帧。In one possible implementation method, the super-resolution module is used to: extract features of the current video frame through the target model to obtain the first feature of the current video frame; extract feature information and the first feature of the reference video frame through the target model Perform fusion to obtain the second feature of the current video frame; perform feature extraction on the second feature through the target model to obtain the third feature of the current video frame; perform feature extraction on the third feature based on the residual information through the target model to obtain the current video The fourth feature of the frame is used as the current video frame after super-resolution.
在一种可能实现的方式中,残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息,超分模块,用于:通过目标模型在N个图像块中,确定残差信息大于预置的残差阈值的P个图像块,N≥2,N>P≥1;通过目标模型对第三特征中与P个图像块对应的特征进行特征提取,得到当前视频帧的第四特征。In one possible implementation, the residual information includes the residual information used in the decoding process of N image blocks in the current video frame. The super-resolution module is used to: determine in the N image blocks through the target model P image blocks whose residual information is greater than the preset residual threshold, N≥2, N>P≥1; use the target model to extract features corresponding to the P image blocks in the third feature to obtain the current video frame The fourth characteristic.
在一种可能实现的方式中,超分模块,还用于通过目标模型对第四特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the super-resolution module is also used to fuse the fourth feature and the current video frame through the target model to obtain the current video frame after super-resolution.
在一种可能实现的方式中,第三特征、第四特征或超分后的当前视频帧作为当前视频帧的特征信息。In a possible implementation manner, the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,超分模块,还用于通过目标模型对第三特征、第四特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In a possible implementation manner, the super-resolution module is also used to extract features of the third feature, the fourth feature or the current video frame after super-resolution through the target model, and obtain the feature information of the current video frame.
本申请实施例的第九方面提供了一种视频处理装置,该装置包括存储器和处理器;存储器存储有代码,处理器被配置为执行代码,当代码被执行时,视频处理装置执行如第一方面、第一方面中任意一种可能的实现方式、第二方面或第二方面中任意一种可能的实现方式所述的方法。A ninth aspect of the embodiment of the present application provides a video processing device, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code. When the code is executed, the video processing device executes the first step aspect, any possible implementation manner in the first aspect, the second aspect, or the method described in any possible implementation manner in the second aspect.
本申请实施例的第十方面提供了一种模型训练装置,该装置包括存储器和处理器;存储器存储有代码,处理器被配置为执行代码,当代码被执行时,模型训练装置执行如第三方面、第三方面中任意一种 可能的实现方式、第四方面或第四方面中任意一种可能的实现方式所述的方法。A tenth aspect of the embodiment of the present application provides a model training device, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code. When the code is executed, the model training device executes the third step Any one of the aspect and the third aspect Possible implementation manners, the fourth aspect, or the method described in any possible implementation manner of the fourth aspect.
本申请实施例的第十一方面提供了一种电路系统,该电路系统包括处理电路,该处理电路配置为执行如第一方面、第一方面中的任意一种可能的实现方式、第二方面、第二方面中任意一种可能的实现方式、第三方面、第三方面中任意一种可能的实现方式、第四方面或第四方面中任意一种可能的实现方式所述的方法。An eleventh aspect of the embodiments of the present application provides a circuit system. The circuit system includes a processing circuit configured to perform any of the possible implementations of the first aspect and the second aspect. , any possible implementation manner in the second aspect, the third aspect, any possible implementation manner in the third aspect, the fourth aspect, or the method described in any possible implementation manner in the fourth aspect.
本申请实施例的第十二方面提供了一种芯片系统,该芯片系统包括处理器,用于调用存储器中存储的计算机程序或计算机指令,以使得该处理器执行如第一方面、第一方面中的任意一种可能的实现方式、第二方面、第二方面中任意一种可能的实现方式、第三方面、第三方面中任意一种可能的实现方式、第四方面或第四方面中任意一种可能的实现方式所述的方法。A twelfth aspect of the embodiments of the present application provides a chip system. The chip system includes a processor for calling a computer program or computer instructions stored in a memory, so that the processor executes the first aspect as described in the first aspect. any possible implementation manner of the second aspect, any possible implementation manner of the second aspect, the third aspect, any possible implementation manner of the third aspect, the fourth aspect or any of the fourth aspects Any possible implementation method.
在一种可能的实现方式中,该处理器通过接口与存储器耦合。In one possible implementation, the processor is coupled to the memory through an interface.
在一种可能的实现方式中,该芯片系统还包括存储器,该存储器中存储有计算机程序或计算机指令。In a possible implementation, the chip system further includes a memory, and computer programs or computer instructions are stored in the memory.
本申请实施例的第十三方面提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,该程序在由计算机执行时,使得计算机实施如第一方面、第一方面中的任意一种可能的实现方式、第二方面、第二方面中任意一种可能的实现方式、第三方面、第三方面中任意一种可能的实现方式、第四方面或第四方面中任意一种可能的实现方式所述的方法。A thirteenth aspect of the embodiments of the present application provides a computer storage medium. The computer storage medium stores a computer program. When executed by a computer, the program causes the computer to implement any one of the first aspect and the first aspect. Possible implementation methods, the second aspect, any one possible implementation method of the second aspect, the third aspect, any one possible implementation method of the third aspect, the fourth aspect or any one possible implementation method of the fourth aspect The method described in the implementation.
本申请实施例的第十四方面提供了一种计算机程序产品,该计算机程序产品存储有指令,该指令在由计算机执行时,使得计算机实施如第一方面、第一方面中的任意一种可能的实现方式、第二方面、第二方面中任意一种可能的实现方式、第三方面、第三方面中任意一种可能的实现方式、第四方面或第四方面中任意一种可能的实现方式所述的方法。A fourteenth aspect of the embodiments of the present application provides a computer program product. The computer program product stores instructions. When executed by a computer, the instructions make it possible for the computer to implement any one of the first aspect and the first aspect. The implementation method, the second aspect, any possible implementation method of the second aspect, the third aspect, any possible implementation method of the third aspect, the fourth aspect or any possible implementation of the fourth aspect method as described.
本申请实施例中,在获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。In the embodiment of the present application, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed features. Information, wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
附图说明Description of drawings
图1为人工智能主体框架的一种结构示意图;Figure 1 is a structural schematic diagram of the main framework of artificial intelligence;
图2a为本申请实施例提供的视频处理系统的一个结构示意图;Figure 2a is a schematic structural diagram of a video processing system provided by an embodiment of the present application;
图2b为本申请实施例提供的视频处理系统的另一结构示意图;Figure 2b is another structural schematic diagram of the video processing system provided by the embodiment of the present application;
图2c为本申请实施例提供的视频处理的相关设备的一个示意图;Figure 2c is a schematic diagram of video processing related equipment provided by the embodiment of the present application;
图3为本申请实施例提供的系统100架构的一个示意图;Figure 3 is a schematic diagram of the architecture of the system 100 provided by the embodiment of the present application;
图4为本申请实施例提供的视频处理方法的一个流程示意图;Figure 4 is a schematic flow chart of the video processing method provided by the embodiment of the present application;
图5为本申请实施例提供的目标模型的一个结构示意图;Figure 5 is a schematic structural diagram of the target model provided by the embodiment of the present application;
图6为本申请实施例提供的视频处理方法的另一流程示意图;Figure 6 is another schematic flowchart of a video processing method provided by an embodiment of the present application;
图7为本申请实施例提供的目标模型的另一结构示意图;Figure 7 is another structural schematic diagram of the target model provided by the embodiment of the present application;
图8为本申请实施例提供的模型训练方法的一个流程示意图;Figure 8 is a schematic flow chart of the model training method provided by the embodiment of the present application;
图9为本申请实施例提供的模型训练方法的另一流程示意图;Figure 9 is another schematic flow chart of the model training method provided by the embodiment of the present application;
图10为本申请实施例提供的视频处理装置的一个结构示意图;Figure 10 is a schematic structural diagram of a video processing device provided by an embodiment of the present application;
图11为本申请实施例提供的视频处理装置的另一结构示意图;Figure 11 is another structural schematic diagram of a video processing device provided by an embodiment of the present application;
图12为本申请实施例提供的模型训练装置的一个结构示意图;Figure 12 is a schematic structural diagram of the model training device provided by the embodiment of the present application;
图13为本申请实施例提供的模型训练装置的另一结构示意图; Figure 13 is another structural schematic diagram of the model training device provided by the embodiment of the present application;
图14为本申请实施例提供的执行设备的一个结构示意图;Figure 14 is a schematic structural diagram of an execution device provided by an embodiment of the present application;
图15为本申请实施例提供的训练设备的一个结构示意图;Figure 15 is a schematic structural diagram of the training equipment provided by the embodiment of the present application;
图16为本申请实施例提供的芯片的一个结构示意图。Figure 16 is a schematic structural diagram of a chip provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供了一种视频处理方法及其相关设备,对视频流中的视频帧具有良好的超分效果,可以使得超分后的整个视频流具备良好的画质,进而提高用户体验。Embodiments of the present application provide a video processing method and related equipment, which have a good super-resolution effect on video frames in the video stream, so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或模块的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或模块,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或模块。在本申请中出现的对步骤进行的命名或者编号,并不意味着必须按照命名或者编号所指示的时间/逻辑先后顺序执行方法流程中的步骤,已经命名或者编号的流程步骤可以根据要实现的技术目的变更执行次序,只要能达到相同或者相类似的技术效果即可。本申请中所出现的单元的划分,是一种逻辑上的划分,实际应用中实现时可以有另外的划分方式,例如多个单元可以结合成或集成在另一个系统中,或一些特征可以忽略,或不执行,另外,所显示的或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元之间的间接耦合或通信连接可以是电性或其他类似的形式,本申请中均不作限定。并且,作为分离部件说明的单元或子单元可以是也可以不是物理上的分离,可以是也可以不是物理单元,或者可以分布到多个电路单元中,可以根据实际的需要选择其中的部分或全部单元来实现本申请方案的目的。The terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or modules and need not be limited to those explicitly listed. Those steps or modules may instead include other steps or modules not expressly listed or inherent to the processes, methods, products or devices. The naming or numbering of steps in this application does not mean that the steps in the method flow must be executed in the time/logical sequence indicated by the naming or numbering. The process steps that have been named or numbered can be implemented according to the purpose to be achieved. The order of execution can be changed for technical purposes, as long as the same or similar technical effect can be achieved. The division of units presented in this application is a logical division. In actual applications, there may be other divisions. For example, multiple units may be combined or integrated into another system, or some features may be ignored. , or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed may be through some interfaces, and the indirect coupling or communication connection between units may be electrical or other similar forms. There are no restrictions in the application. Furthermore, the units or subunits described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed into multiple circuit units, and some or all of them may be selected according to actual needs. unit to achieve the purpose of this application plan.
随着技术的飞速发展,视频已经成为了最重要的信息传播载体。为了增强视频的画质,可以通过能够实现超分辨率(super resolution,SR)重建功能的神经网络模型,来提高视频流中各个视频帧的分辨率,从而提供高质量、高分辨率的视频供用户观看。With the rapid development of technology, video has become the most important carrier of information dissemination. In order to enhance the image quality of the video, the resolution of each video frame in the video stream can be improved through a neural network model that can achieve super-resolution (SR) reconstruction function, thereby providing high-quality, high-resolution video supply. Users watch.
目前,对于待超分的视频流中的当前视频帧(可以为待超分的视频流中的任意一个视频帧),若需要提高当前视频帧的分辨率,可将当前视频帧以及当前视频帧的参考视频帧(例如,当前视频帧的前一视频帧和/或后一视频帧等等)输入至神经网络模型,以使得神经网络模型基于参考视频帧对当前视频帧进行超分,得到超分后的当前视频帧。对于待超分的视频流中除当前视频帧之外的其余视频帧,也可通过神经网络模型对其余视频帧执行如同对当前视频帧所执行的操作,故可得到超分后的各个视频帧,也就是超分后的整个视频流。Currently, for the current video frame in the video stream to be super-resolved (which can be any video frame in the video stream to be super-resolved), if you need to improve the resolution of the current video frame, you can add the current video frame and the current video frame to The reference video frame (for example, the previous video frame and/or the subsequent video frame of the current video frame, etc.) is input to the neural network model, so that the neural network model super-resolves the current video frame based on the reference video frame, and obtains super-resolution The divided current video frame. For the remaining video frames in the video stream to be super-resolved except the current video frame, the neural network model can also be used to perform the same operations on the remaining video frames as the current video frame, so each video frame after super-resolution can be obtained , that is, the entire video stream after super-resolution.
可见,在针对当前视频帧的超分过程中,神经网络模型仅以参考视频帧自身为参考基准,所考虑的因素较为单一,模型输出的超分后的当前视频帧不够优质(无法具备理想的分辨率),以致于超分后的整个视频流的画质依旧不够良好(无法具备理想的质量和分辨率),导致用户体验不佳。It can be seen that in the super-resolution process of the current video frame, the neural network model only uses the reference video frame itself as the reference benchmark, and the factors considered are relatively single. The current video frame output by the model after super-resolution is not of high quality (it cannot have the ideal resolution), so that the image quality of the entire video stream after super-resolution is still not good enough (cannot have ideal quality and resolution), resulting in poor user experience.
进一步地,在针对当前视频帧的超分过程中,神经网络模型需要对整个当前视频帧包含的所有图像块逐一进行一系列的处理,所需要的计算量较大,导致前述基于神经网络模型的视频处理方式难以应用在算力有限的小型设备上(例如,智能手机、智能手表等等)。Furthermore, in the super-resolution process for the current video frame, the neural network model needs to perform a series of processing on all image blocks contained in the entire current video frame one by one, which requires a large amount of calculation, resulting in the aforementioned neural network model-based Video processing methods are difficult to apply to small devices with limited computing power (for example, smartphones, smart watches, etc.).
为了解决上述问题,本申请实施例提供了一种视频处理方法,该方法可结合人工智能(artificial intelligence,AI)技术实现。AI技术是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能的技术学科,AI技术通过感知环境、获取知识并使用知识获得最佳结果。换句话说,人工智能技术是计算机科学的一个分支,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器。利用人工智能进行数据处理是人工智能常见的一个应用方式。In order to solve the above problem, embodiments of the present application provide a video processing method, which can be implemented in conjunction with artificial intelligence (artificial intelligence, AI) technology. AI technology is a technical discipline that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence. AI technology obtains the best results by perceiving the environment, acquiring knowledge and using knowledge. In other words, artificial intelligence technology is a branch of computer science that attempts to understand the nature of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Using artificial intelligence for data processing is a common application method of artificial intelligence.
首先对人工智能系统总体工作流程进行描述,请参见图1,图1为人工智能主体框架的一种结构示意图,下面从“智能信息链”(水平轴)和“IT价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。其中,“智能信息链”反映从数据的获取到处理的一列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经 历了“数据—信息—知识—智慧”的凝练过程。“IT价值链”从人智能的底层基础设施、信息(提供和处理技术实现)到系统的产业生态过程,反映人工智能为信息技术产业带来的价值。First, the overall workflow of the artificial intelligence system is described. Please refer to Figure 1. Figure 1 is a structural schematic diagram of the main framework of artificial intelligence. The following is from the "intelligent information chain" (horizontal axis) and "IT value chain" (vertical axis) The above artificial intelligence theme framework is elaborated on in two dimensions. Among them, the "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. During this process, the data It has gone through the condensation process of "data-information-knowledge-wisdom". The "IT value chain" reflects the value that artificial intelligence brings to the information technology industry, from the underlying infrastructure of human intelligence and information (providing and processing technology implementation) to the systematic industrial ecological process.
(1)基础设施(1)Infrastructure
基础设施为人工智能系统提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。通过传感器与外部沟通;计算能力由智能芯片(CPU、NPU、GPU、ASIC、FPGA等硬件加速芯片)提供;基础平台包括分布式计算框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器和外部沟通获取数据,这些数据提供给基础平台提供的分布式计算系统中的智能芯片进行计算。Infrastructure provides computing power support for artificial intelligence systems, enables communication with the external world, and supports it through basic platforms. Communicate with the outside through sensors; computing power is provided by smart chips (hardware acceleration chips such as CPU, NPU, GPU, ASIC, FPGA, etc.); the basic platform includes distributed computing framework and network and other related platform guarantees and support, which can include cloud storage and Computing, interconnection networks, etc. For example, sensors communicate with the outside world to obtain data, which are provided to smart chips in the distributed computing system provided by the basic platform for calculation.
(2)数据(2)Data
基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、文本,还涉及到传统设备的物联网数据,包括已有系统的业务数据以及力、位移、液位、温度、湿度等感知数据。Data from the upper layer of the infrastructure is used to represent data sources in the field of artificial intelligence. The data involves graphics, images, voice, and text, as well as IoT data of traditional devices, including business data of existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
(3)数据处理(3)Data processing
数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。Among them, machine learning and deep learning can perform symbolic and formal intelligent information modeling, extraction, preprocessing, training, etc. on data.
推理是指在计算机或智能系统中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formal information to perform machine thinking and problem solving based on reasoning control strategies. Typical functions are search and matching.
决策是指智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。Decision-making refers to the process of decision-making after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.
(4)通用能力(4) General ability
对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用的能力,比如可以是算法或者一个通用系统,例如,翻译,文本的分析,计算机视觉的处理,语音识别,图像的识别等等。After the data is processed as mentioned above, some general capabilities can be formed based on the results of further data processing, such as algorithms or a general system, such as translation, text analysis, computer vision processing, speech recognition, and image processing. identification, etc.
(5)智能产品及行业应用(5) Intelligent products and industry applications
智能产品及行业应用指人工智能系统在各领域的产品和应用,是对人工智能整体解决方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能终端、智能交通、智能医疗、自动驾驶、智慧城市等。Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Its application fields mainly include: intelligent terminals, intelligent transportation, Smart healthcare, autonomous driving, smart cities, etc.
接下来介绍几种本申请的应用场景。Next, several application scenarios of this application will be introduced.
图2a为本申请实施例提供的视频处理系统的一个结构示意图,该视频处理系统包括用户设备以及数据处理设备。其中,用户设备包括手机、个人电脑或者信息处理中心等智能终端。用户设备为视频处理的发起端,作为视频处理请求的发起方,通常由用户通过用户设备发起请求。Figure 2a is a schematic structural diagram of a video processing system provided by an embodiment of the present application. The video processing system includes user equipment and data processing equipment. Among them, user equipment includes smart terminals such as mobile phones, personal computers, or information processing centers. The user equipment is the initiator of video processing. As the initiator of the video processing request, the user usually initiates the request through the user equipment.
上述数据处理设备可以是云服务器、网络服务器、应用服务器以及管理服务器等具有数据处理功能的设备或服务器。数据处理设备通过交互接口接收来自智能终端的视频处理请求,再通过存储数据的存储器以及数据处理的处理器环节进行机器学习,深度学习,搜索,推理,决策等方式的信息处理。数据处理设备中的存储器可以是一个统称,包括本地存储以及存储历史数据的数据库,数据库可以在数据处理设备上,也可以在其它网络服务器上。The above-mentioned data processing equipment may be a cloud server, a network server, an application server, a management server, and other equipment or servers with data processing functions. The data processing device receives the video processing request from the smart terminal through the interactive interface, and then performs information processing in the form of machine learning, deep learning, search, reasoning, decision-making, etc. through the memory that stores the data and the processor that processes the data. The memory in the data processing device can be a general term, including local storage and a database that stores historical data. The database can be on the data processing device or on other network servers.
在图2a所示的视频处理系统中,用户设备可以接收用户的指令,例如用户设备可以获取用户输入/选择的压缩视频流,然后向数据处理设备发起请求,使得数据处理设备针对用户设备所得到的压缩视频流执行视频处理应用,从而得到处理后的视频流。示例性的,用户设备可以获取用户选择的压缩视频流,并向数据处理设备发起针对该压缩视频流的处理请求。接着,数据处理设备先获取压缩视频流(低质量、低分辨率的视频流),并对压缩视频流进行解码,从而复原出待超分的视频流(也可以称为解压后的视频流,依旧为低质量、低分辨率的视频流,但视频帧数量较多)。然后,数据处理设备可对待超分的视频进行超分处理,从而得到超分后的视频流(高质量、高分辨率的视频流),并将超分后的视频流返回给用户设备,以供用户观看和使用。In the video processing system shown in Figure 2a, the user equipment can receive the user's instructions. For example, the user equipment can obtain the compressed video stream input/selected by the user, and then initiate a request to the data processing equipment, so that the data processing equipment can obtain the information obtained by the user equipment. A video processing application is executed on the compressed video stream to obtain a processed video stream. For example, the user equipment can obtain the compressed video stream selected by the user and initiate a processing request for the compressed video stream to the data processing device. Next, the data processing device first obtains the compressed video stream (low-quality, low-resolution video stream) and decodes the compressed video stream to restore the video stream to be super-resolved (which can also be called a decompressed video stream. Still a low-quality, low-resolution video stream, but with a larger number of video frames). Then, the data processing device can perform super-resolution processing on the video to be super-resolved, thereby obtaining a super-resolution video stream (a high-quality, high-resolution video stream), and return the super-resolution video stream to the user device. For users to view and use.
在图2a中,数据处理设备可以执行本申请实施例的视频处理方法。 In Figure 2a, the data processing device can execute the video processing method according to the embodiment of the present application.
图2b为本申请实施例提供的视频处理系统的另一结构示意图,在图2b中,用户设备直接作为数据处理设备,该用户设备能够直接获取来自用户的输入并直接由用户设备本身的硬件进行处理,具体过程与图2a相似,可参考上面的描述,在此不再赘述。Figure 2b is another structural schematic diagram of a video processing system provided by an embodiment of the present application. In Figure 2b, the user equipment directly serves as a data processing equipment. The user equipment can directly obtain input from the user and directly perform processing by the hardware of the user equipment itself. Processing, the specific process is similar to Figure 2a, please refer to the above description, and will not be repeated here.
在图2b所示的视频处理系统中,用户设备可以接收用户的指令,例如用户设备可以获取用户选择的压缩视频流,再由用户设备自身获取压缩视频流(低质量、低分辨率的视频流),并对压缩视频流进行解码,从而复原出待超分的视频流(也可以称为解压后的视频流,依旧为低质量、低分辨率的视频流,但视频帧数量较多)。然后,用户设备可对待超分的视频进行超分处理,从而得到超分后的视频流(高质量、高分辨率的视频流),以供用户观看和使用。In the video processing system shown in Figure 2b, the user equipment can receive the user's instructions. For example, the user equipment can obtain the compressed video stream selected by the user, and then the user equipment itself obtains the compressed video stream (low-quality, low-resolution video stream). ), and decodes the compressed video stream to restore the video stream to be super-resolved (which can also be called a decompressed video stream, which is still a low-quality, low-resolution video stream, but with a larger number of video frames). Then, the user equipment can perform super-resolution processing on the video to be super-resolved, thereby obtaining a post-super-resolution video stream (a high-quality, high-resolution video stream) for the user to watch and use.
在图2b中,用户设备自身就可以执行本申请实施例的视频处理方法。In Figure 2b, the user equipment itself can execute the video processing method according to the embodiment of the present application.
图2c为本申请实施例提供的视频处理的相关设备的一个示意图。Figure 2c is a schematic diagram of video processing related equipment provided by the embodiment of the present application.
上述图2a和图2b中的用户设备具体可以是图2c中的本地设备301或者本地设备302,图2a中的数据处理设备具体可以是图2c中的执行设备210,其中,数据存储系统250可以存储执行设备210的待处理数据,数据存储系统250可以集成在执行设备210上,也可以设置在云上或其它网络服务器上。The user equipment in Figure 2a and Figure 2b can be the local device 301 or the local device 302 in Figure 2c, and the data processing device in Figure 2a can be the execution device 210 in Figure 2c, where the data storage system 250 can To store the data to be processed by the execution device 210, the data storage system 250 can be integrated on the execution device 210, or can be set up on the cloud or other network servers.
图2a和图2b中的处理器可以通过神经网络模型或者其它模型(例如,基于支持向量机的模型)进行数据训练/机器学习/深度学习,并利用数据最终训练或者学习得到的模型针对视频执行视频处理应用,从而得到相应的处理结果。The processors in Figure 2a and Figure 2b can perform data training/machine learning/deep learning through neural network models or other models (for example, support vector machine-based models), and use the data to finally train or learn the model to execute on the video Video processing applications to obtain corresponding processing results.
图3为本申请实施例提供的系统100架构的一个示意图,在图3中,执行设备110配置输入/输出(input/output,I/O)接口112,用于与外部设备进行数据交互,用户可以通过客户设备140向I/O接口112输入数据,所述输入数据在本申请实施例中可以包括:各个待调度任务、可调用资源以及其他参数。Figure 3 is a schematic diagram of the architecture of the system 100 provided by the embodiment of the present application. In Figure 3, the execution device 110 is configured with an input/output (I/O) interface 112 for data interaction with external devices. The user Data can be input to the I/O interface 112 through the client device 140. In this embodiment of the present application, the input data may include: various to-be-scheduled tasks, callable resources, and other parameters.
在执行设备110对输入数据进行预处理,或者在执行设备110的计算模块111执行计算等相关的处理(比如进行本申请中神经网络的功能实现)过程中,执行设备110可以调用数据存储系统150中的数据、代码等以用于相应的处理,也可以将相应处理得到的数据、指令等存入数据存储系统150中。When the execution device 110 preprocesses the input data, or when the calculation module 111 of the execution device 110 performs calculation and other related processing (such as implementing the function of the neural network in this application), the execution device 110 can call the data storage system 150 The data, codes, etc. in the system can be used for corresponding processing, and the data, instructions, etc. obtained by corresponding processing can also be stored in the data storage system 150 .
最后,I/O接口112将处理结果返回给客户设备140,从而提供给用户。Finally, the I/O interface 112 returns the processing results to the client device 140, thereby providing them to the user.
值得说明的是,训练设备120可以针对不同的目标或称不同的任务,基于不同的训练数据生成相应的目标模型/规则,该相应的目标模型/规则即可以用于实现上述目标或完成上述任务,从而为用户提供所需的结果。其中,训练数据可以存储在数据库130中,且来自于数据采集设备160采集的训练样本。It is worth mentioning that the training device 120 can generate corresponding target models/rules based on different training data for different goals or different tasks, and the corresponding target models/rules can be used to achieve the above goals or complete the above tasks. , thereby providing users with the desired results. The training data may be stored in the database 130 and come from training samples collected by the data collection device 160 .
在图3中所示情况下,用户可以手动给定输入数据,该手动给定可以通过I/O接口112提供的界面进行操作。另一种情况下,客户设备140可以自动地向I/O接口112发送输入数据,如果要求客户设备140自动发送输入数据需要获得用户的授权,则用户可以在客户设备140中设置相应权限。用户可以在客户设备140查看执行设备110输出的结果,具体的呈现形式可以是显示、声音、动作等具体方式。客户设备140也可以作为数据采集端,采集如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果作为新的样本数据,并存入数据库130。当然,也可以不经过客户设备140进行采集,而是由I/O接口112直接将如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果,作为新的样本数据存入数据库130。In the case shown in FIG. 3 , the user can manually enter the input data, and the manual setting can be operated through the interface provided by the I/O interface 112 . In another case, the client device 140 can automatically send input data to the I/O interface 112. If requiring the client device 140 to automatically send input data requires the user's authorization, the user can set corresponding permissions in the client device 140. The user can view the results output by the execution device 110 on the client device 140, and the specific presentation form may be display, sound, action, etc. The client device 140 can also be used as a data collection end to collect the input data of the input I/O interface 112 and the output results of the output I/O interface 112 as new sample data, and store them in the database 130 . Of course, it is also possible to collect without going through the client device 140. Instead, the I/O interface 112 directly uses the input data input to the I/O interface 112 and the output result of the output I/O interface 112 as a new sample as shown in the figure. The data is stored in database 130.
值得注意的是,图3仅是本申请实施例提供的一种系统架构的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在图3中,数据存储系统150相对执行设备110是外部存储器,在其它情况下,也可以将数据存储系统150置于执行设备110中。如图3所示,可以根据训练设备120训练得到神经网络。It is worth noting that Figure 3 is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, devices, modules, etc. shown in the figure does not constitute any limitation. For example, in Figure 3, the data The storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 can also be placed in the execution device 110. As shown in Figure 3, the neural network can be trained according to the training device 120.
本申请实施例还提供的一种芯片,该芯片包括神经网络处理器NPU。该芯片可以被设置在如图3所示的执行设备110中,用以完成计算模块111的计算工作。该芯片也可以被设置在如图3所示的训练设备120中,用以完成训练设备120的训练工作并输出目标模型/规则。An embodiment of the present application also provides a chip, which includes a neural network processor NPU. The chip can be disposed in the execution device 110 as shown in FIG. 3 to complete the calculation work of the calculation module 111. The chip can also be installed in the training device 120 as shown in Figure 3 to complete the training work of the training device 120 and output the target model/rules.
神经网络处理器NPU,NPU作为协处理器挂载到主中央处理器(centralprocessing unit,CPU)(host CPU)上,由主CPU分配任务。NPU的核心部分为运算电路,控制器控制运算电路提取存储器(权重存储器或输入存储器)中的数据并进行运算。 Neural network processor NPU, NPU is mounted on the main central processing unit (CPU) (host CPU) as a co-processor, and the main CPU allocates tasks. The core part of the NPU is the arithmetic circuit. The controller controls the arithmetic circuit to extract the data in the memory (weight memory or input memory) and perform operations.
在一些实现中,运算电路内部包括多个处理单元(process engine,PE)。在一些实现中,运算电路是二维脉动阵列。运算电路还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路是通用的矩阵处理器。In some implementations, the computing circuit includes multiple processing units (PE). In some implementations, the arithmetic circuit is a two-dimensional systolic array. The arithmetic circuit may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit is a general-purpose matrix processor.
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)中。For example, assume there is an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit fetches the corresponding data of matrix B from the weight memory and caches it on each PE in the arithmetic circuit. The operation circuit takes matrix A data and matrix B from the input memory to perform matrix operations, and the partial result or final result of the obtained matrix is stored in the accumulator (accumulator).
向量计算单元可以对运算电路的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。例如,向量计算单元可以用于神经网络中非卷积/非FC层的网络计算,如池化(pooling),批归一化(batch normalization),局部响应归一化(local response normalization)等。The vector calculation unit can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. For example, the vector computing unit can be used for network calculations in non-convolutional/non-FC layers in neural networks, such as pooling, batch normalization, local response normalization, etc.
在一些实现种,向量计算单元能将经处理的输出的向量存储到统一缓存器。例如,向量计算单元可以将非线性函数应用到运算电路的输出,例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元生成归一化的值、合并值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路的激活输入,例如用于在神经网络中的后续层中的使用。In some implementations, the vector computation unit can store the processed output vector into a unified buffer. For example, the vector calculation unit may apply a nonlinear function to the output of the arithmetic circuit, such as a vector of accumulated values, to generate activation values. In some implementations, the vector computation unit generates normalized values, merged values, or both. In some implementations, the processed output vector can be used as an activation input to an arithmetic circuit, such as for use in a subsequent layer in a neural network.
统一存储器用于存放输入数据以及输出数据。Unified memory is used to store input data and output data.
权重数据直接通过存储单元访问控制器(direct memory accesscontroller,DMAC)将外部存储器中的输入数据搬运到输入存储器和/或统一存储器、将外部存储器中的权重数据存入权重存储器,以及将统一存储器中的数据存入外部存储器。The weight data directly transfers the input data in the external memory to the input memory and/or the unified memory through the storage unit access controller (direct memory access controller, DMAC), stores the weight data in the external memory into the weight memory, and stores the weight data in the unified memory. The data is stored in external memory.
总线接口单元(bus interface unit,BIU),用于通过总线实现主CPU、DMAC和取指存储器之间进行交互。The bus interface unit (BIU) is used to realize the interaction between the main CPU, DMAC and instruction memory through the bus.
与控制器连接的取指存储器(instruction fetch buffer),用于存储控制器使用的指令;The instruction fetch buffer connected to the controller is used to store instructions used by the controller;
控制器,用于调用指存储器中缓存的指令,实现控制该运算加速器的工作过程。The controller is used to call instructions cached in the memory to control the working process of the computing accelerator.
一般地,统一存储器,输入存储器,权重存储器以及取指存储器均为片上(On-Chip)存储器,外部存储器为该NPU外部的存储器,该外部存储器可以为双倍数据率同步动态随机存储器(double data rate synchronous dynamic random accessmemory,DDR SDRAM)、高带宽存储器(high bandwidth memory,HBM)或其他可读可写的存储器。Generally, the unified memory, input memory, weight memory and instruction memory are all on-chip memories, and the external memory is the memory outside the NPU. The external memory can be double data rate synchronous dynamic random access memory (double data). rate synchronous dynamic random accessmemory (DDR SDRAM), high bandwidth memory (high bandwidth memory (HBM)) or other readable and writable memory.
由于本申请实施例涉及大量神经网络的应用,为了便于理解,下面先对本申请实施例涉及的相关术语及神经网络等相关概念进行介绍。Since the embodiments of the present application involve the application of a large number of neural networks, in order to facilitate understanding, the relevant terms involved in the embodiments of the present application and related concepts such as neural networks are first introduced below.
(1)神经网络(1) Neural network
神经网络可以是由神经单元组成的,神经单元可以是指以xs和截距1为输入的运算单元,该运算单元的输出可以为:
The neural network can be composed of neural units. The neural unit can refer to an arithmetic unit that takes xs and intercept 1 as input. The output of the arithmetic unit can be:
其中,s=1、2、……n,n为大于1的自然数,Ws为xs的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入。激活函数可以是sigmoid函数。神经网络是将许多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。Among them, s=1, 2,...n, n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer. The activation function can be a sigmoid function. A neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.
神经网络中的每一层的工作可以用数学表达式y=a(Wx+b)来描述:从物理层面神经网络中的每一层的工作可以理解为通过五种对输入空间(输入向量的集合)的操作,完成输入空间到输出空间的变换(即矩阵的行空间到列空间),这五种操作包括:1、升维/降维;2、放大/缩小;3、旋转;4、平移;5、“弯曲”。其中1、2、3的操作由Wx完成,4的操作由+b完成,5的操作则由a()来实现。这里之所以用“空间”二字来表述是因为被分类的对象并不是单个事物,而是一类事物,空间是指这类事物所有 个体的集合。其中,W是权重向量,该向量中的每一个值表示该层神经网络中的一个神经元的权重值。该向量W决定着上文所述的输入空间到输出空间的空间变换,即每一层的权重W控制着如何变换空间。训练神经网络的目的,也就是最终得到训练好的神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。因此,神经网络的训练过程本质上就是学习控制空间变换的方式,更具体的就是学习权重矩阵。The work of each layer in the neural network can be described by the mathematical expression y=a(Wx+b): From the physical level, the work of each layer in the neural network can be understood as five pairs of input spaces (input vectors) set) operations to complete the transformation from input space to output space (i.e., row space to column space of the matrix). These five operations include: 1. Dimension raising/reducing; 2. Enlarging/reducing; 3. Rotation; 4. Translation; 5. "Bend". Among them, the operations of 1, 2, and 3 are completed by Wx, the operation of 4 is completed by +b, and the operation of 5 is implemented by a(). The reason why the word "space" is used here is because the object to be classified is not a single thing, but a class of things. Space refers to all the things of this type. collection of individuals. Among them, W is a weight vector, and each value in this vector represents the weight value of a neuron in this layer of neural network. This vector W determines the spatial transformation from the input space to the output space described above, that is, the weight W of each layer controls how to transform the space. The purpose of training a neural network is to finally obtain the weight matrix of all layers of the trained neural network (a weight matrix formed by the vector W of many layers). Therefore, the training process of neural network is essentially to learn how to control spatial transformation, and more specifically, to learn the weight matrix.
因为希望神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有初始化的过程,即为神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断的调整,直到神经网络能够预测出真正想要的目标值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么神经网络的训练就变成了尽可能缩小这个loss的过程。Because you want the output of the neural network to be as close as possible to the value you really want to predict, you can compare the predicted value of the current network with the really desired target value, and then update each layer of the neural network based on the difference between the two. weight vector (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the neural network). For example, if the predicted value of the network is high, adjust the weight vector to make it predict lower Some, constant adjustments are made until the neural network can predict the truly desired target value. Therefore, it is necessary to define in advance "how to compare the difference between the predicted value and the target value". This is the loss function (loss function) or objective function (objective function), which is used to measure the difference between the predicted value and the target value. Important equations. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference. Then the training of the neural network becomes a process of reducing this loss as much as possible.
(2)反向传播算法(2)Back propagation algorithm
神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的神经网络模型中参数的大小,使得神经网络模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的神经网络模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的神经网络模型的参数,例如权重矩阵。The neural network can use the error back propagation (BP) algorithm to modify the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, forward propagation of the input signal until the output will produce an error loss, and the parameters in the initial neural network model are updated by backpropagating the error loss information, so that the error loss converges. The backpropagation algorithm is a backpropagation movement dominated by error loss, aiming to obtain the optimal parameters of the neural network model, such as the weight matrix.
下面从神经网络的训练侧和神经网络的应用侧对本申请提供的方法进行描述。The method provided by this application is described below from the training side of the neural network and the application side of the neural network.
本申请实施例提供的模型训练方法,涉及数据序列的处理,具体可以应用于数据训练、机器学习、深度学习等方法,对训练数据(例如,本申请实施例提供的模型训练方法中的当前视频帧等等)进行符号化和形式化的智能信息建模、抽取、预处理、训练等,最终得到训练好的神经网络(如本申请实施例提供的模型训练方法中的目标模型);并且,本申请实施例提供的视频处理方法可以运用上述训练好的神经网络,将输入数据(例如,将本申请实施例提供的视频处理方法中的当前视频帧等等)输入到所述训练好的神经网络中,得到输出数据(如本申请实施例提供的视频处理方法中的超分后的当前视频帧等等)。需要说明的是,本申请实施例提供的模型训练方法和视频处理方法是基于同一个构思产生的发明,也可以理解为一个系统中的两个部分,或一个整体流程的两个阶段:如模型训练阶段和模型应用阶段。The model training method provided by the embodiment of the present application involves the processing of data sequences, and can be specifically applied to methods such as data training, machine learning, and deep learning. The training data (for example, the current video in the model training method provided by the embodiment of the present application) frames, etc.) to perform symbolic and formalized intelligent information modeling, extraction, preprocessing, training, etc., and finally obtain a trained neural network (such as the target model in the model training method provided by the embodiment of this application); and, The video processing method provided by the embodiment of the present application can use the above-trained neural network to input input data (for example, the current video frame in the video processing method provided by the embodiment of the present application, etc.) into the trained neural network. In the network, output data (such as the current video frame after super-resolution in the video processing method provided by the embodiment of the present application, etc.) is obtained. It should be noted that the model training method and video processing method provided in the embodiments of this application are inventions based on the same concept, and can also be understood as two parts of a system, or two stages of an overall process: such as model training phase and model application phase.
图4为本申请实施例提供的视频处理方法的一个流程示意图,如图4所示,该方法包括:Figure 4 is a schematic flow chart of a video processing method provided by an embodiment of the present application. As shown in Figure 4, the method includes:
401、获取当前视频帧,以及当前视频帧的解码过程中所使用的运动矢量。401. Obtain the current video frame and the motion vector used in the decoding process of the current video frame.
本实施例中,在确定用户所指定的压缩视频流后,可对压缩视频流进行解码,从而得到待超分的视频流。需要说明的是,在前述解码过程中,压缩视频流至少包含第一个视频帧,第二个视频帧对应的运动矢量以及残差信息,第三个视频帧对应的运动矢量以及残差信息,...,最后一个视频帧对应的运动矢量以及残差信息。那么,可将第一个视频帧作为第二个视频帧的参考视频帧,基于第二个视频帧对应的运动矢量对第一个视频帧进行运动补偿,得到中间视频帧,再在中间视频帧上叠加第二个视频帧对应的残差信息,得到第二个视频帧,如此一来,则完成了第二个视频帧的解码。接着,可将第二个视频帧作为第三个视频帧的参考视频帧,基于第三个视频帧对应的运动矢量对第二个视频帧进行运动补偿,得到中间视频帧,再在中间视频帧上叠加第三个视频帧对应的残差信息,得到第三个视频帧,如此一来,则完成了第三个视频帧的解码。以此类推,也可以完成第四个视频帧的解码,...,最后一个视频帧的解码,相当于得到第一个视频帧,第二个视频帧,第三个视频帧,...,最后一个视频帧这多个视频帧,这多个视频帧即组成了待超分的视频流。In this embodiment, after the compressed video stream specified by the user is determined, the compressed video stream can be decoded to obtain a video stream to be super-resolved. It should be noted that during the aforementioned decoding process, the compressed video stream at least contains the first video frame, the motion vector and residual information corresponding to the second video frame, the motion vector and residual information corresponding to the third video frame, ..., the motion vector and residual information corresponding to the last video frame. Then, the first video frame can be used as the reference video frame of the second video frame, motion compensation is performed on the first video frame based on the motion vector corresponding to the second video frame, and the intermediate video frame is obtained, and then the intermediate video frame is The residual information corresponding to the second video frame is superimposed to obtain the second video frame. In this way, the decoding of the second video frame is completed. Then, the second video frame can be used as the reference video frame of the third video frame, and motion compensation is performed on the second video frame based on the motion vector corresponding to the third video frame to obtain an intermediate video frame, and then in the intermediate video frame The residual information corresponding to the third video frame is superimposed to obtain the third video frame. In this way, the decoding of the third video frame is completed. By analogy, the decoding of the fourth video frame can also be completed,..., the decoding of the last video frame is equivalent to obtaining the first video frame, the second video frame, the third video frame,... , the last video frame and multiple video frames constitute the video stream to be super-resolved.
为了方便说明,下文以待超分的视频流包含的多个视频帧中的任意一个视频帧进行示意性介绍,并将该视频帧称为当前视频帧。在基于当前视频帧的参考视频帧(例如,当前视频帧的前一个视频帧)、当前视频帧对应的运动矢量以及当前视频帧对应的残差信息,进行解码得到当前视频帧后,还可基于当前视频帧对应的运动矢量,来获取当前视频帧的解码过程中所使用的运动矢量。 For convenience of explanation, any video frame among multiple video frames included in the video stream to be super-resolved will be schematically introduced below, and this video frame will be called the current video frame. After decoding to obtain the current video frame based on the reference video frame of the current video frame (for example, the previous video frame of the current video frame), the motion vector corresponding to the current video frame, and the residual information corresponding to the current video frame, the current video frame can also be obtained based on The motion vector corresponding to the current video frame is used to obtain the motion vector used in the decoding process of the current video frame.
具体地,设当前视频帧可被划分成N个图像块(N为大于或等于2的正整数),可通过以下方式来获取当前视频帧的解码过程中所使用的运动矢量:Specifically, assuming that the current video frame can be divided into N image blocks (N is a positive integer greater than or equal to 2), the motion vector used in the decoding process of the current video frame can be obtained in the following way:
(1)若当前视频帧包含的N个图像块均出现在当前视频帧的参考视频帧中,也就是说,当前视频帧和参考视频帧的内容基本相同,此时,压缩视频流提供的当前视频帧对应的运动矢量包含这N个图像块对应的运动矢量,这N个图像块中第i个图像块(i=1,...,N)对应的运动矢量用于指示第i个图像块在参考视频帧的位置与第i个图像块在当前视频帧的位置之间的差异,即从参考视频帧到当前视频帧,第i个图像块的位置所发生的移动和变化。那么,可直接将来源于压缩视频流的这N个图像块对应的运动运量,作为当前视频帧中这N个图像块的解码过程中所使用的运动矢量,即当前视频帧的解码过程中所使用的运动矢量。(1) If the N image blocks contained in the current video frame all appear in the reference video frame of the current video frame, that is to say, the contents of the current video frame and the reference video frame are basically the same. At this time, the current video frame provided by the compressed video stream The motion vector corresponding to the video frame contains the motion vector corresponding to the N image blocks. The motion vector corresponding to the i-th image block (i=1,...,N) among the N image blocks is used to indicate the i-th image. The difference between the position of the block in the reference video frame and the position of the i-th image block in the current video frame, that is, the movement and change of the position of the i-th image block from the reference video frame to the current video frame. Then, the motion quantities corresponding to the N image blocks derived from the compressed video stream can be directly used as the motion vectors used in the decoding process of the N image blocks in the current video frame, that is, in the decoding process of the current video frame The motion vector used.
(2)若当前视频帧包含的N个图像块中,仅有M个图像块(M小于等于N,且M为大于或等于1的正整数)出现在当前视频帧的参考视频帧中,也就是说,当前视频帧和参考视频帧的内容仅部分相同,还有部分不相同,此时,压缩视频流提供的当前视频帧对应的运动矢量仅包含这M个图像块对应的运动矢量,这M个图像块中第j个图像块(j=1,...,M)对应的运动矢量用于指示第j个图像块在参考视频帧的位置与第j个图像块在当前视频帧的位置之间的差异,即从参考视频帧到当前视频帧,第j个图像块的位置所发生的移动和变化。由于压缩视频流并未提供当前视频帧的其余N-M个图像块对应的运动矢量,故通过以下多种方式来计算这N-M个图像块对应的运动矢量:(2) If among the N image blocks contained in the current video frame, only M image blocks (M is less than or equal to N, and M is a positive integer greater than or equal to 1) appear in the reference video frame of the current video frame, also That is to say, the contents of the current video frame and the reference video frame are only partly the same, and partly different. At this time, the motion vector corresponding to the current video frame provided by the compressed video stream only contains the motion vectors corresponding to these M image blocks. This The motion vector corresponding to the j-th image block (j=1,...,M) among the M image blocks is used to indicate the position of the j-th image block in the reference video frame and the position of the j-th image block in the current video frame. The difference between positions, that is, the movement and change in the position of the j-th image block from the reference video frame to the current video frame. Since the compressed video stream does not provide the motion vectors corresponding to the remaining N-M image blocks of the current video frame, the motion vectors corresponding to the N-M image blocks are calculated in the following multiple ways:
(2.1)将预设值(预设值的大小可根据实际需求进行设置,此处不做限制,例如,预设值为0等等)直接作为这N-M个图像块对应的运动矢量。(2.1) Use the preset value (the size of the preset value can be set according to actual needs, and there is no limit here, for example, the preset value is 0, etc.) directly as the motion vector corresponding to the N-M image blocks.
(2.2)对M个图像块对应的运动矢量进行计算,从而得到这N-M个图像块对应的运动矢量,其中,计算的过程如以下公式所示:
(2.2) Calculate the motion vectors corresponding to the M image blocks to obtain the motion vectors corresponding to the NM image blocks. The calculation process is as shown in the following formula:
上式中,为当前视频帧的这N-M个图像块中第k个图像块对应的运动矢量(k=1,...,N-M),为当前视频帧中位于第k个图像块左侧、右侧、上侧和下侧的四个图像块对应的运动矢量。In the above formula, is the motion vector (k=1,...,NM) corresponding to the k-th image block among the NM image blocks of the current video frame, are the motion vectors corresponding to the four image blocks located on the left, right, upper and lower sides of the k-th image block in the current video frame.
在计算得到这N-M个图像块对应的运动矢量后,可将来源于压缩视频流的这M个图像块对应的运动矢量作为当前视频帧中这M个图像块的解码过程中所使用的运动矢量,并将计算得到的这N-M个图像块对应的运动矢量作为当前视频帧中这N-M个图像块的解码过程中所使用的运动矢量,也就相当于得到了当前视频帧的解码过程中所使用的运动矢量。After calculating the motion vectors corresponding to the N-M image blocks, the motion vectors corresponding to the M image blocks derived from the compressed video stream can be used as the motion vectors used in the decoding process of the M image blocks in the current video frame. , and use the calculated motion vectors corresponding to the N-M image blocks as the motion vectors used in the decoding process of the N-M image blocks in the current video frame, which is equivalent to obtaining the motion vector used in the decoding process of the current video frame. motion vector.
应理解,本实施例仅以当前视频帧的参考视频帧为当前视频帧的前一个视频帧进行示意性说明,在实际应用中,参考视频帧还可以是当前视频帧的后一个视频帧,或,参考视频帧帧还可以是当前视频帧的前两个视频帧,参考视频帧还可以是当前视频帧的后两个视频帧等等,此处不做限制。It should be understood that this embodiment is only schematically illustrated by assuming that the reference video frame of the current video frame is the previous video frame of the current video frame. In practical applications, the reference video frame can also be the next video frame of the current video frame, or , the reference video frame can also be the first two video frames of the current video frame, the reference video frame can also be the last two video frames of the current video frame, etc., and there is no limit here.
402、基于当前视频帧的解码过程中所使用的运动矢量对当前视频帧的参考视频帧的特征信息进行变换,得到变换后的特征信息,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。402. Transform the feature information of the reference video frame of the current video frame based on the motion vector used in the decoding process of the current video frame to obtain the transformed feature information. The feature information of the reference video frame is in the target model of the reference video frame. Obtained during the super score process.
得到当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可利用当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息(也可以称为参考视频帧的隐含状态(hidden state))进行变换,得到参考视频帧的变换后的特征信息,也就是参考视频帧对齐至当前视频帧的特征信息。After obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the motion vector used in the decoding process of the current video frame can be used to obtain the feature information of the reference video frame (which can also be called the hidden information of the reference video frame). Containing state (hidden state)) is transformed to obtain the transformed feature information of the reference video frame, that is, the feature information of the reference video frame aligned to the current video frame.
需要说明的是,参考视频帧的特征信息是在目标模型对参考视频帧的超分过程中得到的,也就是说,在目标模型对参考视频帧的超分过程中,参考视频帧的特征信息既可以是该过程的中间输出,也可以是最终输出,还可以是参考视频帧本身。关于目标模型对参考视频帧的超分过程,可参考后续目标模型对当前视频帧的超分过程的相关说明部分,此处先不展开。It should be noted that the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. That is to say, during the super-resolution process of the target model on the reference video frame, the feature information of the reference video frame is obtained. This can be either the intermediate output of the process, the final output, or the reference video frame itself. Regarding the super-resolution process of the target model on the reference video frame, please refer to the relevant description of the subsequent super-resolution process of the current video frame by the target model, which will not be discussed here.
具体地,可通过以下方式来对参考视频帧的特征信息进行变换,从而得到变换后的特征信息: Specifically, the feature information of the reference video frame can be transformed in the following manner to obtain the transformed feature information:
可通过扭曲(warp)算法对当前视频帧的解码过程中所使用的运动矢量以及参考视频帧的特征信息进行计算,得到变换后的特征信息,其中,计算的过程如以下公式所示:
The motion vector used in the decoding process of the current video frame and the feature information of the reference video frame can be calculated through the warp algorithm to obtain the transformed feature information. The calculation process is as shown in the following formula:
上式中,MVt为当前视频帧的解码过程中所使用的运动矢量,ht-1为参考视频帧的特征信息,为参考视频帧的变换后的特征信息,Warp()为扭曲算法。In the above formula, MV t is the motion vector used in the decoding process of the current video frame, h t-1 is the feature information of the reference video frame, It is the transformed feature information of the reference video frame, and Warp() is the warping algorithm.
403、通过目标模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧。403. Use the target model to perform super-resolution on the current video frame based on the transformed feature information, and obtain the current video frame after super-resolution.
得到变换后的特征信息后,可将变换后的特征信息以及当前视频帧输入至目标模型(例如,已训练的循环神经网络模型),以通过目标模型基于变换后的特征信息对当前视频帧进行超分辨率重建,得到超分后的当前视频帧。After obtaining the transformed feature information, the transformed feature information and the current video frame can be input to the target model (for example, a trained recurrent neural network model), so that the current video frame can be processed by the target model based on the transformed feature information. Super-resolution reconstruction to obtain the current video frame after super-resolution.
具体地,目标模型可通过以下方式来对当前视频帧进行超分,从而得到超分后的当前视频帧:Specifically, the target model can perform super-resolution on the current video frame in the following ways, thereby obtaining the current video frame after super-resolution:
(1)将变换后的特征信息以及当前视频帧输入至目标模型后,目标模型可先对当前视频帧进行特征提取(例如,卷积处理等等),从而得到当前视频帧的第一特征。例如,如图5所示(图5为本申请实施例提供的目标模型的一个结构示意图),设压缩视频流经过解码后,可得到多个视频帧,其中,第t个视频帧LRt为当前视频帧,第t-1个视频帧为第t个视频帧LRt的参考视频帧。将第t个视频帧LRt以及第t-1个视频帧的变换后的隐含状态(由第t个视频帧的解码过程中所使用的运动矢量MVt对第t-1个视频帧的隐含状态ht-1进行变换得到)输入目标模型后,目标模型可先对第t个视频帧LRt进行初步的特征提取,得到第t个视频帧的初步特征ft 1(即前述的第一特征)。(1) After inputting the transformed feature information and the current video frame to the target model, the target model can first perform feature extraction (for example, convolution processing, etc.) on the current video frame to obtain the first feature of the current video frame. For example, as shown in Figure 5 (Figure 5 is a schematic structural diagram of the target model provided by the embodiment of the present application), assuming that the compressed video stream is decoded, multiple video frames can be obtained, where the t-th video frame LR t is The current video frame, the t-1th video frame is the reference video frame of the tth video frame LR t . The transformed implicit state of the t-th video frame LR t and the t-1th video frame (obtained by transforming the hidden state h t- 1 of the t-1th video frame using the motion vector MV t used in the decoding process of the t-th video frame) After inputting the target model, the target model can first Preliminary feature extraction is performed on the video frame LR t to obtain the preliminary feature f t 1 of the t-th video frame (ie, the aforementioned first feature).
(2)得到当前视频帧的第一特征后,目标模型可对变换后的特征信息以及当前视频帧的第一特征进行融合(例如,拼接处理等等),从而得到当前视频帧的第二特征。依旧如上述例子,得到第t个视频帧的初步特征ft 1后,目标模型可将第t个视频帧的初步特征ft 1以及第t-1个视频帧的变换后的隐含状态进行拼接(级联),得到第t个视频帧的融合特征ft 2(即前述的第二特征)。(2) After obtaining the first feature of the current video frame, the target model can fuse the transformed feature information and the first feature of the current video frame (for example, splicing processing, etc.) to obtain the second feature of the current video frame. . Still as in the above example, after obtaining the preliminary feature f t 1 of the t-th video frame, the target model can combine the preliminary feature f t 1 of the t-th video frame and the transformed hidden state of the t-1 video frame. Perform splicing (cascade) to obtain the fusion feature f t 2 of the t-th video frame (i.e., the aforementioned second feature).
(3)得到当前视频帧的第二特征后,目标模型可继续对当前视频帧的第二特征进行特征提取(例如,卷积处理等等),从而得到当前视频帧的第三特征。依旧如上述例子,得到第t个视频帧的融合特征ft 2后,目标模型可继续对第t个视频帧的融合特征ft 2进行特征提取,得到第t个视频帧的进一步特征ft 3(3) After obtaining the second feature of the current video frame, the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the second feature of the current video frame, thereby obtaining the third feature of the current video frame. Still as in the above example, after obtaining the fusion feature f t 2 of the t-th video frame, the target model can continue to perform feature extraction on the fusion feature f t 2 of the t-th video frame to obtain further features f t of the t-th video frame. 3 .
(4)得到当前视频帧的第三特征后,目标模型可对当前视频帧的第三特征以及当前视频帧进行融合(例如,相加处理等等),从而得到并对外输出超分后的当前视频帧。依旧如上述例子,得到第t个视频帧的进一步特征ft 3后,目标模型可将第t个视频帧的进一步特征ft 3以及第t个视频帧LRt进行相加,从而得到并输出超分后的第t个视频帧SRt(4) After obtaining the third feature of the current video frame, the target model can fuse the third feature of the current video frame and the current video frame (for example, addition processing, etc.), thereby obtaining and outputting the super-resolved current Video frames. Still as in the above example, after obtaining the further feature f t 3 of the t-th video frame, the target model can add the further feature f t 3 of the t-th video frame and the t-th video frame LR t to obtain and output The t-th video frame SR t after super-resolution.
进一步地,目标模型可通过多种方式来获取当前视频帧的特征信息(隐含状态):Furthermore, the target model can obtain the feature information (hidden state) of the current video frame in a variety of ways:
(1)得到当前视频帧的第三特征后,目标模型可直接将当前视频帧的第三特征作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用。依旧如上述例子,得到第t个视频帧的进一步特征ft 3后,目标模型可将其作为第t个视频帧的隐含状态ht,并输出第t个视频帧的隐含状态ht(1) After obtaining the third feature of the current video frame, the target model can directly use the third feature of the current video frame as the feature information of the current video frame, and output it externally for use in the super-resolution process of the next video frame. Still as in the above example, after obtaining the further features f t 3 of the t-th video frame, the target model can use it as the hidden state h t of the t-th video frame and output the hidden state h t of the t-th video frame. .
(2)得到超分后的当前视频帧后,目标模型可直接将超分后的当前视频帧作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用。依旧如上述例子,得到超分后的第t个视频帧SRt 后,目标模型可将其作为第t个视频帧的隐含状态ht,并输出第t个视频帧的隐含状态ht(2) After obtaining the current video frame after super-resolution, the target model can directly use the current video frame after super-resolution as the feature information of the current video frame, and output it to the outside for use in the super-resolution process of the next video frame. Still as in the above example, get the t-th video frame SR t after super-resolution Afterwards, the target model can use it as the hidden state h t of the t-th video frame, and output the hidden state h t of the t-th video frame.
(3)得到当前视频帧的第三特征后,目标模型可继续对当前视频帧的第三特征进行特征提取(例如,卷积处理等等),从而得到当前视频帧的特征信息。依旧如上述例子,得到第t个视频帧的进一步特征ft 3后,目标模型可对第t个视频帧的进一步特征ft 3进行特征提取,从而得到并输出第t个视频帧的隐含状态ht(3) After obtaining the third feature of the current video frame, the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the third feature of the current video frame, thereby obtaining feature information of the current video frame. Still as in the above example, after obtaining the further feature f t 3 of the t-th video frame, the target model can perform feature extraction on the further feature f t 3 of the t-th video frame, thereby obtaining and outputting the implicit feature of the t-th video frame. State h t .
(4)得到超分后的当前视频帧后,目标模型可继续对超分后的当前视频帧进行特征提取(例如,卷积处理等等),从而得到当前视频帧的特征信息。依旧如上述例子,得到超分后的第t个视频帧SRt后,目标模型可对超分后的第t个视频帧SRt进行特征提取,从而得到并输出第t个视频帧的隐含状态ht(4) After obtaining the current video frame after super-resolution, the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the current video frame after super-resolution, thereby obtaining the feature information of the current video frame. Still as in the above example, after obtaining the t-th video frame SR t after super-resolution, the target model can perform feature extraction on the t-th video frame SR t after super-resolution, thereby obtaining and outputting the implicit information of the t-th video frame. State h t .
应理解,得到当前视频帧的第三特征后,目标模型还可不对第三特征以及当前视频帧进行融合,而是直接将第三特征作为超分后的当前视频帧。依旧如上述例子,得到第t个视频帧的进一步特征ft 3后,目标模型可将其直接作为超分后的第t个视频帧SRt,并输出超分后的第t个视频帧SRtIt should be understood that after obtaining the third feature of the current video frame, the target model may not fuse the third feature with the current video frame, but directly use the third feature as the super-resolved current video frame. Still as in the above example, after obtaining the further features f t 3 of the t-th video frame, the target model can directly use it as the t-th video frame SR t after super-resolution, and output the t-th video frame SR after super-resolution. t .
至此,则完成了针对当前视频帧的超分处理。对于待超分的视频流中除当前视频帧之外的其余视频帧,也可执行如同对当前视频帧所执行的操作,故可得到超分后的视频流。At this point, the super-resolution processing for the current video frame is completed. For the remaining video frames in the video stream to be super-resolved except the current video frame, the same operations as those performed on the current video frame can also be performed, so that the video stream after super-resolution can be obtained.
本申请实施例中,在获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。In the embodiment of the present application, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed features. Information, wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
图6为本申请实施例提供的视频处理方法的另一流程示意图,如图6所示,该方法包括:Figure 6 is another schematic flowchart of a video processing method provided by an embodiment of the present application. As shown in Figure 6, the method includes:
601、获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息。601. Obtain the current video frame and the residual information used in the decoding process of the current video frame.
本实施例中,在确定用户所指定的压缩视频流后,可对压缩视频流进行解码,从而得到待超分的视频流。需要说明的是,在前述解码过程中,压缩视频流至少包含第一个视频帧,第二个视频帧对应的运动矢量以及残差信息,第三个视频帧对应的运动矢量以及残差信息,...,最后一个视频帧对应的运动矢量以及残差信息。那么,可将第一个视频帧作为第二个视频帧的参考视频帧,基于第二个视频帧对应的运动矢量对第一个视频帧进行运动补偿,得到中间视频帧,再在中间视频帧上叠加第二个视频帧对应的残差信息,得到第二个视频帧,如此一来,则完成了第二个视频帧的解码。接着,可将第二个视频帧作为第三个视频帧的参考视频帧,基于第三个视频帧对应的运动矢量对第二个视频帧进行运动补偿,得到中间视频帧,再在中间视频帧上叠加第三个视频帧对应的残差信息,得到第三个视频帧,如此一来,则完成了第三个视频帧的解码。以此类推,也可以完成第四个视频帧的解码,...,最后一个视频帧的解码,相当于得到第一个视频帧,第二个视频帧,第三个视频帧,...,最后一个视频帧这多个视频帧,这多个视频帧即组成了待超分的视频流。In this embodiment, after the compressed video stream specified by the user is determined, the compressed video stream can be decoded to obtain a video stream to be super-resolved. It should be noted that during the aforementioned decoding process, the compressed video stream at least contains the first video frame, the motion vector and residual information corresponding to the second video frame, the motion vector and residual information corresponding to the third video frame, ..., the motion vector and residual information corresponding to the last video frame. Then, the first video frame can be used as the reference video frame of the second video frame, motion compensation is performed on the first video frame based on the motion vector corresponding to the second video frame, and the intermediate video frame is obtained, and then the intermediate video frame is The residual information corresponding to the second video frame is superimposed to obtain the second video frame. In this way, the decoding of the second video frame is completed. Then, the second video frame can be used as the reference video frame of the third video frame, and motion compensation is performed on the second video frame based on the motion vector corresponding to the third video frame to obtain an intermediate video frame, and then in the intermediate video frame The residual information corresponding to the third video frame is superimposed to obtain the third video frame. In this way, the decoding of the third video frame is completed. By analogy, the decoding of the fourth video frame can also be completed,..., the decoding of the last video frame is equivalent to obtaining the first video frame, the second video frame, the third video frame,... , the last video frame and multiple video frames constitute the video stream to be super-resolved.
为了方便说明,下文以待超分的视频流包含的多个视频帧中的任意一个视频帧进行示意性介绍,并将该视频帧称为当前视频帧。在基于当前视频帧的参考视频帧(例如,当前视频帧的前一个视频帧)、当前视频帧对应的运动矢量以及当前视频帧对应的残差信息,进行解码得到当前视频帧后,还可基于当前视频帧对应的运动矢量,来获取当前视频帧的解码过程中所使用的运动矢量。For convenience of explanation, any video frame among multiple video frames included in the video stream to be super-resolved will be schematically introduced below, and this video frame will be called the current video frame. After decoding to obtain the current video frame based on the reference video frame of the current video frame (for example, the previous video frame of the current video frame), the motion vector corresponding to the current video frame, and the residual information corresponding to the current video frame, the current video frame can also be obtained based on The motion vector corresponding to the current video frame is used to obtain the motion vector used in the decoding process of the current video frame.
那么,压缩视频流提供的当前视频帧对应的残差信息,即可作为当前视频帧的解码过程所使用的残差信息。Then, the residual information corresponding to the current video frame provided by the compressed video stream can be used as the residual information used in the decoding process of the current video frame.
602、通过目标模型基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息, 对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。602. Based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame through the target model, Super-resolution is performed on the current video frame to obtain the current video frame after super-resolution. The feature information of the reference video frame is obtained during the super-resolution processing of the reference video frame by the target model.
得到当前视频帧以及当前视频帧的解码过程中所使用的残差信息后,还可获取参考视频帧的特征信息(也可以称为参考视频帧的隐含状态(hidden state)),并将当前视频帧、当前视频帧的解码过程中所使用的残差信息以及参考视频帧的特征信息输入至目标模型,以使得目标模型基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息,对当前视频帧进行超分,得到超分后的当前视频帧。After obtaining the current video frame and the residual information used in the decoding process of the current video frame, the feature information of the reference video frame (also called the hidden state of the reference video frame) can also be obtained, and the current The video frame, the residual information used in the decoding process of the current video frame, and the feature information of the reference video frame are input to the target model, so that the target model is based on the feature information of the reference video frame and the feature information used in the decoding process of the current video frame. Residual information, perform super-resolution on the current video frame, and obtain the current video frame after super-resolution.
需要说明的是,参考视频帧的特征信息是在目标模型对参考视频帧的超分过程中得到的,也就是说,在目标模型对参考视频帧的超分过程中,参考视频帧的特征信息既可以是该过程的中间输出,也可以是最终输出,还可以是参考视频帧本身。关于目标模型对参考视频帧的超分过程,可参考后续目标模型对当前视频帧的超分过程的相关说明部分,此处先不展开。It should be noted that the feature information of the reference video frame is obtained during the super-resolution process of the target model on the reference video frame. That is to say, during the super-resolution process of the target model on the reference video frame, the feature information of the reference video frame is obtained. This can be either the intermediate output of the process, the final output, or the reference video frame itself. Regarding the super-resolution process of the target model on the reference video frame, please refer to the relevant description of the subsequent super-resolution process of the current video frame by the target model, which will not be discussed here.
具体地,目标模型可通过以下方式来对当前视频帧进行超分,从而得到超分后的当前视频帧:Specifically, the target model can perform super-resolution on the current video frame in the following ways, thereby obtaining the current video frame after super-resolution:
(1)将当前视频帧、当前视频帧的解码过程中所使用的残差信息以及参考视频帧的特征信息输入至目标模型后,目标模型可先对当前视频帧进行特征提取(例如,卷积处理等等),从而得到当前视频帧的第一特征。例如,如图7所示(图7为本申请实施例提供的目标模型的另一结构示意图),设压缩视频流经过解码后,可得到多个视频帧,其中,第t个视频帧LRt为当前视频帧,第t-1个视频帧为第t个视频帧LRt的参考视频帧。将第t个视频帧LRt、当前视频帧的解码过程中所使用的残差信息Rest以及第t-1个视频帧的隐含状态ht-1输入目标模型后,目标模型可先对第t个视频帧LRt进行初步的特征提取,得到第t个视频帧的初步特征ft 1(即前述的第一特征)。(1) After inputting the current video frame, the residual information used in the decoding process of the current video frame, and the feature information of the reference video frame into the target model, the target model can first perform feature extraction (for example, convolution) on the current video frame Processing, etc.) to obtain the first feature of the current video frame. For example, as shown in Figure 7 (Figure 7 is another structural schematic diagram of the target model provided by the embodiment of the present application), assuming that the compressed video stream is decoded, multiple video frames can be obtained, wherein the t-th video frame LR t is the current video frame, and the t-1th video frame is the reference video frame of the t-th video frame LR t . After inputting the t-th video frame LR t , the residual information Res t used in the decoding process of the current video frame, and the hidden state h t-1 of the t-1th video frame into the target model, the target model can first Preliminary feature extraction is performed on the t-th video frame LR t , and the preliminary feature f t 1 of the t-th video frame is obtained (ie, the aforementioned first feature).
(2)得到当前视频帧的第一特征后,目标模型对参考视频帧的特征信息以及当前视频帧的第一特征进行融合(例如,拼接处理等等),从而得到当前视频帧的第二特征。依旧如上述例子,得到第t个视频帧的初步特征ft 1后,目标模型可将第t个视频帧的初步特征ft 1以及第t-1个视频帧的隐含状态ht-1进行拼接(级联),得到第t个视频帧的融合特征ft 2(即前述的第二特征)。(2) After obtaining the first feature of the current video frame, the target model fuses the feature information of the reference video frame and the first feature of the current video frame (for example, splicing processing, etc.) to obtain the second feature of the current video frame. . Still as in the above example, after obtaining the preliminary feature f t 1 of the t-th video frame, the target model can combine the preliminary feature f t 1 of the t-th video frame and the hidden state h t-1 of the t-1th video frame Perform splicing (cascade) to obtain the fusion feature f t 2 of the t-th video frame (i.e., the aforementioned second feature).
(3)得到当前视频帧的第二特征后,通过目标模型可继续对当前视频帧的第二特征进行特征提取(例如,卷积处理等等),从而得到当前视频帧的第三特征。依旧如上述例子,得到第t个视频帧的融合特征ft 2后,目标模型可继续对第t个视频帧的融合特征ft 2进行特征提取,得到第t个视频帧的进一步特征ft 3(3) After obtaining the second feature of the current video frame, the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the second feature of the current video frame, thereby obtaining the third feature of the current video frame. Still as in the above example, after obtaining the fusion feature f t 2 of the t-th video frame, the target model can continue to perform feature extraction on the fusion feature f t 2 of the t-th video frame to obtain further features f t of the t-th video frame. 3 .
(4)得到当前视频帧的第三特征后,目标模型可基于当前视频帧的解码过程中所使用的残差信息,继续对当前视频帧的第三特征进行特征提取(例如,卷积处理等等),从而得到当前视频帧的第四特征。依旧如上述例子,得到第t个视频帧的进一步特征ft 3,目标模型可利用当前视频帧的解码过程中所使用的残差信息Rest,对第t个视频帧的进一步特征ft 3进行特征提取,从而得到第t个视频帧的更进一步特征ft 4(4) After obtaining the third feature of the current video frame, the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the third feature of the current video frame based on the residual information used in the decoding process of the current video frame. etc.), thereby obtaining the fourth feature of the current video frame. Still as in the above example, further features f t 3 of the t-th video frame are obtained. The target model can use the residual information Res t used in the decoding process of the current video frame to obtain further features f t 3 of the t-th video frame. Feature extraction is performed to obtain further features f t 4 of the t-th video frame.
(5)得到当前视频帧的第四特征后,目标模型可对当前视频帧的第四特征以及当前视频帧进行融合(例如,相加处理等等),得到超分后的当前视频帧。依旧如上述例子,得到第t个视频帧的更进一步特征ft 4后,目标模型可将第t个视频帧的更进一步特征ft 4以及第t个视频帧LRt进行相加,从而得到并输出超分后的第t个视频帧SRt(5) After obtaining the fourth feature of the current video frame, the target model can fuse the fourth feature of the current video frame and the current video frame (for example, addition processing, etc.) to obtain the super-resolved current video frame. Still as in the above example, after obtaining the further feature f t 4 of the t-th video frame, the target model can add the further feature f t 4 of the t-th video frame and the t-th video frame LR t to obtain And output the t-th video frame SR t after super-resolution.
更具体地,目标模型可通过以下方式获取当前视频帧的第四特征:More specifically, the target model can obtain the fourth feature of the current video frame in the following way:
(1)设当前视频帧可划分为N个图像块(N为大于或等于2的正整数),故当前视频帧的解码过程中所使用的残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息。在这N个图像块中,目标模型可依次将每个图像块的解码过程中所使用的残差信息与预置的阈值(该阈值的大小可根据实际 需求进行设置,此处不做限制)进行比较,从而确定残差信息大于预置的残差阈值的P个图像块(P小于N,且P为大于或等于1的正整数)。(1) Assume that the current video frame can be divided into N image blocks (N is a positive integer greater than or equal to 2), so the residual information used in the decoding process of the current video frame includes the N image blocks in the current video frame. Residual information used in the decoding process. In these N image blocks, the target model can sequentially compare the residual information used in the decoding process of each image block with the preset threshold (the size of the threshold can be determined according to the actual (requirements are set, there are no restrictions here) are compared to determine P image blocks whose residual information is greater than the preset residual threshold (P is less than N, and P is a positive integer greater than or equal to 1).
(2)得到残差信息大于预置的残差阈值的P个图像块后,目标模型可对当前视频帧的第三特征中与P个图像块对应的这一部分特征进行特征提取,而第三特征中与其余N-P个图像快对应的另一部分特征则保持不变,从而得到当前视频帧的第四特征。(2) After obtaining P image blocks whose residual information is greater than the preset residual threshold, the target model can perform feature extraction on the part of the third feature of the current video frame corresponding to the P image blocks, and the third The other part of the features corresponding to the remaining N-P image blocks remains unchanged, thereby obtaining the fourth feature of the current video frame.
进一步地,目标模型可通过多种方式来获取当前视频帧的特征信息(隐含状态):Furthermore, the target model can obtain the feature information (hidden state) of the current video frame in a variety of ways:
(1)得到当前视频帧的第三特征后,目标模型可直接将当前视频帧的第三特征作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用。依旧如上述例子,得到第t个视频帧的进一步特征ft 3后,目标模型可将其作为第t个视频帧的隐含状态ht,并输出第t个视频帧的隐含状态ht(1) After obtaining the third feature of the current video frame, the target model can directly use the third feature of the current video frame as the feature information of the current video frame, and output it externally for use in the super-resolution process of the next video frame. Still as in the above example, after obtaining the further features f t 3 of the t-th video frame, the target model can use it as the hidden state h t of the t-th video frame and output the hidden state h t of the t-th video frame. .
(2)得到当前视频帧的第四特征后,目标模型可直接将当前视频帧的第四特征作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用。依旧如上述例子,得到第t个视频帧的更进一步特征ft 4后,目标模型可将其作为第t个视频帧的隐含状态ht,并输出第t个视频帧的隐含状态ht(2) After obtaining the fourth feature of the current video frame, the target model can directly use the fourth feature of the current video frame as the feature information of the current video frame, and output it externally for use in the super-resolution process of the next video frame. Still as in the above example, after obtaining the further features f t 4 of the t-th video frame, the target model can use it as the hidden state h t of the t-th video frame and output the hidden state h of the t-th video frame. t .
(3)得到超分后的当前视频帧后,目标模型可直接将超分后的当前视频帧作为当前视频帧的特征信息,并对外输出以供下一个视频帧的超分过程使用。依旧如上述例子,得到超分后的第t个视频帧SRt后,目标模型可将其作为第t个视频帧的隐含状态ht,并输出第t个视频帧的隐含状态ht(3) After obtaining the current video frame after super-resolution, the target model can directly use the current video frame after super-resolution as the feature information of the current video frame, and output it to the outside for use in the super-resolution process of the next video frame. Still as in the above example, after obtaining the super-resolved t-th video frame SR t , the target model can use it as the hidden state h t of the t-th video frame and output the hidden state h t of the t-th video frame. .
(4)得到当前视频帧的第三特征后,目标模型可继续对当前视频帧的第三特征进行特征提取(例如,卷积处理等等),从而得到当前视频帧的特征信息。依旧如上述例子,得到第t个视频帧的进一步特征ft 3后,目标模型可对第t个视频帧的进一步特征ft 3进行特征提取,从而得到并输出第t个视频帧的隐含状态ht(4) After obtaining the third feature of the current video frame, the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the third feature of the current video frame, thereby obtaining feature information of the current video frame. Still as in the above example, after obtaining the further feature f t 3 of the t-th video frame, the target model can perform feature extraction on the further feature f t 3 of the t-th video frame, thereby obtaining and outputting the implicit feature of the t-th video frame. State h t .
(5)得到当前视频帧的第四特征后,目标模型可继续对当前视频帧的第四特征进行特征提取(例如,卷积处理等等),从而得到当前视频帧的特征信息。依旧如上述例子,得到第t个视频帧的更进一步特征ft 4后,目标模型可对第t个视频帧的更进一步特征ft 4进行特征提取,从而得到并输出第t个视频帧的隐含状态ht(5) After obtaining the fourth feature of the current video frame, the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the fourth feature of the current video frame, thereby obtaining feature information of the current video frame. Still as in the above example, after obtaining the further feature f t 4 of the t-th video frame, the target model can perform feature extraction on the further feature f t 4 of the t-th video frame, thereby obtaining and outputting the further feature f t 4 of the t-th video frame. Hidden state h t .
(6)得到超分后的当前视频帧后,目标模型可继续对超分后的当前视频帧进行特征提取(例如,卷积处理等等),从而得到当前视频帧的特征信息。依旧如上述例子,得到超分后的第t个视频帧SRt后,目标模型可对超分后的第t个视频帧SRt进行特征提取,从而得到并输出第t个视频帧的隐含状态ht(6) After obtaining the current video frame after super-resolution, the target model can continue to perform feature extraction (for example, convolution processing, etc.) on the current video frame after super-resolution, thereby obtaining the feature information of the current video frame. Still as in the above example, after obtaining the t-th video frame SR t after super-resolution, the target model can perform feature extraction on the t-th video frame SR t after super-resolution, thereby obtaining and outputting the implicit information of the t-th video frame. State h t .
应理解,得到当前视频帧的第四特征后,目标模型还可不对第四特征以及当前视频帧进行融合,而是直接将第四特征作为超分后的当前视频帧。依旧如上述例子,得到第t个视频帧的更进一步特征ft 4后,目标模型可将其直接作为超分后的第t个视频帧SRt,并输出超分后的第t个视频帧SRtIt should be understood that after obtaining the fourth feature of the current video frame, the target model may not fuse the fourth feature with the current video frame, but directly use the fourth feature as the super-resolved current video frame. Still as in the above example, after obtaining the further features f t 4 of the t-th video frame, the target model can directly use it as the t-th video frame SR t after super-resolution, and output the t-th video frame after super-resolution SR t .
至此,则完成了针对当前视频帧的超分处理。对于待超分的视频流中除当前视频帧之外的其余视频帧,也可执行如同对当前视频帧所执行的操作,故可得到超分后的视频流。At this point, the super-resolution processing for the current video frame is completed. For the remaining video frames in the video stream to be super-resolved except the current video frame, the same operations as those performed on the current video frame can also be performed, so that the video stream after super-resolution can be obtained.
本申请实施例中,获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。前述过程中,目标模型可基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息对当前视频帧进行超分,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间像素值的差异关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。In the embodiment of this application, the current video frame and the residual information used in the decoding process of the current video frame are obtained; the current video frame is super-resolved through the target model based on the feature information and residual information of the reference video frame, and we obtain The feature information of the current video frame after super-resolution and the reference video frame is obtained through the super-resolution processing of the reference video frame by the target model. In the aforementioned process, the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame. It can be seen that during the super-resolution process of the current video frame by the target model , not only the information of the reference video frame itself is considered, but also the difference in pixel values between the reference video frame and the current video frame is considered. The factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is High enough quality (with a relatively ideal resolution) so that the entire video stream after super-resolution has good image quality, thus improving the user experience.
进一步地,目标模型在针对当前视频帧的超分过程中,神经网络模型仅需对当前视频帧包含的部分图像块进行所有的处理,对当前视频帧包含的另一部分图像块则不需要进行所有的处理,可以减少所需要的计算量,故基于目标模型的视频处理方式可应用在算力有限的小型设备上。 Furthermore, during the super-resolution process of the target model for the current video frame, the neural network model only needs to perform all processing on some image blocks contained in the current video frame, and does not need to perform all processing on the other part of the image blocks included in the current video frame. The processing can reduce the amount of calculation required, so the video processing method based on the target model can be applied to small devices with limited computing power.
值得注意的是,图4所示的实施例与图6的实施例可以叠加在一起使用。It is worth noting that the embodiment shown in Fig. 4 and the embodiment shown in Fig. 6 can be superimposed and used.
以上是对本申请实施例提供的视频处理方法所进行的详细说明,以下将对本申请实施例提供的模型训练方法进行介绍。图8为本申请实施例提供的模型训练方法的一个流程示意图,如图8所示,该方法包括:The above is a detailed description of the video processing method provided by the embodiment of the present application. The model training method provided by the embodiment of the present application will be introduced below. Figure 8 is a schematic flow chart of the model training method provided by the embodiment of the present application. As shown in Figure 8, the method includes:
801、获取当前视频帧,以及当前视频帧的解码过程中所使用的运动矢量。801. Obtain the current video frame and the motion vector used in the decoding process of the current video frame.
本实施例中,当需要对待训练模型(需要训练的循环神经网络)进行训练时,可先获取一批训练数据,该批训练数据包含当前视频帧以及当前视频帧的解码过程中所使用的运动矢量。需要说明的是,真实超分后的当前视频帧(也就是当前视频帧的真实超分结果)是已知的。In this embodiment, when the model to be trained (the recurrent neural network that needs to be trained) needs to be trained, a batch of training data can be obtained first. The batch of training data includes the current video frame and the motion used in the decoding process of the current video frame. Vector. It should be noted that the current video frame after the real super-resolution (that is, the real super-resolution result of the current video frame) is known.
在一种可能实现的方式中,当前视频帧包含N个图像块,获取当前视频帧的解码过程中所使用的运动矢量包括:从压缩视频流中,获取当前视频帧中M个图像块的解码过程中所使用的运动矢量,N≥2,N>M≥1;基于M个图像块的解码过程中所使用的运动矢量,计算N-M个图像块的解码过程中所使用的运动矢量,或,将预设值确定为N-M个图像块的解码过程中所使用的运动矢量。In a possible implementation manner, the current video frame contains N image blocks, and obtaining the motion vector used in the decoding process of the current video frame includes: obtaining the decoding of M image blocks in the current video frame from the compressed video stream. The motion vector used in the process, N≥2, N>M≥1; based on the motion vector used in the decoding process of M image blocks, calculate the motion vector used in the decoding process of N-M image blocks, or, The preset value is determined as the motion vector used in the decoding process of N-M image blocks.
802、基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,得到变换后的特征信息,参考视频帧的特征信息在待训练模型对参考视频帧的超分过程中得到。802. Transform the feature information of the reference video frame of the current video frame based on the motion vector to obtain transformed feature information. The feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained.
得到当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可利用当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息(也可以称为参考视频帧的隐含状态(hidden state))进行变换,得到参考视频帧的变换后的特征信息,也就是参考视频帧对齐至当前视频帧的特征信息。After obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the motion vector used in the decoding process of the current video frame can be used to obtain the feature information of the reference video frame (which can also be called the hidden information of the reference video frame). Containing state (hidden state)) is transformed to obtain the transformed feature information of the reference video frame, that is, the feature information of the reference video frame aligned to the current video frame.
需要说明的是,参考视频帧的特征信息是在待训练模型对参考视频帧的超分过程中得到的,也就是说,在待训练模型对参考视频帧的超分过程中,参考视频帧的特征信息既可以是该过程的中间输出,也可以是最终输出。关于待训练模型对参考视频帧的超分过程,可参考后续待训练模型对当前视频帧的超分过程的相关说明部分,此处先不展开。It should be noted that the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained. That is to say, during the super-resolution process of the reference video frame by the model to be trained, the reference video frame Feature information can be either an intermediate output or a final output of the process. Regarding the super-resolution process of the model to be trained on the reference video frame, please refer to the relevant description of the subsequent super-resolution process of the model to be trained on the current video frame, which will not be discussed here.
在一种可能实现的方式中,基于运动矢量对参考视频帧的特征信息进行变换,得到变换后的特征信息包括:通过扭曲算法对运动矢量以及参考视频帧的特征信息进行计算,得到变换后的特征信息。In one possible implementation method, transforming the feature information of the reference video frame based on the motion vector to obtain the transformed feature information includes: calculating the motion vector and the feature information of the reference video frame through a warping algorithm to obtain the transformed feature information. Feature information.
803、通过待训练模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧。803. Use the model to be trained to perform super-resolution on the current video frame based on the transformed feature information to obtain the current video frame after super-resolution.
得到变换后的特征信息后,可将变换后的特征信息以及当前视频帧输入至待训练模型,以通过待训练模型基于变换后的特征信息对当前视频帧进行超分辨率重建,得到超分后的当前视频帧。After obtaining the transformed feature information, the transformed feature information and the current video frame can be input to the model to be trained, so that the model to be trained can perform super-resolution reconstruction of the current video frame based on the transformed feature information, and obtain the super-resolution the current video frame.
在一种可能实现的方式中,通过待训练模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧包括:通过待训练模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过待训练模型对变换后的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过待训练模型对第二特征进行特征提取,得到当前视频帧的第三特征,第三特征作为超分后的当前视频帧。In one possible implementation method, the current video frame is super-resolved based on the transformed feature information through the model to be trained, and obtaining the current video frame after the super-resolution includes: performing feature extraction on the current video frame through the model to be trained, and obtaining The first feature of the current video frame; fuse the transformed feature information and the first feature through the model to be trained to obtain the second feature of the current video frame; perform feature extraction on the second feature through the model to be trained to obtain the current video frame The third feature is the current video frame after super-resolution.
在一种可能实现的方式中,该方法还包括:通过待训练模型对第三特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the method further includes: fusing the third feature and the current video frame through the model to be trained to obtain the super-resolved current video frame.
在一种可能实现的方式中,第三特征或超分后的当前视频帧作为当前视频帧的特征信息。In one possible implementation manner, the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,该方法还包括:通过待训练模型对第三特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In a possible implementation manner, the method further includes: extracting features of the third feature or the current video frame after super-resolution through the model to be trained, to obtain feature information of the current video frame.
804、基于超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异。804. Obtain a target loss based on the current video frame after super-resolution and the current video frame after real super-resolution. The target loss is used to indicate the difference between the current video frame after super-resolution and the current video frame after real super-resolution.
得到超分后的当期视频帧后,可通过预置的损失函数对超分后的当前视频帧以及真实超分后的当前视频帧进行计算,从而得到目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异。After obtaining the current video frame after super-resolution, the current video frame after super-resolution and the current video frame after real super-resolution can be calculated through the preset loss function to obtain the target loss. The target loss is used to indicate the result after super-resolution. The difference between the current video frame and the current video frame after real super-resolution.
805、基于目标损失对待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。805. Update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
得到目标损失后,可基于目标损失对待训练模型的参数进行更新,并利用下一批训练数据继续对更新参数后的待训练模型进行训练,直至满足模型训练条件(例如,目标损失达到收敛等等),得到图4所示实施例中的目标模型。After obtaining the target loss, the parameters of the model to be trained can be updated based on the target loss, and the next batch of training data can be used to continue training the model to be trained after the updated parameters until the model training conditions are met (for example, the target loss reaches convergence, etc. ), the target model in the embodiment shown in Figure 4 is obtained.
本申请实施例训练得到的目标模型,具备对视频帧进行超分的能力。具体地,在获取当前视频帧以 及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。The target model trained in the embodiment of this application has the ability to super-resolve video frames. Specifically, after obtaining the current video frame to and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed feature information, where the feature information of the reference video frame is in Obtained from the super-resolution process of the target model on the reference video frame. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
图9为本申请实施例提供的模型训练方法的另一流程示意图,如图9所示,该方法包括:Figure 9 is another schematic flowchart of a model training method provided by an embodiment of the present application. As shown in Figure 9, the method includes:
901、获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息。901. Obtain the current video frame and the residual information used in the decoding process of the current video frame.
本实施例中,当需要对待训练模型(需要训练的循环神经网络)进行训练时,可先获取一批训练数据,该批训练数据包含当前视频帧以及当前视频帧的解码过程中所使用的残差信息。需要说明的是,真实超分后的当前视频帧(也就是当前视频帧的真实超分结果)是已知的。In this embodiment, when the model to be trained (the recurrent neural network that needs to be trained) needs to be trained, a batch of training data can be obtained first. The batch of training data includes the current video frame and the residuals used in the decoding process of the current video frame. Poor information. It should be noted that the current video frame after the real super-resolution (that is, the real super-resolution result of the current video frame) is known.
902、通过待训练模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在待训练模型对参考视频帧的超分处理中得到。902. Use the model to be trained to perform super-resolution on the current video frame based on the feature information and residual information of the reference video frame to obtain the current video frame after super-resolution. The feature information of the reference video frame is in the model to be trained on the reference video frame. Obtained from super score processing.
得到当前视频帧以及当前视频帧的解码过程中所使用的残差信息后,还可获取参考视频帧的特征信息(也可以称为参考视频帧的隐含状态(hidden state)),并将当前视频帧、当前视频帧的解码过程中所使用的残差信息以及参考视频帧的特征信息输入至待训练模型,以使得待训练模型基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息,对当前视频帧进行超分,得到超分后的当前视频帧。After obtaining the current video frame and the residual information used in the decoding process of the current video frame, the feature information of the reference video frame (also called the hidden state of the reference video frame) can also be obtained, and the current The video frame, the residual information used in the decoding process of the current video frame, and the feature information of the reference video frame are input to the model to be trained, so that the model to be trained is based on the feature information of the reference video frame and the information used in the decoding process of the current video frame. Use the residual information to perform super-resolution on the current video frame and obtain the current video frame after super-resolution.
需要说明的是,参考视频帧的特征信息是在待训练模型对参考视频帧的超分过程中得到的,也就是说,在待训练模型对参考视频帧的超分过程中,参考视频帧的特征信息既可以是该过程的中间输出,也可以是最终输出。关于待训练模型对参考视频帧的超分过程,可参考后续待训练模型对当前视频帧的超分过程的相关说明部分,此处先不展开。It should be noted that the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the model to be trained. That is to say, during the super-resolution process of the reference video frame by the model to be trained, the reference video frame Feature information can be either an intermediate output or a final output of the process. Regarding the super-resolution process of the model to be trained on the reference video frame, please refer to the relevant description of the subsequent super-resolution process of the model to be trained on the current video frame, which will not be discussed here.
在一种可能实现的方式中,通过待训练模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧包括:通过待训练模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过待训练模型对参考视频帧的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过待训练模型对第二特征进行特征提取,得到当前视频帧的第三特征;通过待训练模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征,第四特征作为超分后的当前视频帧。In one possible implementation method, the current video frame is super-resolved based on the feature information and residual information of the reference video frame through the model to be trained, and the current video frame obtained after super-scoring includes: Feature extraction is performed on the frame to obtain the first feature of the current video frame; the feature information of the reference video frame and the first feature are fused through the model to be trained to obtain the second feature of the current video frame; the second feature is processed through the model to be trained Feature extraction is used to obtain the third feature of the current video frame; the model to be trained performs feature extraction on the third feature based on the residual information to obtain the fourth feature of the current video frame, and the fourth feature is used as the current video frame after super-resolution.
在一种可能实现的方式中,残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息,通过待训练模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征包括:通过待训练模型在N个图像块中,确定残差信息大于预置的残差阈值的P个图像块,N≥2,N>P≥1;通过待训练模型对第三特征中与P个图像块对应的特征进行特征提取,得到当前视频帧的第四特征。In one possible implementation, the residual information includes the residual information used in the decoding process of N image blocks in the current video frame, and the model to be trained extracts the third feature based on the residual information to obtain the current The fourth feature of the video frame includes: using the model to be trained, P image blocks whose residual information is greater than the preset residual threshold are determined among the N image blocks, N≥2, N>P≥1; Feature extraction is performed on the features corresponding to the P image blocks in the third feature to obtain the fourth feature of the current video frame.
在一种可能实现的方式中,该方法还包括:通过待训练模型对第四特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the method further includes: fusing the fourth feature and the current video frame through the model to be trained to obtain the super-resolved current video frame.
在一种可能实现的方式中,第三特征、第四特征或超分后的当前视频帧作为当前视频帧的特征信息。In a possible implementation manner, the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,该方法还包括:通过待训练模型对第三特征、第四特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In a possible implementation manner, the method further includes: performing feature extraction on the third feature, the fourth feature or the current video frame after super-resolution through the model to be trained, to obtain the feature information of the current video frame.
903、基于超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异。903. Based on the current video frame after super-resolution and the current video frame after real super-resolution, obtain the target loss. The target loss is used to indicate the difference between the current video frame after super-resolution and the current video frame after real super-resolution.
得到超分后的当期视频帧后,可通过预置的损失函数对超分后的当前视频帧以及真实超分后的当前视频帧进行计算,从而得到目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异。After obtaining the current video frame after super-resolution, the current video frame after super-resolution and the current video frame after real super-resolution can be calculated through the preset loss function to obtain the target loss. The target loss is used to indicate the result after super-resolution. The difference between the current video frame and the current video frame after real super-resolution.
904、基于目标损失对待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。 904. Update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
得到目标损失后,可基于目标损失对待训练模型的参数进行更新,并利用下一批训练数据继续对更新参数后的待训练模型进行训练,直至满足模型训练条件(例如,目标损失达到收敛等等),得到图6所示实施例中的目标模型。After obtaining the target loss, the parameters of the model to be trained can be updated based on the target loss, and the next batch of training data can be used to continue training the model to be trained after the updated parameters until the model training conditions are met (for example, the target loss reaches convergence, etc. ), the target model in the embodiment shown in Figure 6 is obtained.
本申请实施例训练得到的目标模型,具备对视频帧进行超分的能力。具体地,获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。前述过程中,目标模型可基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息对当前视频帧进行超分,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间像素值的差异关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。The target model trained in the embodiment of this application has the ability to super-resolve video frames. Specifically, obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-score the current video frame based on the feature information and residual information of the reference video frame, and obtain the super-score The current video frame, the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the target model. In the aforementioned process, the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame. It can be seen that during the super-resolution process of the current video frame by the target model , not only the information of the reference video frame itself is considered, but also the difference in pixel values between the reference video frame and the current video frame is considered. The factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is High enough quality (with a relatively ideal resolution) so that the entire video stream after super-resolution has good image quality, thus improving the user experience.
以上是对本申请实施例提供的模型训练方法所进行的详细说明,以下将对本申请实施例提供的视频处理装置以及模型训练装置进行介绍。图10为本申请实施例提供的视频处理装置的一个结构示意图,如图10所示,该装置包括:The above is a detailed description of the model training method provided by the embodiment of the present application. The video processing device and the model training device provided by the embodiment of the present application will be introduced below. Figure 10 is a schematic structural diagram of a video processing device provided by an embodiment of the present application. As shown in Figure 10, the device includes:
获取模块1001,用于获取当前视频帧,以及当前视频帧的解码过程中所使用的运动矢量;The acquisition module 1001 is used to acquire the current video frame and the motion vector used in the decoding process of the current video frame;
变换模块1002,用于基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,得到变换后的特征信息,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到;The transformation module 1002 is used to transform the feature information of the reference video frame of the current video frame based on the motion vector to obtain the transformed feature information. The feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model;
超分模块1003,用于通过目标模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧。The super-resolution module 1003 is used to perform super-resolution on the current video frame based on the transformed feature information through the target model to obtain the super-resolved current video frame.
本申请实施例中,在获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。In the embodiment of the present application, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed features. Information, wherein the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
在一种可能实现的方式中,变换模块1002,用于通过扭曲算法对运动矢量以及参考视频帧的特征信息进行计算,得到变换后的特征信息。In one possible implementation manner, the transformation module 1002 is configured to calculate the feature information of the motion vector and the reference video frame through a warping algorithm to obtain transformed feature information.
在一种可能实现的方式中,超分模块1003,用于:通过目标模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过目标模型对变换后的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过目标模型对第二特征进行特征提取,得到当前视频帧的第三特征,第三特征作为超分后的当前视频帧。In a possible implementation manner, the super-resolution module 1003 is used to: perform feature extraction on the current video frame through the target model to obtain the first feature of the current video frame; and extract the transformed feature information and the first feature through the target model. Fusion is performed to obtain the second feature of the current video frame; feature extraction is performed on the second feature through the target model to obtain the third feature of the current video frame, and the third feature is used as the current video frame after super-resolution.
在一种可能实现的方式中,超分模块1003,还用于通过目标模型对第三特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the super-resolution module 1003 is also used to fuse the third feature and the current video frame through the target model to obtain the current video frame after super-resolution.
在一种可能实现的方式中,第三特征或超分后的当前视频帧作为当前视频帧的特征信息。In one possible implementation manner, the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,超分模块1003,还用于通过目标模型对第三特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In one possible implementation manner, the super-resolution module 1003 is also used to extract features of the third feature or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
在一种可能实现的方式中,获取模块1001,用于从压缩视频流中,获取当前视频帧中M个图像块的解码过程中所使用的运动矢量,N≥2,N>M≥1;基于M个图像块的解码过程中所使用的运动矢量,计算N-M个图像块的解码过程中所使用的运动矢量,或,将预设值确定为N-M个图像块的解码过程中所使用的运动矢量。In a possible implementation manner, the acquisition module 1001 is used to acquire the motion vectors used in the decoding process of M image blocks in the current video frame from the compressed video stream, N≥2, N>M≥1; Based on the motion vectors used in the decoding process of the M image blocks, calculate the motion vectors used in the decoding process of the N-M image blocks, or determine the preset value as the motion used in the decoding process of the N-M image blocks. Vector.
图11为本申请实施例提供的视频处理装置的另一结构示意图,如图11所示,该装置包括:Figure 11 is another structural schematic diagram of a video processing device provided by an embodiment of the present application. As shown in Figure 11, the device includes:
获取模块1101,用于获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息; The acquisition module 1101 is used to acquire the current video frame and the residual information used in the decoding process of the current video frame;
超分模块1102,用于通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。The super-resolution module 1102 is used to perform super-resolution on the current video frame based on the feature information and residual information of the reference video frame through the target model to obtain the current video frame after super-resolution. The feature information of the reference video frame is compared with the reference in the target model. Obtained from super-resolution processing of video frames.
本申请实施例中,获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。前述过程中,目标模型可基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息对当前视频帧进行超分,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间像素值的差异关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。In the embodiment of this application, the current video frame and the residual information used in the decoding process of the current video frame are obtained; the current video frame is super-resolved through the target model based on the feature information and residual information of the reference video frame, and we obtain The feature information of the current video frame after super-resolution and the reference video frame is obtained during the super-resolution processing of the reference video frame by the target model. In the aforementioned process, the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame. It can be seen that during the super-resolution process of the current video frame by the target model , not only the information of the reference video frame itself is considered, but also the difference in pixel values between the reference video frame and the current video frame is considered. The factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is High enough quality (with a relatively ideal resolution) so that the entire video stream after super-resolution has good image quality, thus improving the user experience.
在一种可能实现的方式中,超分模块1102,用于:通过目标模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过目标模型对参考视频帧的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过目标模型对第二特征进行特征提取,得到当前视频帧的第三特征;通过目标模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征,第四特征作为超分后的当前视频帧。In a possible implementation manner, the super-resolution module 1102 is used to: perform feature extraction on the current video frame through the target model to obtain the first feature of the current video frame; and extract the feature information of the reference video frame and the first feature through the target model. The features are fused to obtain the second feature of the current video frame; the second feature is extracted through the target model to obtain the third feature of the current video frame; the third feature is extracted based on the residual information through the target model to obtain the current The fourth feature of the video frame, the fourth feature is used as the current video frame after super-resolution.
在一种可能实现的方式中,残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息,超分模块1102,用于:通过目标模型在N个图像块中,确定残差信息大于预置的残差阈值的P个图像块,N≥2,N>P≥1;通过目标模型对第三特征中与P个图像块对应的特征进行特征提取,得到当前视频帧的第四特征。In one possible implementation manner, the residual information includes the residual information used in the decoding process of N image blocks in the current video frame, and the super-resolution module 1102 is used to: use the target model in the N image blocks, Determine P image blocks whose residual information is greater than the preset residual threshold, N≥2, N>P≥1; use the target model to extract features corresponding to the P image blocks in the third feature to obtain the current video The fourth characteristic of the frame.
在一种可能实现的方式中,超分模块1102,还用于通过目标模型对第四特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the super-resolution module 1102 is also used to fuse the fourth feature and the current video frame through the target model to obtain the current video frame after super-resolution.
在一种可能实现的方式中,第三特征、第四特征或超分后的当前视频帧作为当前视频帧的特征信息。In one possible implementation manner, the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,超分模块1102,还用于通过目标模型对第三特征、第四特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In a possible implementation manner, the super-resolution module 1102 is also used to perform feature extraction on the third feature, the fourth feature, or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
图12为本申请实施例提供的模型训练装置的一个结构示意图,如图12所示,该装置包括:Figure 12 is a schematic structural diagram of a model training device provided by an embodiment of the present application. As shown in Figure 12, the device includes:
第一获取模块1201,用于获取当前视频帧,以及当前视频帧的解码过程中所使用的运动矢量;The first acquisition module 1201 is used to acquire the current video frame and the motion vector used in the decoding process of the current video frame;
变换模块1202,用于基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换处理,得到变换后的特征信息,参考视频帧的特征信息在待训练模型对参考视频帧的超分过程中得到;The transformation module 1202 is used to transform the feature information of the reference video frame of the current video frame based on the motion vector to obtain the transformed feature information. The feature information of the reference video frame is used in the super-resolution process of the reference video frame by the model to be trained. get;
超分模块1203,用于通过待训练模型基于变换后的特征信息对当前视频帧进行超分,得到超分后的当前视频帧;The super-resolution module 1203 is used to perform super-resolution on the current video frame based on the transformed feature information through the model to be trained, and obtain the current video frame after super-resolution;
第二获取模块1204,用于基于超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;The second acquisition module 1204 is used to obtain the target loss based on the current video frame after super-resolution and the current video frame after real super-resolution. The target loss is used to indicate the current video frame after super-resolution and the current video after real super-resolution. Differences between frames;
更新模块1205,用于基于目标损失对待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。The update module 1205 is used to update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
本申请实施例训练得到的目标模型,具备对视频帧进行超分的能力。具体地,在获取当前视频帧以及当前视频帧的解码过程中所使用的运动矢量后,可基于运动矢量对当前视频帧的参考视频帧的特征信息进行变换,从而得到变换后的特征信息,其中,参考视频帧的特征信息在目标模型对参考视频帧的超分过程中得到。然后,可通过目标模型基于变换后的特征信息对当前视频帧进行超分,从而得到超分后的当前视频帧。前述过程中,目标模型可基于参考视频帧的变换后的特征信息对当前视频帧进行超分,由于参考视频帧的变换后的特征信息是基于当前视频帧的解码过程中所使用的运动矢量对参考视频帧的特征信息进行变换得到的,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间图像块的位置对应关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。The target model trained in the embodiment of this application has the ability to super-resolve video frames. Specifically, after obtaining the current video frame and the motion vector used in the decoding process of the current video frame, the feature information of the reference video frame of the current video frame can be transformed based on the motion vector, thereby obtaining the transformed feature information, where , the feature information of the reference video frame is obtained during the super-resolution process of the reference video frame by the target model. Then, the current video frame can be super-resolved based on the transformed feature information through the target model, thereby obtaining the super-resolved current video frame. In the foregoing process, the target model can perform super-resolution on the current video frame based on the transformed feature information of the reference video frame, because the transformed feature information of the reference video frame is based on the motion vector pair used in the decoding process of the current video frame. It is obtained by transforming the feature information of the reference video frame. It can be seen that in the super-resolution process of the current video frame by the target model, not only the information of the reference video frame itself is considered, but also the image blocks between the reference video frame and the current video frame are considered. position correspondence relationship, the factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is of high enough quality (with a relatively ideal resolution), so that the entire video stream after super-resolution has good image quality, thereby improving user experience.
在一种可能实现的方式中,变换模块1202,用于通过扭曲算法对运动矢量以及参考视频帧的特征信息进行计算,得到变换后的特征信息。In one possible implementation manner, the transformation module 1202 is configured to calculate the motion vector and the feature information of the reference video frame through a warping algorithm to obtain transformed feature information.
在一种可能实现的方式中,超分模块1203,用于:通过待训练模型对当前视频帧进行特征提取,得 到当前视频帧的第一特征;通过待训练模型对变换后的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过待训练模型对第二特征进行特征提取,得到当前视频帧的第三特征,第三特征作为超分后的当前视频帧。In one possible implementation, the super-resolution module 1203 is used to extract features of the current video frame through the model to be trained, and obtain to the first feature of the current video frame; fuse the transformed feature information and the first feature through the model to be trained to obtain the second feature of the current video frame; extract the second feature through the model to be trained to obtain the current video The third feature of the frame is used as the current video frame after super-resolution.
在一种可能实现的方式中,超分模块1203,还用于通过待训练模型对第三特征以及当前视频帧进行融合,得到超分后的当前视频帧。In one possible implementation manner, the super-resolution module 1203 is also used to fuse the third feature and the current video frame through the model to be trained to obtain the current video frame after super-resolution.
在一种可能实现的方式中,第三特征或超分后的当前视频帧作为当前视频帧的特征信息。In one possible implementation manner, the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,超分模块1203,还用于通过待训练模型对第三特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In one possible implementation manner, the super-resolution module 1203 is also used to extract features of the third feature or the current video frame after super-resolution through the model to be trained, to obtain feature information of the current video frame.
在一种可能实现的方式中,获取模块1201,用于从压缩视频流中,获取当前视频帧中M个图像块的解码过程中所使用的运动矢量,N≥2,N>M≥1;基于M个图像块的解码过程中所使用的运动矢量,计算N-M个图像块的解码过程中所使用的运动矢量,或,将预设值确定为N-M个图像块的解码过程中所使用的运动矢量。In a possible implementation manner, the acquisition module 1201 is used to acquire the motion vectors used in the decoding process of M image blocks in the current video frame from the compressed video stream, N≥2, N>M≥1; Calculate the motion vectors used in the decoding process of N-M image blocks based on the motion vectors used in the decoding process of the M image blocks, or determine the preset value as the motion used in the decoding process of the N-M image blocks Vector.
图13为本申请实施例提供的模型训练装置的另一结构示意图,如图13所示,该装置包括:Figure 13 is another structural schematic diagram of a model training device provided by an embodiment of the present application. As shown in Figure 13, the device includes:
第一获取模块1301,用于获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;The first acquisition module 1301 is used to acquire the current video frame and the residual information used in the decoding process of the current video frame;
超分模块1302,用于通过待训练模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在待训练模型对参考视频帧的超分处理中得到;The super-resolution module 1302 is used to perform super-resolution on the current video frame based on the feature information and residual information of the reference video frame through the model to be trained, and obtain the current video frame after super-resolution. The feature information of the reference video frame is used in the model to be trained. Obtained from super-resolution processing of reference video frames;
第二获取模块1303,用于基于超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,目标损失用于指示超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;The second acquisition module 1303 is used to obtain the target loss based on the current video frame after super-resolution and the current video frame after real super-resolution. The target loss is used to indicate the current video frame after super-resolution and the current video after real super-resolution. Differences between frames;
更新模块1304,用于基于目标损失对待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。The update module 1304 is used to update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
本申请实施例训练得到的目标模型,具备对视频帧进行超分的能力。具体地,获取当前视频帧,以及当前视频帧的解码过程中所使用的残差信息;通过目标模型基于参考视频帧的特征信息以及残差信息,对当前视频帧进行超分,得到超分后的当前视频帧,参考视频帧的特征信息在目标模型对参考视频帧的超分处理中得到。前述过程中,目标模型可基于参考视频帧的特征信息以及当前视频帧的解码过程中所使用的残差信息对当前视频帧进行超分,可见,在目标模型对当前视频帧的超分过程中,不仅考虑了参考视频帧本身的信息,还考虑了参考视频帧和当前视频帧之间像素值的差异关系,所考虑的因素较为全面,故目标模型最终输出的超分后的当前视频帧是足够优质的(具备较为理想的分辨率),以使得超分后的整个视频流具备良好的画质,进而提高用户体验。The target model trained in the embodiment of this application has the ability to super-resolve video frames. Specifically, obtain the current video frame and the residual information used in the decoding process of the current video frame; use the target model to super-score the current video frame based on the feature information and residual information of the reference video frame, and obtain the super-score The current video frame, the feature information of the reference video frame is obtained in the super-resolution processing of the reference video frame by the target model. In the aforementioned process, the target model can perform super-resolution of the current video frame based on the feature information of the reference video frame and the residual information used in the decoding process of the current video frame. It can be seen that during the super-resolution process of the current video frame by the target model , not only the information of the reference video frame itself is considered, but also the difference in pixel values between the reference video frame and the current video frame is considered. The factors considered are relatively comprehensive, so the current video frame after super-resolution finally output by the target model is High enough quality (with a relatively ideal resolution) so that the entire video stream after super-resolution has good image quality, thus improving the user experience.
在一种可能实现的方式中,超分模块1302,用于:通过目标模型对当前视频帧进行特征提取,得到当前视频帧的第一特征;通过目标模型对参考视频帧的特征信息以及第一特征进行融合,得到当前视频帧的第二特征;通过目标模型对第二特征进行特征提取,得到当前视频帧的第三特征;通过目标模型基于残差信息对第三特征进行特征提取,得到当前视频帧的第四特征,第四特征作为超分后的当前视频帧。In a possible implementation manner, the super-resolution module 1302 is used to: perform feature extraction on the current video frame through the target model to obtain the first feature of the current video frame; and perform feature information on the reference video frame and the first feature on the reference video frame through the target model. The features are fused to obtain the second feature of the current video frame; the second feature is extracted through the target model to obtain the third feature of the current video frame; the third feature is extracted based on the residual information through the target model to obtain the current The fourth feature of the video frame, the fourth feature is used as the current video frame after super-resolution.
在一种可能实现的方式中,残差信息包含当前视频帧中N个图像块的解码过程中所使用的残差信息,超分模块1302,用于:通过目标模型在N个图像块中,确定残差信息大于预置的残差阈值的P个图像块,N≥2,N>P≥1;通过目标模型对第三特征中与P个图像块对应的特征进行特征提取,得到当前视频帧的第四特征。In one possible implementation manner, the residual information includes the residual information used in the decoding process of N image blocks in the current video frame. The super-resolution module 1302 is used to: use the target model in the N image blocks, Determine P image blocks whose residual information is greater than the preset residual threshold, N≥2, N>P≥1; use the target model to extract features corresponding to the P image blocks in the third feature to obtain the current video The fourth characteristic of the frame.
在一种可能实现的方式中,超分模块1302,还用于通过目标模型对第四特征以及当前视频帧进行融合,得到超分后的当前视频帧。In a possible implementation manner, the super-resolution module 1302 is also used to fuse the fourth feature and the current video frame through the target model to obtain the current video frame after super-resolution.
在一种可能实现的方式中,第三特征、第四特征或超分后的当前视频帧作为当前视频帧的特征信息。In a possible implementation manner, the third feature, the fourth feature or the current video frame after super-resolution is used as the feature information of the current video frame.
在一种可能实现的方式中,超分模块1302,还用于通过目标模型对第三特征、第四特征或超分后的当前视频帧进行特征提取,得到当前视频帧的特征信息。In one possible implementation manner, the super-resolution module 1302 is also used to perform feature extraction on the third feature, the fourth feature, or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参考本申请实施例前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the modules/units of the above-mentioned device are based on the same concept as the method embodiments of the present application, and the technical effects they bring are the same as those of the method embodiments of the present application. The specific content can be Refer to the description in the method embodiments shown above in the embodiments of the present application, which will not be described again here.
本申请实施例还涉及一种执行设备,图14为本申请实施例提供的执行设备的一个结构示意图。如 图14所示,执行设备1400具体可以表现为手机、平板、笔记本电脑、智能穿戴设备、服务器等,此处不做限定。其中,执行设备1400上可部署有图10或图11对应实施例中所描述的视频处理装置,用于实现图4或图6对应实施例中视频处理的功能。具体的,执行设备1400包括:接收器1401、发射器1402、处理器1403和存储器1404(其中执行设备1400中的处理器1403的数量可以一个或多个,图14中以一个处理器为例),其中,处理器1403可以包括应用处理器14031和通信处理器14032。在本申请的一些实施例中,接收器1401、发射器1402、处理器1403和存储器1404可通过总线或其它方式连接。The embodiment of the present application also relates to an execution device. Figure 14 is a schematic structural diagram of the execution device provided by the embodiment of the present application. like As shown in Figure 14, the execution device 1400 can be embodied as a mobile phone, a tablet, a laptop, a smart wearable device, a server, etc., and is not limited here. The video processing device described in the corresponding embodiment of FIG. 10 or FIG. 11 may be deployed on the execution device 1400 to implement the video processing function in the corresponding embodiment of FIG. 4 or FIG. 6 . Specifically, the execution device 1400 includes: a receiver 1401, a transmitter 1402, a processor 1403 and a memory 1404 (the number of processors 1403 in the execution device 1400 can be one or more, one processor is taken as an example in Figure 14) , wherein the processor 1403 may include an application processor 14031 and a communication processor 14032. In some embodiments of the present application, the receiver 1401, the transmitter 1402, the processor 1403, and the memory 1404 may be connected by a bus or other means.
存储器1404可以包括只读存储器和随机存取存储器,并向处理器1403提供指令和数据。存储器1404的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器1404存储有处理器和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。Memory 1404 may include read-only memory and random access memory and provides instructions and data to processor 1403 . A portion of memory 1404 may also include non-volatile random access memory (NVRAM). The memory 1404 stores processor and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, where the operating instructions may include various operating instructions for implementing various operations.
处理器1403控制执行设备的操作。具体的应用中,执行设备的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。The processor 1403 controls the execution of operations of the device. In specific applications, various components of the execution device are coupled together through a bus system. In addition to the data bus, the bus system may also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are called bus systems in the figure.
上述本申请实施例揭示的方法可以应用于处理器1403中,或者由处理器1403实现。处理器1403可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1403中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1403可以是通用处理器、数字信号处理器(digital signal processing,DSP)、微处理器或微控制器,还可进一步包括专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。该处理器1403可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1404,处理器1403读取存储器1404中的信息,结合其硬件完成上述方法的步骤。The methods disclosed in the above embodiments of the present application can be applied to the processor 1403 or implemented by the processor 1403. The processor 1403 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 1403 . The above-mentioned processor 1403 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, and can further include an application specific integrated circuit (ASIC), a field programmable Gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The processor 1403 can implement or execute each method, step and logical block diagram disclosed in the embodiment of this application. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory 1404. The processor 1403 reads the information in the memory 1404 and completes the steps of the above method in combination with its hardware.
接收器1401可用于接收输入的数字或字符信息,以及产生与执行设备的相关设置以及功能控制有关的信号输入。发射器1402可用于通过第一接口输出数字或字符信息;发射器1402还可用于通过第一接口向磁盘组发送指令,以修改磁盘组中的数据;发射器1402还可以包括显示屏等显示设备。The receiver 1401 may be configured to receive input numeric or character information and generate signal inputs related to performing relevant settings and functional controls of the device. The transmitter 1402 can be used to output numeric or character information through the first interface; the transmitter 1402 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 1402 can also include a display device such as a display screen .
本申请实施例中,在一种情况下,处理器1403,用于通过图4对应实施例中的第一模型或图9对应实施例中的目标模型,对与用户相关联的信息进行项目推荐。In the embodiment of the present application, in one case, the processor 1403 is used to recommend items for information associated with the user through the first model in the corresponding embodiment of FIG. 4 or the target model in the corresponding embodiment of FIG. 9 .
本申请实施例还涉及一种训练设备,图15为本申请实施例提供的训练设备的一个结构示意图。如图15所示,训练设备1500由一个或多个服务器实现,训练设备1500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)1514(例如,一个或一个以上处理器)和存储器1532,一个或一个以上存储应用程序1542或数据1544的存储介质1530(例如一个或一个以上海量存储设备)。其中,存储器1532和存储介质1530可以是短暂存储或持久存储。存储在存储介质1530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对训练设备中的一系列指令操作。更进一步地,中央处理器1514可以设置为与存储介质1530通信,在训练设备1500上执行存储介质1530中的一系列指令操作。The embodiment of the present application also relates to a training device. Figure 15 is a schematic structural diagram of the training device provided by the embodiment of the present application. As shown in Figure 15, the training device 1500 is implemented by one or more servers. The training device 1500 can vary greatly due to different configurations or performance, and can include one or more central processing units (CPU) 1514 (eg, one or more processors) and memory 1532, one or more storage media 1530 (eg, one or more mass storage devices) storing applications 1542 or data 1544. Among them, the memory 1532 and the storage medium 1530 may be short-term storage or persistent storage. The program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the training device. Furthermore, the central processor 1514 may be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the training device 1500 .
训练设备1500还可以包括一个或一个以上电源1526,一个或一个以上有线或无线网络接口1550,一个或一个以上输入输出接口1558;或,一个或一个以上操作系统1541,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。The training device 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558; or, one or more operating systems 1541, such as Windows ServerTM, Mac OS XTM , UnixTM, LinuxTM, FreeBSDTM and so on.
具体的,训练设备可以执行图8或图9对应实施例中的模型训练方法。Specifically, the training device can execute the model training method in the embodiment corresponding to FIG. 8 or FIG. 9 .
本申请实施例还涉及一种计算机存储介质,该计算机可读存储介质中存储有用于进行信号处理的程序,当其在计算机上运行时,使得计算机执行如前述执行设备所执行的步骤,或者,使得计算机执行如前述训练设备所执行的步骤。 Embodiments of the present application also relate to a computer storage medium. The computer-readable storage medium stores a program for performing signal processing. When the program is run on a computer, it causes the computer to perform the steps performed by the aforementioned execution device, or, The computer is caused to perform the steps performed by the aforementioned training device.
本申请实施例还涉及一种计算机程序产品,该计算机程序产品存储有指令,该指令在由计算机执行时使得计算机执行如前述执行设备所执行的步骤,或者,使得计算机执行如前述训练设备所执行的步骤。Embodiments of the present application also relate to a computer program product that stores instructions that, when executed by a computer, cause the computer to perform the steps performed by the foregoing execution device, or cause the computer to perform the steps performed by the foregoing training device. A step of.
本申请实施例提供的执行设备、训练设备或终端设备具体可以为芯片,芯片包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使执行设备内的芯片执行上述实施例描述的数据处理方法,或者,以使训练设备内的芯片执行上述实施例描述的数据处理方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。The execution device, training device or terminal device provided by the embodiment of the present application may specifically be a chip. The chip includes: a processing unit and a communication unit. The processing unit may be, for example, a processor. The communication unit may be, for example, an input/output interface. Pins or circuits, etc. The processing unit can execute the computer execution instructions stored in the storage unit, so that the chip in the execution device executes the data processing method described in the above embodiment, or so that the chip in the training device executes the data processing method described in the above embodiment. Optionally, the storage unit is a storage unit within the chip, such as a register, cache, etc. The storage unit may also be a storage unit located outside the chip in the wireless access device, such as Read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM), etc.
具体的,请参阅图16,图16为本申请实施例提供的芯片的一个结构示意图,所述芯片可以表现为神经网络处理器NPU 1600,NPU 1600作为协处理器挂载到主CPU(Host CPU)上,由Host CPU分配任务。NPU的核心部分为运算电路1603,通过控制器1604控制运算电路1603提取存储器中的矩阵数据并进行乘法运算。Specifically, please refer to Figure 16. Figure 16 is a schematic structural diagram of a chip provided by an embodiment of the present application. The chip can be represented as a neural network processor NPU 1600. The NPU 1600 serves as a co-processor and is mounted to the host CPU (Host CPU). ), tasks are allocated by the Host CPU. The core part of the NPU is the arithmetic circuit 1603. The arithmetic circuit 1603 is controlled by the controller 1604 to extract the matrix data in the memory and perform multiplication operations.
在一些实现中,运算电路1603内部包括多个处理单元(Process Engine,PE)。在一些实现中,运算电路1603是二维脉动阵列。运算电路1603还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路1603是通用的矩阵处理器。In some implementations, the computing circuit 1603 includes multiple processing units (Process Engine, PE). In some implementations, arithmetic circuit 1603 is a two-dimensional systolic array. The arithmetic circuit 1603 may also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 1603 is a general-purpose matrix processor.
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器1602中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器1601中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)1608中。For example, assume there is an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit obtains the corresponding data of matrix B from the weight memory 1602 and caches it on each PE in the arithmetic circuit. The operation circuit takes matrix A data and matrix B from the input memory 1601 to perform matrix operations, and the partial result or final result of the matrix is stored in an accumulator (accumulator) 1608 .
统一存储器1606用于存放输入数据以及输出数据。权重数据直接通过存储单元访问控制器(Direct Memory Access Controller,DMAC)1605,DMAC被搬运到权重存储器1602中。输入数据也通过DMAC被搬运到统一存储器1606中。The unified memory 1606 is used to store input data and output data. The weight data directly passes through the storage unit access controller (Direct Memory Access Controller, DMAC) 1605, and the DMAC is transferred to the weight memory 1602. Input data is also transferred to unified memory 1606 via DMAC.
BIU为Bus Interface Unit即,总线接口单元1613,用于AXI总线与DMAC和取指存储器(Instruction Fetch Buffer,IFB)1609的交互。BIU is the Bus Interface Unit, that is, the bus interface unit 1613, which is used for the interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1609.
总线接口单元1613(Bus Interface Unit,简称BIU),用于取指存储器1609从外部存储器获取指令,还用于存储单元访问控制器1605从外部存储器获取输入矩阵A或者权重矩阵B的原数据。The bus interface unit 1613 (Bus Interface Unit, BIU for short) is used to fetch the memory 1609 to obtain instructions from the external memory, and is also used for the storage unit access controller 1605 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
DMAC主要用于将外部存储器DDR中的输入数据搬运到统一存储器1606或将权重数据搬运到权重存储器1602中或将输入数据数据搬运到输入存储器1601中。DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 1606 or the weight data to the weight memory 1602 or the input data to the input memory 1601 .
向量计算单元1607包括多个运算处理单元,在需要的情况下,对运算电路1603的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。主要用于神经网络中非卷积/全连接层网络计算,如Batch Normalization(批归一化),像素级求和,对预测标签平面进行上采样等。The vector calculation unit 1607 includes multiple arithmetic processing units, and if necessary, further processes the output of the arithmetic circuit 1603, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional/fully connected layer network calculations in neural networks, such as Batch Normalization, pixel-level summation, upsampling of predicted label planes, etc.
在一些实现中,向量计算单元1607能将经处理的输出的向量存储到统一存储器1606。例如,向量计算单元1607可以将线性函数;或,非线性函数应用到运算电路1603的输出,例如对卷积层提取的预测标签平面进行线性插值,再例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元1607生成归一化的值、像素级求和的值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路1603的激活输入,例如用于在神经网络中的后续层中的使用。In some implementations, vector calculation unit 1607 can store the processed output vectors to unified memory 1606 . For example, the vector calculation unit 1607 can apply a linear function; or a nonlinear function to the output of the operation circuit 1603, such as linear interpolation on the prediction label plane extracted by the convolution layer, or a vector of accumulated values, to generate an activation value. . In some implementations, vector calculation unit 1607 generates normalized values, pixel-wise summed values, or both. In some implementations, the processed output vector can be used as an activation input to the arithmetic circuit 1603, such as for use in a subsequent layer in a neural network.
控制器1604连接的取指存储器(instruction fetch buffer)1609,用于存储控制器1604使用的指令;The instruction fetch buffer 1609 connected to the controller 1604 is used to store instructions used by the controller 1604;
统一存储器1606,输入存储器1601,权重存储器1602以及取指存储器1609均为On-Chip存储器。外部存储器私有于该NPU硬件架构。The unified memory 1606, the input memory 1601, the weight memory 1602 and the fetch memory 1609 are all On-Chip memories. External memory is private to the NPU hardware architecture.
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述程序执行的集成电路。The processor mentioned in any of the above places can be a general central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above programs.
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实 现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。In addition, it should be noted that the device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physically separate. The physical unit can be located in one place, or it can be distributed across multiple network units. You can select some or all of the modules according to actual needs to implement The purpose of this embodiment is achieved. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between modules indicates that there are communication connections between them, which can be specifically implemented as one or more communication buses or signal lines.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memories, Special components, etc. to achieve. In general, all functions performed by computer programs can be easily implemented with corresponding hardware. Moreover, the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. circuit etc. However, for this application, software program implementation is a better implementation in most cases. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to the existing technology. The computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to cause a computer device (which can be a personal computer, training device, or network device, etc.) to execute the steps described in various embodiments of the present application. method.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。 The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, the computer instructions may be transferred from a website, computer, training device, or data The center transmits to another website site, computer, training equipment or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store, or a data storage device such as a training device or a data center integrated with one or more available media. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, solid state disk (Solid State Disk, SSD)), etc.

Claims (22)

  1. 一种视频处理方法,其特征在于,所述方法包括:A video processing method, characterized in that the method includes:
    获取当前视频帧,以及所述当前视频帧的解码过程中所使用的运动矢量;Obtain the current video frame and the motion vector used in the decoding process of the current video frame;
    基于所述运动矢量对所述当前视频帧的参考视频帧的特征信息进行变换,得到变换后的特征信息,所述参考视频帧的特征信息在目标模型对所述参考视频帧的超分过程中得到;Based on the motion vector, the feature information of the reference video frame of the current video frame is transformed to obtain the transformed feature information. The feature information of the reference video frame is used in the super-resolution process of the reference video frame by the target model. get;
    通过所述目标模型基于所述变换后的特征信息对所述当前视频帧进行超分,得到超分后的当前视频帧。The target model performs super-resolution on the current video frame based on the transformed feature information to obtain a super-resolved current video frame.
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述运动矢量对所述参考视频帧的特征信息进行变换,得到变换后的特征信息包括:The method according to claim 1, wherein said transforming the feature information of the reference video frame based on the motion vector to obtain the transformed feature information includes:
    通过扭曲算法对所述运动矢量以及所述参考视频帧的特征信息进行计算,得到变换后的特征信息。The motion vector and the feature information of the reference video frame are calculated through a warping algorithm to obtain transformed feature information.
  3. 根据权利要求1或2所述的方法,其特征在于,所述通过所述目标模型基于所述变换后的特征信息对所述当前视频帧进行超分,得到超分后的当前视频帧包括:The method according to claim 1 or 2, wherein the target model performs super-resolution on the current video frame based on the transformed feature information, and obtaining the super-resolved current video frame includes:
    通过所述目标模型对所述当前视频帧进行特征提取,得到所述当前视频帧的第一特征;Perform feature extraction on the current video frame through the target model to obtain the first feature of the current video frame;
    通过所述目标模型对所述变换后的特征信息以及所述第一特征进行融合,得到所述当前视频帧的第二特征;The transformed feature information and the first feature are fused by the target model to obtain the second feature of the current video frame;
    通过所述目标模型对所述第二特征进行特征提取,得到所述当前视频帧的第三特征,所述第三特征作为超分后的当前视频帧。Feature extraction is performed on the second feature through the target model to obtain a third feature of the current video frame, and the third feature is used as the current video frame after super-resolution.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, further comprising:
    通过所述目标模型对所述第三特征以及所述当前视频帧进行融合,得到超分后的当前视频帧。The third feature and the current video frame are fused through the target model to obtain a super-resolved current video frame.
  5. 根据权利要求4所述的方法,其特征在于,所述第三特征或所述超分后的当前视频帧作为所述当前视频帧的特征信息。The method according to claim 4, characterized in that the third feature or the current video frame after super-resolution is used as the feature information of the current video frame.
  6. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method of claim 4, further comprising:
    通过所述目标模型对所述第三特征或所述超分后的当前视频帧进行特征提取,得到所述当前视频帧的特征信息。Feature extraction is performed on the third feature or the current video frame after super-resolution through the target model to obtain feature information of the current video frame.
  7. 根据权利要求1至6任意一项所述的方法,其特征在于,所述当前视频帧包含N个图像块,所述获取当前视频帧的解码过程中所使用的运动矢量包括:The method according to any one of claims 1 to 6, characterized in that the current video frame contains N image blocks, and the obtaining the motion vector used in the decoding process of the current video frame includes:
    从压缩视频流中,获取所述当前视频帧中M个图像块的解码过程中所使用的运动矢量,N≥2,N>M≥1;From the compressed video stream, obtain the motion vectors used in the decoding process of M image blocks in the current video frame, N≥2, N>M≥1;
    基于所述M个图像块的解码过程中所使用的运动矢量,计算N-M个图像块的解码过程中所使用的运动矢量,或,将预设值确定为所述N-M个图像块的解码过程中所使用的运动矢量。Based on the motion vectors used in the decoding process of the M image blocks, calculate the motion vectors used in the decoding process of the N-M image blocks, or determine the preset value as the motion vector used in the decoding process of the N-M image blocks. The motion vector used.
  8. 一种视频处理方法,其特征在于,所述方法包括:A video processing method, characterized in that the method includes:
    获取当前视频帧,以及所述当前视频帧的解码过程中所使用的残差信息;Obtain the current video frame and the residual information used in the decoding process of the current video frame;
    通过目标模型基于所述参考视频帧的特征信息以及所述残差信息,对所述当前视频帧进行超分,得到超分后的当前视频帧,所述参考视频帧的特征信息在所述目标模型对所述参考视频帧的超分处理中得到。The target model performs super-resolution on the current video frame based on the characteristic information of the reference video frame and the residual information to obtain the super-resolved current video frame. The characteristic information of the reference video frame is in the target Obtained from the super-resolution processing of the reference video frame by the model.
  9. 根据权利要求8所述的方法,其特征在于,所述通过所述目标模型基于所述参考视频帧的特征信息以及所述残差信息,对所述当前视频帧进行超分,得到超分后的当前视频帧包括:The method according to claim 8, characterized in that the target model performs super-resolution on the current video frame based on the feature information of the reference video frame and the residual information, and obtains the super-resolution The current video frame includes:
    通过所述目标模型对所述当前视频帧进行特征提取,得到所述当前视频帧的第一特征;Perform feature extraction on the current video frame through the target model to obtain the first feature of the current video frame;
    通过所述目标模型对所述参考视频帧的特征信息以及所述第一特征进行融合,得到所述当前视频帧的第二特征;The feature information of the reference video frame and the first feature are fused by the target model to obtain the second feature of the current video frame;
    通过所述目标模型对所述第二特征进行特征提取,得到所述当前视频帧的第三特征;Perform feature extraction on the second feature through the target model to obtain the third feature of the current video frame;
    通过所述目标模型基于所述残差信息对所述第三特征进行特征提取,得到所述当前视频帧的第四特征,所述第四特征作为超分后的当前视频帧。The target model performs feature extraction on the third feature based on the residual information to obtain a fourth feature of the current video frame, and the fourth feature is used as the current video frame after super-resolution.
  10. 根据权利要求9所述的方法,其特征在于,所述残差信息包含所述当前视频帧中N个图像块的解码过程中所使用的残差信息,所述通过所述目标模型基于所述残差信息对所述第三特征进行特征提取, 得到所述当前视频帧的第四特征包括:The method of claim 9, wherein the residual information includes residual information used in the decoding process of N image blocks in the current video frame, and the target model is based on the The residual information performs feature extraction on the third feature, Obtaining the fourth feature of the current video frame includes:
    通过所述目标模型在所述N个图像块中,确定残差信息大于预置的残差阈值的P个图像块,N≥2,N>P≥1;Use the target model to determine P image blocks whose residual information is greater than the preset residual threshold among the N image blocks, N≥2, N>P≥1;
    通过所述目标模型对所述第三特征中与所述P个图像块对应的特征进行特征提取,得到所述当前视频帧的第四特征。Features of the third features corresponding to the P image blocks are extracted using the target model to obtain the fourth feature of the current video frame.
  11. 根据权利要求9或10所述的方法,其特征在于,所述方法还包括:The method according to claim 9 or 10, characterized in that, the method further includes:
    通过所述目标模型对所述第四特征以及所述当前视频帧进行融合,得到超分后的当前视频帧。The fourth feature and the current video frame are fused through the target model to obtain a super-resolved current video frame.
  12. 根据权利要求11所述的方法,其特征在于,所述第三特征、所述第四特征或所述超分后的当前视频帧作为所述当前视频帧的特征信息。The method according to claim 11, characterized in that the third feature, the fourth feature or the super-resolved current video frame is used as the feature information of the current video frame.
  13. 根据权利要求11所述的方法,其特征在于,所述方法还包括:The method according to claim 11, characterized in that, the method further includes:
    通过所述目标模型对所述第三特征、所述第四特征或所述超分后的当前视频帧进行特征提取,得到所述当前视频帧的特征信息。Feature extraction is performed on the third feature, the fourth feature or the super-resolved current video frame through the target model to obtain feature information of the current video frame.
  14. 一种模型训练方法,其特征在于,所述方法包括:A model training method, characterized in that the method includes:
    获取当前视频帧,以及所述当前视频帧的解码过程中所使用的运动矢量;Obtain the current video frame and the motion vector used in the decoding process of the current video frame;
    基于所述运动矢量对所述当前视频帧的参考视频帧的特征信息进行变换,得到变换后的特征信息,所述参考视频帧的特征信息在待训练模型对所述参考视频帧的超分过程中得到;Based on the motion vector, the feature information of the reference video frame of the current video frame is transformed to obtain the transformed feature information. The feature information of the reference video frame is used in the super-resolution process of the reference video frame by the model to be trained. get in;
    通过所述待训练模型基于所述变换后的特征信息对所述当前视频帧进行超分,得到超分后的当前视频帧;The current video frame is super-resolved by the to-be-trained model based on the transformed feature information to obtain the super-resolved current video frame;
    基于所述超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,所述目标损失用于指示所述超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;Based on the current video frame after the super-resolution and the current video frame after the real super-resolution, a target loss is obtained, and the target loss is used to indicate the current video frame after the super-resolution and the current video frame after the real super-resolution. differences between;
    基于所述目标损失对所述待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。The parameters of the model to be trained are updated based on the target loss until the model training conditions are met, and the target model is obtained.
  15. 一种模型训练方法,其特征在于,所述方法包括:A model training method, characterized in that the method includes:
    获取当前视频帧,以及所述当前视频帧的解码过程中所使用的残差信息;Obtain the current video frame and the residual information used in the decoding process of the current video frame;
    通过待训练模型基于所述参考视频帧的特征信息以及所述残差信息,对所述当前视频帧进行超分,得到超分后的当前视频帧,所述参考视频帧的特征信息在所述待训练模型对所述参考视频帧的超分处理中得到;The model to be trained performs super-resolution on the current video frame based on the feature information of the reference video frame and the residual information to obtain the super-resolved current video frame. The feature information of the reference video frame is in the Obtained from the super-resolution processing of the reference video frame by the model to be trained;
    基于所述超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,所述目标损失用于指示所述超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;Based on the current video frame after the super-resolution and the current video frame after the real super-resolution, a target loss is obtained, and the target loss is used to indicate the current video frame after the super-resolution and the current video frame after the real super-resolution. differences between;
    基于所述目标损失对所述待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。The parameters of the model to be trained are updated based on the target loss until the model training conditions are met, and the target model is obtained.
  16. 一种视频处理装置,其特征在于,所述装置包括:A video processing device, characterized in that the device includes:
    获取模块,用于获取当前视频帧,以及所述当前视频帧的解码过程中所使用的运动矢量;An acquisition module, used to acquire the current video frame and the motion vector used in the decoding process of the current video frame;
    变换模块,用于基于所述运动矢量对所述当前视频帧的参考视频帧的特征信息进行变换,得到变换后的特征信息,所述参考视频帧的特征信息在目标模型对所述参考视频帧的超分过程中得到;A transformation module, configured to transform the feature information of a reference video frame of the current video frame based on the motion vector to obtain transformed feature information. The feature information of the reference video frame is used in the target model to transform the reference video frame. Obtained during the super score process;
    超分模块,用于通过所述目标模型基于所述变换后的特征信息对所述当前视频帧进行超分,得到超分后的当前视频帧。A super-resolution module, configured to perform super-resolution on the current video frame based on the transformed feature information through the target model to obtain a super-resolved current video frame.
  17. 一种视频处理装置,其特征在于,所述装置包括:A video processing device, characterized in that the device includes:
    获取模块,用于获取当前视频帧,以及所述当前视频帧的解码过程中所使用的残差信息;An acquisition module, used to acquire the current video frame and the residual information used in the decoding process of the current video frame;
    超分模块,用于通过目标模型基于所述参考视频帧的特征信息以及所述残差信息,对所述当前视频帧进行超分,得到超分后的当前视频帧,所述参考视频帧的特征信息在所述目标模型对所述参考视频帧的超分处理中得到。A super-resolution module, configured to perform super-resolution on the current video frame based on the feature information of the reference video frame and the residual information through a target model to obtain the current video frame after super-resolution, and the reference video frame is Feature information is obtained in the super-resolution processing of the reference video frame by the target model.
  18. 一种模型训练装置,其特征在于,所述装置包括:A model training device, characterized in that the device includes:
    第一获取模块,用于获取当前视频帧,以及所述当前视频帧的解码过程中所使用的运动矢量;The first acquisition module is used to acquire the current video frame and the motion vector used in the decoding process of the current video frame;
    变换模块,用于基于所述运动矢量对所述当前视频帧的参考视频帧的特征信息进行变换处理,得到变换后的特征信息,所述参考视频帧的特征信息在待训练模型对所述参考视频帧的超分过程中得到;A transformation module, configured to transform the feature information of a reference video frame of the current video frame based on the motion vector to obtain transformed feature information. The feature information of the reference video frame is used in the model to be trained to Obtained during the super-resolution process of video frames;
    超分模块,用于通过所述待训练模型基于所述变换后的特征信息对所述当前视频帧进行超分,得到 超分后的当前视频帧;A super-resolution module, configured to perform super-resolution on the current video frame based on the transformed feature information through the model to be trained, to obtain The current video frame after super-resolution;
    第二获取模块,用于基于所述超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,所述目标损失用于指示所述超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;The second acquisition module is configured to obtain a target loss based on the current video frame after the super-resolution and the current video frame after the real super-resolution, where the target loss is used to indicate the current video frame after the super-resolution and the real super-resolution. The difference between the divided current video frames;
    更新模块,用于基于所述目标损失对所述待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。An update module, configured to update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
  19. 一种模型训练装置,其特征在于,所述装置包括:A model training device, characterized in that the device includes:
    第一获取模块,用于获取当前视频帧,以及所述当前视频帧的解码过程中所使用的残差信息;The first acquisition module is used to acquire the current video frame and the residual information used in the decoding process of the current video frame;
    超分模块,用于通过待训练模型基于所述参考视频帧的特征信息以及所述残差信息,对所述当前视频帧进行超分,得到超分后的当前视频帧,所述参考视频帧的特征信息在所述待训练模型对所述参考视频帧的超分处理中得到;A super-resolution module, configured to perform super-resolution on the current video frame based on the characteristic information of the reference video frame and the residual information through the model to be trained, and obtain the current video frame after super-resolution, the reference video frame The feature information of is obtained in the super-resolution processing of the reference video frame by the model to be trained;
    第二获取模块,用于基于所述超分后的当前视频帧以及真实超分后的当前视频帧,获取目标损失,所述目标损失用于指示所述超分后的当前视频帧以及真实超分后的当前视频帧之间的差异;The second acquisition module is used to obtain a target loss based on the current video frame after the super-resolution and the current video frame after the real super-resolution, where the target loss is used to indicate the current video frame after the super-resolution and the real super-resolution. The difference between the divided current video frames;
    更新模块,用于基于所述目标损失对所述待训练模型的参数进行更新,直至满足模型训练条件,得到目标模型。An update module, configured to update the parameters of the model to be trained based on the target loss until the model training conditions are met and the target model is obtained.
  20. 一种视频处理装置,其特征在于,所述装置包括存储器和处理器;所述存储器存储有代码,所述处理器被配置为执行所述代码,当所述代码被执行时,所述视频处理装置执行如权利要求1至15任意一项所述的方法。A video processing device, characterized in that the device includes a memory and a processor; the memory stores code, the processor is configured to execute the code, and when the code is executed, the video processing The device performs the method according to any one of claims 1 to 15.
  21. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有一个或多个指令,所述指令在由一个或多个计算机执行时使得所述一个或多个计算机实施权利要求1至15任一所述的方法。A computer storage medium, characterized in that the computer storage medium stores one or more instructions, which when executed by one or more computers cause the one or more computers to implement any of claims 1 to 15. The method described in 1.
  22. 一种计算机程序产品,其特征在于,所述计算机程序产品存储有指令,所述指令在由计算机执行时,使得所述计算机实施权利要求1至15任意一项所述的方法。 A computer program product, characterized in that the computer program product stores instructions, which when executed by a computer, cause the computer to implement the method described in any one of claims 1 to 15.
PCT/CN2023/113745 2022-08-30 2023-08-18 Video processing method and related device thereof WO2024046144A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211049719.5A CN115623242A (en) 2022-08-30 2022-08-30 Video processing method and related equipment thereof
CN202211049719.5 2022-08-30

Publications (1)

Publication Number Publication Date
WO2024046144A1 true WO2024046144A1 (en) 2024-03-07

Family

ID=84856895

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/113745 WO2024046144A1 (en) 2022-08-30 2023-08-18 Video processing method and related device thereof

Country Status (2)

Country Link
CN (1) CN115623242A (en)
WO (1) WO2024046144A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115623242A (en) * 2022-08-30 2023-01-17 华为技术有限公司 Video processing method and related equipment thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9794483B1 (en) * 2016-08-22 2017-10-17 Raytheon Company Video geolocation
CN112465698A (en) * 2019-09-06 2021-03-09 华为技术有限公司 Image processing method and device
CN114339260A (en) * 2020-09-30 2022-04-12 华为技术有限公司 Image processing method and device
CN115623242A (en) * 2022-08-30 2023-01-17 华为技术有限公司 Video processing method and related equipment thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9794483B1 (en) * 2016-08-22 2017-10-17 Raytheon Company Video geolocation
CN112465698A (en) * 2019-09-06 2021-03-09 华为技术有限公司 Image processing method and device
CN114339260A (en) * 2020-09-30 2022-04-12 华为技术有限公司 Image processing method and device
CN115623242A (en) * 2022-08-30 2023-01-17 华为技术有限公司 Video processing method and related equipment thereof

Also Published As

Publication number Publication date
CN115623242A (en) 2023-01-17

Similar Documents

Publication Publication Date Title
WO2022022274A1 (en) Model training method and apparatus
WO2022042713A1 (en) Deep learning training method and apparatus for use in computing device
WO2022116856A1 (en) Model structure, model training method, and image enhancement method and device
WO2022179581A1 (en) Image processing method and related device
WO2022111617A1 (en) Model training method and apparatus
WO2021129668A1 (en) Neural network training method and device
WO2022111387A1 (en) Data processing method and related apparatus
WO2022179586A1 (en) Model training method, and device associated therewith
WO2023231954A1 (en) Data denoising method and related device
US20240135174A1 (en) Data processing method, and neural network model training method and apparatus
WO2024046144A1 (en) Video processing method and related device thereof
WO2021169366A1 (en) Data enhancement method and apparatus
WO2024001806A1 (en) Data valuation method based on federated learning and related device therefor
CN111950700A (en) Neural network optimization method and related equipment
CN114266897A (en) Method and device for predicting pox types, electronic equipment and storage medium
WO2022179603A1 (en) Augmented reality method and related device thereof
WO2022156475A1 (en) Neural network model training method and apparatus, and data processing method and apparatus
WO2023246735A1 (en) Item recommendation method and related device therefor
WO2023197910A1 (en) User behavior prediction method and related device thereof
WO2023185541A1 (en) Model training method and related device
WO2024067113A1 (en) Action prediction method and related device thereof
CN113627421A (en) Image processing method, model training method and related equipment
WO2023197857A1 (en) Model partitioning method and related device thereof
WO2024017282A1 (en) Data processing method and device
WO2023020185A1 (en) Image classification method and related device

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

Country of ref document: EP

Kind code of ref document: A1