Method, device, readable medium and electronic device for determining key frame

By inputting video frames into feature vectors to obtain the model, obtaining feature vectors and dividing image scenes, and determining video keyframes, the problem of low video automatic recognition efficiency in the prior art is solved, and more efficient keyframe extraction is achieved.

CN114187557BActive Publication Date: 2025-03-14DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111539658.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2025-03-14
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

In the process of automatic recognition of video content, the prior art has a large amount of calculation and low efficiency, especially in long videos, where there are huge challenges in how to achieve automatic content recognition.

Method used

By acquiring multiple frames of images to be determined, inputting them into pre-trained feature vectors to obtain the model, obtaining the feature vectors of each frame of the image, and dividing the image into image groups of different image scenes based on these feature vectors, thereby determining the keyframe.

Benefits of technology

It realizes faster and more accurate extraction of keyframes, improving the efficiency of subsequent image analysis or image content recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114187557B_ABST
    Figure CN114187557B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, readable medium and electronic device for determining key frames, including: obtaining multiple frames of images to be determined; inputting the multiple frames of images to be determined into a pre-trained feature vector acquisition model to obtain image feature vectors corresponding to each frame of images to be determined output by the feature vector acquisition model; dividing the multiple frames of images to be determined into at least one image group according to the image feature vectors corresponding to each frame of images to be determined; and determining the key frames corresponding to the multiple frames of images to be determined from the images to be determined in each image group. That is, the present disclosure can divide the multiple frames of images to be determined into at least one image group of different image scenes according to the image feature vectors corresponding to each frame of images to be determined, and then determine the key frames corresponding to the multiple frames of images to be determined from each image group, so that the key frames can be extracted more quickly and accurately, thereby improving the efficiency of subsequent image analysis or image content recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of image processing, and in particular, to a method, device, readable medium and electronic device for determining a key frame. Background Art

[0002] With the development of network technology, a large amount of image and video resources are uploaded to the Internet and circulated. The traditional way of identifying and classifying the content of images and videos through visual inspection is labor-intensive and time-consuming, especially for long videos, how to achieve automatic content recognition is a huge challenge.

[0003] In the related art, automatic recognition of video content is achieved through artificial intelligence (AI). However, this method requires recognition of each video frame in the video, which makes the recognition process computationally intensive and inefficient. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a method for determining a key frame, the method comprising:

[0006] Acquire multiple frames of images to be determined;

[0007] Inputting a plurality of frames of the image to be determined into a pre-trained feature vector acquisition model to obtain an image feature vector corresponding to each frame of the image to be determined output by the feature vector acquisition model;

[0008] According to the image feature vector corresponding to each frame of the image to be determined, the multiple frames of the image to be determined are divided into at least one image group, and different image groups correspond to different image scenes;

[0009] From the images to be determined in each of the image groups, key frames corresponding to the multiple frames of images to be determined are determined.

[0010] In a second aspect, the present disclosure provides a device for determining a key frame, the device comprising:

[0011] An image acquisition module, used for acquiring multiple frames of images to be determined;

[0012] A feature vector acquisition module, used for inputting a plurality of frames of the image to be determined into a pre-trained feature vector acquisition model, so as to obtain an image feature vector corresponding to each frame of the image to be determined output by the feature vector acquisition model;

[0013] An image division module, used for dividing the multiple frames of the to-be-determined images into at least one image group according to the image feature vector corresponding to each frame of the to-be-determined images, wherein different image groups correspond to different image scenes;

[0014] The key frame determination module is used to determine the key frames corresponding to the multiple frames of the to-be-determined images from the to-be-determined images in each of the image groups.

[0015] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect of the present disclosure.

[0016] In a fourth aspect, the present disclosure provides an electronic device, including:

[0017] a storage device having a computer program stored thereon;

[0018] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.

