Method for extracting target frame, electronic device and computer program product
By calculating the cross-correlation between the forward and reverse order frames of the video, a global feature distribution is generated and the target frame is determined, which solves the problems of insufficient extraction of video key frames and low efficiency of video processing of indefinite lengths in the existing technology, and improves the quality of video frames. Extraction accuracy and information completeness.
Patent Information
- Application Number
- CN202310194565.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
When the existing technology extracts video key frames, a single key frame is difficult to represent the entire video content, resulting in a lack of information, and extracting frames at fixed time intervals cannot meet the needs for efficient feature extraction of videos of irregular duration, and key information may be missed.
By obtaining the sequence of image frames arranged in forward and reverse order of the video, the cross-correlation between the two is calculated, and a global feature distribution is generated to determine the target frame to improve the accuracy of key frame extraction.
It improves the identification of correlations between distant image frames in the video, enhances the accuracy of key frame extraction and the comprehensiveness of the video summary, ensuring that the extracted frames contain more feature information.
Smart Images

Figure CN118570691A
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of storage devices, and more particularly, to a method for extracting a target frame, an electronic device, and a computer program product. Background Art
[0002] Recently, with the popularity of smart phones, personal videos, video lectures, video diaries, video messages on social networks and videos in many other domains are gradually occupying various scenes in life. With the increase in video usage, more and more videos are stored. In this regard, a better video management method is needed. In order to better store videos and quickly understand the summary of videos, one or more small still images called key frames can be extracted from the video. Key frames can convey most of the key information contained in the original video to users. Summary of the invention
[0003] The embodiments of the present disclosure provide a solution for extracting a target frame based on arranging video frames in forward and reverse order.
[0004] In a first aspect of the present disclosure, a method for extracting a target frame is provided. The method includes obtaining a first sequence of a group of image frames of a video arranged in ascending order. The method also includes generating a second sequence of a group of image frames arranged in descending order based on the first sequence arranged in ascending order. The method also includes determining a first cross-correlation sequence of image frames arranged in ascending order in the first sequence relative to image frames arranged in descending order in the second sequence. The method also includes determining a second cross-correlation sequence of image frames arranged in descending order in the second sequence relative to image frames arranged in ascending order in the first sequence. The method also includes determining a global feature distribution for a group of image frames based on the first cross-correlation sequence and the second cross-correlation sequence. Finally, the method includes determining at least one target frame in a group of image frames based on the global feature distribution.
[0005] In a second aspect of the present disclosure, an electronic device is provided. The electronic device includes a processor and a volatile memory coupled to the processor. The volatile memory has instructions stored therein, and when the instructions are executed by the processor, the device performs an action. The action includes obtaining a first sequence of a group of image frames of a video arranged in a positive order. The action also includes generating a second sequence of a group of image frames arranged in a reverse order based on the first sequence arranged in a positive order. The action also includes determining a first cross-correlation sequence of image frames arranged in a positive order in the first sequence relative to image frames arranged in a reverse order in the second sequence. The action also includes determining a second cross-correlation sequence of image frames arranged in a reverse order in the second sequence relative to image frames arranged in a positive order in the first sequence. The action also includes determining a global feature distribution for a group of image frames based on the first cross-correlation sequence and the second cross-correlation sequence. The action also includes determining at least one target frame in a group of image frames based on the global feature distribution.
[0006] In a third aspect of the present disclosure, there is provided a computer program product tangibly stored on a computer readable medium and comprising machine executable instructions which, when executed, cause a machine to perform the method according to the first aspect.
[0007] This Summary is provided to introduce a selection of concepts in a simplified form that are further described in the Detailed Description below. This Summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the exemplary embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present disclosure. In the accompanying drawings:
[0009] Figure 1 A schematic diagram illustrating an example environment in which embodiments of the present disclosure may be implemented is shown.
[0010] Figure 2 A flowchart showing an example method of extracting a target frame according to an embodiment of the present disclosure is shown;
[0011] Figure 3 A schematic diagram showing an example process of extracting a target frame according to an embodiment of the present disclosure;
[0012] Figure 4A and Figure 4B A schematic diagram showing a method of determining a cross-correlation according to an embodiment of the present disclosure is shown;
[0013] Figure 5A schematic diagram showing a connection relationship of image frames in space according to an embodiment of the present disclosure; and
[0014] Figure 6 A block diagram of an example device that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0015] The principles of the present disclosure will be described below with reference to several example embodiments shown in the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that these embodiments are described only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way.
[0016] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0017] As discussed above, when managing a video, it is necessary to extract key frames or target frames to provide key information for the video.
[0018] Conventionally, an image frame of a video can be extracted from the video as a key frame, and based on the feature extraction of the image frame, a classification feature can be obtained, and the classification feature can be used to perform label classification operations on the video. Alternatively, multiple image key frames can be extracted from the video, and post-fusion technology can be used to process them to obtain corresponding classification features for classification. For example, a frame can be extracted at regular intervals, and the extracted frame can be used as a key to perform splicing to provide users with information about various parts of the entire video.
[0019] However, in conventional solutions, when extracting an image frame as a key frame, a single key frame cannot represent the content of the entire video in most cases, which will cause information loss and insufficient display of key information of the video. When extracting frames at fixed time intervals, the processing of videos of different lengths is more cumbersome and cannot meet the high-efficiency requirements for feature extraction of videos of varying lengths. At the same time, since the intervals between the extracted frames are fixed, this may also lead to missing some key information.
[0020] In view of this, an embodiment of the present disclosure proposes a scheme for extracting a target frame to solve one or more of the above-mentioned problems and other potential problems. In the scheme, a group of image frames arranged in ascending order and a group of image frames arranged in descending order of a video are obtained. Afterwards, the cross-correlation of the image frames arranged in ascending order relative to the image frames arranged in descending order is determined according to the arrangement order of the image frames, and the cross-correlation of the image frames arranged in descending order relative to the image frames arranged in ascending order is determined at the same time. Based on the obtained cross-correlation, a global feature vector is obtained, thereby determining at least one target frame as a summary of the video. In this way, by determining the cross-correlation of a group of image frames arranged in ascending order and a group of image frames arranged in descending order, the correlation between two image frames that are far apart in the video can be obtained, thereby improving the accuracy of key frame extraction.
[0021] Figure 1 1 is a schematic diagram of an example environment 100 in which embodiments of the present disclosure may be implemented. Figure 1 As shown, the example environment 100 includes a computing device 110 and a server 140. A video 120 from a user 150 can be input into the computing device 110 and can also be stored on the server 140. The video 120 is composed of a plurality of image frames arranged in sequence. The computing device 110 can use some video processing applications to extract some specific frames in the video, which can also be called target frames or key frames. The key frame images or target frame images of the video 120 can be a specified number of video frame images extracted from a sequence of image frames of a video through a certain algorithm or rule.
[0022] exist Figure 1 In the illustrated embodiment, the computing device 110 may classify the image frames in the video using machine learning to identify the feature information contained in the image frames and generate a feature table for marking the video using the feature information. The generated feature table may include multiple different levels according to the number of image frames. Figure 1As shown, the computing device 110 generates four feature tables 130-1, 130-2, 130-3, and 130-4 (collectively referred to as feature tables 130). Feature table 130-1 is an L1-level feature table. Feature table 130-2 is an L2-level feature table. Feature table 130-3 is an L3-level feature table. Feature table 130-4 is an L4-level feature table. Feature table 130 may include the distribution of features on all image frames of the entire video, and the selected target frames may be, for example, multiple image frames containing the highest feature quantities. For example, 7 image frames containing the highest feature quantities are selected in feature table 130-1. Since the number of image frames describing the video changes, the weights of different features may also change at this time, so the resulting feature distribution may also be different. After the computing device 110 generates feature table 130, feature table 130 may be stored in server 140, so that user 150 can use keywords to search for videos in server 140.
[0023] Figure 2 FIG. 2 is a flowchart of an exemplary method 200 for extracting a target frame according to an embodiment of the present disclosure. The method 200 may be performed by, for example Figure 1 Executed by the computing device 110 in.
[0024] At 202, the computing device 110 obtains a first sequence of a group of image frames of a video in a positive order. The image frames are arranged in a positive order of time in the video. Therefore, in the first sequence, the image frames are also arranged in a time order. And at 204, the computing device 110 generates a second sequence of a group of image frames in a reverse order based on the first sequence arranged in the positive order.
[0025] At 206, the computing device 110 determines a first cross-correlation sequence of the image frames in the first sequence relative to the image frames in the second sequence arranged in reverse order. Here, the cross-correlation may, for example, represent the similarity between the feature information included in one image frame and the feature information included in another image frame. For example, when the similarity of the feature information included in the two image frames is high, it means that the scenes depicted by the two image frames are more similar, and therefore the correlation between the two image frames is higher.
[0026] The first cross-correlation sequence may include the similarity of each image frame in the first sequence relative to each image frame in the second sequence. For example, the similarity of the first image frame in the first sequence relative to each image frame in the second sequence may be organized in sequence as a cross-similarity vector, and the cross-similarity vector is arranged as an element in the first cross-correlation sequence at a position corresponding to the first image frame. Thus, by performing this operation on each image frame in the first sequence, the first cross-correlation sequence can be obtained, and the order of the cross-correlations in the obtained first cross-correlation sequence is the same as the order of the corresponding image frames in the first sequence.
[0027] Similarly, at 208 , computing device 110 determines a second cross-correlation sequence of image frames arranged in reverse order in the second sequence relative to image frames arranged in forward order in the first sequence.
[0028] At 210, the computing device 110 determines a global feature distribution for a group of image frames based on the first cross-correlation sequence and the second cross-correlation sequence. In some embodiments, the computing device 110 may use the first cross-correlation sequence and the second cross-correlation sequence as weights to weight the original feature distribution of the first sequence, thereby obtaining the global feature distribution.
[0029] At 212, the computing device 110 determines at least one target frame in a group of image frames based on the global feature distribution. In some embodiments, the computing device 110 may select multiple image frames with high feature distribution as target frames. By including the cross-correlation of the positive sequence and the reverse sequence of the image frames in the global feature distribution, the correlation of the image frames far away from the video frame is taken into account, which improves the accuracy of the correlation, so that the obtained global feature distribution can more accurately describe the importance of the feature to the video. In this way, the feature information contained in the extracted target frame is improved to provide a more comprehensive video summary for the user.
[0030] Figure 3 FIG. 3 is a schematic diagram showing an example process 300 of extracting a target frame according to an embodiment of the present disclosure. The process 300 may be performed by, for example Figure 1 The computing device 110 in FIG. Figure 3As shown, the computing device 110 includes a forward encoder 331 and a first self-attention module 332. The forward encoder 331 can receive a first sequence of image frames of a video. The first sequence includes image frames 310-1, 310-2, 310-3, 310-4, and 310-5 arranged in time. The forward encoder 331 can process the image frames 310-1, 310-2, 310-3, 310-4, and 310-5 in the first sequence to generate feature vectors corresponding thereto. Afterwards, the generated feature vectors are input to the first self-attention module 332 to process the generated feature vectors using the self-attention mechanism. In contrast, the computing device 110 also includes a reverse encoder 341 and a second self-attention module 342. The reverse encoder 341 can receive a second sequence of image frames of a video. The second sequence includes image frames 320-1, 320-2, 320-3, 320-4, and 320-5 arranged in reverse order of time. The reverse order encoder 341 can process the image frames 310-1, 310-2, 310-3, 310-4, 310-5 in the first sequence to generate feature vectors corresponding thereto. Afterwards, the generated feature vectors are input to the first self-attention module 332 to process the generated feature vectors using the self-attention mechanism.
[0031] In some embodiments, the first self-attention module 332 includes a self-attention model, and the computing device 110 can use the self-attention model to process the first sequence to obtain a first query weight, a first key weight, and a first value weight. Afterwards, the computing device 110 can use the first query weight, the first key weight, and the first value weight to weight the feature vector of the image frame, thereby obtaining a first group of query vectors, a first group of key vectors, and a first group of value vectors, respectively. In some embodiments, after the computing device 110 processes the first sequence using the self-attention model, it can also obtain the internal correlation between the image frames in the first sequence, as well as the feature distribution based on the internal correlation as described in the following formula:
[0032]
[0033] where F f represents the local feature distribution of the first sequence, Q I represents the query vector of the image frame in video I, The key vector representing the image frame in video I, V I represents the value vector of the image frame in the video I, T represents the Softmax calculation operation used for normalization, and D represents the temperature of the feature vector of the image frame.
[0034] Similarly, the second self-attention module 342 includes a self-attention model, and the computing device 110 can process the second sequence using the self-attention model to obtain a second query weight, a second key weight, and a second value weight. Afterwards, the computing device 110 can weight the feature vectors of the image frame using the second query weight, the second key weight, and the second value weight, respectively, to obtain a second group of query vectors, a second group of key vectors, and a second group of value vectors, respectively. In some embodiments, after processing the first sequence using the self-attention model, the computing device 110 can also obtain the internal correlation between the image frames in the first sequence, as well as the feature distribution based on the internal correlation as described in the following formula:
[0035]
[0036] Among them, F b represents the local feature distribution of the first sequence, Q r(I) represents the query vector of the image frame in the reverse video r(I) of video I, The key vector V represents the image frame in the reverse video r(I). r(I) represents the value vector of the image frame in the reverse video r(I), T represents the Softmax calculation operation used for normalization, and D represents the temperature of the feature vector of the image frame.
[0037] The self-attention model is a network model based on simulating the human attention mechanism. The attention mechanism imitates the internal process of biological observation behavior, that is, a mechanism that aligns internal experience and external sensations to increase the observation precision of some areas. The attention mechanism can quickly extract important features of sparse data. Based on the attention mechanism, the correlation of the attention of the first image feature based on the image channel is captured. The correlation can be the attention weight. By assigning the attention weight to the corresponding feature, the feature to which the attention mechanism is applied is obtained. Since the feature includes the correlation between multiple frames of the video, when the feature is subsequently used for applications such as video classification and recommendation, the classification result or recommendation result is more accurate, thereby improving the accuracy of video classification.
[0038] The attention mechanism model can be trained through a large number of image frame training samples. Different feature classifications can be preset with different weights, so that the trained attention mechanism model adds weight attributes based on the correlation between image frames to the features of the input image frames, thereby obtaining a weighted feature distribution, which increases the proportion of features with high attention. Therefore, when selecting a target frame based on the feature distribution, it can ensure that the selected target frame contains features with high attention.
[0039] After being processed by the self-attention mechanism, the obtained first set of query vectors, the first set of key vectors and the first set of value vectors, as well as the second set of query vectors, the second set of key vectors and the second set of value vectors are input into the cross self-attention module 350. The cross self-attention module 350 can be input to derive the global feature distribution. Figure 4A and Figure 4B Describe in detail the process of calculating the global feature distribution.
[0040] Figure 4A FIG. 4 is a schematic diagram showing an example process 401 of determining a cross-correlation for an image frame 310-1 in a first sequence according to an embodiment of the present disclosure. Figure 4A As shown, the first image frame 310-1 in the first sequence is processed by the forward sequence encoder 331 to obtain the feature vector F a1 . Then, the eigenvector F a1 Multiply by the first query weight W obtained by the trained first self-attention module 331 qa , get the first query vector q a1 The first image frame 320-1 in the second sequence is processed by the reverse order encoder 341 to obtain the feature vector F b1 . Then, the eigenvector F b1 Multiply by the second key weight W obtained by the trained second self-attention module 341 kb , get the second key vector k b1 Similarly, after similar operations are performed on the image frames 320-2, 320-3, 320-4, and 320-5 in the second sequence, k b2 , k b3 , k b4 and k b5 . Then, let the first query vector q a1 and the second key vector k b1 , k b2 , k b3 , k b4 and k b5 A dot product operation is performed to obtain cross-correlations α1, α2, α3, α4, and α5. The cross-correlations α1, α2, α3, α4, and α5 are normalized to obtain α'1, α'2, α'3, α'4, and α'5 between 0 and 1. The normalized cross-correlations α'1, α'2, α'3, α'4, and α'5 are multiplied by the second value vector k of the image frames 320-1, 320-2, 320-3, 320-4, and 320-5, respectively. b1 , k b2 , k b3 , k b4 , k b5, to obtain the eigenvectors b1, b2, b3, b4, b5. Finally, add the eigenvectors b1, b2, b3, b4, b5 to obtain the weighted first eigenvector F sa1 .
[0041] Figure 4B FIG. 4 is a schematic diagram showing an example process 403 of determining a cross-correlation for an image frame 320-1 in a second sequence according to an embodiment of the present disclosure. Figure 4B As shown, after Figure 4B After the processing in , the feature vector F of the first image frame 320-1 in the second sequence is obtained. b1 . Then, the eigenvector F b1 Multiply by the second query weight W obtained by the trained second self-attention module 341 qb , get the second query vector q b1 Similarly, after similar operations are performed on the image frames 310-1, 310-2, 310-3, 310-4, and 310-5 in the first sequence, k are obtained respectively. a1 , k a2 , k a3 , k a4 and k a5 Then, let the second query vector q b1 Respectively with the first key vector k a1 , k a2 , k a3 , k a4 and k a5 Dot product operations are performed to obtain cross-correlations β1, β2, β3, β4, β5. The cross-correlations β1, β2, β3, β4, β5 are normalized to obtain β'1, β'2, β'3, β'4, β'5 between 0 and 1. The compensations 1-β'1, 1-β'2, 1-β'3, 1-β'4, 1-β'5 of the normalized cross-correlation are multiplied by the first value vector k of the image frames 310-1, 310-2, 310-3, 310-4, 310-5, respectively. a1 , k a2 , k a3 , k a4 , k a5 , to obtain the eigenvectors c1, c2, c3, c4, c5. Finally, add the eigenvectors c1, c2, c3, c4, c5 to obtain the weighted second eigenvector F sb1 .
[0042] return Figure 3 , and then get the first eigenvector F sa1 and the second eigenvector F sb1, and the weighted global feature vector of the first image frame 310-1 is obtained by adding the two. After obtaining the global feature vectors of all image frames, after processing, the global feature distribution is obtained. The global feature distribution is calculated, for example, by the following formula:
[0043]
[0044] Among them, F S is the global feature distribution, that is, the matrix of the global feature vector of each image frame, represents the query vector of the first sequence in positive order, The key vector representing the second sequence in reverse order, A vector of values representing the second sequence, represents the query vector of the second sequence, represents the key vector of the first sequence, Represents the value vector of the first sequence. Alternatively, as a simplification, it can also be calculated by, for example, the following formula:
[0045]
[0046] At this time, the global feature distribution and the corresponding position information generated by the coordinate encoder 370, that is, the coordinates of each video frame, are input into the video decoder 360, and the operation of extracting the target frame can be performed to extract the target frame based on the feature distribution 380. Figure 5 To similarly describe the process of extracting the target frame based on the global feature distribution.
[0047] Figure 5 A schematic diagram of the distribution 500 of image frames in space according to an embodiment of the present disclosure is shown. In some embodiments, the computing device 110 may use the coordinate encoder 370 to expand the numbers of the image frames in the first sequence into multi-dimensional coordinates. For example, the computing device 110 may use the following formula to expand the numbers into two-dimensional coordinates:
[0048] p = [sin(2 n π×i), cos(2 n π×i)] (5)
[0049] Where n represents the order and i represents the number. The first item of the generated two-dimensional coordinates can be regarded as the coordinate of the X axis, and the second item is the coordinate of the Y axis. Therefore, using the generated two-dimensional coordinates, the image frame can be projected into a suitable space by utilizing spatial changes. For example, by inputting the generated coordinates and global feature distribution into the multi-layer perceptron MLP:
[0050]
[0051] like Figure 5As shown, the image frames 310-1, 310-2, 310-3, 310-4, and 310-5 in the first sequence are distributed in the space according to the generated coordinates. i The edge convolutional graph neural network is input to predict the connection relationship between each image frame so as to select the target frame based on the connection relationship. For example, when the correlation between image frames is high, the image frames are connected. Therefore, the more connections an image frame has with other image frames, the higher the correlation between the image frame and other image frames, and thus contains more feature information, which is suitable for being selected as the target frame.
[0052] exist Figure 5 In the illustrated embodiment, since image frames 310-1, 310-4, and 310-5 all contain features of playing music, image frames 310-1, 310-4, and 310-5 are connected to each other. Since image frames 310-2 and 310-4 both contain features of the same person, image frames 310-2 and 310-4 are connected to each other. Figure 5 As shown, the image frame 310-4 is connected to the other three image frames more than the other image frames, so if only one image frame is selected as the target frame, the image frame 310-4 will be selected. If three image frames are selected as the target frames, the image frames 310-1 and 310-5 are connected to two other image frames respectively, and thus are also selected as the target frames. This process can be represented by the following formula:
[0053] c i =Sigmoid(MLP(GNN(F i ))) (7)
[0054] where c i represents the score associated with the number of connections of the i-th image frame, GNN represents the edge convolutional graph neural network operation, MLP represents the adjustment of the number of inputs and outputs, and Sigmond represents the sigmond function.
[0055] Figure 6 Schematic block diagram of an example device 600 that can be used to implement embodiments of the present disclosure is shown. Figure 6As shown, the device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0056] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0057] The various processes and processing described above, such as method 200, may be performed by processing unit 601. For example, in some embodiments, method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by CPU 601, one or more actions of methods 200 and 700 described above may be performed.
[0058] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0059] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0060] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0061] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0062] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0063] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0064] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0065] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0066] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for extracting a target frame, include: Obtaining a first sequence of a group of image frames of a video arranged in positive order; Based on the first sequence arranged in the forward order, generating a second sequence of the group of image frames arranged in the reverse order; determining a first cross-correlation sequence of image frames in the first sequence relative to image frames in the second sequence; determining a second cross-correlation sequence of image frames in the second sequence relative to image frames in the first sequence; Determining a global feature distribution for the set of image frames based on the first cross-correlation sequence and the second cross-correlation sequence; as well as At least one target frame in the group of image frames is determined based on the global feature distribution.
2. The method according to claim 1, wherein determining the first cross-correlation sequence include: determining a first set of query vectors, a first set of key vectors, and a first set of value vectors associated with feature vectors of image frames in the first sequence; determining a second set of query vectors, a second set of key vectors, and a second set of value vectors associated with feature vectors of image frames in the second sequence; and The first cross-correlation sequence is determined based on the first set of query vectors and the second set of key vectors.
3. The method according to claim 2, wherein determining the second cross-correlation sequence include: The second cross-correlation sequence is determined based on the second set of query vectors and the first set of key vectors.
4. The method according to claim 3, wherein determining the global feature distribution include: The global feature distribution is determined based on the first cross-correlation sequence, the first set of value vectors, the second cross-correlation sequence, and the second set of value vectors.
5. The method of claim 2, wherein determining the first set of query vectors, the first set of key vectors, and the first set of value vectors include: Processing the first sequence using a self-attention model to obtain a first query weight, a first key weight, and a first value weight; The first set of query vectors, the first set of key vectors, and the first set of value vectors are determined based on the first query weight, the first key weight, the first value weight, and a first set of feature vectors for the first sequence.
6. The method of claim 2, wherein determining the second set of query vectors, the second set of key vectors, and the second set of value vectors include: Processing the second sequence using a self-attention model to obtain a second query weight, a second key weight, and a second value weight; The second set of query vectors, the second set of key vectors, and the second set of value vectors are determined based on the second query weight, the second key weight, the second value weight, and a second set of feature vectors for the second sequence.
7. The method according to claim 1, wherein determining the at least one target frame include: Determine the coordinates of one image frame in the space based on the sequence number of the one image frame in the first sequence; projecting the set of image frames into the space based on the coordinates; Based on the global feature distribution, determining a connection relationship between the group of image frames in the space; as well as An image frame whose number of connections with other image frames is greater than a connection number threshold is determined as the at least one target frame.
8. The method according to claim 7, wherein determining the coordinates include: The sequence number is expanded into the two-dimensional coordinate.
9. The method according to claim 7, wherein determining the connection relationship include: Based on the global feature distribution and the coordinates, the connection relationship between the image frames in the group of image frames is determined according to an edge convolutional graph neural network.
10. An electronic device, include: processor; as well as a volatile memory coupled to the processor, the volatile memory having instructions stored therein, the instructions, when executed by the processor, causing the device to perform actions, the actions comprising: Obtaining a first sequence of a group of image frames of a video arranged in positive order; Based on the first sequence arranged in the forward order, generating a second sequence of the group of image frames arranged in the reverse order; Determine a first cross-correlation sequence of the image frames arranged in the positive order in the first sequence relative to the image frames arranged in the reverse order in the second sequence; Determine a second cross-correlation sequence of the image frames arranged in the reverse order in the second sequence relative to the image frames arranged in the forward order in the first sequence; Determining a global feature distribution for the set of image frames based on the first cross-correlation sequence and the second cross-correlation sequence; and At least one target frame in the group of image frames is determined based on the global feature distribution.
11. The apparatus according to claim 10, wherein determining the first cross-correlation sequence include: determining a first set of query vectors, a first set of key vectors, and a first set of value vectors associated with feature vectors of image frames in the first sequence; determining a second set of query vectors, a second set of key vectors, and a second set of value vectors associated with feature vectors of image frames in the second sequence; and The first cross-correlation sequence is determined based on the first set of query vectors and the second set of key vectors.
12. The apparatus according to claim 11, wherein determining the second cross-correlation sequence include: The second cross-correlation sequence is determined based on the second set of query vectors and the first set of key vectors.
13. The apparatus according to claim 12, wherein determining the global feature distribution include: The global feature distribution is determined based on the first cross-correlation sequence, the first set of value vectors, the second cross-correlation sequence, and the second set of value vectors.
14. The apparatus of claim 11, wherein determining the first set of query vectors, the first set of key vectors, and the first set of value vectors include: Processing the first sequence using a self-attention model to obtain a first query weight, a first key weight, and a first value weight; The first set of query vectors, the first set of key vectors, and the first set of value vectors are determined based on the first query weight, the first key weight, the first value weight, and a first set of feature vectors for the first sequence.
15. The apparatus of claim 11, wherein determining the second set of query vectors, the second set of key vectors, and the second set of value vectors include: Processing the second sequence using a self-attention model to obtain a second query weight, a second key weight, and a second value weight; The second set of query vectors, the second set of key vectors, and the second set of value vectors are determined based on the second query weight, the second key weight, the second value weight, and a second set of feature vectors for the second sequence.
16. The apparatus according to claim 10, wherein determining the at least one target frame include: Determine the coordinates of one image frame in the space based on the sequence number of the one image frame in the first sequence; projecting the set of image frames into the space based on the coordinates; Based on the global feature distribution, determining a connection relationship between the group of image frames in the space; as well as An image frame whose number of connections with other image frames is greater than a connection number threshold is determined as the at least one target frame.
17. The apparatus of claim 16, wherein determining the coordinates include: The sequence number is expanded into the two-dimensional coordinate.
18. The device according to claim 16, wherein determining the connection relationship include: Based on the global feature distribution and the coordinates, the connection relationship between the image frames in the group of image frames is determined according to an edge convolutional graph neural network.
19. A computer program product tangibly stored on a computer readable medium and comprising machine executable instructions which, when executed, cause a machine to: Obtaining a first sequence of a group of image frames of a video arranged in positive order; Based on the first sequence arranged in the forward order, generating a second sequence of the group of image frames arranged in the reverse order; Determine a first cross-correlation sequence of the image frames arranged in the positive order in the first sequence relative to the image frames arranged in the reverse order in the second sequence; Determine a second cross-correlation sequence of the image frames arranged in the reverse order in the second sequence relative to the image frames arranged in the forward order in the first sequence; Determining a global feature distribution for the set of image frames based on the first cross-correlation sequence and the second cross-correlation sequence; as well as At least one target frame in the group of image frames is determined based on the global feature distribution.
20. The computer program product of claim 19, wherein determining the first cross-correlation sequence include: determining a first set of query vectors, a first set of key vectors, and a first set of value vectors associated with feature vectors of image frames in the first sequence; determining a second set of query vectors, a second set of key vectors, and a second set of value vectors associated with feature vectors of image frames in the second sequence; and The first cross-correlation sequence is determined based on the first set of query vectors and the second set of key vectors.
Citation Information
Patent Citations
Nonlinear splicing method and device for digital shadow figure animation script file based on Xml
CN103793934A
Performing multiple queries within a robust video search and retrieval mechanism
CN108780457A
Temporal information prediction in autonomous machine applications
CN111695717A
Method and system for searching video key frames based on deep learning algorithm
CN112651271A
Target identification method and device, equipment, storage medium and radar
CN112861811A
Cited By
Resource recommendation method, method and device for training deep learning model, and intelligent agent
CN120653846A
