Methods and devices for generating customized video segment based on content features
Methods and devices for generating a customized video segment from a video are disclosed. The video is partitioned into video segments. For each respective video segment, a respective set of scores is computed, where each score represents a respective content feature in the respective video segment. A respective weighted aggregate score is computed for each respective video segment by applying, to each respective set of scores, a common set of weight values. A selected video segment is outputted as the customized video segment, where the selected video segment is selected from one or more high-ranked video segments having high-ranked weighted aggregate scores.
1 . A method for generating a customized video segment from a video, the method comprising:
computing, for each respective video segment of one or more video segments of the video, each video segment having two or more frames, a respective set of scores, each score representing a respective content feature in the respective video segment;
receiving, from a user device, user input including a selection of one or more user-selected weight values to be applied to each respective set of scores;
computing a respective weighted aggregate score for each respective video segment by applying, to each respective set of scores, a common set of weight values including the user-selected one or more weight values;
selecting a selected video segment as the customized video segment, the selected video segment being selected from one or more high-ranked video segments having high-ranked weighted aggregate scores;
receiving, from the user device, a changed user input that causes the common set of weight values to change to a changed common set of weight values;
recomputing the respective weighted aggregate score for each respective video segment using the changed common set of weight values;
selecting an updated selected video segment as the customized video segment, based on the updated selected video segment being one of one or more reranked video segments having high-ranked recomputed weighted aggregate scores; and
outputting the updated selected video segment as the customized video segment.
2 . The method of claim 1 , wherein the updated selected video segment has a highest ranked recomputed weighted aggregate score.
3 . The method of claim 1 , further comprising:
receiving, from the user device, further user input including a user-submitted query;
comparing a query feature vector representing features of the user-submitted query with a respective video segment feature vector representing features of each respective reranked video segment; and
selecting the reranked video segment represented by the video segment feature vector having a highest similarity with the query feature vector as the updated selected video segment.
4 . The method of claim 1 , further comprising:
prior to receiving the changed user input, providing output to the user device to cause the user device to provide a preview of the selected video segment together with a visual indication of the weighted aggregate score for the selected video segment.
5 . The method of claim 4 , further comprising:
after selecting the updated selected video segment, updating the preview based on the updated selected video segment and updating the visual indication based on the recomputed weighted aggregate score.
6 . The method of claim 1 , wherein outputting the updated selected video segment comprises:
computing a respective frame difference between a start and an end frame of each respective reranked video segment; and
selecting the updated selected video segment to be a reranked video segment having a respective frame difference that falls within a defined difference threshold.
7 . The method of claim 1 , wherein outputting the updated selected video segment comprises:
computing a frame difference between a start and an end frame of the updated selected video segment;
in response to the frame difference exceeding a defined difference threshold, defining a frame previous to the end frame as a new end frame or defining a frame following the start frame as a new start frame; and
repeating the computing and the defining until the frame difference falls within the defined difference threshold.
8 . The method of claim 1 , wherein computing the respective set of scores for each respective video segment comprises, for a given video segment:
generating each respective score in the set of scores by processing the given video segment using a respective trained content feature extraction model.
9 . The method of claim 8 , wherein the respective trained content feature extraction model includes at least one of:
a trained action prediction model;
a trained emotion prediction model;
a trained cheering prediction model;
a trained speed detection model; or
a trained loop detection model.
10 . The method of claim 1 , further comprising:
partitioning the video into the one or more video segments by computing an amount of change between every pair of two consecutive frames of the video; and
defining a start frame of a video segment when the computed amount of change exceeds a defined scene change threshold.
11 . The method of claim 1 , further comprising:
prior to outputting the updated selected video segment as the customized video segment, detecting a region of interest (ROI) in the selected video segment; and
zooming in on the ROI in the updated selected video segment.
12 . The method of claim 1 , further comprising:
prior to outputting the updated selected video segment as the customized video segment, defining a plurality of frames at a start of the updated selected video segment as variable start frames or defining a plurality of frames at an end of the updated selected video segment as variable end frames; and
outputting the customized video segment to have a variable length, wherein the variable length is variable based on a random selection of one of the variable start frames as a first frame of the customized video segment or a random selection of one of the variable end frames as a last frame of the customized video segment.
13 . The method of claim 1 , wherein the customized video segment is outputted in an animated GIF format.
14 . A computing device comprising:
a processing unit configured to execute instructions to cause the computing device to perform a method comprising:
computing, for each respective video segment of one or more video segments of the video, each video segment having two or more frames, a respective set of scores, each score representing a respective content feature in the respective video segment;
receiving, from a user device, user input including a selection of one or more user-selected weight values to be applied to each respective set of scores;
computing a respective weighted aggregate score for each respective video segment by applying, to each respective set of scores, a common set of weight values including the user-selected one or more weight values; selecting a selected video segment as the customized video segment, the selected video segment being selected from one or more high-ranked video segments having high-ranked weighted aggregate scores;
receiving, from the user device, a changed user input that causes the common set of weight values to change to a changed common set of weight values;
recomputing the respective weighted aggregate score for each respective video segment using the changed common set of weight values;
selecting an updated selected video segment as the customized video segment, based on the updated selected video segment being one of one or more reranked video segments having high-ranked recomputed weighted aggregate scores; and
outputting the updated selected video segment as the customized video segment.
15 . The computing device of claim 14 , wherein the instructions cause the computing device to perform the method further comprising:
receiving, from the user device, further user input including a user-submitted query;
comparing a query feature vector representing features of the user-submitted query with a respective video segment feature vector representing features of each respective high-ranked reranked video segment; and
selecting the reranked video segment represented by the video segment feature vector having a highest similarity with the query feature vector as the updated selected video segment.
16 . The computing device of claim 14 , wherein the instructions cause the computing device to perform the method further comprising:
prior to receiving the changed user input, providing output to the computing device to cause the computing device to provide a preview of the selected video segment together with a visual indication of the weighted aggregate score for the selected video segment; and
after selecting the updated selected video segment, updating the preview based on the updated selected video segment and updating the visual indication based on the recomputed weighted aggregate score.
17 . A non-transitory computer readable medium storing instructions thereon, wherein the instructions are executable by a processing unit of a computing device to cause the computing device to perform a method comprising:
computing, for each respective video segment of one or more video segments of the video, each video segment having two or more frames, a respective set of scores, each score representing a respective content feature in the respective video segment;
receiving, from a user device, user input including a selection of one or more user-selected weight values to be applied to each respective set of scores;
computing a respective weighted aggregate score for each respective video segment by applying, to each respective set of scores, a common set of weight values including the user-selected one or more weight values;
selecting a selected video segment as the customized video segment, the selected video segment being selected from one or more high-ranked video segments having high-ranked weighted aggregate scores;
receiving, from the user device, a changed user input that causes the common set of weight values to change to a changed common set of weight values;
recomputing the respective weighted aggregate score for each respective video segment using the changed common set of weight values;
selecting an updated selected video segment as the customized video segment, based on the updated selected video segment being one of one or more reranked video segments having high-ranked recomputed weighted aggregate scores; and
outputting the updated selected video segment as the customized video segment.
18 . The non-transitory computer readable medium of claim 17 , wherein the instructions cause the computing device to perform the method further comprising:
receiving, from the user device, further user input including a user-submitted query;
comparing a query feature vector representing features of the user-submitted query with a respective video segment feature vector representing features of each respective reranked video segment; and
selecting the reranked video segment represented by the video segment feature vector having a highest similarity with the query feature vector as the updated selected video segment.
19 . The non-transitory computer readable medium of claim 17 , wherein the instructions cause the computing device to perform the method further comprising:
prior to receiving the changed user input, providing output to the computing device to cause the computing device to provide a preview of the selected video segment together with a visual indication of the weighted aggregate score for the selected video segment; and
after selecting the updated selected video segment, updating the preview based on the updated selected video segment and updating the visual indication based on the recomputed weighted aggregate score.