[0019] Through the above technical solution, multiple frames of images to be determined are obtained; the multiple frames of images to be determined are input into a pre-trained feature vector acquisition model to obtain the image feature vectors corresponding to each frame of the images to be determined output by the feature vector acquisition model; the multiple frames of images to be determined are divided into at least one image group according to the image feature vectors corresponding to each frame of the images to be determined, and different image groups correspond to different image scenes; and the key frames corresponding to the multiple frames of images to be determined are determined from the images to be determined in each of the image groups. That is to say, the present disclosure can divide the multiple frames of images to be determined into at least one image group of different image scenes according to the image feature vectors corresponding to each frame of the images to be determined, and then determine the key frames corresponding to the multiple frames of images to be determined from each image group. In this way, the key frames can be extracted more quickly and accurately, thereby improving the efficiency of subsequent image analysis or image content recognition.

[0020] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0022] Figure 1 is a flowchart of a method for determining a key frame according to an exemplary embodiment of the present disclosure;

[0023] Figure 2 is a flowchart showing another method for determining a key frame according to an exemplary embodiment of the present disclosure;

[0024] Figure 3 is a schematic diagram of a network structure according to an exemplary embodiment of the present disclosure;

[0025] Figure 4 is a block diagram of a device for determining a key frame according to an exemplary embodiment of the present disclosure;

[0026] Figure 5 is a block diagram of a second device for determining a key frame according to an exemplary embodiment of the present disclosure;

[0027] Figure 6 is a block diagram of a third device for determining a key frame according to an exemplary embodiment of the present disclosure;

[0028] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0035] First, the application scenario of the present disclosure is explained. The recognition of key frames is a very critical part of machine understanding and analysis of video content. Currently, there are two types of key frames commonly used: one is the frame before and after the scene change, and the other is the central frame that can represent the entire scene. In the related art, one way is to judge whether there is a scene change based on the difference between adjacent frames (the sum of the point-to-point Euclidean distance). However, this method requires a threshold to be determined in advance, and there is no mature standard for the screening of the threshold, which affects the accuracy of the judgment. At the same time, in the case of insertion and camera movement, the recognition effect is also relatively poor. Another way is to train the model based on manually annotated data, that is, manually annotate some key frames, and then simulate the behavior of manual annotation based on the CNN (Convolutional Neural Network) model. However, this method requires a relatively high labor cost, and the technical ability requirements of the annotation personnel are also relatively high, resulting in less annotation data related to the key frames, which makes the model training more difficult.

[0036] In order to solve the above-mentioned problems, the present disclosure provides a method, device, readable medium and electronic device for determining key frames, which can divide the multiple frames of images to be determined into at least one image group of different image scenes according to the image feature vector corresponding to each frame of the image to be determined, and then determine the key frames corresponding to the multiple frames of images to be determined from each image group. In this way, the key frames can be extracted more quickly and accurately, thereby improving the efficiency of subsequent image analysis or image content recognition.

[0037] The present disclosure is described below in conjunction with specific embodiments.

[0038] Figure 1 is a flowchart of a method for determining a key frame according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the method may include:

[0039] S101, obtaining multiple frames of images to be determined.

[0040] In this step, the target video of the key frame to be determined can be obtained first, and then each frame of the video image in the target video can be extracted to obtain multiple frames of images to be determined. The target video can be a self-made video (long video, short video, etc.) launched on the video platform, or a film and television drama, sports event video, etc., or an animation. The present disclosure does not limit the type of the target video.

[0041] S102 , inputting multiple frames of images to be determined into a pre-trained feature vector acquisition model to obtain an image feature vector corresponding to each frame of the image to be determined output by the feature vector acquisition model.

[0042] The image feature vector is used to represent the spatial distance between the to-be-determined images of different frames.

[0043] In this step, after obtaining multiple frames of images to be determined, the multiple frames of images to be determined can be input into the feature vector acquisition model, and each frame of the image to be determined is processed by the feature vector acquisition model to obtain an image feature vector corresponding to each frame of the image to be determined. For example, the image feature vectors corresponding to the multiple frames of images to be determined can be expressed as {Z0, Z1, Z2, ..., Zn}, where n is the number of images to be determined.

[0044] The feature vector acquisition model can be trained in the following manner: multiple sample sets are obtained, the sample sets include positive sample images, simple sample images, and difficult sample images, and a target neural network model is trained using the multiple sample sets to obtain the feature vector acquisition model.

[0045] S103 . Divide the multiple frames of images to be determined into at least one image group according to the image feature vector corresponding to each frame of the image to be determined.

[0046] Among them, different image groups may correspond to different image scenes.

