Video processing method and device, equipment and storage medium
By obtaining the video processing model corresponding to the video frame and processing it, the problem of insufficient accuracy of the basic mapping table in video image processing is solved, and a more efficient video processing effect is achieved.
Patent Information
- Application Number
- CN202410628010.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Video image processing based on basic mapping tables has the problem of insufficient accuracy.
By obtaining the video processing model corresponding to the video frame to be processed, and inputting the video frame into the model for processing, the brightness information of the video frame is used to determine the video processing model, thereby improving the accuracy and real-time performance of the processing.
It improves the accuracy and real-time performance of video processing, ensures accurate processing of video frames, and enhances the efficiency of video processing.
Smart Images

Figure CN118612474A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of video image processing technology in the field of image processing technology, and in particular to a method, apparatus, device and storage medium for video processing. Background Art
[0002] With the development of image processing technology, basic mapping tables are widely used in the process of video image processing.
[0003] However, in the process of performing video image processing based on the basic mapping table, the problem of inaccurate video processing may occur. Summary of the invention
[0004] The present disclosure provides a method, apparatus, device and storage medium for video processing.
[0005] According to a first aspect of the present disclosure, there is provided a video processing method, comprising:
[0006] When the Nth video frame of the video to be processed is obtained, a video processing model corresponding to the Nth video frame is obtained; wherein the video processing model corresponding to the Nth video frame is determined based on the Nth video frame; N is a positive integer greater than or equal to 1;
[0007] The Nth video frame is input into the video processing model corresponding to the Nth video frame for processing, and the processed Nth video frame is obtained and displayed.
[0008] According to a second aspect of the present disclosure, a video processing apparatus is provided, comprising:
[0009] An acquisition module, used for acquiring a video processing model corresponding to the Nth video frame when the Nth video frame of the video to be processed is acquired; wherein the video processing model corresponding to the Nth video frame is determined based on the Nth video frame; N is a positive integer greater than or equal to 1;
[0010] The processing module is used to input the Nth video frame into the video processing model corresponding to the Nth video frame for processing, and obtain and display the processed Nth video frame.
[0011] According to a third aspect of the present disclosure, a computer program product is provided, comprising: a computer program, wherein the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the method described in the first aspect.
[0012] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0013] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising: a computer program, wherein the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the method described in the first aspect.
[0014] The technology according to the present disclosure improves the accuracy of video processing.
[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0017] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0018] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;
[0019] Figure 3 is a flowchart of an example of processing the Nth video frame of a video to be processed provided by the present disclosure;
[0020] Figure 4 is a schematic diagram according to a third embodiment of the present disclosure;
[0021] Figure 5 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0022] Figure 6 is a block diagram of an apparatus for implementing video processing according to an embodiment of the present disclosure;
[0023] Figure 7 The present invention is a block diagram of an electronic device for implementing the video processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0025] The present disclosure provides a video processing method, device, equipment and storage medium, which are applied to the video image processing technology field in the image processing technology field to achieve the effect of improving the accuracy of video processing.
[0026] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the video processing method provided by the first embodiment of the present disclosure includes:
[0027] Step S101: when the Nth video frame of the video to be processed is obtained, a video processing model corresponding to the Nth video frame is obtained.
[0028] Specifically, when the Nth video frame of the video to be processed is obtained, the video processing model corresponding to the Nth video frame can be obtained. The video is composed of a series of continuous still image frames, each frame represents an image at a time point in the video, and the video frame is the basic unit in the video. The video playback effect can be achieved by playing the video frames quickly and continuously. Specifically, the video to be processed is composed of multiple video frames, and the Nth video frame is the current video frame to be processed among the multiple video frames included in the video to be processed. For example, when the first video frame of the video to be processed is obtained, the current video frame to be processed is the first video frame.
[0029] The video processing model corresponding to the Nth video frame is the model obtained for processing the Nth video frame. The present application does not limit the process of obtaining the video processing model corresponding to the Nth video frame. Optionally, the video processing model corresponding to the Nth video frame can be determined based on the brightness information of the Nth video frame and the N-1th video frame. The video processing model corresponding to the Nth video frame is determined based on the Nth video frame, so the Nth video frame can be accurately processed, further improving the accuracy of video processing.
[0030] Wherein, N is a positive integer greater than or equal to 1. Wherein, the minimum value of N is 1. If N is equal to 1, the Nth video frame is determined to be the first video frame of the video to be processed. Wherein, the maximum value of N corresponds to the total number of video frames of the video to be processed. For example, if the total number of video frames of the video to be processed is 100 frames, the maximum value of N is 100. At this time, if N is equal to 100, the Nth video frame is determined to be the last video frame of the video to be processed. For example, if N is equal to 1, when the Nth video frame of the video to be processed is obtained, the video processing model corresponding to the Nth video frame is obtained. When the first video frame of the video to be processed is obtained, the video processing model corresponding to the first video frame is obtained; if N is equal to 2, when the Nth video frame of the video to be processed is obtained, the video processing model corresponding to the Nth video frame is obtained. When the second video frame of the video to be processed is obtained, the video processing model corresponding to the second video frame is obtained.
[0031] Step S102: input the Nth video frame into a video processing model corresponding to the Nth video frame for processing, and obtain and display the processed Nth video frame.
[0032] Specifically, after obtaining the video processing model corresponding to the Nth video frame, the Nth video frame can be input into the video processing model corresponding to the Nth video frame for processing, and the processed Nth video frame can be obtained and displayed.
[0033] Among them, inputting the Nth video frame into the video processing model corresponding to the Nth video frame for processing can improve the accuracy of processing the Nth video frame, and further improve the accuracy of video processing. Among them, after obtaining the Nth video frame, determining the video processing model corresponding to the Nth video frame in real time and processing the Nth video frame can improve the real-time performance of video frame processing, and further improve the real-time performance of video processing.
[0034] In the disclosed embodiment, when the Nth video frame of the video to be processed is obtained, the video processing model corresponding to the Nth video frame is obtained, and the Nth video frame is input into the video processing model corresponding to the Nth video frame for processing, and the processed Nth video frame is obtained and displayed, wherein, by processing the Nth video frame of the video to be processed according to the video processing model corresponding to the Nth video frame, the accuracy of processing the Nth video frame can be improved, thereby further improving the accuracy of video processing.
[0035] In order to enable readers to more deeply understand the implementation principle of the present disclosure, the following Figure 2-Figure 6 right Figure 1 The illustrated embodiment is further refined.
[0036] In a possible embodiment, obtaining a video processing model corresponding to the Nth video frame may include:
[0037] If it is determined that the brightness information of the Nth video frame and the N-1th video frame are inconsistent, or if it is determined that the Nth video frame is the first video frame, then according to the Nth video frame, a video processing model corresponding to the Nth video frame is determined. Wherein, the description of the Nth video frame can refer to the description in step S101, and this embodiment will not be repeated. The N-1th video frame is the previous video frame of the Nth video frame, wherein, because the Nth video frame is the video frame to be processed, therefore, the N-1th video frame is the video frame that has just been processed.
[0038] Specifically, if it is determined that the brightness information of the Nth video frame and the N-1th video frame are inconsistent, or if it is determined that the Nth video frame is the first video frame, then the video processing model corresponding to the Nth video frame can be determined based on the Nth video frame. The present disclosure does not limit the process of determining the brightness information of the Nth video frame and the N-1th video frame. Optionally, the brightness information of the Nth video frame and the N-1th video frame can be determined based on the color space YUV, wherein the color space YUV is a color encoding system that can separate the color information of an image into two components, brightness information Y and chromaticity information U and V, wherein the brightness information Y represents brightness, that is, grayscale value, and the two components of chromaticity information U and V represent chromaticity, which is used to describe color and saturation. Among them, the present disclosure does not limit the process of determining the video processing model corresponding to the Nth video frame based on the Nth video frame. Optionally, the weight set corresponding to the Nth video frame can be first determined based on the Nth video frame, and then the video processing model corresponding to the Nth video frame can be determined based on the basic mapping table set and the weight set corresponding to the Nth video frame.
[0039] If it is determined that the brightness information of the Nth video frame is consistent with that of the N-1th video frame, then the video processing model corresponding to the N-1th video frame is determined to be the video processing model corresponding to the Nth video frame.
[0040] Specifically, if it is determined that the brightness information of the Nth video frame and the N-1th video frame are consistent, then the video processing model corresponding to the N-1th video frame can be determined to be the video processing model corresponding to the Nth video frame. Among them, the determination of the brightness information of the Nth video frame and the N-1th video frame can refer to the description above, and this step will not be repeated. Among them, the video processing model corresponding to the N-1th video frame is when the video to be processed is N-1, that is, when the N-1th video frame of the video to be processed is obtained, the video processing model corresponding to the N-1th video frame is obtained. Among them, the process of obtaining the video processing model corresponding to the N-1th video frame can refer to the process of obtaining the video processing model corresponding to the Nth video frame, which will not be repeated here. For example: if it is determined that the brightness information of the second video frame is consistent with that of the first video frame, then the video processing model corresponding to the second video frame is determined to be the video processing model corresponding to the first video frame, wherein the process of obtaining the video processing model corresponding to the first video frame can refer to the process described above of determining the video processing model corresponding to the Nth video frame based on the Nth video frame if the Nth video frame is determined to be the first video frame, which will not be repeated here. For example: if it is determined that the brightness information of the third video frame is consistent with that of the second video frame, then the video processing model corresponding to the third video frame is determined to be the video processing model corresponding to the second video frame, wherein the process of obtaining the video processing model corresponding to the second video frame can refer to the process described above of determining the video processing model corresponding to the Nth video frame if the brightness information of the Nth video frame is consistent with that of the N-1th video frame, that is, if it is determined that the brightness information of the second video frame is consistent with that of the first video frame, then the video processing model corresponding to the second video frame is determined to be the video processing model corresponding to the first video frame. Processing model, otherwise, the process of obtaining the video processing model corresponding to the second video frame can refer to the process described above where if it is determined that the brightness information of the Nth video frame and the N-1th video frame are inconsistent, or if it is determined that the Nth video frame is the first video frame, then the process of determining the video processing model corresponding to the Nth video frame is based on the Nth video frame, that is, if it is determined that the brightness information of the second video frame and the first video frame are inconsistent, then the weight set corresponding to the second video frame will be determined based on the second video frame, and the processing model determined based on the determined weight set corresponding to the second video frame is determined to be the video processing model corresponding to the second video frame.
[0041] Among them, in the embodiment of the present disclosure, the method of obtaining the video processing model corresponding to the Nth video frame is determined according to the brightness information of the Nth video frame obtained, that is, for adjacent video frames with the same brightness information, the obtained video processing models are the same, which can improve the efficiency of obtaining the video processing model corresponding to the Nth video frame on the basis of ensuring accuracy, and also avoid the problem of color jump between frames. Among them, according to the brightness information of the video frame, the acquisition process of the video processing model corresponding to the video frame is distinguished, which can improve the accuracy of the distinction and at the same time improve the efficiency of the distinction.
[0042] In a possible embodiment, determining, according to the Nth video frame, a video processing model corresponding to the Nth video frame may include:
[0043] First, according to the Nth video frame, determine the weight set corresponding to the Nth video frame; wherein the weight set corresponding to the Nth video frame includes weights corresponding to the basic mapping table, and the basic mapping table is used to indicate the mapping relationship between the pixel input value and the pixel output value of the pixel point in the image; the weight set corresponding to the Nth video frame is determined based on the Nth video frame. The weight corresponding to the basic mapping table characterizes the importance of each basic mapping table. The present disclosure does not limit the process of determining the weight set corresponding to the Nth video frame according to the Nth video frame. Optionally, a weight generation model corresponding to the Nth video frame can be generated according to the Nth video frame; and the Nth video frame is downsampled to obtain the Nth video frame after the downsampling process; then, the Nth video frame after the downsampling process is input into the weight generation model corresponding to the Nth video frame to obtain the weight set corresponding to the Nth video frame. Among them, the video processing model corresponding to the Nth video frame is determined based on the basic mapping table set and the weight set corresponding to the Nth video frame, wherein the weight set corresponding to the Nth video frame is determined based on the Nth video frame, therefore, the accuracy of the weight set corresponding to the Nth video frame is improved, thereby improving the accuracy of the acquired video processing model corresponding to the Nth video frame, and further improving the accuracy of video processing.
[0044] Then, according to the basic mapping table set and the weight set corresponding to the Nth video frame, the video processing model corresponding to the Nth video frame is determined; wherein the basic mapping table set includes multiple basic mapping tables. Wherein, the present disclosure does not limit the process of determining the video processing model corresponding to the Nth video frame according to the basic mapping table set and the weight set corresponding to the Nth video frame. Optionally, the basic mapping table set can be firstly weighted according to the weight set corresponding to the Nth video frame. Then, the multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after the weight combination processing are integrated to obtain the video processing model corresponding to the Nth video frame. Wherein, the mapping table, i.e., the lookup table (LUT for short), is used to map the input value to the output value. In video color processing, the LUT is usually an array, in which each element corresponds to a range of input pixel values, and stores the corresponding output pixel value, which is used for color correction, color enhancement and other video processing operations. The basic mapping table represents a mapping table with different color tendencies, for example: a mapping table with red tendencies, a mapping table with yellow tendencies and other mapping tables. The basic mapping table set includes multiple basic mapping tables, that is, multiple mapping tables representing different color tendencies, for example, the basic mapping table set includes a mapping table with red tendencies, a mapping table with yellow tendencies, and other mapping tables. Optionally, the number of basic mapping tables included in the basic mapping table set and the color tendencies of the mapping tables represented by each basic mapping table included in the basic mapping table set can be preset according to user needs, for example, preset according to the importance of each color tendency in the historical video processing process. Among them, the video processing model corresponding to the Nth video frame is determined based on the basic mapping table set and the weight set corresponding to the Nth video frame, which can improve the accuracy of the obtained video processing model corresponding to the Nth video frame, and further improve the accuracy of video processing.
[0045] Among them, the video processing model corresponding to the Nth video frame is determined based on a basic mapping table set and a weight set corresponding to the Nth video frame, the basic mapping table set includes multiple basic mapping tables, and the basic mapping tables are used to indicate the mapping relationship between the pixel input value and the pixel output value of the pixel point in the image. Specifically, the present disclosure does not limit the process of determining the video processing model corresponding to the Nth video frame based on the basic mapping table set and the weight set corresponding to the Nth video frame. Optionally, the basic mapping table set can be first weighted according to the weight set corresponding to the Nth video frame, and then the multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after the weighted combination processing are integrated to obtain the video processing model corresponding to the Nth video frame.
[0046] In a possible embodiment, determining the video processing model corresponding to the Nth video frame according to the weight set corresponding to the Nth video frame may include:
[0047] First, according to the weight set corresponding to the Nth video frame, the basic mapping table set is weighted combined to obtain the basic mapping table set after weighted combination. The basic mapping table set after weighted combination includes multiple basic mapping tables carrying corresponding weights. For the description of the weight set corresponding to the Nth video frame, reference can be made to the description in step S101, and this step will not be repeated. Specifically, before the basic mapping table set is weighted combined, the weights of the multiple basic mapping tables included in the basic mapping table set are all 1. Secondly, the multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after weighted combination are integrated to obtain the video processing model corresponding to the Nth video frame. The present disclosure does not limit the process of integrating the multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after weighted combination. Optionally, the multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after weighted combination can be integrated by a transformation matrix algorithm to obtain the video processing model corresponding to the Nth video frame.
[0048] In the disclosed embodiments, according to the weight set corresponding to the Nth video frame, the basic mapping table set is weighted combined and integrated to obtain the video processing model corresponding to the Nth video frame, wherein the weight set of the video processing model corresponding to the Nth video frame is obtained based on the weight set corresponding to the Nth video frame, which can improve the accuracy of the video processing model corresponding to the Nth video frame, wherein the process of obtaining the video processing model corresponding to the Nth video frame is weighted combined and integrated to the basic mapping table set, which is relatively simple and can improve the efficiency of obtaining the video processing model corresponding to the Nth video frame.
[0049] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure. Figure 2 As shown, the process of determining the weight set corresponding to the Nth video frame according to the Nth video frame provided by the second embodiment of the present disclosure includes:
[0050] Step S201: Generate a weight generation model corresponding to the Nth video frame according to the Nth video frame.
[0051] Specifically, a weight generation model corresponding to the Nth video frame can be generated according to the Nth video frame. For the description of the Nth video frame, reference can be made to the description in step S101, and this step will not be repeated. The weight generation model corresponding to the Nth video frame is a model for determining the weight set corresponding to the Nth video frame according to the Nth video frame.
[0052] The present disclosure does not limit the process of generating a weight generation model corresponding to the Nth video frame based on the Nth video frame. Optionally, the first initial model and the second initial model may be obtained first.
[0053] Wherein, the first initial model is an initial weight generation model pre-constructed based on a convolutional neural network. Wherein, the present disclosure does not limit the process of pre-constructing the first initial model. Optionally, the first initial model can be constructed based on a convolutional neural network CNN, wherein the stacking of lightweight convolutional neural networks CNN can reduce the complexity of the model. Wherein, the second initial model is an initial weight generation model pre-constructed again based on the first initial model, a basic mapping table set, and a weight model training set. Wherein, the weight model training set includes multiple image pairs. The image pair includes an original image and a target image. The original image is an unprocessed image, and the target image is a processed original image. Wherein, the image pair is a combination of images in the historical image processing process, and the original image corresponds to the target image, that is, the target image is obtained by processing the original image using an existing image processing method, wherein the target image meets the requirements for image processing proposed in the present disclosure. The present disclosure does not limit the process of pre-constructing the second initial model based on the first initial model, the basic mapping table set and the weight model training set. Optionally, the first initial model can be obtained, and the image pair to be trained can be obtained from the weight model training set; according to the obtained first initial model, the original image to be trained included in the image pair to be trained and the basic mapping table set, the initial image processing model corresponding to the original image to be trained is generated; according to the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained, the first initial model obtained is trained to obtain the second initial model. The stacking of lightweight convolutional neural networks (CNNs) can reduce the complexity of the model, thereby improving the accuracy of the second initial model pre-constructed based on the first initial model, the basic mapping table set and the weight model training set.
[0054] Based on the Nth video frame, the first initial model and the second initial model, the weight generation model corresponding to the Nth video frame is generated according to the knowledge distillation algorithm training. Among them, the knowledge distillation algorithm is a deep learning technology, and its main purpose is to transfer the knowledge of a complex model (called the teacher model) to a simpler model (called the student model). In this way, the student model can imitate the behavior of the teacher model and achieve similar performance, but with fewer parameters and computing requirements. Simply put, knowledge distillation is a model compression technology that allows large and complex models to be simplified into small and efficient models while maintaining the performance of the model as much as possible.
[0055] Among them, based on the above description of the first initial model, the stacking of lightweight convolutional neural networks CNN reduces the complexity of the model and improves the accuracy of the second initial model. However, since the convolutional neural network CNN itself has fewer model parameters, the second initial model pre-constructed based on the first initial model, the basic mapping table set and the weight model training set has poor learning ability, that is, poor generation efficiency. Therefore, the second initial model can be compressed according to the knowledge distillation algorithm to improve the processing efficiency of the weight generation model corresponding to the generated Nth video frame, further improve the efficiency of generating the video processing model corresponding to the Nth video frame, and ensure the real-time performance of video processing.
[0056] Step S202: downsample the Nth video frame to obtain the Nth video frame after downsampling.
[0057] Specifically, after generating a weight generation model corresponding to the Nth video frame according to the Nth video frame, the Nth video frame can be downsampled to obtain the Nth video frame after the downsampling process. The present disclosure does not limit the process of downsampling the Nth video frame to obtain the Nth video frame after the downsampling process. Any process that can downsample the Nth video frame to obtain the Nth video frame after the downsampling process can be used as the process of downsampling the Nth video frame to obtain the Nth video frame after the downsampling process provided by the present disclosure. Specifically, the Nth video frame after the downsampling process includes multiple sub-video frames, wherein the multiple sub-video frames constitute the Nth video frame.
[0058] Step S203: input the Nth video frame after the downsampling process into the weight generation model corresponding to the Nth video frame to obtain the weight set corresponding to the Nth video frame.
[0059] Specifically, after downsampling the Nth video frame to obtain the Nth video frame after downsampling, the Nth video frame after downsampling can be input into the weight generation model corresponding to the Nth video frame to obtain the weight set corresponding to the Nth video frame. The description of the Nth video frame after downsampling can refer to the description in step S202, and this step will not be repeated.
[0060] In the disclosed embodiment, the process of determining the weight set corresponding to the Nth video frame according to the Nth video frame includes: generating a weight generation model corresponding to the Nth video frame according to the Nth video frame, downsampling the Nth video frame to obtain the Nth video frame after the downsampling, and inputting the Nth video frame after the downsampling into the weight generation model corresponding to the Nth video frame to obtain the weight set corresponding to the Nth video frame, wherein downsampling the Nth video frame can improve the generation efficiency of the weight set corresponding to the Nth video frame, further improving the efficiency of video processing. wherein, based on the weight generation model corresponding to the Nth video frame generated according to the Nth video frame, generating the weight set corresponding to the Nth video frame can also improve the accuracy and efficiency of the weight set corresponding to the Nth video frame, further improving the accuracy and efficiency of video processing.
[0061] In a possible embodiment, when the Nth video frame of the video to be processed is obtained, the video processing model corresponding to the Nth video frame can be first obtained according to the Nth video frame. Specifically, the Nth video frame can be downsampled first to obtain the Nth video frame after the downsampling process, and then the Nth video frame after the downsampling process can be input into the weight generation model corresponding to the Nth video frame to obtain the weight set corresponding to the Nth video frame, and then the basic mapping table set can be weight-combined according to the weight set corresponding to the Nth video frame to obtain the basic mapping table set after the weight combination process, and finally, the multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after the weight combination process are integrated to obtain the video processing model corresponding to the Nth video frame. Specifically, after obtaining the weight set corresponding to the Nth video frame, the Nth video frame can be input into the video processing model corresponding to the Nth video frame for processing to obtain and display the processed Nth video frame. The specific process is as follows. Figure 3 As shown, Figure 3 4 is a flowchart of an example of processing the Nth video frame of a video to be processed provided by the present disclosure.
[0062] Figure 4 is a schematic diagram according to the third embodiment of the present disclosure. Figure 4 As shown, the process of obtaining the second initial model provided by the third embodiment of the present disclosure includes:
[0063] Step S401: Obtain a first initial model, and obtain image pairs to be trained from a weight model training set.
[0064] Specifically, a first initial model can be obtained, and an image pair to be trained can be obtained from a weight model training set. Wherein, for the description of the first initial model and the weight model training set, reference can be made to the description in step S201, and this step will not be repeated. Wherein, the image pair to be trained refers to an image pair extracted from the image pairs included in the weight model training set, and used to train the acquired first initial model. Wherein, the present disclosure does not limit the process of obtaining the image pair to be trained from the weight model training set, and optionally, it can be randomly extracted from the image pairs included in the weight model training set. Wherein, the image pair to be trained includes: an original image to be trained and a target image to be trained. Step S402, based on the acquired first initial model, the original image to be trained included in the image pair to be trained, and a set of basic mapping tables, an initial image processing model corresponding to the original image to be trained is generated.
[0065] Specifically, an initial image processing model corresponding to the original image to be trained can be generated according to the acquired first initial model, the original image to be trained included in the image pair to be trained, and the basic mapping table set.
[0066] Wherein, the initial image processing model corresponding to the original image to be trained is used to train the acquired first initial model. Wherein, the present disclosure does not limit the process of generating the initial image processing model corresponding to the original image to be trained according to the acquired first initial model, the original image to be trained included in the image pair to be trained, and the basic mapping table set. Optionally, the original image to be trained can be first input into the acquired first initial model to obtain the initial weight set corresponding to the original image to be trained. Wherein, the initial weight set corresponding to the original image to be trained is used to generate the initial image processing model corresponding to the original image to be trained. Wherein, the process of generating the initial image processing model corresponding to the original image to be trained according to the initial weight set corresponding to the original image to be trained can refer to the process of determining the video processing model corresponding to the Nth video frame according to the weight set corresponding to the Nth video frame described in the above embodiment, which will not be repeated here. Specifically, according to the initial weight set corresponding to the original image to be trained, the basic mapping table set can be weighted combined to obtain the basic mapping table set after weight combination processing corresponding to the original image to be trained. Then, a plurality of basic mapping tables carrying corresponding weights included in the basic mapping table set after weight combination processing corresponding to the original image to be trained are integrated to generate an initial image processing model corresponding to the original image to be trained.
[0067] Among them, the initial weight set of the initial image processing model corresponding to the original image to be trained is a weight set generated according to the original image to be trained, which can improve the accuracy of the initial image processing model corresponding to the original image to be trained. Among them, the process of obtaining the initial image processing model corresponding to the original image to be trained is to perform weight combination processing and integration processing on the basic mapping table set, which is relatively simple and can improve the efficiency of obtaining the initial image processing model corresponding to the original image to be trained.
[0068] Step S403: training the acquired first initial model according to the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained to obtain a second initial model.
[0069] Specifically, after generating the initial image processing model corresponding to the original image to be trained based on the acquired first initial model, the original image to be trained included in the image pair to be trained, and a set of basic mapping tables, the acquired first initial model can be trained based on the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained to obtain a second initial model.
[0070] The present disclosure does not limit the process of training the first initial model acquired according to the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained to obtain the second initial model. Optionally, the original image to be trained included in the image pair to be trained can be first input into the generated initial image processing model corresponding to the original image to be trained to obtain the initial processed image corresponding to the original image to be trained. Then, the first initial model acquired is trained according to the target image to be trained included in the image pair to be trained and the initial processed image corresponding to the original image to be trained to obtain the second initial model. The initial processed image corresponding to the original image to be trained is the image obtained after the original image to be trained is processed by the initial image processing model corresponding to the original image to be trained. The initial processed image corresponding to the original image to be trained is used to train the first initial model acquired. Based on the initial processed image corresponding to the original image to be trained and the target image corresponding to the original image to be trained, the first initial model acquired is trained to obtain the second initial model, which can improve the accuracy of the second initial model acquired.
[0071] Among them, the present disclosure does not limit the process of training the acquired first initial model according to the target image to be trained included in the image pair to be trained and the initial processed image corresponding to the original image to be trained to obtain the second initial model. Optionally, the acquired first initial model can be parameter-adjusted according to the target image to be trained included in the image pair to be trained and the initial processed image corresponding to the original image to be trained to obtain the first initial model after parameter adjustment; the original image to be trained is input into the obtained first initial model after parameter adjustment to obtain the initial weight set after parameter adjustment corresponding to the original image to be trained; according to the initial weight set after parameter adjustment corresponding to the original image to be trained, an initial image processing model after parameter update corresponding to the original image to be trained is generated; the original image to be trained included in the image pair to be trained is input into the generated initial image processing model after parameter update corresponding to the original image to be trained to obtain the initial processed image after parameter update corresponding to the original image to be trained. Then, according to the target image to be trained included in the image pair to be trained and the initial processed image after parameter update corresponding to the original image to be trained, the first initial model after parameter update is trained to obtain the second initial model.
[0072] Among them, the present disclosure does not limit the process of training the first initial model after the parameters are updated according to the target image to be trained included in the image pair to be trained and the initial processed image after the parameters are updated corresponding to the original image to be trained, to obtain the second initial model. Optionally, if it is determined that the training has been completed according to the target image to be trained included in the image pair to be trained and the initial processed image after the parameters are updated corresponding to the original image to be trained, the first initial model after the parameters are adjusted can be determined as the second initial model, otherwise the process described above of generating the first initial model after the parameters are updated, generating the initial image processing model after the parameters are updated, generating the initial processed image after the parameters are updated, and training the first initial model after the parameters are updated based on the initial processed image after the parameters are updated is repeated until it is determined that the training has been completed according to the target image to be trained included in the image pair to be trained and the initial processed image after the parameters are updated corresponding to the original image to be trained. Among them, based on the target image to be trained included in the image pair to be trained, and the initial processed image after the parameters corresponding to the original image to be trained are updated, the condition for determining that the training has been completed can be that the matching degree between the target image to be trained included in the image pair to be trained, and the initial processed image after the parameters corresponding to the original image to be trained are higher than a preset matching degree threshold.
[0073] In the disclosed embodiment, the process of obtaining the second initial model includes: obtaining the first initial model, and obtaining an image pair to be trained from a weight model training set, generating an initial image processing model corresponding to the original image to be trained according to the obtained first initial model, the original image to be trained included in the image pair to be trained, and a set of basic mapping tables, training the obtained first initial model according to the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained to obtain a second initial model, wherein, training the obtained first initial model according to the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained to obtain a second initial model can improve the accuracy of the obtained second initial model and further improve the accuracy of video processing.
[0074] Figure 5 is a schematic diagram according to the fourth embodiment of the present disclosure. Figure 5 As shown, the process provided by the fourth embodiment of the present disclosure of training and generating a weight generation model corresponding to the Nth video frame based on the Nth video frame, the first initial model and the second initial model according to the knowledge distillation algorithm includes:
[0075] Step S501: input the Nth video frame into the second initial model to obtain a second weight set corresponding to the Nth video frame.
[0076] Specifically, the Nth video frame can be input into the second initial model to obtain a second weight set corresponding to the Nth video frame. The second weight set is a set of weights determined based on the Nth video frame and the second initial model. For the description of the second initial model, reference can be made to the description in the above embodiment, which will not be repeated in this embodiment.
[0077] Step S502: downsample the Nth video frame to obtain the Nth video frame after the downsampling process, and input the Nth video frame after the downsampling process into the first initial model to obtain a first weight set corresponding to the Nth video frame.
[0078] Specifically, the Nth video frame can be downsampled to obtain the Nth video frame after the downsampling process, and the Nth video frame after the downsampling process is input into the first initial model to obtain the first weight set corresponding to the Nth video frame. The process of downsampling the Nth video frame can refer to the description in step S203, and this step will not be repeated. The first weight set is a set of weights determined based on the Nth video frame after the downsampling process and the first initial model. The description of the first initial model can refer to the description in the above embodiment, and this step will not be repeated.
[0079] The present disclosure does not limit the order of steps S501 and S502.
[0080] Step S503: Based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame, the first initial model input by the Nth video frame after downsampling is trained according to the knowledge distillation algorithm to generate a weight generation model corresponding to the Nth video frame.
[0081] Specifically, based on the first weight set corresponding to the Nth video frame obtained in step S502 and the second weight set corresponding to the Nth video frame obtained in step S501, the first initial model input to the Nth video frame after downsampling is trained according to the knowledge distillation algorithm to generate a weight generation model corresponding to the Nth video frame. Among them, the present disclosure does not limit the process of training the first initial model input to the Nth video frame after downsampling based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame according to the knowledge distillation algorithm to generate a weight generation model corresponding to the Nth video frame.
[0082] Optionally, the loss function value between the first initial model input to the Nth video frame after downsampling and the second initial model input to the Nth video frame can be determined based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame. The present disclosure does not limit the process of determining the loss function value between the first initial model input to the Nth video frame after downsampling and the second initial model input to the Nth video frame based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame. Any process that can determine the loss function value between the first initial model input to the Nth video frame after downsampling and the second initial model input to the Nth video frame based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame can be used as the process provided by the present disclosure of determining the loss function value between the first initial model input to the Nth video frame after downsampling and the second initial model input to the Nth video frame based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame.
[0083] Then, according to the preset loss function value threshold and the loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame, the parameters of the first initial model input by the Nth video frame after downsampling processing are adjusted to obtain an updated first initial model. Among them, the preset loss function value threshold can be preset according to user needs. Among them, the present disclosure does not limit the process of adjusting the parameters of the first initial model input by the Nth video frame after downsampling processing according to the preset loss function value threshold and the loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame to obtain the updated first initial model. Any process that can adjust the parameters of the first initial model input by the Nth video frame after downsampling processing according to the preset loss function value threshold and the loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame to obtain the updated first initial model can be used as the process provided by the present disclosure of adjusting the parameters of the first initial model input by the Nth video frame after downsampling processing according to the preset loss function value threshold and the loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame to obtain the updated first initial model.
[0084] Then, according to the preset loss function value threshold and the updated first initial model, a weight generation model corresponding to the Nth video frame is generated. Among them, the present disclosure does not limit the process of generating the weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model. Any process that can generate the weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model can be used as the process provided by the present disclosure for generating the weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model.
[0085] Among them, the present disclosure provides a process of training the first initial model input to the Nth video frame after downsampling processing based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame according to the knowledge distillation algorithm training to generate a weight generation model corresponding to the Nth video frame. The loss function value between the first initial model input to the Nth video frame after downsampling processing and the second initial model input to the Nth video frame is determined based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame. Then, according to a preset loss function value threshold and the determined loss function value between the first initial model input to the Nth video frame after downsampling processing and the second initial model input to the Nth video frame, the first initial model input to the Nth video frame after downsampling processing is adjusted to obtain an updated first initial model. Then, according to the preset loss function value threshold and the updated first initial model, a weight generation model corresponding to the Nth video frame is generated. Among them, according to the preset loss function value, the first initial model is trained to generate a weight generation model corresponding to the Nth video frame, which can improve the accuracy and efficiency of the weight generation model.
[0086] Among them, the present disclosure does not limit the process of generating a weight generation model corresponding to the Nth video frame according to a preset loss function value threshold and an updated first initial model. Optionally, the Nth video frame after downsampling processing can be first input into the updated first initial model to obtain an updated first weight set corresponding to the Nth video frame.
[0087] Based on the second weight set corresponding to the Nth video frame and the updated first weight set corresponding to the Nth video frame, the loss function value between the updated first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame is determined.
[0088] Among them, if the loss function value between the updated first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame meets the requirements of the preset loss function value threshold, the updated first initial model is determined as the weight generation model corresponding to the Nth video frame.
[0089] Otherwise, repeat the process of obtaining the updated first initial model and generating the weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model, until the loss function value between the updated first initial model input by the Nth video frame after downsampling and the second initial model input by the Nth video frame meets the requirement of the preset loss function value threshold.
[0090] Among them, in the process of generating the weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model, using the preset loss function threshold as the convergence condition of model training can improve the accuracy and accuracy of the weight generation model corresponding to the Nth video frame obtained by training.
[0091] In the disclosed embodiment, based on the Nth video frame, the first initial model and the second initial model, the process of generating a weight generation model corresponding to the Nth video frame according to the knowledge distillation algorithm training includes: inputting the Nth video frame into the second initial model to obtain a second weight set corresponding to the Nth video frame, downsampling the Nth video frame to obtain the Nth video frame after the downsampling process, and inputting the Nth video frame after the downsampling process into the first initial model to obtain a first weight set corresponding to the Nth video frame, based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame, training the first initial model input to the Nth video frame after the downsampling process according to the knowledge distillation algorithm training to generate a weight generation model corresponding to the Nth video frame. Among them, according to the knowledge distillation algorithm training, the first initial model input to the Nth video frame after the downsampling process is trained, and the weight generation model corresponding to the Nth video frame generated improves the weight generation efficiency and further improves the efficiency of video processing.
[0092] Figure 6 is a block diagram of a device for implementing video processing in an embodiment of the present disclosure, such as Figure 6 As shown, the video processing device 600 provided in the fifth embodiment of the present disclosure includes: an acquisition model 601 and a processing module 602.
[0093] Acquiring model 601, for acquiring a video processing model corresponding to the Nth video frame when the Nth video frame of the video to be processed is acquired; wherein the video processing model corresponding to the Nth video frame is determined based on the Nth video frame; N is a positive integer greater than or equal to 1;
[0094] The processing module 602 is used to input the Nth video frame into the video processing model corresponding to the Nth video frame for processing, and obtain and display the processed Nth video frame.
[0095] In an embodiment of the present disclosure, a video processing device includes an acquisition model for acquiring a video processing model corresponding to the Nth video frame when the Nth video frame of the video to be processed is acquired; wherein the video processing model corresponding to the Nth video frame is determined based on the Nth video frame; N is a positive integer greater than or equal to 1; and also includes a processing module for inputting the Nth video frame into the video processing model corresponding to the Nth video frame for processing, and obtaining and displaying the processed Nth video frame.
[0096] In some embodiments, the acquisition model 601 includes: a first acquisition unit 603 (not shown in the figure), which is used to determine the video processing model corresponding to the Nth video frame according to the Nth video frame if it is determined that the brightness information of the Nth video frame and the N-1th video frame are inconsistent, or if it is determined that the Nth video frame is the first video frame; a second acquisition unit 604 (not shown in the figure) is used to determine that the video processing model corresponding to the N-1th video frame is the video processing model corresponding to the Nth video frame if it is determined that the brightness information of the Nth video frame and the N-1th video frame are consistent, wherein the Nth video frame of the video to be processed is processed according to the video processing model corresponding to the Nth video frame, which can improve the accuracy of processing the Nth video frame, and further improve the accuracy of video processing, wherein the video processing model corresponding to the Nth video frame is determined based on the basic mapping table set and the weight set corresponding to the Nth video frame, which can improve the accuracy of the acquired video processing model corresponding to the Nth video frame, and further improve the accuracy of video processing.
[0097] In some embodiments, the first acquisition unit 603 (not shown in the figure) is specifically used to determine the weight set corresponding to the Nth video frame based on the Nth video frame; wherein the weight set corresponding to the Nth video frame includes weights corresponding to a basic mapping table, and the basic mapping table is used to indicate the mapping relationship between the pixel input value and the pixel output value of a pixel point in an image; based on the basic mapping table set and the weight set corresponding to the Nth video frame, determine the video processing model corresponding to the Nth video frame; wherein the basic mapping table set includes multiple basic mapping tables.
[0098] In some embodiments, the first acquisition unit 603 (not shown in the figure) includes: a first generation subunit 6011 (not shown in the figure), which is used to generate a weight generation model corresponding to the Nth video frame based on the Nth video frame; a first processing subunit 6012 (not shown in the figure), which is used to downsample the Nth video frame to obtain the Nth video frame after the downsampling; and a second generation subunit 6013 (not shown in the figure), which is used to input the Nth video frame after the downsampling into the weight generation model corresponding to the Nth video frame to obtain the weight set corresponding to the Nth video frame.
[0099] In some embodiments, the first generation subunit 6011 (not shown in the figure) is specifically used to obtain a first initial model and a second initial model; wherein the first initial model is an initial weight generation model pre-constructed based on a convolutional neural network; the second initial model is an initial weight generation model pre-constructed again based on the first initial model, a basic mapping table set and a weight model training set; wherein the weight model training set includes multiple image pairs; the image pairs include original images and target images; the original image is an unprocessed image, and the target image is the processed original image; based on the Nth video frame, the first initial model and the second initial model, the weight generation model corresponding to the Nth video frame is generated according to the knowledge distillation algorithm training.
[0100] In some embodiments, the first generating subunit 6011 (not shown in the figure) is further specifically used to obtain a first initial model and obtain an image pair to be trained from a weight model training set; wherein the image pair to be trained includes: an original image to be trained and a target image to be trained; based on the acquired first initial model, the original image to be trained included in the image pair to be trained, and a set of basic mapping tables, an initial image processing model corresponding to the original image to be trained is generated; based on the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained, the acquired first initial model is trained to obtain a second initial model.
[0101] In some embodiments, the first generating subunit 6011 (not shown in the figure) is further specifically used to input the original image to be trained into the acquired first initial model to obtain an initial weight set corresponding to the original image to be trained; according to the initial weight set corresponding to the original image to be trained, the basic mapping table set is weighted combined to obtain the basic mapping table set after weight combination processing corresponding to the original image to be trained; multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after weight combination processing corresponding to the original image to be trained are integrated to generate an initial image processing model corresponding to the original image to be trained.
[0102] In some embodiments, the first generating subunit 6011 (not shown in the figure) is further specifically used to input the original image to be trained included in the image pair to be trained into the initial image processing model corresponding to the generated original image to be trained, so as to obtain the initial processed image corresponding to the original image to be trained; according to the target image to be trained included in the image pair to be trained, and the initial processed image corresponding to the original image to be trained, the acquired first initial model is trained to obtain the second initial model.
[0103] In some embodiments, the first generation subunit 6011 (not shown in the figure) is further specifically used to input the Nth video frame into the second initial model to obtain a second weight set corresponding to the Nth video frame; downsample the Nth video frame to obtain the Nth video frame after the downsampling; and input the Nth video frame after the downsampling into the first initial model to obtain a first weight set corresponding to the Nth video frame; based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame, according to the knowledge distillation algorithm training, the first initial model input into the Nth video frame after the downsampling is trained to generate a weight generation model corresponding to the Nth video frame.
[0104] In some embodiments, the first generation subunit 6011 (not shown in the figure) is further specifically used to determine the loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame; according to a preset loss function value threshold and the determined loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame, adjust the parameters of the first initial model input by the Nth video frame after downsampling processing to obtain an updated first initial model; generate a weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model.
[0105] In some embodiments, the first generating subunit 6011 (not shown in the figure) is further specifically used to input the Nth video frame after downsampling processing into the updated first initial model to obtain the updated first weight set corresponding to the Nth video frame; based on the second weight set corresponding to the Nth video frame and the updated first weight set corresponding to the Nth video frame, determine the loss function value between the updated first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame; if the updated first initial model input by the Nth video frame after downsampling processing, If the loss function value between the updated first initial model input by the Nth video frame and the second initial model input by the Nth video frame meets the requirement of the preset loss function value threshold, the updated first initial model is determined as the weight generation model corresponding to the Nth video frame; otherwise, the process of obtaining the updated first initial model and generating the weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model is repeated until the loss function value between the updated first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame meets the requirement of the preset loss function value threshold.
[0106] In some embodiments, the first acquisition unit 603 (not shown in the figure) also includes: a second processing sub-unit 6014 (not shown in the figure), which is used to perform weight combination processing on the basic mapping table set according to the weight set corresponding to the Nth video frame to obtain the basic mapping table set after weight combination processing; wherein the basic mapping table set after weight combination processing includes multiple basic mapping tables carrying corresponding weights; the multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after weight combination processing are integrated to obtain a video processing model corresponding to the Nth video frame.
[0107] Figure 6 The provided video processing device can execute the steps involved in the terminal in the above-mentioned corresponding method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0108] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the solution provided by any of the above embodiments.
[0109] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute a solution provided by any of the above embodiments.
[0110] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0111] Figure 6 is a block diagram of an electronic device for implementing the video processing method of an embodiment of the present disclosure, Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0112] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0113] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0114] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a method for video processing. For example, in some embodiments, the method for video processing may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the method for video processing described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform a method for video processing by any other appropriate means (e.g., by means of firmware).
[0115] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0116] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0117] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0118] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0119] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0120] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0121] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0122] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A video processing method, comprising: When the Nth video frame of the video to be processed is obtained, a video processing model corresponding to the Nth video frame is obtained; wherein the video processing model corresponding to the Nth video frame is determined based on the Nth video frame; N is a positive integer greater than or equal to 1; The Nth video frame is input into the video processing model corresponding to the Nth video frame for processing, and the processed Nth video frame is obtained and displayed.
2. The method according to claim 1, wherein: The obtaining of the video processing model corresponding to the Nth video frame includes: If it is determined that the brightness information of the Nth video frame and the N-1th video frame are inconsistent, or if it is determined that the Nth video frame is the first video frame, then determining a video processing model corresponding to the Nth video frame according to the Nth video frame; If it is determined that the brightness information of the Nth video frame is consistent with that of the N-1th video frame, then the video processing model corresponding to the N-1th video frame is determined to be the video processing model corresponding to the Nth video frame.
3. The method according to claim 2, wherein: The step of determining the video processing model corresponding to the Nth video frame according to the Nth video frame includes: Determine, according to the Nth video frame, a weight set corresponding to the Nth video frame; wherein the weight set corresponding to the Nth video frame includes weights corresponding to a basic mapping table, wherein the basic mapping table is used to indicate a mapping relationship between a pixel input value and a pixel output value of a pixel point in an image; A video processing model corresponding to the Nth video frame is determined according to a basic mapping table set and a weight set corresponding to the Nth video frame; wherein the basic mapping table set includes a plurality of the basic mapping tables.
4. The method according to claim 3, wherein: The step of determining a weight set corresponding to the Nth video frame according to the Nth video frame includes: According to the Nth video frame, a weight generation model corresponding to the Nth video frame is generated; Downsampling the Nth video frame to obtain the Nth video frame after downsampling; The Nth video frame after downsampling is input into the weight generation model corresponding to the Nth video frame to obtain a weight set corresponding to the Nth video frame.
5. The method according to claim 4, wherein: The step of generating a weight generation model corresponding to the Nth video frame according to the Nth video frame includes: Obtain a first initial model and a second initial model; wherein the first initial model is an initial weight generation model pre-constructed based on a convolutional neural network; the second initial model is an initial weight generation model pre-constructed again based on the first initial model, a basic mapping table set, and a weight model training set; wherein the weight model training set includes a plurality of image pairs; the image pairs include an original image and a target image; the original image is an unprocessed image, and the target image is a processed original image; Based on the Nth video frame, the first initial model and the second initial model, a weight generation model corresponding to the Nth video frame is generated by training according to the knowledge distillation algorithm.
6. The method according to claim 5, wherein: Acquiring the second initial model includes: Acquire a first initial model, and acquire an image pair to be trained from the weight model training set; wherein the image pair to be trained includes: an original image to be trained and a target image to be trained; Generate an initial image processing model corresponding to the original image to be trained according to the acquired first initial model, the original image to be trained included in the image pair to be trained, and a set of basic mapping tables; The acquired first initial model is trained according to the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained to obtain a second initial model.
7. The method according to claim 6, wherein: The step of generating an initial image processing model corresponding to the original image to be trained according to the acquired first initial model, the original image to be trained included in the image pair to be trained, and a set of basic mapping tables comprises: Inputting the original image to be trained into the acquired first initial model to obtain an initial weight set corresponding to the original image to be trained; According to the initial weight set corresponding to the original image to be trained, the basic mapping table set is subjected to weight combination processing to obtain the basic mapping table set after weight combination processing corresponding to the original image to be trained; A plurality of basic mapping tables carrying corresponding weights included in the basic mapping table set after weight combination processing corresponding to the original image to be trained are integrated to generate an initial image processing model corresponding to the original image to be trained.
8. The method according to any one of claims 6 to 7, wherein: The step of training the first initial model obtained according to the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained to obtain the second initial model includes: Inputting the original image to be trained included in the image pair to be trained into the generated initial image processing model corresponding to the original image to be trained to obtain an initial processed image corresponding to the original image to be trained; The acquired first initial model is trained according to the target image to be trained included in the image pair to be trained and the initial processed image corresponding to the original image to be trained to obtain the second initial model.
9. The method according to any one of claims 5 to 8, wherein: The method of generating a weight generation model corresponding to the Nth video frame based on the Nth video frame, the first initial model and the second initial model according to the knowledge distillation algorithm training includes: Inputting the Nth video frame into the second initial model to obtain a second weight set corresponding to the Nth video frame; Downsampling the Nth video frame to obtain the Nth video frame after the downsampling process; and inputting the Nth video frame after the downsampling process into the first initial model to obtain a first weight set corresponding to the Nth video frame; Based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame, according to the knowledge distillation algorithm training, the first initial model input by the Nth video frame after downsampling is trained to generate a weight generation model corresponding to the Nth video frame.
10. The method according to claim 9, wherein: The method includes training the first initial model inputted by the Nth video frame after downsampling processing based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame according to the knowledge distillation algorithm, and generating a weight generation model corresponding to the Nth video frame, including: Determine, based on a first weight set corresponding to the Nth video frame and a second weight set corresponding to the Nth video frame, a loss function value between a first initial model input to the Nth video frame after downsampling processing and a second initial model input to the Nth video frame; According to a preset loss function value threshold and a determined loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame, a parameter adjustment is performed on the first initial model input by the Nth video frame after downsampling processing to obtain an updated first initial model; According to the preset loss function value threshold and the updated first initial model, a weight generation model corresponding to the Nth video frame is generated.
11. The method according to claim 10, wherein: The step of generating a weight generation model corresponding to the Nth video frame according to a preset loss function value threshold and the updated first initial model includes: Inputting the Nth video frame after downsampling processing into the updated first initial model to obtain an updated first weight set corresponding to the Nth video frame; Determine a loss function value between an updated first initial model input by the Nth video frame after downsampling and a second initial model input by the Nth video frame based on a second weight set corresponding to the Nth video frame and an updated first weight set corresponding to the Nth video frame; If the loss function value between the updated first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame meets the requirement of the preset loss function value threshold, the updated first initial model is determined as the weight generation model corresponding to the Nth video frame; Otherwise, repeat the process of obtaining the updated first initial model and generating the weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model, until the loss function value between the updated first initial model input by the Nth video frame after downsampling and the second initial model input by the Nth video frame meets the requirement of the preset loss function value threshold.
12. The method according to any one of claims 3 to 11, wherein: The step of determining the video processing model corresponding to the Nth video frame according to the basic mapping table set and the weight set corresponding to the Nth video frame includes: According to the weight set corresponding to the Nth video frame, the basic mapping table set is subjected to weight combination processing to obtain a basic mapping table set after weight combination processing; wherein the basic mapping table set after weight combination processing includes a plurality of basic mapping tables carrying corresponding weights; The multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after weight combination processing are integrated to obtain a video processing model corresponding to the Nth video frame.
13. A video processing device, comprising: An acquisition module, used for acquiring a video processing model corresponding to the Nth video frame when the Nth video frame of the video to be processed is acquired; wherein the video processing model corresponding to the Nth video frame is determined based on the Nth video frame; The processing module is used to input the Nth video frame into the video processing model corresponding to the Nth video frame for processing, and obtain and display the processed Nth video frame.
14. The device according to claim 13, wherein: The acquisition module comprises: A first acquisition unit is used to determine a video processing model corresponding to the Nth video frame according to the Nth video frame if it is determined that the brightness information of the Nth video frame and the N-1th video frame are inconsistent, or if it is determined that the Nth video frame is the first video frame; If the second acquisition unit determines that the brightness information of the Nth video frame is consistent with that of the N-1th video frame, the video processing model corresponding to the N-1th video frame is determined to be the video processing model corresponding to the Nth video frame.
15. The device according to claim 14, wherein: The first acquisition unit is specifically used to determine the weight set corresponding to the Nth video frame based on the Nth video frame; wherein the weight set corresponding to the Nth video frame includes weights corresponding to a basic mapping table, and the basic mapping table is used to indicate the mapping relationship between the pixel input value and the pixel output value of the pixel point in the image; based on the basic mapping table set and the weight set corresponding to the Nth video frame, determine the video processing model corresponding to the Nth video frame; wherein the basic mapping table set includes a plurality of the basic mapping tables.
16. The device according to claim 15, wherein: The first acquisition unit includes: A first generating subunit, configured to generate a weight generating model corresponding to the Nth video frame according to the Nth video frame; A first processing subunit is used to perform downsampling processing on the Nth video frame to obtain the Nth video frame after downsampling processing; The second generating subunit is used to input the Nth video frame after downsampling processing into the weight generating model corresponding to the Nth video frame to obtain the weight set corresponding to the Nth video frame.
17. The device according to claim 16, wherein: The first generating subunit is specifically used to obtain a first initial model and a second initial model; wherein the first initial model is an initial weight generation model pre-constructed based on a convolutional neural network; the second initial model is an initial weight generation model pre-constructed again based on the first initial model, a basic mapping table set and a weight model training set; wherein the weight model training set includes multiple image pairs; the image pairs include original images and target images; the original image is an unprocessed image, and the target image is a processed original image; based on the Nth video frame, the first initial model and the second initial model, a weight generation model corresponding to the Nth video frame is generated according to the knowledge distillation algorithm training.
18. The device according to claim 17, wherein: The first generating subunit is further specifically used to obtain a first initial model and obtain an image pair to be trained from the weight model training set; wherein the image pair to be trained includes: an original image to be trained and a target image to be trained; based on the obtained first initial model, the original image to be trained included in the image pair to be trained and a set of basic mapping tables, an initial image processing model corresponding to the original image to be trained is generated; based on the generated initial image processing model corresponding to the original image to be trained and the image pair to be trained, the obtained first initial model is trained to obtain a second initial model.
19. The device according to claim 18, wherein: The first generating sub-unit is further specifically used to input the original image to be trained into the acquired first initial model to obtain an initial weight set corresponding to the original image to be trained; perform weight combination processing on the basic mapping table set according to the initial weight set corresponding to the original image to be trained to obtain the basic mapping table set after weight combination processing corresponding to the original image to be trained; integrate and process multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after weight combination processing corresponding to the original image to be trained to generate an initial image processing model corresponding to the original image to be trained.
20. The device according to any one of claims 18-19, wherein The first generating subunit is further specifically used to input the original image to be trained included in the image pair to be trained into the generated initial image processing model corresponding to the original image to be trained, so as to obtain an initial processed image corresponding to the original image to be trained; The acquired first initial model is trained according to the target image to be trained included in the image pair to be trained and the initial processed image corresponding to the original image to be trained to obtain the second initial model.
21. The device according to any one of claims 17 to 20, wherein: The first generating sub-unit is further specifically used to input the Nth video frame into the second initial model to obtain a second weight set corresponding to the Nth video frame; downsample the Nth video frame to obtain the Nth video frame after downsampling; and input the Nth video frame after downsampling into the first initial model to obtain a first weight set corresponding to the Nth video frame; based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame, according to the knowledge distillation algorithm training, the first initial model input into the Nth video frame after downsampling is trained to generate a weight generation model corresponding to the Nth video frame.
22. The device according to claim 21, wherein The first generating sub-unit is further specifically used to determine the loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame based on the first weight set corresponding to the Nth video frame and the second weight set corresponding to the Nth video frame; according to a preset loss function value threshold and the determined loss function value between the first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame, adjust the parameters of the first initial model input by the Nth video frame after downsampling processing to obtain an updated first initial model; generate a weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model.
23. The device according to claim 22, wherein: The first generating sub-unit is further specifically used to input the Nth video frame after downsampling processing into the updated first initial model to obtain the updated first weight set corresponding to the Nth video frame; based on the second weight set corresponding to the Nth video frame and the updated first weight set corresponding to the Nth video frame, determine the loss function value between the updated first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame; if the loss function value between the updated first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame meets the requirements of a preset loss function value threshold, then determine the updated first initial model as the weight generation model corresponding to the Nth video frame; otherwise, repeat the process of obtaining the updated first initial model and generating the weight generation model corresponding to the Nth video frame according to the preset loss function value threshold and the updated first initial model, until the loss function value between the updated first initial model input by the Nth video frame after downsampling processing and the second initial model input by the Nth video frame meets the requirements of the preset loss function value threshold.
24. The device according to any one of claims 15 to 23, wherein: The first acquisition unit further includes: The second processing sub-unit is used to perform weight combination processing on the basic mapping table set according to the weight set corresponding to the Nth video frame to obtain the basic mapping table set after the weight combination processing; wherein the basic mapping table set after the weight combination processing includes multiple basic mapping tables carrying corresponding weights; the multiple basic mapping tables carrying corresponding weights included in the basic mapping table set after the weight combination processing are integrated to obtain the video processing model corresponding to the Nth video frame.
25. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.
26. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.
27. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Video processing method and system based on neural network, and computer readable medium
CN114125449A
Training method and device of color enhancement network and color enhancement method and device
CN114299360A
Image processing model training method and device, storage medium and electronic equipment
CN116762101A
Image processing method and related equipment
CN116993619A
Video enhancement method and device, equipment, storage medium and program product
CN117061683A
