Animal video highlights clip editing method, device, storage medium, and program product
By building an animal behavior scoring model, we can automatically extract and edit highlights from animal videos, solving the problem of low efficiency in existing technologies, achieving efficient and accurate video editing, and improving content creation efficiency and audience experience.
Patent Information
- Application Number
- CN202411001925.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-25
AI Technical Summary
Existing technology is difficult to extract highlights from a large number of animal videos quickly and efficiently. It mainly relies on manual operations, which is time-consuming, labor-intensive and inefficient.
By constructing the first model parameter set and the second model parameter set of various animals, human-like behavior scoring models and conventional behavior scoring models are generated, video clips are automatically extracted from the original videos, and animal highlights are determined based on comprehensive scores and curves. The starting and ending moments to realize automated editing.
It significantly improves the efficiency of video creation and editing, reduces manual judgment bias, improves the accuracy of obtaining the climax of the video, increases the entertainment and attractiveness of animal highlights, and simplifies the content production process.
Smart Images

Figure CN118540423B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method, device, storage medium, and program product for editing highlights of animal videos. Background Art
[0002] With the rapid development of digital camera technology and the continued prosperity of the pet market, people's demand for recording and sharing animal video content is growing. However, due to the accelerated pace of modern life, the time people can devote to observing animal behavior and capturing wonderful moments has become limited. In addition, the popularity of live broadcasting and video surveillance has generated a huge amount of video data, making it a technical challenge to quickly extract the highlights of animal videos from these data. At present, the editing of such highlights mainly relies on manual operation, which is not only time-consuming and labor-intensive, but also inefficient. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure provide a method, device, storage medium, and program product for editing animal video highlights, which can automatically identify and edit animal highlights from original videos of animals, significantly improving the efficiency of video creation and editing.
[0004] In a first aspect, the embodiments of the present disclosure provide a method for editing highlights of animal videos, which adopts the following technical solutions:
[0005] Constructing a first model parameter set and a plurality of second model parameter sets for a plurality of animals;
[0006] Obtaining an original video of an animal, and detecting the type of the animal in the original video;
[0007] selecting a first parameter set from a plurality of first model parameter sets according to the category;
[0008] selecting a second parameter set from a plurality of second model parameter sets according to the category;
[0009] Deploying the first parameter set into a first model to generate a human-like behavior scoring model;
[0010] deploying the second parameter set into a second model to generate a conventional behavior scoring model;
[0011] Extracting multiple video clips from the original video;
[0012] Based on the human-like behavior scoring model, respectively evaluate the multiple video clips to obtain first scores of the multiple video clips;
[0013] Based on the conventional behavior scoring model, respectively evaluate the multiple video clips to obtain second scores of the multiple video clips;
[0014] Based on the first scores and the second scores of the multiple video clips, obtaining comprehensive scores of the multiple video clips;
[0015] constructing a curve graph based on the comprehensive scores of the multiple video clips;
[0016] Obtaining the maximum score in the curve graph, and determining the start time and the end time of the animal highlight segment based on the maximum score;
[0017] Based on the start time and the end time of the animal highlight segment, the animal highlight segment is edited from the original video.
[0018] Optionally, constructing a first model parameter set and a plurality of second model parameter sets for a plurality of animals comprises:
[0019] Acquire human-like behavior datasets and conventional behavior datasets of the plurality of animals;
[0020] The first model is trained and optimized using the human-like behavior data set, and after the training and optimization are completed, the parameters of the first model are encapsulated into the first model parameter set;
[0021] The second model is trained and optimized using the conventional behavior data set, and after the training and optimization are completed, the parameters of the second model are encapsulated into the second model parameter set.
[0022] Optionally, extracting a plurality of video clips from the original video includes:
[0023] Obtain the total duration of the original video;
[0024] When the total duration is divisible by a preset time interval, extracting a plurality of video segments of equal length from the original video according to the preset time interval;
[0025] When the total duration cannot be divided by the preset time interval, obtaining a remainder obtained by dividing the total duration by the preset time interval;
[0026] According to half of the remainder, setting a starting point extracted from the original video;
[0027] From the starting point, a plurality of video segments of equal length are extracted from the original video at preset time intervals.
[0028] Optionally, the calculation formula of the comprehensive score is:
[0029] F i =a*F1-b*F2;
[0030] Where i is the number of the video clip; F i is the comprehensive score of the ith video clip; a and b are weight values; F1 is the first score of the ith video clip; F2 is the second score of the ith video clip.
[0031] Optionally, it also includes:
[0032] determining a commonality level of the animal in the original video according to the species;
[0033] b is determined based on the common level.
[0034] Optionally, constructing a curve graph based on the comprehensive scores of the multiple video clips includes:
[0035] Obtaining the starting time points and the ending time points of the multiple video clips in the original video;
[0036] Construct the xoy coordinate system;
[0037] Based on the starting time point, the ending time point and the comprehensive score, obtaining coordinates of multiple video clips;
[0038] Based on the coordinates of the plurality of video clips, constructing a plurality of base points in the xoy coordinate system;
[0039] Connecting the plurality of base points in sequence to generate a curve graph;
[0040] Among them, the coordinates of the i-th video clip are (x i ,y i );
[0041] x i =(Q i1 + Q i2 ) / 2;
[0042] y i = F i ;
[0043] Where i is the number of the video clip; x i is the horizontal coordinate value of the i-th video clip in the xoy coordinate system; i is the ordinate value of the i-th video segment in the xoy coordinate system; Q i1 is the starting time point of the i-th video segment in the original video; Q i2 is the ending time point of the i-th video segment in the original video; F i is the comprehensive score of the i-th video clip.
[0044] Optionally, determining the start time and end time of the animal highlight segment based on the maximum score includes:
[0045] determining in the curve graph whether there are valleys on both sides of the maximum score;
[0046] If yes, the x values of the two troughs adjacent to the maximum score are used as the starting time and the ending time respectively;
[0047] If not, determining a plurality of coordinate points whose y values are equal to a preset threshold value from the curve graph;
[0048] Obtaining the x values of the multiple coordinate points;
[0049] Obtaining the absolute values of the differences between the x values of the plurality of coordinate points and the maximum score respectively;
[0050] The absolute values are sorted from small to large, and the x values corresponding to the first two absolute values are used as the start time and the end time respectively.
[0051] Optionally, it also includes:
[0052] If there is no coordinate point with a y value equal to the preset threshold in the curve graph or there is only one coordinate point with a y value equal to the preset threshold, the preset threshold is subtracted from the preset parameter, and the subtraction result is used as the new preset threshold.
[0053] Optionally, it also includes:
[0054] determining a commonality level of the animal in the original video according to the species;
[0055] An initial value of a preset threshold is determined according to the common level.
[0056] In a second aspect, the disclosed embodiment further provides a system for editing animal video highlights, which adopts the following technical solution:
[0057] A model parameter set construction module, used to construct a first model parameter set and a plurality of second model parameter sets for a plurality of animals;
[0058] An animal species detection module is used to obtain an original video of an animal and detect the species of the animal in the original video;
[0059] A first parameter set selection module, configured to select a first parameter set from a plurality of first model parameter sets according to the category;
[0060] A second parameter set selection module, configured to select a second parameter set from a plurality of second model parameter sets according to the category;
[0061] A first parameter set deployment module, used to deploy the first parameter set into a first model to generate a human-like behavior scoring model;
[0062] A second parameter set deployment module, used to deploy the second parameter set into a second model to generate a conventional behavior scoring model;
[0063] A video segment extraction module, used to extract multiple video segments from the original video;
[0064] A first score acquisition module, configured to evaluate the plurality of video clips respectively based on the human-like behavior scoring model to acquire first scores of the plurality of video clips;
[0065] A second score acquisition module, configured to evaluate the plurality of video clips respectively based on the conventional behavior scoring model to acquire second scores of the plurality of video clips;
[0066] A comprehensive score acquisition module, configured to acquire comprehensive scores of the plurality of video clips based on the first scores and the second scores of the plurality of video clips;
[0067] A curve graph construction module, used for constructing a curve graph based on the comprehensive scores of the plurality of video clips;
[0068] A start and end time determination module, used to obtain the maximum score in the curve graph, and determine the start and end time of the animal highlight segment based on the maximum score;
[0069] The animal highlight clipping module is used to clip the animal highlight clip from the original video based on the start time and end time of the animal highlight clip.
[0070] In a third aspect, the embodiments of the present disclosure further provide a computer device, which adopts the following technical solution:
[0071] The computer device comprises:
[0072] at least one processor; and,
[0073] a memory communicatively connected to the at least one processor; wherein,
[0074] 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 so that the at least one processor can execute any of the above-mentioned methods for editing highlights of animal videos.
[0075] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above-mentioned methods for editing animal video highlights.
[0076] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program / instruction, which implements the steps of any of the above methods when executed by a processor.
[0077] The method for editing animal video highlights provided by the embodiment of the present disclosure creates exclusive first model parameter sets and second model parameter sets for multiple animals according to the characteristics of different animal species, and then finds the first parameter set and second parameter set exclusive to the animal species in the original video from multiple first model parameter sets and multiple second model parameter sets by analyzing the animal species in the original video, and then combines the first parameter set with the first model to generate an exclusive human-like behavior scoring model, and combines the second parameter set with the second model to generate an exclusive conventional behavior scoring model. Extract multiple video clips from the original video, and use the exclusive human-like behavior scoring model and conventional behavior scoring model to perform personalized evaluation of the human-like behavior and conventional behavior of the animal in each video clip, while considering the two dimensions of human-like behavior and conventional behavior, providing a comprehensive perspective for the scoring of video clips, and improving the accuracy of recognition and scoring. Through the calculation of the comprehensive score and the construction of the curve chart, as well as the acquisition of the maximum score, the start and end times of the climax of the animal behavior in the original video can be quickly located, thereby improving the editing efficiency, and the animal highlights are determined based on the scoring results of the data and model, reducing the deviation of subjective judgment and improving the accuracy of obtaining the climax of the original video. This method detects and evaluates animal behavior in videos by automated methods, reducing the time and effort required for manual editing. By highlighting the interesting or unusual behavior of animals, it increases the entertainment and appeal of animal highlights and improves the viewing experience of viewers.
[0078] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0080] Figure 1 A schematic diagram of a flow chart of a method for editing animal video highlights provided by an embodiment of the present disclosure;
[0081] Figure 2A flow chart of a parameter set construction method provided in an embodiment of the present disclosure;
[0082] Figure 3 A schematic diagram of a flow chart of a video clip extraction method provided in an embodiment of the present disclosure;
[0083] Figure 4 A schematic diagram of a flow chart of a method for constructing a curve graph provided in an embodiment of the present disclosure;
[0084] Figure 5 A schematic diagram of a flow chart of a method for obtaining a start time and an end time provided in an embodiment of the present disclosure;
[0085] Figure 6 A functional block diagram of a system for editing animal video highlights provided by an embodiment of the present disclosure;
[0086] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0087] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0088] It should be clear that the following embodiments of the present disclosure are described by specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0089] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0090] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0091] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0092] Reference Figure 1 The present invention provides a method for editing highlights of animal videos, comprising the following steps:
[0093] S1: constructing a first model parameter set and multiple second model parameter sets for multiple animals;
[0094] S2: Obtain the original video of the animal and detect the type of the animal in the original video;
[0095] S3: selecting a first parameter set from a plurality of first model parameter sets according to the type;
[0096] S4: selecting a second parameter set from a plurality of second model parameter sets according to the type;
[0097] S5: deploying the first parameter set into the first model to generate a human-like behavior scoring model;
[0098] S6: deploying the second parameter set into the second model to generate a regular behavior scoring model;
[0099] S7: extract multiple video clips from the original video;
[0100] S8: Based on the human-like behavior scoring model, evaluate the multiple video clips respectively to obtain first scores of the multiple video clips;
[0101] S9: Based on the conventional behavior scoring model, the multiple video clips are evaluated respectively to obtain second scores of the multiple video clips;
[0102] S10: Obtaining comprehensive scores of the multiple video clips based on the first scores and the second scores of the multiple video clips;
[0103] S11: constructing a curve graph based on the comprehensive scores of multiple video clips;
[0104] S12: Obtaining the maximum score in the curve graph, and determining the start time and end time of the animal highlight segment based on the maximum score;
[0105] S13: based on the start time and the end time of the animal highlight segment, the animal highlight segment is edited from the original video.
[0106] The animal video highlight clip editing method disclosed in the present invention creates exclusive first model parameter sets and second model parameter sets for multiple animals according to the behavioral characteristics of different animal species, then finds the first parameter set and the second parameter set exclusive to the animal species in the original video from multiple first model parameter sets and multiple second model parameter sets by analyzing the animal species in the original video, then combines the first parameter set with the first model to generate an exclusive human-like behavior scoring model, and combines the second parameter set with the second model to generate an exclusive conventional behavior scoring model. Extract multiple video clips from the original video, use the exclusive human-like behavior scoring model and the conventional behavior scoring model to perform personalized evaluation on the human-like behavior and conventional behavior of the animal in each video clip, and consider the two dimensions of human-like behavior and conventional behavior at the same time, provide a comprehensive perspective for the scoring of the video clips, and improve the accuracy of recognition and scoring. Through the calculation of the comprehensive score and the construction of the curve chart, as well as the acquisition of the maximum score, the start and end times of the climax of the animal behavior in the original video can be quickly located, thereby improving the editing efficiency, and the animal highlight clips are determined based on the scoring results of the data and the model, thereby reducing the deviation of subjective judgment and improving the accuracy of obtaining the climax of the original video.
[0107] In summary, this method detects and evaluates animal behaviors in videos through an automated method, reducing the time and effort required for manual editing. By highlighting the interesting or unusual behaviors of animals, the entertaining and attractive animal highlights are increased, thus improving the audience's viewing experience. This method can be easily extended to more types of animals or more types of video content by simply adding the corresponding first model parameter set and multiple second model parameter sets. The scoring criteria and editing strategies can also be customized according to the specific needs of users, providing more personalized services, and providing content creators with a powerful tool to help them quickly extract exciting content from a large number of videos and accelerate the content production process.
[0108] Reference Figure 2 A flow chart of a parameter set construction method is shown, in which in S1, a first model parameter set and a plurality of second model parameter sets for a plurality of animals are constructed, comprising the following steps:
[0109] S011: Obtain human-like behavior datasets and regular behavior datasets of various animals;
[0110] S012: training and optimizing the first model using the human-like behavior data set, and after the training and optimization are completed, encapsulating the parameters of the first model into a first model parameter set;
[0111] S013: Use a conventional behavior data set to train and optimize the second model. After the training and optimization are completed, encapsulate the parameters of the second model into a second model parameter set.
[0112] In S011, an animal set containing multiple animals is set up. For each animal in the animal set, videos containing the animal showing human-like behaviors (referred to as human-like behaviors) are collected to ensure that the number of collected videos is sufficient and the types are diverse. Videos with high quality and obvious behaviors are screened out from the collected videos to ensure the accuracy and availability of the data set. Each screened video is carefully annotated, including marking key information such as the type of human-like behavior, the specific time points when the behavior starts and ends, etc. After all videos are annotated, all annotated human-like behavior videos of the same animal are integrated together to form a structured human-like behavior data set. The human-like behavior data set of each animal is verified to ensure the consistency and accuracy of the annotations and eliminate possible errors or omissions. The human-like behavior data set is further optimized, including balancing the number of samples of different behavior types and performing data enhancement.
[0113] Similarly, for each animal in the animal set, collect videos containing the animal's routine behaviors to ensure that the number of collected videos is sufficient and the types are diverse. Screen out high-quality videos with obvious behaviors from the collected videos to ensure the accuracy and availability of the data set. Perform detailed annotation work on each screened video, including marking key information such as the type and characteristics of routine behaviors. After completing the annotation of all videos, integrate all the annotated routine behavior videos of the same animal to form a structured routine behavior data set. Verify the routine behavior data set of each animal to ensure the consistency and accuracy of the annotations and eliminate possible errors or omissions. Further optimize the routine behavior data set, including balancing the number of samples of different behavior types and performing data enhancement.
[0114] In S012, a 3D CNN model (3D Convolutional Neural Network) is selected as the first model, which may be C3D or I3D. The humanoid behavior data set is divided into a first training set and a first validation set according to a preset ratio. The first training set is used to train the first model to learn the characteristics of identifying the humanoid behavior of animals from the video. During the training process, the hyperparameters of the first model are adjusted, including adjusting the learning rate, batch size, training cycle, etc. The trained first model is verified by the first validation set to evaluate the performance of the model in practical applications, especially its ability to identify humanoid behavior. According to the feedback results of the first validation set, the first model is optimized. The optimized first model can more accurately identify the humanoid behavior of animals and give a reasonable evaluation score. The optimized first model is comprehensively evaluated to analyze its performance on different types of humanoid behavior videos to ensure that the first model has good generalization ability and accuracy. The training and optimization of the first model is regarded as an iterative process, and the first model is continuously improved according to the results of each iteration until the expected performance standard is reached. The parameters of the first model finally obtained are encapsulated to generate a first model parameter set. It is worth noting that each animal in the animal set corresponds to a first model parameter set. Based on the above, it can be seen that the first model parameter set is a set of model parameters obtained after training and optimization in the video analysis task of the first model for an animal's human-like behavior.
[0115] In S013, the YOLO model (You Only Look Once) is selected as the second model. Specifically, any version of YOLOv8, YOLOv7, YOLOv6 or YOLOv5 can be selected. The routine behavior data set is divided into a second training set and a second validation set according to a preset ratio. The second training set is used to train the second model to learn to identify the characteristics of the routine behavior of animals from the video. During the training process, the hyperparameters of the second model are adjusted, including adjusting the learning rate, batch size, training cycle, etc. The trained second model is verified by the second validation set to evaluate the performance of the model in practical applications, especially its ability to identify routine behaviors. According to the feedback results of the second validation set, the second model is optimized. The optimized second model can more accurately identify the routine behavior of animals and give a reasonable evaluation score. The optimized second model is comprehensively evaluated to analyze its performance on different types of human-like behavior videos to ensure that the second model has good generalization ability and accuracy. The training and optimization of the second model is regarded as an iterative process, and the second model is continuously improved according to the results of each iteration until the expected performance standard is reached. The parameters of the second model finally obtained are encapsulated to generate a second model parameter set. It is worth noting that each animal in the animal set corresponds to a second model parameter set. Based on the above, it can be seen that the second model parameter set is a set of model parameters obtained after training and optimization in the video analysis task of the second model for the routine behavior of an animal.
[0116] In S2, the original video of the animal is obtained. The original video can specify the source, such as surveillance video, live video, etc., as well as other forms of recorded video. The classification model is used to detect the type of animal in the original video.
[0117] Among them, ResNet (Residual Network), Inception (InceptionNetwork) or MobileNet (Mobile Network) is selected as the classification model, and a large number of videos containing animals are collected to ensure that the videos cover different environments, lighting conditions and animal behaviors. Image frames are extracted from these videos to build an image data set, and image preprocessing is performed on each image frame in the image data set, including scaling, cropping, color correction, etc., to identify and annotate the animal species in each image frame. The annotated image data set is divided into a third training set, a third validation set and a test set. The classification model is trained using the third training set data. After the training is completed, the performance of the classification model is evaluated on the third validation set, and the model is optimized based on the evaluation results. The final classification model is tested on the test set to ensure that the classification model has good generalization ability.
[0118] In S3-S6, according to the type of animal detected in the original video, a corresponding first model parameter set is selected from a plurality of first model parameter sets and recorded as a first parameter set, and the first parameter set is deployed in the first model to generate a human-like behavior scoring model for the type. According to the type of animal detected in the original video, a corresponding second model parameter set is selected from a plurality of second model parameter sets and recorded as a second parameter set, and the second parameter set is deployed in the second model to generate a conventional behavior scoring model for the type.
[0119] Reference Figure 3 The flowchart of the video clip extraction method is shown, in S7, extracting multiple video clips from the original video, including the following steps:
[0120] S071: Obtain the total duration of the original video;
[0121] S072: Determine whether the total duration is divisible by the preset time interval; if it is divisible, execute S073; if it is not divisible, execute S074;
[0122] S073: extracting a plurality of video clips of equal length from the original video at a preset time interval;
[0123] S074: Obtain the remainder obtained by dividing the total duration by the preset time interval;
[0124] S075: setting a starting point extracted from the original video according to half of the remainder;
[0125] S076: Extracting a plurality of video segments of equal length from the original video at a preset time interval from the starting point.
[0126] Take an example to illustrate the above: if the total length of the original video is 30 minutes, the preset time interval is 2 minutes, and 30 minutes is divisible by 2 minutes, then 15 video clips of 2 minutes each are extracted from the original video. If the total length of the original video is 31 minutes, the preset time interval is 2 minutes, and 31 minutes is not divisible by 2 minutes, then the remainder of 31 minutes divided by 2 minutes is obtained, which is 1 minute, and half of this 1 minute is obtained, which is 30 seconds. Taking the 30th second of the original video as the starting point, 15 video clips of 2 minutes each are extracted, from the 30th minute and 30 seconds to the 31st minute of the original video. Since the length is less than 2 minutes, it does not need to be extracted as a separate video clip.
[0127] In S8 and S9, the multiple video clips are respectively input into the human-like behavior scoring model, and the human-like behavior scoring model evaluates the input video clips and gives evaluation scores of the video clips, which are recorded as first scores. The multiple video clips are respectively input into the conventional behavior scoring model, and the conventional behavior scoring model evaluates the input video clips and gives evaluation scores of the video clips, which are recorded as second scores.
[0128] In S10, for each video clip, a comprehensive score is calculated according to its first score and second score. The calculation formula of the comprehensive score is:
[0129] F i =a*F1-b*F2;
[0130] Where i is the number of the video clip; F i is the comprehensive score of the ith video clip; a and b are weight values; F1 is the first score of the ith video clip; F2 is the second score of the ith video clip.
[0131] Furthermore, the commonness level of the animals in the original video is determined according to the species, and b is determined based on the commonness level. The higher the commonness level, the larger b. For example, the Chinese rural dog is the third level, b is 3, the chinchilla is the second level, b is 2.3, and the panda is the first level, b is 1.5.
[0132] Reference Figure 4 A flow chart of a curve graph construction method is shown. In S11, a curve graph is constructed based on the comprehensive scores of multiple video clips, including the following steps:
[0133] S111: Obtaining the starting time points and ending time points of multiple video clips in the original video;
[0134] S112: construct xoy coordinate system;
[0135] S113: Obtaining coordinates of multiple video clips based on the start time point, the end time point, and the comprehensive score;
[0136] S114: constructing a plurality of base points in the xoy coordinate system based on the coordinates of the plurality of video clips; and connecting the plurality of base points in sequence to generate a curve graph.
[0137] In S111, for two adjacent video clips, the end time point of the previous video clip is the start time point of the next video clip. For example, if the total duration of the original video is 31 minutes and the preset time interval is 2 minutes, the start time point of the first video clip in the original video is the 30th second and the end time point is the 2nd minute and 30 seconds, the start time point of the second video clip in the original video is the 2nd minute and 30 seconds and the end time point is the 4th minute and 30 seconds, and so on, the start time point of the 15th video clip in the original video is the 28th minute and 30 seconds and the end time point is the 30th minute and 30 seconds.
[0138] In S112, the x-axis of the xoy coordinate system represents time, the y-axis represents the comprehensive score, and the x-value of point o may be the starting time point of the first video segment in the original video.
[0139] In S113, the coordinates of the i-th video segment are (x i ,y i );
[0140] x i =(Q i1 + Q i2 ) / 2;
[0141] y i = F i ;
[0142] Where i is the number of the video clip; x i is the horizontal coordinate value of the i-th video clip in the xoy coordinate system; i is the ordinate value of the i-th video segment in the xoy coordinate system; Q i1 is the starting time point of the i-th video segment in the original video; Q i2 is the ending time point of the i-th video segment in the original video; F i is the comprehensive score of the i-th video clip.
[0143] In S114 , the coordinates of the plurality of video clips form points in the xoy coordinate system, and these points are recorded as base points.
[0144] In S115, multiple base points are connected in sequence to form a curve graph. This curve graph has a predictive effect because in addition to the base points, there are countless points on the curve, and the y values of these points are equivalent to the predicted values of the comprehensive scores of the original video at different time points.
[0145] In S12, obtain the maximum score in the curve graph, refer to Figure 5 The flowchart of the method for obtaining the start time and the end time is shown, and the start time and the end time of the animal highlight clip are determined based on the maximum score, including the following steps:
[0146] S121: Determine whether there are valleys on both sides of the maximum score in the curve graph; if so, execute S122; if not, execute S123;
[0147] S122: taking the x values of the two troughs adjacent to the maximum score as the starting time and the ending time respectively;
[0148] S123: Determine from the curve graph a plurality of coordinate points whose y values are equal to a preset threshold value;
[0149] S124: Obtain x values of multiple coordinate points;
[0150] S125: Obtaining the absolute values of the differences between the x values of the plurality of coordinate points and the maximum score respectively;
[0151] S126: Sort the absolute values from small to large, and use the x values corresponding to the first two absolute values as the start time and the end time respectively.
[0152] In S122, for two troughs adjacent to the maximum score, the x value of the trough on the left side of the maximum score is used as the start time, and the x value of the trough on the right side of the maximum score is used as the end time.
[0153] In S123, the curve of the curve graph includes numerous points, including base points and points formed by connecting the base points. A plurality of points whose y values are equal to a preset threshold are determined from the curve graph, and these points are recorded as coordinate points.
[0154] In S125, the x value of the coordinate point is subtracted from the maximum score to obtain the difference between the two, and then the absolute value of the difference is obtained.
[0155] In S126, the difference corresponding to the first two absolute values is obtained. One of the two differences must be negative and the other must be positive. If the difference is negative, the x value corresponding to the difference is the starting time. If the difference is positive, the x value corresponding to the difference is the ending time.
[0156] Furthermore, if there is no coordinate point in the curve graph whose y value is equal to the preset threshold or there is only one coordinate point with the y value equal to the preset threshold, the preset threshold is subtracted from the preset parameter, and the subtraction result is used as the new preset threshold to determine whether there is a coordinate point in the curve graph whose y value is equal to the new preset threshold. If there is still no coordinate point or there is only one coordinate point with the y value equal to the new preset threshold, the preset threshold is continued to be updated in the above-mentioned manner of subtracting the preset parameter until at least two coordinate points with y values equal to the preset threshold can be determined from the curve graph.
[0157] Further, the initial value of the preset threshold is determined according to the common level of animals in the original video, and the higher the common level, the higher the initial value of the preset threshold.
[0158] In S13, according to the above-obtained start time and end time, animal highlights are edited from the original video.
[0159] The above content is for the original video that only includes one animal. First, the comprehensive score of each video clip is evaluated based on the first model and the second model, and then the comprehensive score of the video clip at each time is predicted by constructing a curve graph, so as to more accurately determine the starting and ending times of the animal highlights, thereby editing out animal highlights with good effects.
[0160] When the original video includes two or more animals, a multimodal deep learning model is used to process the original video. Through the definition of animal highlights and combined with the video understanding ability of the multimodal deep learning model, the multimodal deep learning model automatically identifies the original video content and gives the location of the believed animal highlights in the original video, including the start and end times, which can be specific to minutes or seconds. The multimodal deep learning model can also output the length of the animal highlights and the corresponding overview of the highlights.
[0161] Through the video editing software package, the animal highlights are captured from the original video according to the start time, end time and length of the animal highlights video returned by the multimodal deep learning model. The captured animal highlights and the description of the highlights are given to the multimodal deep learning model again, and the multimodal deep learning model selects a frame that best reflects the highlights according to the description as the cover of the animal highlights.
[0162] The multimodal deep learning model can also generate text content for animal highlights based on animal highlights and wonderful information descriptions, such as anthropomorphic dialogues between animals, sound effect prompts, etc. While generating the above content, it will also return the corresponding text time point, that is, at which specific time point in the animal highlight clip the text content should be displayed.
[0163] Select the transition video frame as the highlight frame, give the copy content of the highlight frame, and associate the copy content with the highlight frame. According to the difference in video content before and after the transition, you can add corresponding transition copy. For example, after two puppies play and fight, one puppy starts to leave. During the process of leaving, it looks back at the other puppy and then continues to walk out of the video screen. At this time, according to the changes in video content before and after the puppy turns back, generate a transition copy "I want to go home, play next time~".
[0164] The text content, text time point, text content of the highlight frames, transition text and animal highlight clips of the animal highlight clips are input into the video synthesis system at the same time, which synthesizes these texts into the animal highlight clips, and selects appropriate special effects based on these texts to add to the animal highlight clips to generate new animal highlight clips.
[0165] Specifically, the multimodal deep learning model uses the learned video understanding ability to judge the difference between the current picture before and after, to increase the special effects that can be added in the current scene, and randomly selects one of them to add. For example, a slow motion special effect is used when the puppy turns its head to emphasize the emotional depth of this action.
[0166] The new animal highlight clips are input into the audio generation model. The audio generation model analyzes the content of the new animal highlight clips, generates a sound effect that matches the style of the new animal highlight clips, and automatically synthesizes a video with sound. The audio generation model also supports manual input of style to meet the personalized needs of creators.
[0167] In addition to video comprehension capabilities, during the learning process, multimodal deep learning models use videos with audio. With a large amount of video material training, multimodal deep learning models can learn what kind of music style, special effects sound, or background music is associated with a certain type of material. For example, if puppies are fighting in a video, sound effects that match the battle scene are added; if puppies are barking at each other, funny audio from a certain region is added.
[0168] This method, which makes full use of the versatility and video understanding capabilities of multimodal deep learning models, can automatically identify and highlight the highlights in animal videos, and then combine natural language processing technology to achieve efficient analysis and editing of animal video content. Through this automated processing, the workload of video copywriting and script compilation has been greatly reduced, which not only improves work efficiency but also adds novelty to video content. In addition, through intelligent analysis, the selection and synthesis time of covers, copywriting, and sound effects in the video editing process is effectively shortened, and by accurately matching sound effects, special effects, and copywriting, the professional quality and viewing experience of animal highlights are further improved, the coordination and attractiveness of the audio-visual experience are enhanced, and users are provided with a rich and immersive viewing experience.
[0169] Moreover, for multimodal deep learning models, manual labeling of animal highlights is low-cost, and new unlabeled animal highlights can be automatically identified, which has higher discovery capabilities, reduces the animal video copywriting and script editing process, adds more novelty, and reduces the selection and synthesis time of videos, copywriting, and background sound effects.
[0170] Reference Figure 6 The present disclosure provides a system for editing animal video highlights, comprising:
[0171] A model parameter set construction module 101 is used to construct a first model parameter set and a plurality of second model parameter sets for a plurality of animals;
[0172] The animal species detection module 102 is used to obtain the original video of the animal and detect the species of the animal in the original video;
[0173] A first parameter set selection module 103, configured to select a first parameter set from a plurality of first model parameter sets according to the type;
[0174] A second parameter set selection module 104, configured to select a second parameter set from a plurality of second model parameter sets according to the type;
[0175] A first parameter set deployment module 105, configured to deploy the first parameter set into the first model to generate a human-like behavior scoring model;
[0176] A second parameter set deployment module 106, configured to deploy the second parameter set into the second model to generate a conventional behavior scoring model;
[0177] The video segment extraction module 107 is used to extract multiple video segments from the original video;
[0178] A first score acquisition module 108, configured to evaluate the plurality of video clips respectively based on the human-like behavior scoring model to acquire first scores of the plurality of video clips;
[0179] A second score acquisition module 109, configured to evaluate the plurality of video clips respectively based on a conventional behavior scoring model to acquire second scores of the plurality of video clips;
[0180] A comprehensive score acquisition module 110, configured to acquire comprehensive scores of the plurality of video clips based on the first scores and the second scores of the plurality of video clips;
[0181] A curve graph construction module 111, configured to construct a curve graph based on comprehensive scores of multiple video clips;
[0182] A start and end time determination module 112, for obtaining the maximum score in the curve graph, and determining the start and end time of the animal highlight segment based on the maximum score;
[0183] The animal highlight clipping module 113 is used to clip the animal highlight clips from the original video based on the start time and end time of the animal highlight clips.
[0184] The various variations and specific examples of the animal video highlight clip editing method provided above are also applicable to the animal video highlight clip editing system provided in the present invention. Through the above detailed description of the animal video highlight clip editing method, those skilled in the art can clearly know the implementation method of the animal video highlight clip editing system. For the sake of brevity of the specification, it will not be described in detail here.
[0185] The computer device according to the embodiment of the present disclosure includes a memory and a processor. The memory is used to store non-temporary computer-readable instructions. Specifically, the memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc.
[0186] The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions. In one embodiment of the present disclosure, the processor is used to run the computer-readable instructions stored in the memory, so that the computer device performs all or part of the steps of the animal video highlight clip editing method of each embodiment of the present disclosure.
[0187] Those skilled in the art should be able to understand that in order to solve the technical problem of how to obtain a good user experience, the present embodiment may also include well-known structures such as a communication bus and an interface, and these well-known structures should also be included in the protection scope of the present disclosure.
[0188] like Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure is shown, which is a schematic diagram of the structure of a computer device suitable for implementing the embodiment of the present disclosure. Figure 7 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0189] like Figure 7 As shown, the computer device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the computer device are also stored. The processor, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0190] Typically, the following devices can be connected to the I / O interface: input devices such as sensors or visual information acquisition devices; output devices such as display screens; storage devices such as tapes, hard disks, etc.; and communication devices. The communication device can allow the computer device to communicate with other devices (such as edge computing devices) wirelessly or by wire to exchange data. Figure 7 A computer device having various devices is shown, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0191] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processor, all or part of the steps of the animal video highlight clip editing method of the embodiment of the present disclosure are executed.
[0192] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0193] According to the computer-readable storage medium of the embodiment of the present disclosure, non-transitory computer-readable instructions are stored thereon. When the non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the animal video highlight clip editing method of each embodiment of the present disclosure are executed.
[0194] The above-mentioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or mobile hard disk), media with built-in rewritable non-volatile memory (e.g., memory card) and media with built-in ROM (e.g., ROM box).
[0195] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0196] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0197] In the present disclosure, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The block diagrams of the devices, devices, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0198] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0199] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0200] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0201] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0202] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for editing highlights of animal videos, characterized in that: include: Constructing a first model parameter set and a plurality of second model parameter sets for a plurality of animals; Obtaining an original video of an animal, and detecting the type of the animal in the original video; selecting a first parameter set from a plurality of first model parameter sets according to the category; selecting a second parameter set from a plurality of second model parameter sets according to the category; Deploying the first parameter set into a first model to generate a human-like behavior scoring model; deploying the second parameter set into a second model to generate a conventional behavior scoring model; Extracting multiple video clips from the original video; Based on the human-like behavior scoring model, respectively evaluate the multiple video clips to obtain first scores of the multiple video clips; Based on the conventional behavior scoring model, respectively evaluate the multiple video clips to obtain second scores of the multiple video clips; Based on the first scores and the second scores of the multiple video clips, obtaining comprehensive scores of the multiple video clips; constructing a curve graph based on the comprehensive scores of the multiple video clips; Obtaining the maximum score in the curve graph, and determining the start time and the end time of the animal highlight segment based on the maximum score; Based on the start time and the end time of the animal highlight segment, editing the animal highlight segment from the original video; The calculation formula of the comprehensive score is: F i =a*F1-b*F2; Where i is the number of the video clip; F i is the comprehensive score of the i-th video clip; a and b are weight values; F1 is the first score of the i-th video clip; F2 is the second score of the i-th video clip; The step of constructing a curve graph based on the comprehensive scores of the plurality of video clips includes: Obtaining the starting time points and the ending time points of the multiple video clips in the original video; Construct the xoy coordinate system; Based on the starting time point, the ending time point and the comprehensive score, obtaining coordinates of multiple video clips; Based on the coordinates of the plurality of video clips, constructing a plurality of base points in the xoy coordinate system; Connecting the plurality of base points in sequence to generate a curve graph; Among them, the coordinates of the i-th video clip are (x i ,y i ); x i =(Q i1 +Q i2 ) / 2; y i =F i ; Where i is the number of the video clip; x i is the horizontal coordinate value of the i-th video clip in the xoy coordinate system; i is the ordinate value of the i-th video segment in the xoy coordinate system; Q i1 is the starting time point of the i-th video segment in the original video; Q i2 is the ending time point of the i-th video segment in the original video; F i is the comprehensive score of the i-th video clip; Wherein, determining the start time and end time of the animal highlight segment based on the maximum score includes: determining in the curve graph whether there are valleys on both sides of the maximum score; If yes, the x values of the two troughs adjacent to the maximum score are used as the starting time and the ending time respectively; If not, determining a plurality of coordinate points whose y values are equal to a preset threshold value from the curve graph; Obtaining the x values of the multiple coordinate points; Obtaining the absolute values of the differences between the x values of the plurality of coordinate points and the maximum score respectively; The absolute values are sorted from small to large, and the x values corresponding to the first two absolute values are used as the start time and the end time respectively.
2. The method for editing animal video highlights according to claim 1, characterized in that: The method of constructing a first model parameter set and a plurality of second model parameter sets for a plurality of animals comprises: Acquire human-like behavior datasets and conventional behavior datasets of the plurality of animals; The first model is trained and optimized using the human-like behavior data set, and after the training and optimization are completed, the parameters of the first model are encapsulated into the first model parameter set; The second model is trained and optimized using the conventional behavior data set, and after the training and optimization are completed, the parameters of the second model are encapsulated into the second model parameter set.
3. The method for editing animal video highlights according to claim 1, characterized in that: The step of extracting a plurality of video clips from the original video comprises: Obtain the total duration of the original video; When the total duration is divisible by a preset time interval, extracting a plurality of video segments of equal length from the original video according to the preset time interval; When the total duration cannot be divided by the preset time interval, obtaining a remainder obtained by dividing the total duration by the preset time interval; According to half of the remainder, setting a starting point extracted from the original video; From the starting point, a plurality of video segments of equal length are extracted from the original video at preset time intervals.
4. The method for editing animal video highlights according to claim 1, characterized in that: Also includes: If there is no coordinate point with a y value equal to the preset threshold in the curve graph or there is only one coordinate point with a y value equal to the preset threshold, the preset threshold is subtracted from the preset parameter, and the subtraction result is used as the new preset threshold.
5. A computer device, characterized in that: The computer device comprises: at least one processor; and, 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 so that the at least one processor can execute the animal video highlight clip editing method described in any one of claims 1-4.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the method for editing animal video highlights as described in any one of claims 1-4.
7. A computer program product comprising computer instructions, characterized in that When the computer instruction is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