[0047] In this step, after the image feature vector corresponding to each frame of the image to be determined is obtained, the multiple frames of the image to be determined can be divided into at least one image group according to different image scenes based on the multiple image feature vectors.

[0048] S104: Determine key frames corresponding to the multiple frames of the images to be determined from the images to be determined in each image group.

[0049] The key frame may include the transition frames before and after the scene is changed and the center frame of the entire scene. For example, if the fifth frame of the image to be determined is two handbags and the sixth frame is a plurality of flower pots, the fifth and sixth frames are transition frames; if the first to fifth frames are all two handbags, the third frame is the center frame of the scene, and thus the third, fifth and sixth frames are the key frames.

[0050] In this step, for each image group, the image scene of the image group is different from that of the adjacent image group. The first frame of the image to be determined and the last frame of the image to be determined in the image group can be used as transition frames, and the middle frame of the image to be determined in the image group can be used as the center frame to obtain the key frame corresponding to the image group.

[0051] By adopting the above method, the multiple frames of images to be determined can be divided into at least one image group of different image scenes according to the image feature vector corresponding to each frame of the image to be determined, and then the key frames corresponding to the multiple frames of images to be determined are determined from each image group. In this way, the key frames can be extracted more quickly and accurately, thereby improving the efficiency of subsequent image analysis or image content recognition.

[0052] Figure 2 is a flowchart of another method for determining a key frame according to an exemplary embodiment of the present disclosure. Figure 2 As shown, the method may include:

[0053] S201, obtaining multiple frames of images to be determined.

[0054] S202 , inputting multiple frames of images to be determined into a pre-trained feature vector acquisition model to obtain an image feature vector corresponding to each frame of the image to be determined output by the feature vector acquisition model.

[0055] The image feature vector is used to characterize the spatial distance between the to-be-determined images of different frames. The feature vector acquisition model can be trained by the following method:

[0056] S1. Obtain multiple sample sets.

[0057] The sample set may include positive sample images, simple sample images, and difficult sample images. The positive sample image may include two sample images with relatively small differences, for example, the positive sample image may include two adjacent sample images. The simple sample image may include two sample images with relatively large differences, for example, the simple sample image may include two sample images in two videos. The difficult sample image may include two sample images with centered differences, for example, the difficult sample image may be two sample images with relatively large intervals in a unified video. A plurality of reference sample images may be obtained first, and for each reference sample image, the positive sample image, the simple sample image, and the difficult sample image corresponding to the reference sample image may be obtained.

[0058] In a possible implementation, the reference sample image and the adjacent sample image can be used as the positive sample image, the adjacent sample image is any frame sample image adjacent to the reference sample image in the first sample video to which the reference sample image belongs; the reference sample image and any frame sample image in at least one second sample video are used as the simple sample image, the second sample video is different from the first sample video. For example, the positive sample image may include x and x+, x is the reference sample image, and x+ is the next frame sample image adjacent to the reference sample image.

[0059] In addition, the scene type corresponding to the first sample video can be determined based on the reference sample image, and the difficult sample image can be determined based on the reference sample image and the scene type. For example, the scene type can include a long video scene and a short video scene. The present disclosure can identify the reference sample image through an image recognition method of the prior art, determine the image content corresponding to the reference sample image, and determine the scene type corresponding to the first sample video based on the image content.

[0060] After determining the scene type corresponding to the first sample video, the target interval can be determined according to the scene type, and the benchmark sample image and any frame sample image in the first sample video whose interval with the benchmark sample image is greater than or equal to the target interval can be used as the difficult sample image. By way of example, the target interval corresponding to the scene type can be determined by a pre-established interval association relationship, and the interval association relationship can include a correspondence between different scene types and intervals. For long video scenes, a longer target interval can be set, for example, the target interval can be 30s, and for short video scenes, a shorter target interval can be set, for example, the target interval can be 15s. It should be noted that the above-mentioned setting method of the target interval is only an example, and the present disclosure does not limit this. By way of example, the difficult sample image can include x and x-, x is the benchmark sample image, and x- is any frame sample image in the first sample video whose interval with the benchmark sample image is greater than or equal to the target interval.

