Method and device for generating customized video clip based on content features
By rating the content characteristics of video clips and ranking the weighted total score, and adjusting the weight value based on user input, the problem of difficulty in generating customized video clips in the existing technology is solved, and automated and cross-platform video clip generation is realized to meet user preference needs. .
Patent Information
- Application Number
- CN202280087808.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-06
- Publication Date
- 2024-09-10
AI Technical Summary
Existing technologies are difficult to effectively generate customized video clips from longer videos. In particular, they cannot automatically identify and extract interesting moments in videos based on user preferences, and often require a large amount of user input or user portraits.
By scoring the content characteristics of video clips, using a weighted total score to rank and select video clips, and adjusting weight values based on user input, you can generate and automate customized video clips across different devices and systems.
It automates the generation of customized video clips from longer videos, reducing the need for user input and providing a customizable and cross-platform solution that generates interest-based video clips based on user preferences.
Smart Images

Figure CN118633085A
Abstract
Description
Technical Field
[0001] The present disclosure relates to generating customized video segments from longer videos, wherein the video segments can be customized based on content characteristics that can be selected based on user input. Background Art
[0002] There are currently a large number of videos available for users to watch, for example, through online searches. With so many videos available, it is difficult for the average user to easily identify which videos are worth watching, or which moments in a selected video are of particular interest. Typically, when a user searches for a video, a short preview (e.g., a 1-second portion) of each video is provided to the user to help the user determine whether the video is worth watching. However, such a preview may be defined by the video generator and may not be in line with the user's interests. Furthermore, the preview defined for a given video may be manually selected (e.g., by the video generator) and may not be a good representation of the main points of interest in the video.
[0003] Some existing solutions can select video clips that match the user's text query. However, this requires the user to know what content to query in advance. For example, the user may just want to see the interesting moment captured in the video without knowing exactly what the content of the interesting moment is. Other existing solutions do not support customizing video clips for each user, or require extensive analysis of the user before customization.
[0004] Therefore, it would be useful to provide a solution that supports the generation of customizable video segments from longer videos. Summary of the invention
[0005] In various examples, the present disclosure describes methods and apparatus for generating customized video segments from longer videos, wherein the video segments are customized by scoring various content features and ranking the video segments according to a weighted total score. In some examples, user input can be used to determine the weight values used to calculate the weighted total score. In some examples, the video segments can be customized based on similarity to video segments submitted by users. The technical effect is to output a customized video segment that can be customized according to the user's preferences. This also provides a technical advantage that customized video segments can be generated from longer videos without requiring a large amount of user input or user portraits. Another technical advantage is that the generation of video segments (e.g., preview clips) can be more automated without sacrificing customizability.
[0006] The disclosed examples may provide a modular solution for generating customized video clips. The modular solution means that the disclosed examples may not be specific to any one video platform. For example, the disclosed examples may not require information from a user profile maintained on a specific platform, and may not require any video metadata or format specific to any specific platform. This provides a technical advantage that the disclosed examples may be implemented in a variety of devices and systems (including cloud-based video services, workstations, personal devices, etc.).
[0007] In an exemplary aspect, the present disclosure describes a method for generating a customized video segment from a video. The method includes: for each corresponding video segment in one or more video segments of the video, calculating a corresponding score set, each video segment having two or more frames, each score representing a corresponding content feature in the corresponding video segment; calculating a corresponding weighted total score for each corresponding video segment by applying a common weight value set to each corresponding score set; and outputting a selected video segment as the customized video segment, the selected video segment being selected from one or more top-ranked video segments having top-ranked weighted total scores.
[0008] In one example of the above exemplary aspect of the method, the selected video segment may be a top-ranked video segment having a top-ranked weighted total score.
[0009] In an example of any of the above exemplary aspects of the method, the method may further include: receiving a user input from a user device, the user input including a selection of one or more weight values in the set of common weight values.
[0010] In an example of any of the above-mentioned exemplary aspects of the method, the method may also include: receiving user input from a user device, the user input including a query submitted by a user; comparing a query feature vector with a corresponding video clip feature vector, the query feature vector representing features of the query submitted by the user, the corresponding video clip feature vector representing features of each corresponding top-ranked video clip; selecting the selected video clip as the top-ranked video clip, the top-ranked video clip being represented by the video clip feature vector having the highest similarity to the query feature vector.
[0011] In an example of any of the above-mentioned exemplary aspects of the method, the method may also include: before outputting the selected video segment, providing an output to the user device so that the user device provides a preview of the selected video segment and a visual indication of the weighted total score of the selected video segment.
[0012] In one example of the above-mentioned exemplary aspect of the method, the method may also include: recalculating the weighted total score for each video clip and updating the selection of the selected video clip in response to changes in the user input; updating the preview based on the updated selection of the selected video clip, and updating the visual indication based on the recalculated weighted total score.
[0013] In an example of any of the above-mentioned exemplary aspects of the method, outputting the selected video segments may include: calculating the corresponding frame difference between the start frame and the end frame of each corresponding top-ranked video segment; selecting the selected video segments as the top-ranked video segments, and the top-ranked video segments have the corresponding frame difference within a defined difference threshold.
[0014] In an example of any of the above-mentioned exemplary aspects of the method, outputting the selected video segment may include: calculating the frame difference between the start frame and the end frame of the selected video segment; in response to the frame difference exceeding a defined difference threshold, defining the previous frame of the end frame as a new end frame, or defining the next frame of the start frame as a new start frame; repeating the calculation and the definition until the frame difference is within the defined difference threshold.
[0015] In an example of any of the above-described exemplary aspects of the method, calculating a corresponding set of scores for each corresponding video segment may include, for a given video segment: generating each corresponding score in the set of scores by processing the given video segment using a corresponding trained content feature extraction model.
[0016] In an example of any of the above-mentioned exemplary aspects of the method, the corresponding trained content feature extraction model may include at least one of the following: a trained action prediction model; a trained emotion prediction model; a trained cheer prediction model; a trained speed detection model; or a trained cycle detection model.
[0017] In an example of any of the above-mentioned exemplary aspects of the method, the method may also include: dividing the video into the one or more video segments by calculating the change amount between each pair of two consecutive frames of the video; when the calculated change amount exceeds a defined scene change threshold, defining the starting frame of the video segment.
[0018] In an example of any of the above-mentioned exemplary aspects of the method, the method may also include: before outputting the selected video segment as the customized video segment, detecting a region of interest (ROI) in the selected video segment; and enlarging the ROI in the selected video segment.
[0019] In an example of any of the above-mentioned exemplary aspects of the method, the method may also include: before outputting the selected video segment as the customized video segment, defining multiple frames at the beginning of the selected video segment as variable start frames, or defining multiple frames at the end of the selected video segment as variable end frames; outputting the customized video segment with a variable length, wherein the variable length can vary based on randomly selecting one of the variable start frames as the first frame of the customized video segment or randomly selecting one of the variable end frames as the last frame of the customized video segment.
[0020] In one example of any of the above exemplary aspects of the method, the customized video clip may be output in a GIF animation format.
[0021] In another exemplary aspect, the present disclosure describes a computing device comprising: a processing unit for executing instructions to cause the computing device to perform any of the above exemplary aspects of the method.
[0022] In another exemplary aspect, the present disclosure describes a non-transitory computer-readable medium storing instructions, wherein the instructions are executable by a processing unit of a computing device to cause the computing device to perform any of the above exemplary aspects of the method.
[0023] In another exemplary aspect, the present disclosure describes a computer-readable medium having instructions stored thereon, wherein the instructions are executable by a processing unit of a computing device to cause the computing device to perform any of the above exemplary aspects of the method.
[0024] In another exemplary aspect, the present disclosure describes a computer program executable by a computing device to cause the computing device to perform any of the above exemplary aspects of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Reference will now be made, by way of example, to the accompanying drawings which show exemplary embodiments of the present application, in which:
[0026] Figure 1 is a block diagram of an exemplary video clip generation system provided by the present disclosure examples;
[0027] Figure 2 is a block diagram of an exemplary computing device that may be used to implement examples of the present disclosure;
[0028] Figure 3 is a block diagram of an exemplary implementation of a content feature scoring module provided by the examples of the present disclosure;
[0029] Figure 4 is a flowchart of an exemplary method for generating a customized video clip provided by an example of the present disclosure;
[0030] Figure 5A and Figure 5B An exemplary user interface that may be provided according to examples of the present disclosure is shown.
[0031] Similar reference numerals may be used in different drawings to represent similar components. DETAILED DESCRIPTION
[0032] In various examples, the present disclosure describes methods and devices for generating customized video clips from longer videos. Specifically, the present disclosure examples may support generating video "highlights" or video "previews" from longer videos, the video "highlights" or video "previews" corresponding to interesting moments in the video. For example, if the video includes a sports game, the present disclosure examples may support generating video clips that capture exciting moments (e.g., goals) in the sports game.
[0033] The disclosed examples enable users to provide input (e.g., by selecting weight values for calculating weighted total scores, or by user-submitted video clips) so that the generated video clips can be customized according to the user's preferences. The disclosed methods and devices can provide an end-to-end solution, which means that there may be no need for pre-processing of longer videos (e.g., video segmentation) or post-processing of the output video clips (e.g., video looping).
[0034] Figure 1 is a block diagram of an exemplary video segment generation system 100, which can be implemented using the devices and methods disclosed herein. The video segment generation system 100 can be implemented in a single physical machine or device (e.g., as a single computing device, such as a single workstation, a single server, etc.), or can be implemented using multiple physical machines or devices (e.g., as a server cluster). For example, the video segment generation system 100 can be implemented as a virtual machine or a cloud-based service (e.g., implemented using a cloud computing platform that provides a virtualized computing resource pool), which can be accessed by a user device (e.g., a smartphone, a tablet computer, a desktop device, a workstation, etc.).
[0035] In some examples, the video segment generation system 100 may communicate with a video database 10 storing retrievable videos (e.g., via a wireless communication network). The videos stored in the video database 10 may or may not be logically divided into video segments. The video segment generation system 100 may communicate with the video database 10 to retrieve the video from which the customized video segment is generated. In some examples, the generated customized video segment may also be stored in the video database 10 in association with the original longer video. In other examples, the video segment generation system 100 may not communicate directly with the video database 10. Alternatively, the video segment generation system 100 may receive the video to be generated for the customized video segment from another computing device (e.g., a user device). Other arrangements are also possible within the scope of the present disclosure.
[0036] The video clip generation system 100 generates customized video clips from a video (e.g., a longer video stored in a video database 10). A video is typically a sequence of two or more frames (wherein each frame is typically a 2D RGB image). A subset of frames from a longer video may be referred to as a video clip. For example, each video clip may be defined by a start frame and an end frame (with zero, one or more frames between the start frame and the end frame) and / or by a start timestamp and an end timestamp. A video may be divided into two or more video clips, which may or may not overlap. In some examples, a video may be divided into video clips, and the union of the video clips may not include all frames of the video. For example, a video may be divided into video clips corresponding to different scenes, wherein non-scene frames (e.g., credits) are not part of any video clip.
[0037] As disclosed herein, the video segment generation system 100 performs the operation of outputting a customized video segment (generated from a longer video), wherein the customized video segment is customized based on the content characteristics of each video segment. For example, the customized video segment can be provided as a looping video segment (e.g., as a GIF animation file).
[0038] The video segment generation system 100 in this example includes subsystems, including a video segmentation module 102, a content feature scoring module 104, a score merging module 106, and a post-processing module 108. In some examples, one or more of the subsystems 102, 104, 106, and 108 may be optional. For example, if the videos stored in the video database 10 have been logically divided into video segments, the video segmentation module 102 may not be needed (or may be disabled). In another example, if the generated video segments do not need to be post-processed (e.g., looped or smoothed), the post-processing module 108 may not be needed (or may be disabled). One or more of the subsystems 102, 104, 106, and 108 can be implemented using machine learning models. For example, the content feature scoring module 104 can be implemented using one or more machine learning models, each of which is pre-trained to extract certain content features from video segments, as discussed further below.
[0039] In some examples, the video segment generation system 100 can receive user input (e.g., from a user device), and can generate a customized video segment based on the user input. For example, the user input can be a selection of weight values, which can be used by the score merging module 106 to calculate the weighted total score. In another example, the user input can be a query (e.g., in the form of a video segment, audio data, or text data), and the customized video segment can be customized to have content features similar to the query. Examples of how the video segment generation system 100 can utilize such user input will be further described below.
[0040] although Figure 1 Certain subsystems of the video segment generation system 100 are shown, but it should be understood that this is not intended to be limiting, and that the video segment generation system 100 may include a greater or lesser number of subsystems (and may not include any subsystems at all). Functions described as being performed by particular subsystems may be performed by different subsystems, and / or may be functions of the entire video segment generation system 100. The operation of the video segment generation system 100 will be discussed in more detail below.
[0041] Figure 2 is a block diagram of a simplified exemplary computing device 200 that may be used to implement the video segment generation system 100 in some embodiments. For example, the computing device 200 may represent a server. As previously mentioned, the video segment generation system 100 may be implemented in other hardware configurations, including using multiple computing devices (e.g., a cloud-based computing platform accessing a virtual resource pool) or in an end-user device (e.g., a smartphone, tablet, desktop device, workstation, etc.). Although Figure 2A single instance of each component is shown, but multiple instances of each component may exist in computing device 200. Computing device 200 may be used to execute instructions for processing data using a trained machine learning-based model (e.g., a neural network), as discussed further below.
[0042] In this example, the computing device 200 includes at least one processing unit 202, such as a processor, a microprocessor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a dedicated logic circuit, a dedicated artificial intelligence processing unit, a graphics processing unit (GPU), a tensor processing unit (TPU), a neural processing unit (NPU), a hardware accelerator, or a combination thereof.
[0043] Computing device 200 may include an input / output (I / O) interface 204 that may support connection with input devices and / or output devices (not shown).
[0044] The computing device 200 may include a network interface 206 for wired or wireless communication with other computing devices (e.g., the video database 10, a user device providing user input, etc.). The network interface 206 may include a wired link (e.g., an Ethernet cable) and / or a wireless link (e.g., one or more antennas) for intra-network communication and / or extra-network communication. The network interface 206 may also enable the computing device 200 to output the generated video clip to another computing device (e.g., for storage in the video database 10, or as a response to a query from a user device).
[0045] Computing device 200 may include storage unit 208 , which may include a mass storage unit, such as a solid state drive, a hard disk drive, a magnetic disk drive, and / or an optical disk drive. In some examples, video representation memory 140 may be implemented using storage unit 208 .
[0046] The computing device 200 may include a memory 210, which may include volatile or non-volatile memory (e.g., flash memory, random access memory (RAM), and / or read-only memory (ROM)). The non-transitory memory 210 may store instructions 212, which are executed by the processing unit 202, for example, to perform the exemplary embodiments described in the present disclosure. For example, the memory 210 may store instructions 212 for implementing the video segment generation system 100 and any of the methods disclosed herein. The memory 210 may also store neural network parameters 214, which may be parameters of a trained neural network, as described below. The memory 210 may include other software instructions, such as for implementing an operating system and other applications / functions.
[0047] The computing device 200 may execute instructions from an external memory (e.g., an external drive in wired or wireless communication with a server), or executable instructions may be provided by a transient or non-transient computer-readable medium. Examples of non-transient computer-readable media include RAM, ROM, erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, CD-ROM, or other portable memory.
[0048] Reference again Figure 1 An exemplary operation of the video segment generation system 100 is now described.
[0049] In some examples, the video segmentation module 102 first processes a video (e.g., a video from the video database 10, provided by a user device, locally stored at the video segment generation system 100, or received from some other computing device) into multiple video segments. As previously described, in some examples, the video may have already been divided into video segments, and the video segmentation module 102 may not be used. In some examples, the video segmentation module 102 can be used to generate video segments regardless of whether the video has already been divided into video segments. For example, although the video may have already been divided into video segments, such video segments may be incorrectly defined (e.g., not corresponding to actual scene changes in the video), or may be content-independent (e.g., divided into 10-minute long segments without considering the content). In this case, the video segmentation module 102 can be used to divide the video into video segments that are more suitable for generating customized video segments based on content.
[0050] The video segmentation module 102 may use any suitable algorithm to divide the video into a plurality of video segments. An example is described below, but this is not intended to be limiting.
[0051] For example, the video may be divided based on scene changes. If the image changes significantly between a first frame and a next consecutive second frame, the first frame may be defined as the end frame of the current video segment and the second frame may be defined as the start frame of a new video segment. The scene change may be determined based on the change in pixel values between the first frame and the next consecutive second frame, for example, as calculated using the following equation:
[0052]
[0053] Where Δ is a value representing the amount of change between a first frame at time t-1 and a next consecutive second frame at time t, where (i, j) is the position of each pixel in the frame, and where I is the pixel value of each pixel (e.g., intensity value, RGB value, etc.). If the amount of change is greater than a predefined scene change threshold, a scene change (and therefore a new video segment) can be determined.
[0054] In some examples, video segmentation module 102 may implement more complex algorithms and / or implement trained machine learning-based models to perform video segmentation.
[0055] In some examples, the video segmentation module 102 can divide the video into video segments based on any other suitable criteria. For example, the video can be divided into video segments based on any pauses or reductions in motion between frames, based on changes in music in an audio file associated with the video, etc. In some examples, the video segmentation module 102 can use a moving window (e.g., a window of 20 frames, moving in steps of 2 frames each time) to divide the video into overlapping video segments, among other possibilities.
[0056] Each video segment (e.g., segmented from the video by the video segmentation module 102) is processed by the content feature scoring module 104, which generates a set of scores for each video segment (e.g., using one or more trained feature extraction models, which can be any suitable machine learning-based models). In some examples, the input to the content feature scoring module 104 can be the entire original video (rather than the video segments segmented from the video) and information defining the video segments (e.g., the index of the start frame and the end frame of each video segment; or the index of the start timestamp and the end timestamp of each video segment). In some examples, the input to the content feature scoring module 104 can be the entire original video and the segmented video segments. Access to the entire original video allows the content feature scoring module 104 to generate a content feature score that takes into account the overall context of the video and can more accurately understand the overall semantic meaning of the video.
[0057] Figure 3 is a block diagram of an exemplary implementation of the content feature scoring module 104. In the example shown, the content feature scoring module 104 receives a video clip as input and outputs a set of scores representing content features of the video clip (e.g., in the form of a content feature score vector). In other examples, the content feature scoring module 104 may receive multiple video clips as input, or may receive the entire original video and information defining the video clips, and may output multiple sets of scores representing content features of each corresponding video clip (e.g., in the form of a content feature score matrix, where each row of the matrix corresponds to a corresponding video clip). For simplicity, the following discussion will refer to an example in which the content feature scoring module 104 processes a video clip to output a set of scores, but this is not intended to be limiting.
[0058] In this example, the content feature scoring module 104 is implemented using multiple trained machine learning-based models 302 to 310, where each model is trained to extract a specific content feature of interest. It should be understood that the content feature scoring module 104 can implement a greater or lesser number of models, can use different models to extract different content features of interest, and can also use non-machine learning-based algorithms. In some examples, the content feature scoring module 104 can be implemented using a single trained machine learning-based model that generates content feature scores for all content features of interest (rather than using different models for different content features).
[0059] The model implemented by the content feature scoring module 104 can be a model for extracting content features related to exciting moments in a video. In the example shown, the content feature scoring module 104 includes a trained action prediction model 302, an emotion prediction model 304, a cheer prediction model 306, a speed detection model 308, and a loop detection model 310. The content features extracted by each model can be a numerical output (e.g., a vector or scalar) that is a representation of the extent to which a particular content exists in a video clip. The action prediction model 302 can generate a numerical score (e.g., an action score, represented as Sa) representing the amount of action content (e.g., dynamic human action) in a video clip. The emotion prediction model 304 can generate a numerical score (e.g., an emotion score, represented as Se) representing the amount of emotional content (e.g., strong emotions such as anger, fear, and joy) in a video clip. The cheer prediction model 306 can generate a numerical score (e.g., a cheer score, represented as Sc) representing the amount of cheering (e.g., clapping, waving, jumping, etc.) in a video clip. The speed detection model 308 can generate a numerical score (e.g., a speed score, denoted as Ss) representing the amount of speed content in the video clip (e.g., the speed of a moving scene, the speed of an object in the scene, etc.). The loop detection model 310 can generate a numerical score (e.g., a loop score, denoted as Sl) representing the amount of looping or repetitive content in the video clip (e.g., important moments can be shown repeatedly). Models 302, 304, 306, 308, 310 can each be any suitable machine learning-based model (or in some cases non-machine learning-based model) that is developed for a specific task. Some examples that can be used to implement models 302, 304, 306, 308, 310 are now described, but these examples are not intended to be limiting. Lin et al. ("TSM: Temporal Shift Module for Efficient Video Understanding", arXiv:1811.08383v3, 2019) describes an example that can be used for action prediction model 302. Mellouk et al. (“Facial emotion recognition using deep learning: review and insights,” Procedia Computer Science 175:689-694, 2020) describe examples that can be used for emotion prediction model 304.Franzoni et al. (“Emotional sounds of crowds: spectrogram-based analysis using deeplearning”, Multimedia Tools and Applications 79:36063-36075, 2020) describe examples that can be used for cheer prediction model 306. Benaim et al. (“SpeedNed: Learning the Speediness in Videos”, arXiv:2004.006130v2, 20020) describe examples that can be used for speed detection model 308. Cycle detection model 310 can be implemented using a variety of non-machine learning based algorithms that detect whether there are a large number of repeated frames in a video clip. Each of the scores generated by different models 302 to 310 can be combined (e.g., concatenated) to output a set of scores for the video clip (e.g., in the format of a content feature score vector).
[0060] The set of scores for a given video segment indicates the degree to which certain content features are present in the given video segment (e.g., a higher score for a certain content feature indicates that the content feature is found in more frames in the video segment). Thus, by considering all sets of scores generated for all video segments partitioned from a video, it is possible to identify (based on the score values) which individual video segments most strongly exhibit a particular content feature. Furthermore, as discussed below, the scores can be combined (e.g., using weighted aggregation) to identify which video segments most strongly exhibit a particular combination of content features.
[0061] In some examples, a set of scores may be stored with the video in the video database 10 (e.g., may be stored with the video as metadata), each score representing a content feature of a corresponding video segment of the video. This may enable the set of scores to be retrieved at a later time and repeatedly used to generate different customized video segments for the video without having to reprocess the video using the video segmentation module 102 and the content feature scoring module 104. In the following discussion, it may be assumed that the set of scores generated by the content feature scoring module 104 is subsequently processed by the score merging module 106. However, the set of scores generated by the content feature scoring module 104 is stored (e.g., in the video database 10) and retrieved later to be processed by the score merging module 106.
[0062] The score sets generated for the video segments are processed by the score merging module 106. The score merging module 106 combines (or merges) the score sets for each video segment in a customizable manner. For example, the score merging module 106 can calculate a weighted total score from the score set for a given video segment by applying a set of weight values to the score sets. The weighted total score for each video segment is calculated using the same set of weight values. The set of weight values adjusts (or "adjusts") the relative importance of each content feature by applying a larger value weight to the more important content features and a smaller value weight to the less important content features. The weighted sum is the weighted total score. A higher weighted total score indicates that the corresponding video segment has more desired content features (represented by the set of weight values).
[0063] It should be noted that the score merging module 106 supports recalculating the weighted total score when the weight value set changes, without recalculating the content feature score. This means that the relative importance of each content feature can be adjusted dynamically, for example in response to user input, without recalculating the content feature score. This avoids the following situation, that is, every time the user wants to generate a customized video clip to emphasize different content features, the same video clip must be repeatedly processed by different machine learning-based models (which is computationally expensive and time-consuming). For example, the user may first want to generate a customized video clip with a lot of cheers (e.g., by selecting a first weight value set), and then change his mind at a later time and want to generate a customized video clip with a lot of fast action (e.g., by selecting a different second weight value set). In another example, the customized video clip can be generated based on a default weight value set (e.g., predefined at the video clip generation system 100), and the user can alternatively select a different weight value set to generate a different customized video clip. This customization can be achieved through user input, which adjusts the weight value applied to the score set.
[0064] In some examples, the score merging module 106 can also enable the video clip to be matched with a query (e.g., provided by user input). For example, the query can be a video query (e.g., a short video clip including a few frames), an audio query (e.g., audio data including a short audio clip), a text query (e.g., text data including a word, a phrase, or a short sentence), or an image query (e.g., 2D image data). The score merging module 106 can implement a trained feature extraction model to extract query features from the query (e.g., in the form of a query feature vector), and similarly extract query features from the video clip (e.g., in the form of a video clip feature vector). The trained feature extraction model can be a machine learning-based model that has been trained to generate query feature vectors and video clip feature vectors in the same vector space (e.g., a multidimensional space defined by all possible feature vectors that can be extracted) to support direct comparison between the query feature vector and the video clip feature vector. Depending on the format of the query, different trained feature extraction models can be used. For example, if the query is in the form of a video query, a trained first feature extraction model can be used, which has been trained to generate a query feature vector from video data; and if the query is in the form of a text query, a different trained second feature extraction model can be used, which has been trained to generate a query feature vector from text data. The feature extraction model used to generate the query feature vector and the video segment feature vector can be any suitable machine learning-based model. Some non-limiting examples are now described. For example, a convolutional neural network can be used as a feature extraction model that is used to generate a query feature vector from a video query and to generate a video segment feature vector. For example, EfficientNet (e.g., described in Tan et al. "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks" arXiv:1905.11946v5, 2020) can be used to extract features from frames of a video query (or video segment), and the extracted features can be averaged or otherwise aggregated to generate a query feature vector (or video segment feature vector). In another example, if the query is an audio query, a convolutional neural network (e.g., as described in Hershey et al., “CNN Architectures for Large-Scale Audio Classification,” arXiv:1609.09430v2, 2017) can be trained to generate audio embeddings from the audio data, and the audio embeddings can be used as the query feature vector.In another example, if the query is a text query, a language model such as BERT (e.g., described in Devlin et al., “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” arXiv:1810.04805v2, 2019) can be used to generate text embeddings from text data, and the text embeddings can be used as query feature vectors. Therefore, the score merging module 106 can implement different trained feature extraction models depending on the query. In some examples, the score merging module 106 does not implement the trained feature extraction model itself, but can use an external feature extraction model (e.g., outside the video segment generation system 100, such as another cloud-based service) to generate a query feature vector and / or a video segment feature vector.
[0065] A similarity score can be calculated (e.g., by calculating vector correlation) between the query feature vector and the video segment feature vector of each of the video segments with the highest weighted total score (the top five or ten weighted total scores). Video segments with high similarity scores are considered to be good matches to the query (e.g., having similar content features as the query). The similarity scores can be incorporated (e.g., added or multiplied) into the weighted total score, or can be separate scores (e.g., the similarity score can be a secondary score that is considered after the weighted total score; or the similarity score can be a primary score that takes precedence over the weighted total score).
[0066] The score merging module 106 may rank the video segments in descending order of weighted total scores (optionally, similarity scores), and the top-ranked video segments (eg, the top-ranked video segments with the top-ranked weighted total scores) may be selected as customized video segments to be output.
[0067] In some examples, before outputting the customized video clip, the post-processing module 108 can perform a post-processing operation. The post-processing operation can enable the customized video clip to be used as a looping animation (eg, a GIF animation file or a short video clip).
[0068] For example, in order to enable the customized video segment to be played in a loop without a sudden frame jump when a new loop begins (i.e., after playing the last frame and looping back to the first frame), the post-processing module 108 can perform operations to ensure that the frames at the beginning and end of the customized video segment are similar (e.g., at the pixel level). The frame difference between one or more frames at the beginning of the customized video segment and one or more frames at the end of the customized video segment can be calculated. In some examples, the frame difference between a single starting frame (i.e., the first frame) and a single ending frame (i.e., the last frame) of the customized video segment can be calculated. For example, the following calculation process can be used to calculate the pixel-to-pixel frame difference between the starting frame and the ending frame of the customized video segment:
[0069]
[0070] Wherein Δ is a frame difference value, which represents the change between the end frame (denoted by the subscript end) and the start frame (denoted by the subscript start), where (i, j) is the position of each pixel in the frame, and where I is the pixel value of each pixel (e.g., intensity value, RGB value, etc.).
[0071] In another example, the frame difference between a defined number of frames (e.g., five frames) at the beginning of the custom video segment (which may be referred to as the start clip) and a defined number of frames (e.g., five frames) at the end of the custom video segment (which may be referred to as the end clip) may be calculated. For example, the frame difference between the start clip and the end clip may be calculated using the following calculation process:
[0072]
[0073] Where Δ is the calculated frame difference between the start clip and the end clip, where (i, j) is the position of each pixel in the frame of each clip, and where I is the pixel value (e.g., intensity value, RGB value, etc.) of each pixel. In this calculation, the pixel intensities in each clip are first summed, and then the frame difference between the two summed pixel intensities is calculated. In some examples, each sum can be averaged by the number of frames in the corresponding clip, and the frame difference between the two averaged pixel intensities can be calculated (e.g., to accommodate the possibility of having a different number of frames in the start clip and the end clip).
[0074] Regardless of how the frame difference is calculated, the calculated difference can be compared to a defined difference threshold (which may be stricter than the threshold used to identify scene changes during the video segmentation operation). If the calculated difference is within the threshold, the customized video segment can be considered to be similar enough between the start frame and the end frame to achieve smooth looping. If the calculated difference exceeds the threshold, the customized video segment can be further processed by the post-processing module 108. For example, the post-processing module 108 can shorten the customized video segment by discarding the end frame and using the frame before the end frame (i.e., the second to last frame) as the new end frame, recalculating the frame difference, and repeating the process until the difference threshold is no longer exceeded. In some examples, instead of discarding the end frame, a similar process can be performed for the start frame. That is, the process can involve discarding the start frame and using the frame after the start frame (i.e., the second frame) as the new start frame, recalculating the frame difference and repeating the process until the frame difference is within the difference threshold. In another example, the post-processing module 108 may reject the custom video segment and select a different video segment (e.g., a video segment with the second highest weighted total score) as a new custom video segment. Then, a frame difference may be calculated for the new custom video segment, and the process may be repeated until a custom video segment with a frame difference within a difference threshold is obtained. In general, the post-processing module 108 may perform operations to ensure similarity between the start frame and the end frame of the custom video segment.
[0075] The post-processing module 108 may additionally or alternatively perform an operation of zooming in on a region of interest (ROI) in the custom video clip. For example, the post-processing module 108 may implement a trained facial detection model or other object detection model (e.g., a vehicle detection model, a human detection model, etc.) to detect possible ROIs within the custom video clip and crop one or more frames to zoom in on the ROI. For example, an object detection model may be used to detect an object of interest (e.g., a face or a human body) as an ROI and determine a bounding box of the object of interest. For example, a suitable object detection model may be YOLOv3 (e.g., as described in “YOLOv3: An Incremental Improvement” by Redmon et al., arXiv1804.02767v1, 2018). Sampled frames of the custom video clip may be processed (e.g., sampled at regular intervals) using the object detection model to detect an object of interest and generate a bounding box for the object in the sampled frame. For any frame not processed by the object detection model, the location of the bounding box may be estimated (e.g., using any suitable video tracking algorithm). The bounding box may be used to define the ROI of the customized video segment. The post-processing module 108 may then zoom in on the detected ROI before outputting the customized video segment.
[0076] In another example, if the customized video segment is to be played in a loop, the post-processing module 108 may additionally or alternatively perform operations to change the length (i.e., the number of frames) in each loop of the customized video segment. For example, the post-processing module 108 may define a number of frames at the end of the customized video segment (e.g., the last five frames) as variable end frames and / or may define a number of frames at the beginning of the customized video segment (e.g., the first five frames) as variable start frames. In some examples, the variable length of the customized video segment may be variable within a certain range, which may be defined by user input. For example, a user may provide an input for enabling or disabling the variable length, and may also provide an input indicating the number of frames (or time length) that may be defined as variable start frames or end frames at the beginning and / or end of the customized video segment. The post-processing module 108 may include metadata for the customized video segment so that when played in a loop, each loop of the customized video segment may start from any one of the variable start frames and / or end from any one of the variable end frames (e.g., based on a random selection).
[0077] Reference now Figure 4 , Figure 4 is a flow chart of an exemplary method 400 that may be performed by the video segment generation system 100. For example, the computing device 200 may execute instructions stored in a memory or a non-transitory computer-readable medium to implement the method 400 using various subsystems of the video segment generation system 100.
[0078] At 402, a video (having a plurality of frames) is obtained. The video may be obtained by retrieving the video from the video database 10 or by receiving the video from a user device, among other means.
[0079] At 404, the video is divided into a plurality of video segments (e.g., using the video segmentation module 102 as described above). In some examples, if video segments have already been defined for the video, step 404 may be omitted. In other examples, even if video segments have already been defined for the video, step 404 may still be performed, which may result in video segments that are different from those previously defined for the video.
[0080] At 406, a set of scores is calculated for each video segment (e.g., using content feature scoring module 104). For a given set of scores corresponding to a given video segment, each score in the given set of scores represents a corresponding content feature in the given video segment. Specifically, the magnitude of each numerical score can represent the degree to which the corresponding content feature exists in the given video segment. As previously described, the set of scores can include action scores, emotion scores, cheer scores, speed scores, and / or loop scores, among other scores. Each score can be calculated using a corresponding trained machine learning model that has been trained to extract and quantify the corresponding content feature from the video segment. After performing step 406, a set of scores has been calculated for each video segment.
[0081] At 408, a weighted total score (e.g., a weighted sum) is calculated for each video segment using the corresponding set of scores calculated for each video segment (e.g., using the score merging module 106). The weighted total score is calculated using a common set of weight values. As described above, user input can be received to adjust the set of weight values. The user input can involve adjusting the value of a particular weight, or can involve replacing a defined set of weight values (a set of weight values that places more emphasis on a first content feature (e.g., speed)) with a different defined set of weight values (e.g., a set of weight values that places more emphasis on a different second content feature (e.g., motion)). In some examples, if the set of weight values is not adjusted using user input (or in the absence of any user input), a default set of weight values can be used.
[0082] Optionally, at 410, if a query is received (e.g., the user input is a query, which can be a video query, an audio query, a text query, or an image query), a similarity score can be calculated for each video segment. The similarity score for a given video segment represents the similarity of the content features of the video segment to the content features of the query. For example, as described above, a feature extraction model can be trained according to the format of the query (e.g., video data, text data, or 2D image data) to extract a query feature vector from the query, and also extract a video segment feature vector from a given video segment. The feature extraction model should be trained to make the query feature vector and the video segment feature vector in the same vector space to achieve a similarity comparison between the query feature vector and the video segment feature vector. The similarity score can be a numerical representation of the similarity between the query feature vector and the video segment feature vector in the same vector space. After performing step 410, a similarity score has been calculated for each video segment.
[0083] At 412, based on the weighted total score (calculated at step 408), a video segment is selected from all video segments partitioned from the original video. In some examples, if a similarity score is also calculated at 410, the similarity score can be merged (e.g., added or multiplied) into the weighted total score. In other examples, if a similarity score is calculated, the video segment is selected by first considering the weighted total score (e.g., ranking all video segments in descending order of the weighted total score), and then selecting the video segment with the highest similarity score from the top-ranked (e.g., top 5 or top 10) video segments. In another example, the similarity score can be first considered (e.g., ranking all video segments in descending order of the similarity score), and then selecting the video segment with the highest weighted total score from the top-ranked (e.g., top 5 or top 10) video segments. After performing step 412, a video segment has been selected, wherein the selected video segment is considered to best match the desired content (as indicated by the set of weight values), and optionally the query (if step 410 was performed).
[0084] Optionally, at 414, a preview of the selected video segment can be provided (e.g., via a user interface as described below). The preview can be viewed by the user via the user device and can enable the user to determine whether the selected video segment meets the desired content. If the user is not satisfied with the preview of the selected video segment, the user can provide new user input (e.g., adjust the set of weight values and / or provide a query), and the method 400 can return to steps 408 and / or 410 in response to the new user input. If the user is satisfied with the preview of the selected video segment, the user can provide user input indicating that the selected video segment is acceptable.
[0085] Optionally, at 416, before outputting the selected video segment, post-processing may be performed on the selected video segment (e.g., using post-processing module 108). Post-processing of the selected video segment may include, for example, operations to ensure smooth looping of the selected video segment, operations to enable variable length of each loop, operations to zoom in on a ROI within the selected video segment, etc.
[0086] At 418, the selected video segment (which may optionally have been post-processed) is output as a customized video segment. For example, the customized video segment may be output as a short video clip (e.g., a preview of the original video) or a looping animation (e.g., a GIF animation) that can be viewed on the user device. In some examples, the customized video segment may simply be viewed on the user device (e.g., streamed) without storing the customized video segment in the long-term storage of the user device. In other examples, the customized video segment may be output for storage in the long-term storage of the user device.
[0087] Figure 5A and Figure 5B An exemplary user interface 500 is shown that may be provided to a user to enable the user to provide user input for adjusting weight values (e.g., at step 408). Additionally, the user interface 500 may enable the user to provide user input in the form of a query (e.g., a video query, an audio query, a text query, or an image query). The user interface 500 may be displayed on a user device, for example, as a means for the user to provide user input to the video segment generation system 100 via the user device.
[0088] User interface 500 may include a select video option 502 that a user may select to select a video to be used in generating a custom video clip. For example, select video option 502 may enable a user to upload a video from a user device, select a video from video database 10, etc. when selected.
[0089] User interface 500 may include automatic GIF option 504, which the user may select to generate a custom video clip using a default weight value set. The custom video clip in this example may be output in the format of a GIF animation. User interface 500 may also include custom GIF option 506, which the user may select to enable the user to provide user input for adjusting the weight value set. In this example, custom GIF option 506 has been selected (as shown by the shading). Selecting custom GIF option 506 may enable filter selector option 508 and weight adjustment option 510 of user interface 500 (if automatic GIF option 504 is selected instead, options 508 and 510 may be disabled or not displayed).
[0090] Selecting the filter selector option 508 can cause the user interface 500 to display a drop-down menu or pop-up menu (not shown), from which the user can select one or more content features that are more desirable to appear in the custom video clip and / or select one or more content features that are less desirable to appear in the custom video clip. In some examples, selecting the filter selector option 508 can cause the user interface 500 to display a drop-down menu or pop-up menu (not shown), from which the user can select from a plurality of defined weight value sets. The defined weight value sets can be predefined combinations of weight values designed to achieve different content goals. For example, there can be a first weight value set and a different second weight value set, wherein the first weight value set is designed to focus on exciting sports moments (e.g., having higher weight values for action, speed, and cheering content features), and the second weight value set is designed to focus on strong emotional moments (e.g., having higher weight values for emotional content features). In some examples, selecting filter selection option 508 may cause user interface 500 to display a pop-up menu (not shown) that enables a user to enter a query (eg, in the form of an upload of a video clip, text data, or 2D image data).
[0091] In this example, weight adjustment options 510 are provided in user interface 500 as sliders with which a user can interact to adjust the relative weight values of each content feature (in this example, emotion, cheer, and loop content features, but this is not intended to be limiting).
[0092] It should be understood that the above description and Figure 5A The input mechanism shown in is illustrative and is not intended to be limiting. Other input mechanisms (e.g., buttons, input fields, etc.) may also be used.
[0093] The user interface 500 may include a preview area 512 in which a preview of the selected video segment (based on the set of weight values and / or query input) may be displayed. A curve 514 may be overlaid on the preview area 512, which curve 514 represents the weighted total score that has been calculated for the different video segments of the entire video. Figure 5A The portion of curve 514 corresponding to the selected video segment is indicated by a dotted line in the figure, or by other means such as highlighting, so that the user can better understand the reason for selecting the selected video segment.
[0094] For example, Figure 5B 5 shows the user interface 500 after a user input has been received to change the relative weight value of a content feature. Figure 5A compared to, Figure 5BIt shows that the weight value of the emotion content feature is reduced, the weight value of the cheering content feature is increased, and the weight value of the cycle content feature remains unchanged. Due to the change of the weight value, the weighted total score of the video clip is recalculated. Figure 5B Curve 514 in FIG. 5 shows that the weighted total score of the video segment has changed (relative to Figure 5A 514 in FIG. 5 ), and now a different video segment is selected (e.g., using Figure 5B Different selected video clips may be displayed in the preview area 512.
[0095] A confirmation option 516 may be provided which the user may select to indicate that the selected video segment is acceptable for output as a custom video segment. Selecting the confirmation option 516 may cause, for example, a GIF animation file showing frames of the custom video segment to be generated.
[0096] The user interface 500 may include other options, such as selectable options for enabling or disabling different post-processing operations (e.g., options for smooth looping, options for variable loop lengths, options for scaling the ROI, etc., which may be performed by the post-processing module 108). The user interface 500 may also include options for selecting a desired file format for outputting the custom video clip, options for selecting a desired length of the custom video clip (e.g., in seconds, minutes, or frames), etc. Other options may be included in the user interface 500.
[0097] In various examples, the present disclosure describes methods and devices that support generating customized video clips that can be customized based on user input. The customized video clips can be output, for example, in a file format that can be used for looping animations (e.g., GIF animation files) and / or for video previews. For example, the length of the customized video clip can be from 1 second to several seconds, or can be up to several minutes.
[0098] The disclosed examples may support the generation of customized video clips that capture interesting moments (e.g., exciting moments or extremely moving moments) in longer videos, without requiring the user to manually search for and select the start and end frames of a particular moment. Customized video clips may be generated in a manner that avoids sharp scene or shot changes (e.g., by performing video segmentation that avoids such sharp changes) and / or in a manner that achieves smooth looping (e.g., by performing operations that ensure that the start and end frames of the video clip are sufficiently similar). Customized video clips may also be generated to be more dynamic, such as making the length of each loop of the video clip variable and / or achieving zooming in on an ROI within the video clip.
[0099] The present disclosure enables a user to provide input (e.g., by adjusting weight values used to calculate a weighted total score, or by providing query input) that causes video clips to be re-ranked (e.g., based on recalculated content scores and / or based on similarity scores), so that different customized video clips can be generated in response to different user input.
[0100] An exemplary user interface is also disclosed that enables a user to better understand how a customized video clip is generated and guides the user to provide user input.
[0101] In some examples, user input in response to the preview of the selected video clip (e.g., user input to change the weight value to better match the user's desired content) can be collected as feedback information, which can be used for retraining of the machine learning model (e.g., the machine learning model implemented by the content feature scoring module 104). Therefore, examples of the present disclosure can follow the MLOps principle, where MLOps generally refers to a set of industry practices for continuously testing and improving the reliability and performance of machine learning models.
[0102] Examples of the present disclosure may be implemented as a modular system (eg, as a cloud-based service, or as an application executing on a user device) that may interact with any existing or future video editing software.
[0103] Although the present disclosure describes methods and processes by steps performed in a certain order, one or more steps in the methods and processes may be omitted or changed as appropriate. Where appropriate, one or more steps may be performed in an order other than the order described.
[0104] Although the present disclosure is at least partially described in terms of methods, it will be understood by those of ordinary skill in the art that the present disclosure is also directed to various components for performing at least some aspects and features of the methods, whether by hardware components, software, or any combination thereof. Accordingly, the technical solutions of the present disclosure may be embodied in the form of software products. Suitable software products may be stored in pre-recorded storage devices or other similar non-volatile or non-transient computer-readable media, including DVDs, CD-ROMs, USB flash drives, removable hard disks, or other storage media. The software product includes instructions tangibly stored thereon, which enable a processor device (e.g., a personal computer, a server, or a network device) to execute examples of the methods disclosed herein.
[0105] Without departing from the subject matter of the claims, the present disclosure may be implemented in other specific forms. The exemplary embodiments described are merely illustrative in all respects and are not restrictive. Features selected from one or more of the above-described embodiments may be combined to create optional embodiments that are not explicitly described, and features suitable for such combinations may be understood within the scope of the present disclosure.
[0106] All values and sub-ranges within the disclosed range are also disclosed. In addition, although the systems, devices and processes disclosed and shown herein may include a specific number of elements / components, the systems, devices and components may be modified to include more or less elements / components in such elements / components. For example, although any disclosed element / component may be cited as a single quantity, the embodiments disclosed herein may be modified to include a plurality of such elements / components. The subject matter described herein is intended to cover and encompass all appropriate technical changes.
Claims
1. A method for generating a customized video clip from a video, characterized in that: The method comprises: For each corresponding video segment of one or more video segments of the video, calculating a corresponding set of scores, each video segment having two or more frames, each score representing a corresponding content feature in the corresponding video segment; calculating a respective weighted total score for each respective video segment by applying a common set of weight values to each respective set of scores; and A selected video clip is output as the customized video clip, wherein the selected video clip is selected from one or more top-ranked video clips having top-ranked weighted total scores.
2. The method according to claim 1, characterized in that The selected video clips are the top-ranked video clips having the top-ranked weighted total scores.
3. The method according to claim 1 or 2, characterized in that: Also includes: A user input is received from a user device, the user input comprising a selection of one or more weight values from the common set of weight values.
4. The method according to claim 1 or 2, characterized in that: Also includes: receiving user input from a user device, the user input comprising a query submitted by a user; comparing a query feature vector representing features of the query submitted by the user with corresponding video segment feature vectors representing features of each corresponding top-ranked video segment; and The selected video segment is selected as the top-ranked video segment, and the top-ranked video segment is represented by the video segment feature vector having the highest similarity to the query feature vector.
5. The method according to claim 3 or 4, characterized in that: Also includes: Prior to outputting the selected video segment, an output is provided to the user device so that the user device provides a preview of the selected video segment and a visual indication of the weighted total score of the selected video segment.
6. The method according to claim 5, characterized in that Also includes: Responsive to changes in the user input, recalculating the weighted total score for each video segment and updating the selection of the selected video segments; as well as The preview is updated based on the updated selection of the selected video segment, and the visual indication is updated based on the recalculated weighted total score.
7. The method according to any one of claims 1 to 6, characterized in that Outputting the selected video clip includes: calculating a corresponding frame difference between a start frame and an end frame of each corresponding top-ranked video segment; and The selected video segments are selected as top-ranked video segments having corresponding frame differences within a defined difference threshold.
8. The method according to any one of claims 1 to 6, characterized in that Outputting the selected video clip includes: Calculating a frame difference between a start frame and an end frame of the selected video segment; In response to the frame difference exceeding a defined difference threshold, defining a frame before the end frame as a new end frame, or defining a frame after the start frame as a new start frame; and The calculating and the defining are repeated until the frame difference is within the defined difference threshold.
9. The method according to any one of claims 1 to 8, characterized in that Calculating the corresponding set of scores for each corresponding video segment includes, for a given video segment: Each corresponding score in the set of scores is generated by processing the given video clip using a corresponding trained content feature extraction model.
10. The method according to claim 9, characterized in that The corresponding trained content feature extraction model includes at least one of the following: A trained action prediction model; Trained sentiment prediction model; Trained cheer prediction model; A trained speed detection model; or Trained cycle detection model.
11. The method according to any one of claims 1 to 10, characterized in that Also includes: Dividing the video into the one or more video segments by calculating the amount of change between each pair of two consecutive frames of the video; as well as When the calculated change amount exceeds a defined scene change threshold, a start frame of the video segment is defined.
12. The method according to any one of claims 1 to 11, characterized in that Also includes: Before outputting the selected video segment as the customized video segment, detecting a region of interest (ROI) in the selected video segment; as well as The ROI in the selected video segment is enlarged.
13. The method according to any one of claims 1 to 12, characterized in that Also includes: Before outputting the selected video segment as the customized video segment, defining a plurality of frames at the beginning of the selected video segment as variable start frames, or defining a plurality of frames at the end of the selected video segment as variable end frames; as well as The customized video segment is outputted with a variable length, wherein the variable length can be changed based on randomly selecting one of the variable start frames as the first frame of the customized video segment or randomly selecting one of the variable end frames as the last frame of the customized video segment.
14. The method according to any one of claims 1 to 13, characterized in that The customized video clip is output in GIF animation format.
15. A computing device, characterized in that: include: A processing unit, configured to execute instructions to cause the computing device to perform the method according to any one of claims 1 to 14.
16. A computer-readable medium storing instructions, characterized in that: The instructions are executable by a processing unit of a computing device to cause the computing device to perform the method according to any one of claims 1 to 14.
17. A computer program executable by a computing device, characterized in that Used to cause the computing device to execute the method according to any one of claims 1 to 14.
Citation Information
Cited By
Video outline generation method and device, computer equipment and medium
CN120281995A
Video outline generation method, device, computer equipment and medium
CN120281995B