[0061] It should be noted that for each sample set, based on the reference sample image x in the sample set, x+ can be used as a positive sample, and x- can be used as a negative sample. The similarity between x and x+ is relatively high, while the difference between x- and x is relatively large.

[0062] S2. Train the target neural network model through multiple sample sets to obtain the feature vector acquisition model.

[0063] Among them, the target neural network model can be a ResNet network, Figure 3 is a schematic diagram of a network structure according to an exemplary embodiment of the present disclosure, such as Figure 3As shown in the figure, the left side is the overall schematic diagram of the network structure, and the right side is the schematic diagram corresponding to the convolution process. After the sample set is input into the target neural network model, the sample images in the sample set can be convolved twice through two convolution layers, and then the processing results after the convolution operation and the sample set are processed through three convolution processes (convolution process 1, convolution process 2 and convolution process 3). Finally, the smoothing layer is used for dimensionality reduction, and the fully connected layer is used for classification. Among them, the network structures corresponding to the three convolution processes are the same, including convolution layer (Conv2D), pooling layer, layer normalization (LayerNorm) and batch normalization (BatchNorm).

[0064] In this step, the target neural network model can be trained according to the debiasing loss function with reference to the model training method of the prior art, which will not be described in detail here. The expression of the debiasing loss function is:

[0065]

[0066] in, represents expectation, f(x), f(x+), f(x-) and f(v) are image feature vectors, x is a sample image, p is 1 / N, N is the number of sample images in the sample set, is the possibility that the selected sample image is a positive sample, τ+ is the probability of selecting a positive sample (1 / M, M is the number of sample videos to which the sample image belongs), τ- is the probability of selecting a negative sample ((M-1) / M), Q is the total number of negative samples, and v represents the expected operator.

[0067] S203 , clustering the image feature vectors corresponding to the multiple frames of images to be determined to obtain at least one cluster category.

[0068] Among them, different clustering categories can correspond to different image scenes.

[0069] In this step, a plurality of image feature vectors corresponding to a plurality of frames of images to be determined can be clustered using a hierarchical clustering method of the prior art to obtain at least one clustering category, wherein different clustering categories correspond to different clustering sets, and each clustering set includes at least one image feature vector.

[0070] S204: The to-be-determined images corresponding to each cluster category are taken as an image group.

[0071] In this step, after clustering multiple image feature vectors to obtain at least one cluster category, for each cluster category, the to-be-determined image corresponding to the cluster category can be determined according to at least one target image feature vector in the cluster set corresponding to the cluster category, and the to-be-determined image corresponding to the cluster category can be regarded as an image group. For example, if five cluster categories are obtained after clustering multiple image feature vectors: cluster category A, cluster category B, cluster category C, cluster category D, and cluster category E, the to-be-determined images in the cluster set corresponding to cluster category A can be regarded as image group A, the to-be-determined images in the cluster set corresponding to cluster category B can be regarded as image group B, the to-be-determined images in the cluster set corresponding to cluster category C can be regarded as image group C, the to-be-determined images in the cluster set corresponding to cluster category D can be regarded as image group D, and the to-be-determined images in the cluster set corresponding to cluster category E can be regarded as image group E.

[0072] S205 . For each cluster category, determine the cluster center corresponding to the cluster category, and use the to-be-determined image corresponding to the cluster center as the central frame image of the image group corresponding to the cluster category.

[0073] In this step, after clustering multiple image feature vectors to obtain at least one cluster category, for each cluster category, the image feature vector of the cluster center corresponding to the cluster category can be determined, and the image to be determined corresponding to the image feature vector of the cluster center is used as the central frame image of the image group corresponding to the cluster category.

[0074] S206 . For each image group, use the first frame of the image to be determined, the last frame of the image to be determined, and the center frame image in the image group as key frames corresponding to the multiple frames of the image to be determined.

[0075] In this step, different image groups correspond to different image scenes. After determining the central frame image of each image group, the first frame of the image to be determined and the last frame of the image to be determined in the image group can be determined for each image group, and the first frame of the image to be determined, the last frame of the image to be determined and the central frame image in the image group can be used as key frames corresponding to the multiple frames of the image to be determined.

[0076] By adopting the above method, the image feature vector corresponding to each frame of the image to be determined is obtained through the feature vector acquisition model, and the image feature vector can characterize the spatial distance between different images to be determined. After that, the multiple image feature vectors are clustered, and the multiple frames of the image to be determined are divided into at least one image group. Different image groups correspond to different clustering categories, and different clustering categories correspond to different image scenes. In this way, the key frames corresponding to the multiple frames of the image to be determined can be determined from the images to be determined in each image group, and the key frames can be extracted more quickly and accurately, thereby improving the efficiency of subsequent image analysis or image content recognition.

[0077] Figure 4 is a block diagram of a device for determining a key frame according to an exemplary embodiment of the present disclosure, such as Figure 4 As shown, the device may include:

[0078] An image acquisition module 401 is used to acquire multiple frames of images to be determined;

[0079] A feature vector acquisition module 402 is used to input multiple frames of the image to be determined into a pre-trained feature vector acquisition model to obtain an image feature vector corresponding to each frame of the image to be determined output by the feature vector acquisition model;

[0080] An image division module 403 is used to divide multiple frames of the to-be-determined image into at least one image group according to the image feature vector corresponding to each frame of the to-be-determined image, where different image groups correspond to different image scenes;

[0081] The key frame determination module 404 is used to determine the key frames corresponding to the multiple frames of the to-be-determined images from each of the to-be-determined images in the image group.

[0082] Optionally, Figure 5 is a block diagram of a second device for determining a key frame according to an exemplary embodiment of the present disclosure, such as Figure 5 As shown, the device may also include:

[0083] The model training module 405 is used to obtain multiple sample sets, which include positive sample images, simple sample images and difficult sample images; train the target neural network model through multiple sample sets to obtain the feature vector acquisition model.

[0084] Optionally, the model training module 405 is further used to:

[0085] Acquire a plurality of benchmark sample images;

[0086] For each of the reference sample images, the positive sample image, the simple sample image and the difficult sample image corresponding to the reference sample image are obtained.

[0087] Optionally, the model training module 405 is further used to:

[0088] The reference sample image and the adjacent sample image are used as the positive sample image, wherein the adjacent sample image is any frame sample image adjacent to the reference sample image in the first sample video to which the reference sample image belongs;

[0089] The reference sample image and any one frame sample image in at least one second sample video are used as the simple sample image, and the second sample video is different from the first sample video.

[0090] Optionally, the model training module 405 is further used to:

[0091] Determining, according to the reference sample image, a scene type corresponding to the first sample video;

[0092] The difficult sample image is determined according to the reference sample image and the scene type.

[0093] Optionally, the model training module 405 is further used to:

[0094] Determine the target interval according to the scenario type;

[0095] The reference sample image and any frame sample image in the first sample video whose interval with the reference sample image is greater than or equal to the target interval are used as the difficult sample image.

[0096] Optionally, the image segmentation module 403 is further used for:

[0097] Performing clustering processing on image feature vectors corresponding to multiple frames of the to-be-determined image to obtain at least one cluster category, where different cluster categories correspond to different image scenes;

[0098] The to-be-determined images corresponding to each cluster category are taken as an image group.

[0099] Optionally, Figure 6 is a block diagram of a third device for determining a key frame according to an exemplary embodiment of the present disclosure. Figure 6 As shown, the device may also include:

[0100] The central frame image determination module 406 is used to determine the cluster center corresponding to each cluster category, and use the to-be-determined image corresponding to the cluster center as the central frame image of the image group corresponding to the cluster category;

[0101] The key frame determination module 404 is further used for:

[0102] For each of the image groups, the first frame of the image to be determined, the last frame of the image to be determined and the central frame image in the image group are used as key frames corresponding to the multiple frames of the image to be determined.

[0103] Through the above-mentioned device, the multiple frames of images to be determined can be divided into at least one image group of different image scenes according to the image feature vector corresponding to each frame of the image to be determined, and then the key frames corresponding to the multiple frames of images to be determined are determined from each image group. In this way, the key frames can be extracted more quickly and accurately, thereby improving the efficiency of subsequent image analysis or image content recognition.

[0104] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0105] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 700 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic 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.

[0106] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0107] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0108] 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 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0109] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0110] In some embodiments, the electronic device can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0111] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0112] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains multiple frames of images to be determined; inputs the multiple frames of images to be determined into a pre-trained feature vector acquisition model to obtain image feature vectors corresponding to each frame of the images to be determined output by the feature vector acquisition model; divides the multiple frames of images to be determined into at least one image group according to the image feature vectors corresponding to each frame of the images to be determined, and different image groups correspond to different image scenes; and determines the key frames corresponding to the multiple frames of images to be determined from the images to be determined in each of the image groups.

[0113] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through 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., via the Internet using an Internet service provider).

[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite 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 a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0115] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, an image acquisition module may also be described as a "module for acquiring multiple frames of images to be determined."

[0116] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0117] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0118] According to one or more embodiments of the present disclosure, Example 1 provides a method for determining key frames, the method comprising: acquiring multiple frames of images to be determined; inputting the multiple frames of images to be determined into a pre-trained feature vector acquisition model to obtain image feature vectors corresponding to each frame of the images to be determined output by the feature vector acquisition model; dividing the multiple frames of images to be determined into at least one image group according to the image feature vectors corresponding to each frame of the images to be determined, different image groups corresponding to different image scenes; and determining the key frames corresponding to the multiple frames of images to be determined from the images to be determined in each of the image groups.

[0119] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, and the feature vector acquisition model is trained by the following method: obtaining multiple sample sets, wherein the sample sets include positive sample images, simple sample images, and difficult sample images; training the target neural network model with the multiple sample sets to obtain the feature vector acquisition model.

[0120] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein obtaining multiple sample sets includes: obtaining multiple benchmark sample images; for each of the benchmark sample images, obtaining the positive sample image, the simple sample image, and the difficult sample image corresponding to the benchmark sample image.

[0121] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein obtaining the positive sample image and the simple sample image corresponding to the benchmark sample image includes: taking the benchmark sample image and an adjacent sample image as the positive sample image, wherein the adjacent sample image is any frame sample image adjacent to the benchmark sample image in a first sample video to which the benchmark sample image belongs; taking the benchmark sample image and any frame sample image in at least one second sample video as the simple sample image, wherein the second sample video is different from the first sample video.

[0122] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, and obtaining the difficult sample image corresponding to the baseline sample image includes: determining the scene type corresponding to the first sample video based on the baseline sample image; and determining the difficult sample image based on the baseline sample image and the scene type.

[0123] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein determining the difficult sample image based on the benchmark sample image and the scene type includes: determining a target interval based on the scene type; and taking any frame sample image in the first sample video whose interval with the benchmark sample image is greater than or equal to the target interval as the difficult sample image.

[0124] According to one or more embodiments of the present disclosure, Example 7 provides a method of any one of Examples 1-6, wherein the method of dividing multiple frames of images to be determined into at least one image group according to the image feature vector corresponding to each frame of the images to be determined includes: clustering the image feature vectors corresponding to the multiple frames of the images to be determined to obtain at least one clustering category, wherein different clustering categories correspond to different image scenes; and treating the images to be determined corresponding to each of the clustering categories as one of the image groups.

[0125] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 7, before determining the key frames corresponding to the multiple frames of images to be determined from the images to be determined in each of the image groups, the method also includes: for each of the cluster categories, determining the cluster center corresponding to the cluster category, and using the image to be determined corresponding to the cluster center as the central frame image of the image group corresponding to the cluster category; determining the key frames corresponding to the multiple frames of images to be determined from the images to be determined in each of the image groups includes: for each of the image groups, using the first frame of the image to be determined, the last frame of the image to be determined and the central frame image in the image group as the key frames corresponding to the multiple frames of images to be determined.

[0126] According to one or more embodiments of the present disclosure, Example 9 provides a device for determining key frames, the device comprising: an image acquisition module, used to acquire multiple frames of images to be determined; a feature vector acquisition module, used to input the multiple frames of images to be determined into a pre-trained feature vector acquisition model to obtain the image feature vector corresponding to each frame of the images to be determined output by the feature vector acquisition model; an image division module, used to divide the multiple frames of images to be determined into at least one image group according to the image feature vector corresponding to each frame of the images to be determined, different image groups corresponding to different image scenes; a key frame determination module, used to determine the key frames corresponding to the multiple frames of images to be determined from the images to be determined in each of the image groups.

[0127] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in any one of Examples 1-8 when executed by a processing device.

[0128] According to one or more embodiments of the present disclosure, Example 11 provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of the method described in any one of Examples 1-8.

[0129] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0130] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0131] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A method for determining a key frame, characterized in that: The method comprises: Acquire multiple frames of images to be determined; Inputting a plurality of frames of the to-be-determined images into a pre-trained feature vector acquisition model to obtain an image feature vector corresponding to each frame of the to-be-determined images output by the feature vector acquisition model; the image feature vector is used to characterize the spatial distance between the to-be-determined images of different frames; According to the image feature vector corresponding to each frame of the image to be determined, the multiple frames of the image to be determined are divided into at least one image group, and different image groups correspond to different image scenes; From the images to be determined in each of the image groups, key frames corresponding to the multiple frames of images to be determined are determined.

2. The method according to claim 1, characterized in that The feature vector acquisition model is trained by the following method: Acquire multiple sample sets, wherein the sample sets include positive sample images, simple sample images, and difficult sample images; The target neural network model is trained by using a plurality of the sample sets to obtain the feature vector acquisition model.

3. The method according to claim 2, characterized in that The obtaining of multiple sample sets comprises: Acquire a plurality of benchmark sample images; For each of the reference sample images, the positive sample image, the simple sample image, and the difficult sample image corresponding to the reference sample image are obtained.

4. The method according to claim 3, characterized in that The obtaining of the positive sample image and the simple sample image corresponding to the reference sample image comprises: The reference sample image and the adjacent sample image are used as the positive sample image, wherein the adjacent sample image is any frame sample image adjacent to the reference sample image in the first sample video to which the reference sample image belongs; The reference sample image and any one frame of sample image in at least one second sample video are used as the simple sample image, and the second sample video is different from the first sample video.

5. The method according to claim 4, characterized in that Acquiring the difficult sample image corresponding to the reference sample image includes: Determining, according to the reference sample image, a scene type corresponding to the first sample video; The difficult sample image is determined according to the reference sample image and the scene type.

6. The method according to claim 5, characterized in that The determining the difficult sample image according to the reference sample image and the scene type comprises: determining a target interval according to the scenario type; The reference sample image and any frame sample image in the first sample video whose interval with the reference sample image is greater than or equal to the target interval are used as the difficult sample image.

7. The method according to any one of claims 1 to 6, characterized in that: The dividing the multiple frames of the to-be-determined images into at least one image group according to the image feature vector corresponding to each frame of the to-be-determined images comprises: Performing clustering processing on image feature vectors corresponding to the multiple frames of the to-be-determined images to obtain at least one clustering category, where different clustering categories correspond to different image scenes; The to-be-determined images corresponding to each cluster category are taken as an image group.

8. The method according to claim 7, characterized in that Before determining key frames corresponding to the multiple frames of the images to be determined from the images to be determined in each of the image groups, the method further includes: For each of the cluster categories, determine the cluster center corresponding to the cluster category, and use the to-be-determined image corresponding to the cluster center as the central frame image of the image group corresponding to the cluster category; Determining key frames corresponding to the multiple frames of the to-be-determined images from the to-be-determined images of each of the image groups comprises: For each of the image groups, the first frame of the image to be determined, the last frame of the image to be determined, and the central frame image in the image group are used as key frames corresponding to the multiple frames of the image to be determined.

9. A device for determining a key frame, characterized in that: The device comprises: An image acquisition module, used for acquiring multiple frames of images to be determined; A feature vector acquisition module, used for inputting a plurality of frames of the to-be-determined images into a pre-trained feature vector acquisition model, so as to obtain an image feature vector corresponding to each frame of the to-be-determined images output by the feature vector acquisition model; the image feature vector is used for representing the spatial distance between the to-be-determined images of different frames; An image division module, used for dividing the multiple frames of the to-be-determined images into at least one image group according to the image feature vector corresponding to each frame of the to-be-determined images, wherein different image groups correspond to different image scenes; The key frame determination module is used to determine the key frames corresponding to the multiple frames of the to-be-determined images from the to-be-determined images in each of the image groups.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 8 are implemented.

11. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data processing method and device and storage medium

    CN110147469A

  • Key video frame extraction method and device and storage medium

    CN110674673A